:root {
  /* Paleta vino, con la lógica de Brittany Chiang: fondo profundo, grises
     teñidos del mismo tono y un solo acento claro para etiquetas y hover. */
  --bg: #1c0f16;
  --text: #b8a2ab;
  --strong: #f3e7ec;
  --dim: #856c77;
  --accent: #fda4af;
  --pill-bg: rgba(251, 113, 133, 0.12);
  --card-hover: rgba(61, 33, 46, 0.5);
  --glow: rgba(190, 24, 93, 0.15);
  --mx: -1000px;
  --my: -1000px;
}

/* Todo está en rem: en pantallas grandes la base crece y el diseño llena el ancho. */
html { font-size: 16px; scroll-behavior: smooth; }
@media (min-width: 1024px) { html { font-size: clamp(16px, 1.25vw, 24px); } }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
}
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); color: #fff; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
strong { color: var(--strong); font-weight: 500; }

.spotlight {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(37.5rem at var(--mx) var(--my), var(--glow), transparent 80%);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 50;
  padding: 0.6rem 1rem;
  border-radius: 0.375rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.skip:focus { left: 1rem; }

.layout {
  position: relative;
  z-index: 1;
  max-width: 80rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Columna izquierda */
.side h1 { font-size: 2.25rem; line-height: 1.1; font-weight: 700; letter-spacing: -0.025em; color: var(--strong); }
.side h1 a { color: inherit; }
.side h2 { margin-top: 0.75rem; font-size: 1.125rem; line-height: 1.75rem; font-weight: 500; letter-spacing: -0.025em; color: var(--strong); }
.tagline { margin-top: 1rem; max-width: 20rem; line-height: 1.5; }

.nav { display: none; }
.nav ul { list-style: none; margin: 4rem 0 0; padding: 0; width: max-content; }
.nav a { display: flex; align-items: center; padding: 0.75rem 0; }
.nav__line { width: 2rem; height: 1px; margin-right: 1rem; background: var(--dim); transition: width 0.15s ease, background 0.15s ease; }
.nav__text { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); transition: color 0.15s ease; }
.nav a:hover .nav__line, .nav a:focus-visible .nav__line, .nav a.is-active .nav__line { width: 4rem; background: var(--strong); }
.nav a:hover .nav__text, .nav a:focus-visible .nav__text, .nav a.is-active .nav__text { color: var(--strong); }

.social { list-style: none; display: flex; align-items: center; gap: 1.25rem; margin: 2rem 0 0 0.25rem; padding: 0; }
.social a { display: block; color: var(--text); transition: color 0.15s ease; }
.social a:hover, .social a:focus-visible { color: var(--strong); }
.social svg { width: 1.5rem; height: 1.5rem; fill: currentColor; display: block; }

/* Columna derecha */
.content { padding: 6rem 0 4rem; }
.section:last-child { margin-bottom: 0; }
.section { margin-bottom: 4rem; scroll-margin-top: 4rem; }
.section > p + p { margin-top: 1rem; }
.section__sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -1.5rem 1rem;
  padding: 1.25rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--strong);
}

.inline { color: var(--strong); font-weight: 500; transition: color 0.15s ease; }
.inline:hover, .inline:focus-visible { color: var(--accent); }

/* Tarjetas */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 3rem; }
.card { position: relative; display: grid; gap: 0.5rem; transition: opacity 0.2s ease; }
.card::before {
  content: "";
  position: absolute;
  inset: -1rem -1.5rem;
  z-index: -1;
  border-radius: 0.375rem;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.card__when { margin-top: 0.25rem; font-size: 0.75rem; line-height: 1.25rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--dim); }
.card h3 { font-size: 1rem; line-height: 1.375; font-weight: 500; color: var(--strong); }
.card p:not(.card__when) { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.625; }
.card__link { transition: color 0.15s ease; }
.card__hit { position: absolute; inset: -1rem -1.5rem; z-index: 1; border-radius: 0.375rem; }
.arrow { display: inline-block; margin-left: 0.25rem; font-size: 0.875rem; transition: transform 0.15s ease; }

.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 0; padding: 0; }
.pills li { padding: 0.25rem 0.75rem; border-radius: 999px; background: var(--pill-bg); color: var(--accent); font-size: 0.75rem; font-weight: 500; line-height: 1.25rem; }



/* Accesibilidad: texto solo para lectores de pantalla */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Easter egg: "piano" se pinta letra por letra, toca In the Pool y trae el cursor de motosierra */
:root { --chainsaw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg transform='rotate(-45 16 16)'%3E%3Crect x='-2' y='13' width='20' height='6' rx='3' fill='%23cbd5e1' stroke='%23334155'/%3E%3Cpath d='M0 13l2-2 2 2 2-2 2 2 2-2 2 2 2-2 2 2' fill='none' stroke='%23334155'/%3E%3Crect x='16' y='9' width='14' height='14' rx='3' fill='%23f97316' stroke='%237c2d12' stroke-width='1.2'/%3E%3Crect x='19' y='6' width='8' height='4' rx='1.5' fill='%23111827'/%3E%3C/g%3E%3C/svg%3E") 3 3, pointer; }
.egg { display: inline; padding: 0; border: 0; background: none; font: inherit; color: var(--strong); font-weight: 500; cursor: var(--chainsaw); }
.egg [aria-hidden] > span { display: inline-block; transition: color 75ms ease, transform 75ms ease; transition-delay: var(--d); }
.egg:hover [aria-hidden] > span, .egg:focus-visible [aria-hidden] > span, .egg[aria-pressed="true"] [aria-hidden] > span { color: var(--c, inherit); transform: translateY(-1px); }
.egg[aria-pressed="true"] [aria-hidden] > span { animation: bounce 0.6s ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes bounce { to { transform: translateY(-3px); } }
html.is-playing, html.is-playing * { cursor: var(--chainsaw) !important; }

/* Disco escondido abajo a la derecha */
.vinyl { position: absolute; right: 1rem; bottom: 1rem; z-index: 3; width: 3.25rem; height: 3.25rem; padding: 0; border: 0; background: none; cursor: pointer; opacity: 0.55; transition: opacity 0.2s ease, transform 0.2s ease; }
.vinyl:hover, .vinyl:focus-visible { opacity: 1; transform: translateY(-0.4rem); }
.vinyl svg { width: 100%; height: 100%; animation: spin 4s linear infinite; }
html.is-playing .vinyl svg { animation-duration: 1.2s; }
@keyframes spin { to { transform: rotate(360deg); } }

.portal { width: min(26rem, calc(100% - 2rem)); padding: 2.5rem 2rem 2rem; border: 0; border-radius: 1rem; background: var(--bg); color: var(--text); text-align: center; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent), 0 30px 80px rgba(0, 0, 0, 0.6); overflow: hidden; }
.portal::backdrop { background: rgba(10, 4, 8, 0.7); backdrop-filter: blur(4px); }
.portal__ring { width: 7rem; height: 7rem; margin: 0 auto 1.5rem; border-radius: 50%; background: conic-gradient(from 0deg, var(--accent), #9f1239, #f472b6, #fcd34d, var(--accent)); -webkit-mask: radial-gradient(circle, transparent 52%, #000 54%); mask: radial-gradient(circle, transparent 52%, #000 54%); animation: spin 2.4s linear infinite; filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 60%, transparent)); }
.portal__title { font-size: 1.125rem; font-weight: 600; color: var(--strong); }
.portal__links { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.portal__links a, .portal__links button { display: block; width: 100%; padding: 0.7rem 1rem; border: 0; border-radius: 0.5rem; background: var(--pill-bg); color: var(--strong); font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: color 0.15s ease, background 0.15s ease; }
.portal__links a:hover, .portal__links button:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.portal__links button { cursor: var(--chainsaw); }
.portal__close { position: absolute; top: 0.6rem; right: 0.8rem; padding: 0.2rem 0.5rem; border: 0; background: none; color: var(--dim); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.portal__close:hover { color: var(--strong); }

.toast { position: fixed; left: 50%; bottom: 1.5rem; z-index: 60; transform: translateX(-50%); padding: 0.6rem 1.1rem; border-radius: 999px; background: var(--strong); color: var(--bg); font-size: 0.8125rem; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }

/* Detalles de tarjetas */
.card p.card__sub { margin-top: 0.25rem; font-size: 0.875rem; color: var(--dim); }
.card p.metric { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.6rem; font-size: 0.8125rem; font-weight: 500; color: var(--strong); }
.card p.metric span { color: var(--accent); font-size: 0.75rem; }

.more { display: inline-flex; align-items: center; gap: 0.25rem; margin-top: 3rem; font-weight: 600; color: var(--strong); transition: color 0.15s ease; }
.more:hover, .more:focus-visible { color: var(--accent); }
.more:hover .arrow { transform: translateX(0.25rem); }

/* Logros: lista de año + título, como la sección de escritos de Brittany */
.awards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.awards li { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 1rem; align-items: baseline; padding: 0.9rem 0; border-bottom: 1px solid color-mix(in srgb, var(--dim) 25%, transparent); }
.awards li:last-child { border-bottom: 0; }
.awards__year { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; color: var(--dim); }
.awards__title { font-size: 0.9375rem; font-weight: 500; color: var(--strong); }
.awards__note { font-size: 0.75rem; color: var(--dim); white-space: nowrap; }
.awards__note--hi { padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--pill-bg); color: var(--accent); font-weight: 500; }
@media (max-width: 640px) {
  .awards li { grid-template-columns: 1fr auto; gap: 0.25rem 1rem; }
  .awards__year { grid-column: 1 / -1; }
}

@media (min-width: 640px) {
  .layout { padding: 5rem 3rem; }
  .side h1 { font-size: 3rem; }
  .side h2 { font-size: 1.25rem; }
}

/* Escritorio */
@media (min-width: 1024px) {
  .layout { display: flex; justify-content: space-between; gap: 4rem; max-width: none; padding: 0 3rem 0 3rem; }
  .side {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 44%;
    max-height: 100vh;
    padding: 6rem 0;
  }
  .nav { display: block; }
  .social { margin-top: 0; }
  .content { width: 50%; padding: 6rem 0; }
  .section { margin-bottom: 9rem; scroll-margin-top: 6rem; }
  .section__sticky { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; padding: 0; }

  .card { grid-template-columns: 2fr 6fr; gap: 2rem; }
  .card:hover::before { background: var(--card-hover); box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.1); }
  .cards:hover .card { opacity: 0.5; }
  .cards:hover .card:hover { opacity: 1; }
  .card:hover .card__link { color: var(--accent); }
  .card:hover .arrow { transform: translate(0.125rem, -0.125rem); }
}


/* Página de archivo */
.archive { position: relative; z-index: 1; max-width: 80rem; margin: 0 auto; padding: 4rem 1.5rem; }
.archive__back { display: inline-flex; gap: 0.4rem; font-weight: 600; color: var(--accent); }
.archive__back:hover span { transform: translateX(-0.2rem); }
.archive__back span { display: inline-block; transition: transform 0.15s ease; }
.archive h1 { margin-top: 0.5rem; font-size: 2.25rem; font-weight: 700; letter-spacing: -0.025em; color: var(--strong); }
.archive__table { width: 100%; margin-top: 3rem; border-collapse: collapse; text-align: left; }
.archive__table th { position: sticky; top: 0; z-index: 2; padding: 1.25rem 1rem 1.25rem 0; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(8px); font-size: 0.875rem; font-weight: 600; color: var(--strong); }
.archive__table td { padding: 1rem 1rem 1rem 0; border-bottom: 1px solid color-mix(in srgb, var(--dim) 20%, transparent); vertical-align: top; font-size: 0.875rem; }
.archive__table tr:last-child td { border-bottom: 0; }
.archive__table .year { padding-top: 1.1rem; color: var(--dim); white-space: nowrap; }
.archive__table .name { font-weight: 600; font-size: 1rem; line-height: 1.375; color: var(--strong); }
.archive__table .name a:hover, .archive__table .name a:focus-visible { color: var(--accent); }
.archive__table .pills { margin-top: 0; }
.archive__table .link { color: var(--text); white-space: nowrap; }
.archive__table .link:hover, .archive__table .link:focus-visible { color: var(--accent); }
.archive__table .name .arrow { display: none; }
@media (max-width: 1023px) { .hide-md { display: none; } }
@media (max-width: 639px) { .hide-sm { display: none; } .archive__table .name .arrow { display: inline-block; } }
@media (min-width: 640px) { .archive { padding: 5rem 3rem; } .archive h1 { font-size: 3rem; } }
@media (min-width: 1024px) { .archive { padding: 6rem 3rem; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Mini reproductor de In the Pool */
.player { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 60; width: min(320px, calc(100vw - 2rem)); padding: 0.6rem; border: 1px solid rgba(253, 164, 175, 0.18); border-radius: 0.75rem; background: color-mix(in srgb, var(--bg) 92%, #000); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); animation: player-in 0.25s ease-out; }
.player[hidden] { display: none; }
.player__head { display: flex; align-items: center; gap: 0.6rem; font-size: 0.8125rem; color: var(--text); }
.player__title { flex: 1; }
.player__title b { color: var(--strong); font-weight: 600; }
.player__close { padding: 0 0.35rem; border: 0; background: none; color: var(--dim); font-size: 1.1rem; line-height: 1; }
.player__close:hover { color: var(--accent); }
.player__frame[hidden] { display: none; }
.player__frame { margin-top: 0.5rem; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 0.5rem; background: #000; }
.player__frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.player__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.player__bars i { width: 3px; height: 100%; border-radius: 1px; background: var(--accent); transform-origin: bottom; animation: eq 0.9s ease-in-out infinite alternate; }
.player__bars i:nth-child(2) { animation-delay: -0.3s; }
.player__bars i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }
@keyframes player-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .player, .player__bars i { animation: none; } }

/* Miniaturas de proyectos: a la izquierda en escritorio, debajo del texto en celular */
.card__thumb { order: 2; display: block; width: 100%; max-width: 12.5rem; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border: 2px solid rgba(226, 232, 240, 0.1); border-radius: 0.25rem; transition: border-color 0.2s ease; }
@media (min-width: 640px) {
  .card--project { grid-template-columns: 2fr 6fr; gap: 2rem; }
  .card--project .card__thumb { order: 0; max-width: none; transform: translateY(0.25rem); }
}
@media (hover: hover) { .card--project:hover .card__thumb { border-color: rgba(226, 232, 240, 0.3); } }
