/* =============================================================
   SOY SARA — WEB · Design System v1.0
   Tokens extraídos de Figma (Soy Sara - Web)
   ============================================================= */

/* ---------- Fuentes ---------- */
@font-face { font-family: 'Degular'; src: url('../fonts/Degular-Light.otf') format('opentype');    font-weight: 300; font-display: swap; }
@font-face { font-family: 'Degular'; src: url('../fonts/Degular-Regular.otf') format('opentype');  font-weight: 400; font-display: swap; }
@font-face { font-family: 'Degular'; src: url('../fonts/Degular-Medium.otf') format('opentype');   font-weight: 500; font-display: swap; }
@font-face { font-family: 'Degular'; src: url('../fonts/Degular-Semibold.otf') format('opentype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Didot';   src: url('../fonts/Didot-Italic.otf') format('opentype');     font-style: italic; font-weight: 400; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --ink: #050505;
  --paper: #EEEEEE;
  --cream: #E5E2DD;
  --sand: #CDC6B2;
  --stone: #9C968A;
  --white: #FFFFFF;

  --radius-pill: 999px;
  --radius-card: 36px;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;
  --space-7: clamp(56px, 8vw, 112px);

  --font-sans: 'Degular', 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Didot', 'Bodoni MT', Didot, serif;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur: .8s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.4;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
i { font-style: normal; }

.container {
  width: min(1376px, 100% - 40px);
  margin-inline: auto;
}
/* Desktop: misma proporción que el diseño (contenido 72% del viewport,
   márgenes ~14% por lado, como los 272px sobre 1920 del Figma) */
@media (min-width: 769px) {
  .container { width: min(1376px, 72vw); }
}


/* ---------- Tipografía base ---------- */
.display {
  font-size: clamp(40px, 6vw, 88px);
  font-weight: 400;
  line-height: .92;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.display strong { font-weight: 600; }
.display--light { color: var(--paper); }


/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  font-size: clamp(15px, 1.1vw, 16px);
  line-height: 1;
  padding: .9em 1.5em;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: transform .5s var(--ease), background .5s var(--ease), border-color .5s var(--ease), color .5s var(--ease), box-shadow .5s var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(5,5,5,.14); }
.btn:active { transform: translateY(-1px) scale(.98); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--stone); border-color: var(--stone); }
/* Variante contorno: fondo papel sólido para que se lea sobre la foto del hero */
.btn:not(.btn--solid) { background: var(--paper); }
.btn--small { font-size: 16px; padding: .7em 1.3em; }
.btn:not(.btn--solid):hover {
  border-color: var(--sand);
  color: var(--ink);
}

/* =============================================================
   HEADER
   ============================================================= */
.header {
  position: fixed;
  top: 0; right: 0; left: 0;
  z-index: 130; /* por encima del menú mobile para poder cerrarlo */
  padding: 22px 0;
  transition: padding .4s var(--ease), background .4s var(--ease), box-shadow .4s var(--ease), transform .35s var(--ease);
}
/* Al bajar se esconde (sale más rápido de lo que entra); al subir vuelve */
.header.is-hidden {
  transform: translateY(-100%);
  transition: padding .4s var(--ease), background .4s var(--ease), box-shadow .4s var(--ease), transform .25s cubic-bezier(.4, 0, 1, 1);
}
/* Con el menú abierto el header se funde con el fondo cream */
body.menu-open .header { background: transparent; box-shadow: none; }
.header.is-scrolled {
  padding: 12px 0;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(5,5,5,.1);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; }
.header__logo img { transition: transform .35s var(--ease); }
.header__logo:hover img { transform: scale(1.06) rotate(-2deg); }

.nav { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); }
.nav__link {
  position: relative;
  font-weight: 500;
  font-size: 15px;
  opacity: .72;
  transition: opacity .3s;
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -5px;
  width: 100%; height: 1.5px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav__link:hover, .nav__link.is-active { opacity: 1; }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); transform-origin: left; }

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px; height: 44px;
  background: none; border: none; cursor: pointer;
  z-index: 130;
}
.burger span {
  display: block;
  width: 26px; height: 1.8px;
  margin-inline: auto;
  background: var(--ink);
  transition: transform .4s var(--ease), opacity .3s;
}
.burger.is-open span:nth-child(1) { transform: translateY(7.8px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7.8px) rotate(-45deg); }

/* Menú mobile */
.mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 120;
  display: flex; flex-direction: column; justify-content: center; gap: 48px;
  padding: 0 8vw;
  background: var(--cream);
  -webkit-clip-path: circle(0% at calc(100% - 44px) 40px);
  clip-path: circle(0% at calc(100% - 44px) 40px);
  transition: clip-path .7s var(--ease), -webkit-clip-path .7s var(--ease);
  visibility: hidden;
}
.mobile-menu.is-open { -webkit-clip-path: circle(150% at calc(100% - 44px) 40px); clip-path: circle(150% at calc(100% - 44px) 40px); visibility: visible; }
.mobile-menu__nav { display: flex; flex-direction: column; gap: 28px; }
.mobile-menu__link {
  font-size: clamp(30px, 8vw, 42px);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.mobile-menu.is-open .mobile-menu__link { opacity: 1; transform: none; }
.mobile-menu.is-open .mobile-menu__link:nth-child(1) { transition-delay: .15s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(2) { transition-delay: .23s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(3) { transition-delay: .31s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(4) { transition-delay: .39s; }
.mobile-menu.is-open .mobile-menu__cta { transition-delay: .48s; }
.mobile-menu__cta { align-self: flex-start; opacity: 0; transform: translateY(24px); transition: all .5s var(--ease); }
.mobile-menu.is-open .mobile-menu__cta { opacity: 1; transform: none; }
.mobile-menu__foot { color: var(--stone); font-size: 20px; }

/* =============================================================
   HERO
   ============================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(90px, 12vh, 140px);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: end;
  gap: clamp(24px, 3vw, 48px);
}
.hero__content { align-self: center; padding-bottom: 4vh; }
.hero__title {
  font-size: clamp(42px, 7.5vw, 108px);
  font-weight: 400;
  line-height: .96;
  text-transform: uppercase;
  letter-spacing: -0.005em;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line__inner {
  display: inline-block;
  transform: translateY(115%);
  animation: rise 1.1s var(--ease) forwards;
}
.hero__title .line:nth-child(2) .line__inner { animation-delay: .12s; }
@keyframes rise { to { transform: translateY(0); } }

.hero__highlight {
  position: relative;
  font-weight: 600;
  background: var(--cream);
  padding: 0 .12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
/* Extremos tipo selección de texto (como en el diseño original) */
.handle {
  position: absolute;
  width: 9px;
  height: 9px;
  background: var(--paper);
  border: 1.5px solid #A9A190;
}
.handle--tl { top: -5px; left: -5px; }
.handle--tr { top: -5px; right: -5px; }
.handle--bl { bottom: -5px; left: -5px; }
.handle--br { bottom: -5px; right: -5px; }
.hero__eyebrow {
  margin-top: clamp(20px, 3vw, 40px);
  font-weight: 500;
  font-size: clamp(17px, 1.3vw, 19px);
  color: var(--stone);
}
.hero__body {
  margin-top: clamp(18px, 2.5vw, 34px);
  max-width: 46ch;
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.45;
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(24px, 3vw, 44px); }


/* En desktop los CTAs pisan el borde inferior de la foto, como en el diseño */
@media (min-width: 1025px) {
  .hero__grid { position: relative; }
  .hero__ctas {
    position: absolute;
    left: 62%;
    bottom: 13.5%;
    margin: 0;
    z-index: 2;
  }
  /* Como en el diseño: aire grande entre el eyebrow y la bajada,
     que queda abajo alineada con la fila de los botones */
  .hero__body { margin-top: clamp(48px, 19vh, 230px); }
}

.hero__media {
  position: relative;
  align-self: end;
  margin-bottom: 0;
}
/* Solo en desktop la foto sangra hasta el borde derecho del viewport */
@media (min-width: 1025px) {
  .hero__media { margin-right: calc((100vw - min(1376px, 72vw)) / -2); }
}
.hero__media img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  object-position: bottom right;
  mix-blend-mode: darken; /* integra el fondo claro del PNG con --paper */
  animation: fadeIn 1.4s var(--ease) both .3s;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(30px); } }

.hero__scroll {
  position: absolute;
  left: 50%; bottom: 28px;
  transform: translateX(-50%);
  animation: bob 2.4s ease-in-out infinite;
  opacity: .8;
}
@keyframes bob { 0%,100% { transform: translate(-50%,0); } 50% { transform: translate(-50%,10px); } }

/* =============================================================
   PROYECTOS
   ============================================================= */
.projects {
  background: var(--cream);
  padding-block: var(--space-7);
}
.projects__head { margin-bottom: clamp(40px, 5vw, 72px); }
.projects__head .display { margin-top: 28px; }
.projects__intro {
  margin-top: 28px;
  max-width: 58ch;
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.45;
}
.projects__cat { margin-top: clamp(40px, 5vw, 64px); }
.cat__label {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 500;
  font-size: clamp(17px, 1.3vw, 20px);
  color: var(--ink);
  margin-bottom: clamp(24px, 3vw, 36px);
}
.cat__line { flex: 1; height: 1px; background: var(--stone); opacity: .4; }

.folders {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 2.5vw, 32px);
}

/* ---------- Folder (recreación CSS del asset macOS) ---------- */
.folder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transition: transform .45s var(--ease);
}
.folder-card:hover { transform: translateY(-6px); }
.folder-card h4 {
  font-weight: 500;
  font-size: clamp(15px, 1.1vw, 16px);
  letter-spacing: -0.01em;
  text-align: center;
  position: relative;
}
.folder-card h4::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -6px;
  width: 0; height: 1px;
  background: var(--ink);
  transition: width .4s var(--ease), left .4s var(--ease);
}
.folder-card:hover h4::after { width: 100%; left: 0; }

.folder {
  position: relative;
  width: min(150px, 72%);
  aspect-ratio: 1 / .82;
}
.folder__back {
  position: absolute;
  top: 12%; right: 0; bottom: 0; left: 0;
  background: linear-gradient(180deg, #4b4b4b 0%, #2b2b2b 30%, #161616 100%);
  border-radius: 13px;
  box-shadow: 0 18px 30px -12px rgba(5,5,5,.45);
}
.folder__back::before {
  content: '';
  position: absolute;
  top: -9%;
  left: 0;
  width: 40%;
  height: 26%;
  background: linear-gradient(180deg, #565656, #3a3a3a);
  border-radius: 10px 14px 0 0;
  -webkit-clip-path: polygon(0 0, 78% 0, 100% 100%, 0 100%);
  clip-path: polygon(0 0, 78% 0, 100% 100%, 0 100%);
}
.folder__paper, .folder__preview {
  position: absolute;
  left: 12%;
  width: 76%;
  height: 66%;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(5,5,5,.25);
  transition: transform .5s var(--ease);
}
.folder__paper {
  top: 2%;
  background: linear-gradient(180deg, #fafafa, #e9e9ea);
  transform: rotate(-2.5deg);
}
.folder__preview {
  top: 5%;
  left: 16%;
  width: 70%;
  background: linear-gradient(180deg, var(--cream), var(--sand));
  transform: rotate(2deg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  font-weight: 500;
  font-size: clamp(18px, 1.8vw, 26px);
  letter-spacing: .02em;
  color: var(--ink);
  padding-top: .12em;
}
.folder__front {
  position: absolute;
  top: 28%; right: 0; bottom: 0; left: 0;
  background: linear-gradient(180deg, #454545 0%, #262626 55%, #131313 100%);
  border-radius: 13px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    inset 0 -3px 6px rgba(0,0,0,.4),
    0 10px 24px -8px rgba(5,5,5,.5);
  transition: transform .5s var(--ease);
  transform-origin: bottom center;
}
.folder__front::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 9%;
  height: 3px;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05));
}
.folder-card:hover .folder__paper { transform: translateY(-16%) rotate(-4deg); }
.folder-card:hover .folder__preview { transform: translateY(-24%) rotate(3.5deg); }
.folder-card:hover .folder__front { transform: scaleY(.97); }

/* =============================================================
   SOBRE MÍ
   ============================================================= */
.about { padding-block: var(--space-7); }
.about__grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(40px, 7vw, 120px);
  align-items: start;
}
.about__media {
  position: sticky;
  top: 120px;
  border-radius: var(--radius-card);
  overflow: hidden;
}
.about__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 543 / 600;
  object-fit: cover;
  transition: transform .8s var(--ease);
}
.about__media:hover img { transform: scale(1.04); }
.about__content .display { margin: 18px 0 32px; }
.about__content p { font-size: clamp(16px, 1.2vw, 18px); line-height: 1.5; margin-bottom: 22px; max-width: 62ch; }

.specs { margin-top: 48px; }
.specs__row {
  display: grid;
  grid-template-columns: minmax(140px, 225px) 1fr;
  gap: 24px;
  padding-block: 22px;
  border-top: 1px solid var(--stone);
}
.specs__row dt {
  font-weight: 500;
  font-size: clamp(15px, 1.1vw, 16px);
  color: var(--stone);
}
.specs__row dd { font-size: clamp(15px, 1.1vw, 16px); line-height: 1.4; }

/* =============================================================
   CTA
   ============================================================= */
.cta {
  background: var(--ink);
  color: var(--paper);
  padding-block: var(--space-7) clamp(56px, 8vw, 110px);
}
.cta__body {
  margin-top: 36px;
  max-width: 52ch;
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.5;
  opacity: .92;
}
.cta__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-top: clamp(40px, 6vw, 80px);
}
.cta__mail {
  position: relative;
  display: inline-block;
  font-size: clamp(24px, 2.6vw, 32px);
  padding-bottom: 8px;
  transition: color .35s;
}
.cta__mail::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--paper);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .6s var(--ease);
}
.cta__mail:hover { color: var(--sand); }
.cta__mail:hover::after { transform: scaleX(1); transform-origin: left; background: var(--sand); }

.socials { display: flex; flex-wrap: wrap; gap: clamp(20px, 3vw, 40px); }
.socials a {
  position: relative;
  font-weight: 500;
  font-size: clamp(14px, 1vw, 15px);
  padding-bottom: 5px;
}
.socials a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--paper);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .6s var(--ease);
}
.socials a:hover::after { transform: scaleX(1); transform-origin: left; }
.socials a:hover { color: var(--sand); }
.socials a:hover::after { background: var(--sand); }

/* =============================================================
   FOOTER
   ============================================================= */
.footer {
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid rgba(238,238,238,.18);
  padding-block: 28px;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.footer__inner p { font-size: 15px; opacity: .8; }
.footer__top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: opacity .3s;
}
.footer__top img { filter: invert(1); transition: transform .35s var(--ease); }
.footer__top:hover img { transform: translateY(-4px); }

/* =============================================================
   ANIMACIONES DE SCROLL
   ============================================================= */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

[data-stagger] .folder-card {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
[data-stagger].is-in .folder-card { opacity: 1; transform: none; }
[data-stagger].is-in .folder-card:nth-child(1) { transition-delay: .05s; }
[data-stagger].is-in .folder-card:nth-child(2) { transition-delay: .13s; }
[data-stagger].is-in .folder-card:nth-child(3) { transition-delay: .21s; }
[data-stagger].is-in .folder-card:nth-child(4) { transition-delay: .29s; }

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 1024px) {
  .folders { grid-template-columns: repeat(3, 1fr); }
  /* Hero apilado como el Figma mobile: título → eyebrow → foto → bajada → CTAs */
  .hero {
    min-height: auto;
    padding-top: clamp(90px, 14vh, 120px);
    padding-bottom: 40px;
  }
  .hero__grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .hero__content { display: contents; }
  .hero__title   { order: 1; }
  .hero__eyebrow { order: 2; margin-top: 14px; }
  .hero__media   { order: 3; align-self: stretch; margin: 24px 0 0; }
  .hero__body    { order: 4; margin-top: 28px; max-width: none; }
  .hero__ctas    { order: 5; margin-top: 24px; }
  .hero__media img {
    width: 100%;
    max-height: 46vh;
    object-fit: contain;
    object-position: center bottom;
  }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .burger { display: flex; }
  .folders { grid-template-columns: repeat(2, 1fr); }
  .about__grid { grid-template-columns: 1fr; }
  .about__media { position: static; }
  .specs__row { grid-template-columns: 1fr; gap: 8px; }
  .cta__row { flex-direction: column; align-items: flex-start; }
  .footer__inner { flex-direction: column; text-align: center; }
  .hero__scroll { display: none; }
  .hero__title { font-size: clamp(46px, 13.5vw, 64px); }
}

@media (max-width: 420px) {
  .folders { gap: 24px 16px; }
  .hero__ctas .btn { width: 100%; }
}

/* =============================================================
   LIGHTBOX / QUICK LOOK
   ============================================================= */
.lightbox {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
}
.lightbox.is-open { visibility: visible; }
.lightbox__backdrop {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(44, 42, 38, .62);
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.lightbox.is-open .lightbox__backdrop { opacity: 1; }

.lightbox__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: min(1100px, 86vw);
}
.lb-window {
  width: 100%;
  background: #d9d8d4;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(5,5,5,.5);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: transform .55s var(--ease), opacity .4s var(--ease);
  will-change: transform;
}
.lightbox.is-open .lb-window { opacity: 1; }
.lb-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #c9c7c2;
}
.lb-bar__dots { display: flex; gap: 6px; }
.lb-bar__dots i {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink);
}
.lb-bar__file { font-weight: 500; font-size: 14px; }
.lb-bar__desc {
  margin-left: auto;
  font-size: 13px;
  color: #3d3c39;
}
.lb-close {
  display: none;
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(5,5,5,.08);
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
}
.lb-stage {
  position: relative;
  aspect-ratio: 1917 / 1077; /* mismo ratio que los frames desktop de Figma */
  margin: 0 8px 8px;
  border-radius: 8px;
  overflow: hidden;
  background: #dcdcdc;
  touch-action: pan-y;
}
.lb-track {
  display: flex;
  height: 100%;
  transition: transform .45s var(--ease);
  will-change: transform;
}
.lb-slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 15px;
  color: var(--stone);
}
.lb-slide img { width: 100%; height: 100%; object-fit: cover; }
.lb-caption { display: none; padding: 14px 16px 4px; }
.lb-caption h4 { font-size: 17px; font-weight: 500; }
.lb-caption p { font-size: 14px; color: #55534e; margin-top: 2px; }
.lb-foot { display: none; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid rgba(5,5,5,.12); }
.lb-foot__btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500; color: var(--ink);
  padding: 10px 0;
}
.lb-count { font-size: 13px; color: #55534e; }

.lb-dots { display: flex; gap: 4px; }
.lb-dots i {
  width: 9px; height: 9px;
  box-sizing: content-box;
  border: 5px solid transparent; /* zona de toque más grande */
  background-clip: content-box;
  border-radius: 50%;
  background-color: rgba(238,238,238,.45);
  cursor: pointer;
  transition: background-color .3s;
}
.lb-dots i.is-current { background-color: var(--paper); }

.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 46px; height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(5,5,5,.25);
  transition: transform .3s var(--ease), background .3s;
}
.lb-arrow:hover { background: var(--white); transform: translateY(-50%) scale(1.08); }
.lb-arrow--prev { left: max(24px, 4vw); }
.lb-arrow--next { right: max(24px, 4vw); }

body.lb-lock { overflow: hidden; }

/* ---- Lightbox mobile: hoja a pantalla completa ---- */
@media (max-width: 768px) {
  .lightbox { align-items: flex-end; }
  .lightbox__inner { width: 100%; gap: 0; }
  .lb-window {
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    transform: translateY(100%);
  }
  .lightbox.is-open .lb-window { transform: translateY(0); }
  .lb-bar { padding: 12px 16px; }
  .lb-bar__dots, .lb-bar__desc { display: none; }
  .lb-bar__file { font-size: 13px; }
  .lb-close { display: block; margin-left: auto; }
  .lb-stage { flex: 1; aspect-ratio: auto; margin: 0; border-radius: 0; background: transparent; }
  .lb-slide img { object-fit: contain; } /* verticales 4:5 completas, sin recorte */
  .lb-caption { display: block; }
  .lb-foot { display: flex; }
  .lb-arrow { display: none; }
  .lb-dots {
    position: absolute;
    bottom: 118px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
  }
  .lb-dots i { background-color: rgba(5,5,5,.25); }
  .lb-dots i.is-current { background-color: var(--ink); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal, [data-stagger] .folder-card { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Fallbacks Safari < 15 (sin aspect-ratio) ---------- */
@supports not (aspect-ratio: 1 / 1) {
  .folder { height: 0; padding-bottom: 82%; }
  .about__media img { height: auto; min-height: 420px; }
  .lb-stage { height: 58vh; }
}

/* =============================================================
   INTERACCIÓN · foco, toque y carga
   ============================================================= */
/* Las anclas no quedan tapadas por el header */
section[id] { scroll-margin-top: 80px; }

/* Saltar al contenido, visible solo con teclado */
.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  transform: translateY(-160%);
  transition: transform .25s var(--ease);
}
.skip-link:focus-visible { transform: none; }

/* Foco visible en todo lo que se toca con teclado */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 6px; }
.cta :focus-visible, .footer :focus-visible { outline-color: var(--paper); }
.btn:focus-visible { border-radius: var(--radius-pill); }
.lb-window:focus-visible { outline: none; }

/* La carpeta reacciona igual con teclado que con mouse */
.folder-card { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.folder-card:focus-visible { outline: none; transform: translateY(-6px); }
.folder-card:focus-visible h4::after { width: 100%; left: 0; }
.folder-card:focus-visible .folder__paper { transform: translateY(-16%) rotate(-4deg); }
.folder-card:focus-visible .folder__preview { transform: translateY(-24%) rotate(3.5deg); }
.folder-card:focus-visible .folder__front { transform: scaleY(.97); }
/* Al tocar, la carpeta se hunde un poco: confirma el toque antes de abrir */
.folder-card:active .folder { transform: scale(.96); transition: transform .12s ease-out; }
.btn, .nav__link, .socials a, .footer__top { touch-action: manipulation; }

/* Las láminas aparecen cuando terminan de cargar, sin saltos */
.lb-slide img { opacity: 0; transition: opacity .4s var(--ease); }
.lb-slide img.is-loaded { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .header.is-hidden { transition: none; }
  .lb-slide img { opacity: 1; }
}
