/* =====================================
   COLORES (tu paleta)
===================================== */

:root {

  /* naranja = tú (intro, footer, selección) */
  --color-me: #E1855A;

  /* cada categoría tiene su color */
  --color-systems: #4F7ED0;
  --color-visual: #E1855A;   /* dos colores no más: naranjo y azul */

  /* neutros */
  --color-line: #C7C0B7;
  --color-ink: #242424;
  --color-paper: #FFFFFF;
  --color-muted: #6E6A64;

  /* reserva */
  --color-purple: #7870CB;
  --color-green: #BDD36C;

  /* color del texto encima de cada color */
  --ink-on-me: #242424;
  --ink-on-systems: #FFFFFF;
  --ink-on-visual: #242424;


  /* medidas */
  --sidebar-w: 300px;
  --gutter: 110px;
  --col-gap: 150px;
  --card-max: 390px;
  --footer-h: 88vh;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
}



/* =====================================
   RESET
===================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Instrument Sans", sans-serif;
  background-color: var(--color-paper);
  color: var(--color-ink);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background-color: var(--color-me);
  color: var(--ink-on-me);
}

:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 4px;
}



/* =====================================
   INTRO ANIMADA
   Solo se muestra si boot.js lo decide
===================================== */

.site-intro {
  display: none;
  position: fixed;
  inset: 0;
  background-color: var(--color-paper);
  z-index: 20000;
  overflow: hidden;
  cursor: pointer;
}

.js:not(.skip-intro) .site-intro {
  display: block;
}

/* bloquea el scroll mientras corre la intro */
.js:not(.skip-intro) body {
  overflow: hidden;
}


.intro-sequence {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: translateY(-4vh);
}

.intro-line {
  position: absolute;
  width: 100%;
  padding: 0 30px;
  text-align: center;
  font-size: clamp(30px, 4vw, 68px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.05em;
  opacity: 0;
}

.intro-color-wipe {
  position: absolute;
  inset: 0;
  background-color: var(--color-me);
  transform: translateY(100%);
  z-index: 10;
}



/* =====================================
   BLOQUE DE TRANSICIÓN ENTRE PÁGINAS
===================================== */

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 30000;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;

  padding: 0 30px;
  text-align: center;

  background-color: var(--pt-bg, var(--color-me));
  color: var(--pt-ink, var(--color-ink));

  visibility: hidden;
  pointer-events: none;
}

.is-entering .page-transition {
  visibility: visible;
  pointer-events: auto;
}

.pt-line {
  overflow: hidden;
  transform: translateY(-4vh);
}

.page-transition__title {
  font-size: clamp(30px, 4vw, 68px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
  padding-bottom: 0.08em;
}

.page-transition__meta {
  font-size: 13px;
  font-weight: 500;
}



/* =====================================
   SIDEBAR
===================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 30px;

  display: flex;
  flex-direction: column;

  background-color: var(--color-paper);
  border-right: 1px solid var(--color-line);
  z-index: 100;
}

.profile-photo {
  display: block;
  width: 105px;
  height: 130px;
  margin-bottom: 60px;
  overflow: hidden;
  background-color: var(--color-line);
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}

.profile-photo:hover img {
  transform: scale(1.06);
}


.profile-info h1.is-replay {
  cursor: pointer;
  outline-offset: 6px;
}

.profile-info h1 {
  font-size: 30px;
  font-weight: 600;
  line-height: 0.99;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.profile-info p {
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}



/* la frase bajo el nombre */
.profile-info .profile-motto {
  margin-top: 18px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--color-ink);
}



/* =====================================
   SELECTOR DE IDIOMA (en / es)
===================================== */

.lang-switch {
  position: absolute;
  top: 30px;
  right: 30px;
  display: flex;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
}

.lang-switch button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.3s ease;
}

.lang-switch button:hover {
  color: var(--color-ink);
}

.lang-switch button.is-active {
  color: var(--color-me);
  cursor: default;
}

/* en español, los textos fijos se esconden hasta traducirse (sin "flash" en inglés) */
html[lang="es"]:not(.i18n-ready) [data-i18n] {
  visibility: hidden;
}



/* =====================================
   MENU
   El link activo aparece entre paréntesis
===================================== */

.menu {
  margin-top: 65px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu a {
  width: fit-content;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-muted);
  transition: color 0.3s ease;
}

.menu a::before,
.menu a::after {
  content: "";
}

.menu a.is-active {
  color: var(--color-me);
}

.menu a.is-active::before {
  content: "(";
}

.menu a.is-active::after {
  content: ")";
}

.menu a:hover {
  color: var(--color-ink);
}



/* =====================================
   LINKS
===================================== */

.sidebar-links {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-links a {
  width: fit-content;
  font-size: 12px;
  transition: opacity 0.3s ease;
}

.sidebar-links a:hover {
  opacity: 0.5;
}



/* =====================================
   COPIAR EMAIL
===================================== */

.js-copy-email {
  position: relative;
}

.js-copy-email.is-copied::after {
  content: var(--copied-label, "(copied)");
  margin-left: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}



/* =====================================
   ABOUT (panel naranja)
   Sale desde detrás del sidebar
===================================== */

.about-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 90;

  background-color: var(--color-me);
  color: var(--ink-on-me);
  overflow-y: auto;

  transform: translateX(-100%);
  visibility: hidden;
  transition:
    transform 0.8s var(--ease-in-out),
    visibility 0s linear 0.8s;
}

.about-open .about-panel {
  transform: none;
  visibility: visible;
  transition:
    transform 0.8s var(--ease-in-out),
    visibility 0s;
}

/* no se puede hacer scroll en la página con el panel abierto */
.about-open body {
  overflow: hidden;
}


/* barra de arriba: queda fija mientras haces scroll en el panel */
.about-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 30px var(--gutter) 16px;
  background-color: var(--color-me);
}

.about-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.about-close {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.about-close:hover {
  opacity: 0.5;
}

/* frase chica de entrada */
.about-lead {
  margin-bottom: 18px;
  font-size: clamp(17px, 1.5vw, 24px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* la pregunta: mismo formato que los títulos, más grande */
.about-intro {
  max-width: 22ch;
  font-size: clamp(38px, 4.6vw, 80px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

/* 1. primera pantalla (naranja) */
.about-first {
  position: relative;
  min-height: calc(100vh - 62px);
  padding: 8vh var(--gutter) 90px;
}

/* la bio queda cerca de la pregunta (no pegada abajo) */
.about-first-bottom {
  margin-top: clamp(80px, 18vh, 170px);
}

/* (more ↓) abajo a la derecha */
.about-more-hint {
  position: absolute;
  right: var(--gutter);
  bottom: 34px;
}

.about-bio {
  max-width: 520px;
}

.about-more-hint {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.about-more-hint:hover {
  opacity: 0.5;
}


/* 2. segunda parte (blanco) */
.about-more {
  scroll-margin-top: 62px;
  padding: 90px var(--gutter) 90px;
  background-color: var(--color-paper);
  color: var(--color-ink);

  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.6fr);
  column-gap: clamp(50px, 6vw, 110px);
  row-gap: 50px;
  align-items: start;
  font-size: 13px;
  line-height: 1.5;
}

.about-more.has-photo {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.6fr);
}

.about-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.about-photo figcaption {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-muted);
}

.about-years {
  color: var(--color-muted);
}

.about-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.about-role {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.about-bio-text {
  margin-top: 18px;
  max-width: 44ch;
  font-size: 15px;
  line-height: 1.45;
}

.about-bio-text strong {
  font-weight: 600;
}

.about-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* textos más angostos para que respiren */
.about-highlights li {
  max-width: 30ch;
}

.about-years {
  font-variant-numeric: tabular-nums;
}

.about-highlight {
  font-weight: 600;
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.about-links a {
  display: block;
  width: fit-content;
}

.about-links a:hover {
  text-decoration: underline;
}


/* el contenido entra en cascada después del panel */
.about-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.about-open .about-reveal {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.6s ease calc(0.45s + var(--i) * 0.07s),
    transform 0.8s var(--ease-out) calc(0.45s + var(--i) * 0.07s);
}


/* menú: con el panel abierto, "about" queda activo */
.about-open .menu a.is-active {
  color: var(--color-muted);
}

.about-open .menu a.is-active::before,
.about-open .menu a.is-active::after {
  content: "";
}

.about-open .menu a[data-section="about"] {
  color: var(--color-me);
}

.about-open .menu a[data-section="about"]::before {
  content: "(";
}

.about-open .menu a[data-section="about"]::after {
  content: ")";
}



/* =====================================
   MAIN
   Va encima del footer, por eso tiene
   fondo blanco y z-index
===================================== */

.main {
  position: relative;
  z-index: 1;
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  background-color: var(--color-paper);
}



/* =====================================
   TÍTULOS DE LAS COLUMNAS
   El tamaño de acá es el de cuando quedan
   fijos arriba. El tamaño grande del hero
   lo calcula script.js (sección 06).
===================================== */

.work-titles {
  position: sticky;
  top: 0;
  z-index: 50;

  padding: 26px var(--gutter) 18px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: var(--col-gap);
  align-items: start;

  pointer-events: none;
}

/* fondo blanco detrás de los títulos (sin línea) */
.work-titles__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--color-paper);
}

.work-title {
  width: 100%;
  max-width: var(--card-max);
  justify-self: center;

  font-size: 22px;
  font-weight: 600;
  line-height: 0.99;
  letter-spacing: -0.05em;

  transform-origin: left top;
}

/*
  Con animación, el texto se dibuja GRANDE (tamaño hero)
  y GSAP lo achica al subir. Así se ve nítido.
  La barra queda con alto fijo y el título "sobra" hacia
  abajo solo mientras está grande.
*/
.has-title-motion .work-titles {
  height: 92px;
}

.has-title-motion .work-title {
  font-size: clamp(38px, 3.6vw, 62px);
}

/*
  cuadradito de color: aparece al quedar arriba.
  Cuelga a la izquierda del texto para que el título
  siga alineado con las cards.
*/
.work-title {
  position: relative;
}

.work-title__mark {
  position: absolute;
  top: 0.3em;
  left: -0.7em;
  width: 0.36em;
  height: 0.36em;
}

.work-title--systems .work-title__mark {
  background-color: var(--color-systems);
}

.work-title--visual .work-title__mark {
  background-color: var(--color-visual);
}


/* =====================================
   HERO (espacio bajo los títulos)
===================================== */

.intro {
  position: relative;
  width: 100%;
  height: 40vh;
}

/* con animación, el hero ocupa casi toda la pantalla */
.has-title-motion .intro {
  height: calc(100vh - 92px);
}

.scroll-indicator {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--color-muted);
}

/* hora de Santiago en el hero */
.hero-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 50px;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: var(--col-gap);
  pointer-events: none;
}

.hero-clock {
  width: 100%;
  max-width: var(--card-max);
  justify-self: center;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* los dos puntos parpadean */
.clock-colon {
  animation: clock-blink 1s steps(1) infinite;
}

@keyframes clock-blink {
  50% { opacity: 0; }
}

.scroll-arrow {
  font-size: 20px;
  animation: scroll-animation 1.5s ease-in-out infinite;
}

@keyframes scroll-animation {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(9px); }
}



/* =====================================
   PROJECTS
===================================== */

.projects-section {
  position: relative;
  width: 100%;
}


/* --- Títulos por columna (solo mobile) --- */

.column-label::before {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}

.column-label--systems::before {
  background-color: var(--color-systems);
}

.column-label--visual::before {
  background-color: var(--color-visual);
}


/* --- Grilla --- */

.projects-grid {
  width: 100%;
  padding: 80px var(--gutter) 340px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: var(--col-gap);
  align-items: start;
}

.project-column {
  position: relative;
  min-width: 0;
}

/* solo se ve en mobile */
.column-label {
  display: none;
}

.project-track {
  display: flex;
  flex-direction: column;
  gap: 110px;
  will-change: transform;
}



/* =====================================
   PROJECT CARD
===================================== */

.project-card {
  display: block;
  width: 100%;
  max-width: var(--card-max);
  margin: 0 auto;
  transition: opacity 0.45s ease;
}

.project-card[data-category="systems"] { --cat: var(--color-systems); }
.project-card[data-category="visual"]  { --cat: var(--color-visual); }


/* el marco queda fijo y lo que crece es lo de adentro */
.project-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--color-line);
}

.project-media__inner {
  position: absolute;
  inset: 0;
  background-color: var(--placeholder, var(--color-line));
  transition: transform 0.9s var(--ease-out);
}

.project-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.project-media img.is-current {
  opacity: 1;
}

/* cuadradito de color de la categoría al hacer hover
   (dialoga con los cuadraditos de los títulos de arriba) */
.project-media::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: clamp(20px, 2vw, 30px);
  height: clamp(20px, 2vw, 30px);
  background-color: var(--cat);
  transform: scale(0);
  transform-origin: top left;
  transition: transform 0.5s var(--ease-out);
}

.project-card:hover .project-media__inner,
.project-card:focus-visible .project-media__inner {
  transform: scale(1.05);
}

.project-card:hover .project-media::after,
.project-card:focus-visible .project-media::after {
  transform: scale(1);
}


.project-info {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 15px;
  transition: transform 0.45s var(--ease-out);
}

.project-card:hover .project-info {
  transform: translateX(7px);
}

.project-info h3 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.project-info p {
  font-size: 12px;
  color: var(--color-muted);
  text-align: right;
}



/* =====================================
   SOLO PARA MOUSE (no táctil)
===================================== */

@media (hover: hover) and (pointer: fine) {

  .project-card,
  .pd-next,
  .profile-info h1.is-replay {
    cursor: none;
  }

  /* las demás cards se apagan */
  .projects-grid:has(.project-card:hover) .project-card:not(:hover) {
    opacity: 0.35;
  }

}



/* =====================================
   CURSOR
   .view-cursor se mueve con GSAP
   .view-cursor__dot crece con CSS
===================================== */

.view-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 9999;
}

.view-cursor__dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 68px;
  height: 68px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  background-color: var(--color-ink);
  color: var(--color-paper);
  font-size: 11px;
  font-weight: 600;

  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  transition:
    opacity 0.2s ease,
    transform 0.45s var(--ease-out),
    background-color 0.3s ease,
    color 0.3s ease;
}

.view-cursor.is-active .view-cursor__dot {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.view-cursor.is-active.is-pressed .view-cursor__dot {
  transform: translate(-50%, -50%) scale(0.85);
}

.view-cursor[data-category="systems"] .view-cursor__dot {
  background-color: var(--color-systems);
  color: var(--ink-on-systems);
}

.view-cursor[data-category="visual"] .view-cursor__dot {
  background-color: var(--color-visual);
  color: var(--ink-on-visual);
}

.view-cursor[data-category="me"] .view-cursor__dot {
  background-color: var(--color-me);
  color: var(--ink-on-me);
}



/* =====================================
   PÁGINA DE PROYECTO
   Las imágenes son las protagonistas.
   Grilla de 12 columnas: cada bloque
   ocupa más o menos columnas según su
   tamaño (full, wide, large, medium,
   small, pair) y su lado (align).
===================================== */

body[data-category="systems"] { --accent: var(--color-systems); }
body[data-category="visual"]  { --accent: var(--color-visual); }

.pd {
  padding: 0 var(--gutter);
}


/* --- barra superior (sin línea) --- */

.pd-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 30px;
  font-size: 12px;
  font-weight: 600;
}

.pd-back {
  transition: opacity 0.3s ease;
}

.pd-back:hover {
  opacity: 0.5;
}

.pd-category {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-category::before {
  content: "";
  width: 8px;
  height: 8px;
  background-color: var(--accent);
}


/* --- encabezado --- */

.pd-hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: end;
  padding: 24vh 0 70px;
}

.pd-title {
  grid-column: 1 / span 8;
  font-size: clamp(44px, 5.6vw, 96px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.pd-info {
  grid-column: 9 / -1;
}

.pd-meta {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-muted);
}

.pd-summary {
  margin-top: 14px;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}


/* --- recorrido de bloques --- */

.pd-flow {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 120px;
  padding-bottom: 160px;
}

.pd-block {
  min-width: 0;
}

/* tamaños */
.pd-full {
  grid-column: 1 / -1;
  margin: 0 calc(var(--gutter) * -1);
}

.pd-wide,
.pd-pair {
  grid-column: 1 / -1;
}

.pd-large.pd-align-left    { grid-column: 1 / span 8; }
.pd-large.pd-align-center  { grid-column: 3 / span 8; }
.pd-large.pd-align-right   { grid-column: 5 / -1; }

.pd-medium.pd-align-left   { grid-column: 1 / span 6; }
.pd-medium.pd-align-center { grid-column: 4 / span 6; }
.pd-medium.pd-align-right  { grid-column: 7 / -1; }

.pd-small.pd-align-left    { grid-column: 1 / span 4; }
.pd-small.pd-align-center  { grid-column: 5 / span 4; }
.pd-small.pd-align-right   { grid-column: 9 / -1; }

/*
  párrafos
  left y right ocupan 1/3, así caben al lado de una
  imagen large o medium del lado contrario.
*/
.pd-paragraph.pd-align-left   { grid-column: 1 / span 4; }
.pd-paragraph.pd-align-center { grid-column: 4 / span 6; }
.pd-paragraph.pd-align-right  { grid-column: 9 / -1; }

/* alineación vertical respecto a la imagen del lado */
.pd-paragraph.pd-valign-top    { align-self: start; }
.pd-paragraph.pd-valign-center { align-self: center; }
.pd-paragraph.pd-valign-bottom { align-self: end; }

.pd-paragraph p {
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

/* títulos chicos (párrafos y ficha) */
.pd-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: 10px;
}

/* ficha: contexto, rol, entregables, créditos */
.pd-facts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 30px;
  margin-top: -60px;
  font-size: 13px;
  line-height: 1.5;
}

/* par de imágenes */
.pd-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}


/* imágenes */
.pd-frame {
  position: relative;
  overflow: hidden;
  background-color: var(--placeholder, var(--color-line));
}

.pd-frame img,
.pd-frame video {
  display: block;
  width: 100%;
  height: auto;
}

/* los videos no llevan fondo de color mientras cargan */
.pd-frame:has(video) {
  background-color: transparent;
}

.pd-frame.is-empty {
  aspect-ratio: var(--ratio, 4 / 3);
}

.pd-placeholder-label {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-size: 12px;
  color: var(--color-ink);
  opacity: 0.55;
}

.pd-block figcaption {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-muted);
}

.pd-full figcaption {
  padding: 0 var(--gutter);
}


/* --- siguiente proyecto --- */

.pd-next {
  position: relative;
  display: block;
  padding: 50px var(--gutter) 120px;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.5s var(--ease-out);
}

.pd-next[data-category="systems"] { --next: var(--color-systems); --next-ink: var(--ink-on-systems); }
.pd-next[data-category="visual"]  { --next: var(--color-visual);  --next-ink: var(--ink-on-visual); }

/* el color de la próxima categoría sube al hacer hover */
.pd-next::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--next);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.6s var(--ease-out);
  z-index: -1;
}

@media (hover: hover) {

  .pd-next:hover {
    color: var(--next-ink);
  }

  .pd-next:hover::before {
    transform: scaleY(1);
  }

}

.pd-next-label {
  font-size: 12px;
  font-weight: 600;
}

.pd-next-title {
  margin-top: 24px;
  font-size: clamp(40px, 5vw, 88px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.pd-next-meta {
  margin-top: 14px;
  font-size: 12px;
}

.pd-not-found {
  padding: 30vh var(--gutter);
  font-size: 20px;
}

.pd-not-found a {
  text-decoration: underline;
}



/* =====================================
   FOOTER
   Queda fijo debajo y la página sube
   para descubrirlo (como la intro, al revés)
===================================== */

.footer-spacer {
  height: var(--footer-h);
}

.site-footer {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  height: var(--footer-h);
  z-index: 0;

  background-color: var(--color-me);
  color: var(--ink-on-me);
  overflow: hidden;
}

.site-footer__inner {
  height: 100%;
  padding: 50px var(--gutter) 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.footer-kicker {
  font-size: 14px;
  font-weight: 600;
}

.footer-email {
  display: inline-block;
  margin-top: 4vh;
  font-size: clamp(36px, 6.2vw, 112px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
  word-break: break-word;

  /* subrayado que crece */
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 3px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.6s var(--ease-out);
}

.footer-email:hover {
  background-size: 100% 3px;
}

.footer-email.is-copied::after {
  position: absolute;
  top: -10px;
  left: 100%;
  font-size: 14px;
}

.footer-hint {
  margin-top: 14px;
  font-size: 12px;
}

.footer-bottom {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
  font-size: 12px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.footer-label {
  font-weight: 600;
  margin-bottom: 8px;
}

.footer-col a {
  display: block;
  width: fit-content;
}

.footer-col a:hover {
  text-decoration: underline;
}

.footer-col--end {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}



/* =====================================
   TABLET
===================================== */

@media (max-width: 1150px) {

  :root {
    --gutter: 60px;
    --col-gap: 80px;
    --card-max: 350px;
  }

  .footer-bottom {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-col--end {
    justify-content: flex-start;
  }

}



/* =====================================
   MOBILE
===================================== */

@media (max-width: 800px) {

  :root {
    --sidebar-w: 0px;
    --gutter: 20px;
  }

  .intro-line {
    font-size: 30px;
    padding: 0 25px;
  }


  /* sidebar compacta arriba */
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 20px;

    display: grid;
    grid-template-columns: 64px 1fr;
    grid-template-areas:
      "photo info"
      "menu  menu"
      "links links";
    column-gap: 16px;
    row-gap: 24px;

    border-right: none;
    border-bottom: 1px solid var(--color-line);
  }

  .lang-switch {
    top: 20px;
    right: 20px;
  }

  .profile-photo {
    grid-area: photo;
    width: 64px;
    height: 80px;
    margin-bottom: 0;
  }

  .profile-info {
    grid-area: info;
    align-self: end;
  }

  .profile-info h1 {
    font-size: 24px;
    margin-bottom: 8px;
  }

  .profile-info .profile-motto {
    font-size: 15px;
  }

  .menu {
    grid-area: menu;
    margin-top: 0;
    flex-direction: row;
    gap: 14px;
  }

  .sidebar-links {
    grid-area: links;
    margin-top: -12px;
    flex-direction: row;
    gap: 14px;
  }

  .menu a {
    white-space: nowrap;
  }

  .main {
    margin-left: 0;
    width: 100%;
  }


  /* en mobile los títulos son el hero (sin animación) */
  .work-titles {
    position: relative;
    padding: 16vh 20px 0;
    grid-template-columns: 1fr;
    row-gap: 14px;
  }

  .work-titles__bg {
    display: none;
  }

  .work-title {
    max-width: none;
    font-size: 34px;
  }

  .work-title__mark {
    display: none;
  }

  .intro,
  .has-title-motion .intro {
    height: 22vh;
  }

  .scroll-indicator {
    display: none;
  }

  .hero-meta {
    bottom: 24px;
    padding: 0 20px;
    grid-template-columns: 1fr;
  }

  .hero-clock {
    max-width: none;
    font-size: 12px;
  }


  /* en mobile cada columna tiene su propio título sticky */
  .column-label {
    position: sticky;
    top: 0;
    z-index: 5;

    display: flex;
    align-items: center;
    gap: 8px;

    margin: 0 -20px 30px;
    padding: 16px 20px;

    font-size: 12px;
    font-weight: 600;

    background-color: var(--color-paper);
    border-bottom: 1px solid var(--color-line);
  }

  .projects-grid {
    padding: 0 20px 100px;
    grid-template-columns: 1fr;
    row-gap: 80px;
  }

  .project-track {
    gap: 60px;
    transform: none !important;
  }

  .project-card {
    max-width: none;
  }


  /* proyecto: todo a una columna */
  .pd-hero {
    grid-template-columns: 1fr;
    row-gap: 24px;
    padding: 14vh 0 50px;
  }

  .pd-title,
  .pd-info {
    grid-column: 1 / -1;
  }

  .pd-flow {
    grid-template-columns: 1fr;
    row-gap: 50px;
    padding-bottom: 80px;
  }

  .pd-flow .pd-block {
    grid-column: 1 / -1;
  }

  .pd-small {
    width: 70%;
  }

  .pd-small.pd-align-right {
    justify-self: end;
  }

  .pd-pair {
    gap: 10px;
  }

  .pd-facts {
    grid-template-columns: 1fr 1fr;
    margin-top: 0;
  }

  .pd-next {
    padding-bottom: 80px;
  }


  /* about: pantalla completa */
  .about-panel {
    left: 0;
    z-index: 200;
  }

  .about-top {
    padding: 20px 20px 14px;
  }

  .about-first {
    min-height: calc(100svh - 50px);
    padding: 6vh 20px 24px;
  }

  .about-first-bottom {
    margin-top: 60px;
  }

  .about-more-hint {
    left: 20px;
    right: auto;
    bottom: 24px;
  }

  .about-more,
  .about-more.has-photo {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 50px 20px 60px;
  }


  /* footer normal (sin telón) */
  .footer-spacer {
    height: 0;
  }

  .site-footer {
    position: relative;
    left: 0;
    height: auto;
    min-height: 80vh;
  }

  .site-footer__inner {
    min-height: 80vh;
    gap: 60px;
  }

  .footer-email.is-copied::after {
    position: static;
    display: block;
    margin: 8px 0 0;
  }

}



/* =====================================
   MENOS MOVIMIENTO
   (si la persona lo pidió en su sistema)
===================================== */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

}



/* =====================================
   COPIA PARA CLIENTE
===================================== */

/* va solo en español */
.lang-switch {
  display: none !important;
}

/* hasta tres piezas verticales en fila (reels, posts) */
.pd-trio {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 24px;
}

/* hasta 4 en fila; con 3 o menos, cada una ocupa un tercio */
.pd-trio figure {
  flex: 0 1 calc((100% - (var(--n, 3) - 1) * 24px) / var(--n, 3));
  min-width: 0;
}

/* misma altura para toda la fila (ratio: "9 / 16" en projects.js) */
.pd-trio .pd-frame img,
.pd-trio .pd-frame video {
  aspect-ratio: var(--trio-ratio, auto);
  object-fit: cover;
}

.pd-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.3s ease;
}

.pd-link:hover {
  opacity: 0.5;
}

@media (max-width: 800px) {
  .pd-trio {
    gap: 10px;
  }

  .pd-trio {
    flex-wrap: wrap;
  }

  .pd-trio figure {
    flex-basis: calc((100% - 20px) / 3);
  }

  /* en celular, las de a cuatro van de a dos */
  .pd-trio[style*="--n: 4"] figure {
    flex-basis: calc((100% - 10px) / 2);
  }
}

/* sin portada, la ficha no sube hacia el título */
.pd-flow > .pd-facts:first-child {
  margin-top: 0;
}



/* =====================================
   INICIO SIN SCROLL
   Arriba el título; abajo la franja de proyectos
   que se mueve hacia el lado (script.js → setupStrip)
===================================== */

.home-top {
  height: 46vh;
  min-height: 280px;
  padding: 30px 48px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-line);
}

.home-title {
  font-size: clamp(60px, 8.2vw, 148px);
  font-weight: 600;
  line-height: 0.88;
  letter-spacing: -0.045em;
}

.home-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  font-weight: 600;
}

.home-meta .hero-clock {
  position: static;
  width: auto;
  max-width: none;
}

.home-hint {
  color: var(--color-muted);
}


.strip {
  height: 54vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  user-select: none;
}

.strip-info {
  padding: 24px 24px 26px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--color-line);
}

.strip-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

.strip-info__body {
  margin-top: auto;
  margin-bottom: 22px;
}

.strip-info__body.is-in {
  animation: strip-in 0.5s var(--ease-out);
}

@keyframes strip-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.strip-cat {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.strip-cat[data-category="systems"] { color: var(--color-systems); }
.strip-cat[data-category="visual"]  { color: var(--color-visual); }

.strip-title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.strip-meta {
  font-size: 13px;
  color: var(--color-muted);
}

.strip-open {
  width: fit-content;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.3s ease;
}

.strip-open:hover {
  opacity: 0.5;
}

.strip-viewport {
  position: relative;
  overflow: hidden;
  margin: 24px 0 26px 24px;
}

.strip-track {
  position: absolute;
  inset: 0;
}

.strip-card {
  position: absolute;
  left: 0;
  bottom: 0;
  overflow: hidden;
  background-color: var(--placeholder, var(--color-line));
  will-change: transform, width, height;
}

.strip-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: transform 0.8s var(--ease-out);
}

.strip-card:hover img {
  transform: scale(1.04);
}

.strip-card__empty {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
}

.has-strip .strip { cursor: grab; }
.strip.is-dragging { cursor: grabbing; }


/* celular: todo hacia abajo y la franja se desliza con el dedo */
@media (max-width: 800px) {

  .home-top {
    height: auto;
    min-height: 0;
    padding: 48px 20px 18px;
    gap: 40px;
  }

  .home-title {
    font-size: 15vw;
  }

  .strip {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .strip-info {
    padding: 18px 20px 14px;
    border-right: none;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 10px;
  }

  .strip-info__body {
    margin: 0;
    grid-row: 2;
  }

  .strip-open {
    grid-row: 2;
  }

  .strip-viewport {
    min-width: 0;
    margin: 0 0 40px;
    overflow: visible;
  }

  .strip-track {
    position: static;
    display: flex;
    gap: 12px;
    padding: 0 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 20px;
    scrollbar-width: none;
  }

  .strip-track::-webkit-scrollbar {
    display: none;
  }

  .strip-card {
    position: relative;
    flex: 0 0 72vw;
    aspect-ratio: 4 / 5;
    scroll-snap-align: start;
  }
}

/* miniatura recortada (ej. un celular sin fondo): se ve entera, con aire */
.strip-card[data-fit="contain"] img {
  object-fit: contain;
  padding: 8% 10%;
}


/* =====================================
   SOBRE MÍ · SERVICIOS
===================================== */

.about-services {
  grid-column: 1 / -1;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--color-line);
}

.about-services-sentence {
  margin: 18px 0 44px;
  font-size: clamp(34px, 4.6vw, 76px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}

.svc-item {
  white-space: nowrap;
}

.svc-n {
  display: inline-block;
  vertical-align: top;
  margin-right: 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}

.svc-n[data-c="systems"] { color: var(--color-systems); }
.svc-n[data-c="visual"]  { color: var(--color-visual); }

.about-services-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
  font-size: 13px;
  line-height: 1.5;
}

.about-services-list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (max-width: 800px) {
  .svc-item { white-space: normal; }
  .about-services-list { grid-template-columns: 1fr 1fr; }
}

/* celular: el mail del footer cabe en una línea */
@media (max-width: 800px) {
  .footer-email {
    font-size: min(36px, 8.6vw);
    word-break: normal;
    white-space: nowrap;
  }
}

/* miniatura con marco fino (sin color de fondo) */
.strip-card[data-frame] {
  box-shadow: inset 0 0 0 1px var(--color-line);
}
.strip-card[data-frame] img {
  padding: 10% 12%;
}
