/* =========================
   RESET + BASE
   ========================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body{
  font-family: "Inter", sans-serif;
  background: #f6f5f2;
  color: #0c0c0c;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

/* Layout vars */
:root{
  --padX: clamp(18px, 5vw, 56px);
  --padY: clamp(52px, 7vw, 96px);
  --serif: "Times New Roman", serif;

  --ink: #0c0c0c;
  --paper: #f6f5f2;

  --ui: rgba(255,255,255,0.74);
  --uiBorder: rgba(0,0,0,0.12);

  --shadow: 0 20px 60px rgba(0,0,0,0.12);
  --ease: cubic-bezier(.77,0,.18,1);
  --easeSoft: cubic-bezier(.22,1,.18,1);
}

/* =========================
   SCROLL SNAP (desktop vertical)
   ========================= */
html, body{ scroll-snap-type: y mandatory; }
.project{ scroll-snap-align: start; scroll-snap-stop: always; }
.snap{ scroll-snap-align: start; }
@media (max-width: 768px){
  html, body{ scroll-snap-type: y proximity; }
}

/* =========================
   GRAIN
   ========================= */
.grain{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0.12;
  mix-blend-mode: multiply;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

/* =========================
   SITE LOGO (PC + MOBILE)
   - solo visible mientras body.in-hero
   ========================= */
.site-logo{
  position: fixed;
  top: calc(22px + env(safe-area-inset-top));
  left: var(--padX);
  z-index: 151;

  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 1.8vw, 26px);
  letter-spacing: 0.38em;
  text-transform: uppercase;

  color: #fff;
  pointer-events: none;
  text-shadow: 0 10px 28px rgba(0,0,0,0.55);

  opacity: 0;
  transform: translateY(-10px);
  filter: blur(10px);
  transition: opacity .40s ease, transform .40s var(--easeSoft), filter .40s ease;
}
body.in-hero .site-logo{
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
@keyframes logoPopNice{
  from{ opacity: 0; transform: translateY(-10px); filter: blur(10px); }
  to  { opacity: 1; transform: translateY(0);  filter: blur(0); }
}
.site-logo.logo-pop{
  animation: logoPopNice .55s var(--easeSoft) both;
}

/* =========================
   INTRO
   ========================= */
.intro{
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: grid;
  place-items: center;
  z-index: 200;
  transition: opacity 0.9s ease;
}
.intro.is-hidden{ opacity: 0; pointer-events: none; }

.intro .logo{
  width: 300px;
  max-width: 75vw;

  opacity: 0;
  transform: scale(.975);
  filter: blur(8px);
  transition:
    opacity .95s ease,
    transform .95s var(--easeSoft),
    filter .95s ease;
}
.intro.is-visible .logo{
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

/* =========================
   MENU BUTTON (afinada)
   ========================= */
.menu-btn{
  position: fixed;
  top: calc(22px + env(safe-area-inset-top));
  right: calc(var(--padX) - 6px);
  z-index: 210;

  width: 34px;
  height: 28px;
  background: none;
  border: none;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;

  color: rgba(0,0,0,0.92);
  transition: transform .25s ease;
}
.menu-btn:active{ transform: scale(0.98); }

body.in-hero .menu-btn{ color: rgba(255,255,255,0.92); }
body.menu-open .menu-btn{ color: rgba(255,255,255,0.92); }

.menu-btn span{
  height: 2px;
  background: currentColor;
  transition: transform .52s var(--easeSoft), opacity .28s ease;
  border-radius: 0;
}

/* estado X (más fino) */
.menu-btn.open span:nth-child(1){
  transform: translateY(13px) rotate(45deg);
}
.menu-btn.open span:nth-child(2){
  opacity: 0;
}
.menu-btn.open span:nth-child(3){
  transform: translateY(-13px) rotate(-45deg);
}

/* contraste del burger/X según fondo del overlay */
.menu-btn.menu-ink-dark{ color: rgba(0,0,0,0.92) !important; }
.menu-btn.menu-ink-light{ color: rgba(255,255,255,0.92) !important; }

body.menu-open{ overflow: hidden; }

/* =========================
   MENU OVERLAY (afinada, mismo menú)
   ========================= */
.menu-overlay{
  position: fixed;
  inset: 0;
  z-index: 140;
  background: #000;
  display: flex;
  align-items: center;
  padding-left: var(--padX);

  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.95s var(--easeSoft), opacity 0.35s ease;

  /* UX/UI: sensación premium */
  will-change: transform, opacity;
}
.menu-overlay.open{
  transform: translateX(0);
  opacity: 1;
}

/* links */
.menu-items{ display: flex; flex-direction: column; gap: 18px; }
.menu-items a{
  font-size: clamp(2.6rem, 7vw, 6.8rem);
  font-weight: 800;
  color: rgba(255,255,255,0.30);
  text-decoration: none;
  letter-spacing: 0.03em;
  display: inline-block;
  max-width: 92vw;

  transform: translateX(10px);
  opacity: 0.92;
  transition: color .28s ease, letter-spacing .28s ease, transform .45s var(--easeSoft);
}
.menu-items a.menu-anim{
  animation: fadeIn 0.70s var(--easeSoft) forwards;
  animation-delay: calc(var(--i) * 0.08s);
}
@keyframes fadeIn{
  from{ opacity: 0; transform: translateX(52px); }
  to  { opacity: 1; transform: translateX(0); }
}
.menu-items a:hover{
  color: #fff;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.10em;
  transform: translateX(0);
}
.menu-line{
  position: absolute;
  left: var(--padX);
  right: var(--padX);
  bottom: calc(18px + env(safe-area-inset-bottom));
  height: 1px;
  background: rgba(255,255,255,0.12);
}

/* =========================
   PROJECTS (desktop vertical)
   ========================= */
.projects{ width: 100%; }

.project{
  position: relative;
  height: 100svh;
  min-height: 100svh;
  display: grid;
  place-items: end start;
  padding: 0 var(--padX) calc(12vh + env(safe-area-inset-bottom));
  overflow: hidden;
}

.project-media{
  position: absolute;
  inset: -2%;
  background-image: var(--bg);
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
  will-change: transform;
}
.project-media::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.62) 78%),
    linear-gradient(to top, rgba(0,0,0,0.62), rgba(0,0,0,0.08));
}

.project-title{
  position: relative;
  z-index: 2;
  text-align: left;
  color: #fff;
  font-family: var(--serif);
  padding: 0;
  max-width: 720px;
}
.project-title::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-2.1rem;
  width: 420px;
  height: 7rem;
  background: radial-gradient(ellipse, rgba(0,0,0,.44), rgba(0,0,0,0));
  filter: blur(10px);
  z-index: -1;
}
.project-title h2{
  font-size: clamp(1.2rem, 2.6vw, 2rem);
  letter-spacing: 0.28em;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.12;
}
.project-title h2 span{ display:inline-block; white-space: nowrap; }
.project-title p{
  margin-top: 12px;
  font-size: 0.62rem;
  letter-spacing: 0.38em;
  opacity: 0.85;
}

/* fade al cambiar slide (mobile) */
@keyframes slideFade{
  from{ opacity: .80; filter: blur(7px); transform: translateY(2px); }
  to  { opacity: 1;   filter: blur(0);  transform: translateY(0); }
}
.project.fade{ animation: slideFade .48s var(--easeSoft) both; }
.project.is-active .project-media{
  transform: scale(1.05);
  transition: transform .65s var(--easeSoft);
}

/* =========================
   DOTS MOBILE
   ========================= */
.projects-dots{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 152;
  display: none;
  gap: 10px;
  align-items: center;
  justify-content: center;

  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  filter: blur(10px);
  transition: opacity .40s ease, transform .40s var(--easeSoft), filter .40s ease;
}
body.in-hero .projects-dots{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  filter: blur(0);
}

.projects-dots .dot{
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: width .25s ease, opacity .25s ease, background .25s ease;
}
.projects-dots .dot.active{
  width: 22px;
  background: rgba(255,255,255,0.90);
  opacity: 1;
}

/* =========================
   REVEAL (más caro)
   ========================= */
.reveal{
  opacity: 0;
  transform: translateY(18px);
  filter: blur(12px);
  transition: opacity 1.05s var(--easeSoft), transform 1.05s var(--easeSoft), filter 1.05s var(--easeSoft);
}
.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* =========================
   ABOUT
   ========================= */
.about{
  background: var(--paper);
  padding: var(--padY) var(--padX);
  font-family: var(--serif);
}
.about-header{
  display:flex;
  justify-content: space-between;
  align-items:flex-start;
  gap: 24px;
  margin-bottom: clamp(48px, 7vw, 96px);
}
.about-logo{
  font-family: var(--serif);
  font-size: .92rem;
  letter-spacing: .30em;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
}
.about-logo span{
  display:block;
  font-size: .62rem;
  letter-spacing: .25em;
  margin-top: .45rem;
  opacity: .75;
}
.about-nav a{
  margin-left: 2rem;
  font-size: .65rem;
  letter-spacing: .25em;
  text-decoration: none;
  color: var(--ink);
  opacity: .82;
  position: relative;
}
.about-nav a::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-8px;
  width:0;
  height:1px;
  background: var(--ink);
  transition: width .25s ease;
}
.about-nav a:hover{ opacity: 1; }
.about-nav a:hover::after{ width: 100%; }

.about-content{
  display:grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(28px, 6vw, 92px);
  align-items: start;
}
.about-left p{
  font-size: .72rem;
  letter-spacing: .25em;
  opacity: .85;
}
.about-right{ max-width: 62ch; }
.about-right p{
  font-size: .90rem;
  line-height: 1.95;
  margin-bottom: 2.2rem;
}
.about-right strong{
  font-weight: 700;
  letter-spacing: .02em;
}

/* =========================
   EXPERIMENTAL (ICON MARQUEE) — menos margen + más presencia
   ========================= */
.experimental{
  background: var(--paper);
  padding: var(--padY) var(--padX);
  padding-bottom: clamp(26px, 4vw, 54px); /* QUITA el margen grande bajo iconos */
  overflow: hidden;
}
.experimental-title{
  font-family: var(--serif);
  font-size: .70rem;
  letter-spacing: .35em;
  margin-bottom: clamp(22px, 4.2vw, 50px);
  text-transform: uppercase;
}
.icon-marquee{
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.icon-track{
  display:flex;
  align-items:center;
  gap: clamp(80px, 10vw, 160px);
  width: max-content;
  animation: scrollIcons 26s linear infinite;
  will-change: transform;
}
@keyframes scrollIcons{
  from{ transform: translate3d(0,0,0); }
  to  { transform: translate3d(-50%,0,0); }
}
.icon-box{
  width: clamp(160px, 15vw, 240px);   /* MÁS GRANDES */
  height: clamp(160px, 15vw, 240px);  /* MÁS GRANDES */
  display:flex;
  align-items:center;
  justify-content:center;
}
.icon-box img{
  max-width:100%;
  max-height:100%;
  opacity:.46;
  transition: opacity .30s ease, transform .30s var(--easeSoft), filter .30s ease;
}
.icon-box:hover img{
  opacity: 1;
  transform: scale(1.085);
}
@media (hover: hover) and (pointer: fine){
  .icon-marquee:hover .icon-track{ animation-play-state: paused; }
}

/* =========================
   AREAS (sin timeline)
   ========================= */
.home-timeline{
  padding: var(--padY) var(--padX);
  padding-top: clamp(36px, 6vw, 86px);
  background: var(--paper);
  font-family: var(--serif);
}
.section-title{
  font-size: .70rem;
  letter-spacing: .35em;
  margin-bottom: 2rem;
  text-transform: uppercase;
}
.section-title.center{ text-align:center; }

.areas-list{
  display:flex;
  justify-content:center;
  gap: clamp(18px, 3.5vw, 56px);
  margin-bottom: 0; /* sin timeline ya no se necesita aire abajo */
  flex-wrap: wrap;
}
.areas-list button{
  background:none;
  border:none;
  font-size: .65rem;
  letter-spacing: .35em;
  color: rgba(0,0,0,0.50);
  cursor:pointer;
  position: relative;
  padding: 8px 0;
  text-transform: uppercase;
}
.areas-list button::after{
  content:"";
  position:absolute;
  left:0;
  bottom:2px;
  width:0;
  height:1px;
  background: var(--ink);
  transition: width .25s ease;
}
.areas-list button:hover{ color: var(--ink); }
.areas-list button:hover::after{ width:100%; }

/* =========================
   CTA + FOOTER
   ========================= */
.final-cta{
  padding: calc(var(--padY) + 40px) var(--padX) var(--padY);
  background: var(--paper);
  text-align:center;
  font-family: var(--serif);
}
.final-question{
  font-size: 1rem;
  letter-spacing: .35em;
  margin-bottom: 2.2rem;
  text-transform: uppercase;
}
.final-button{
  display:inline-block;
  background: var(--ink);
  color:#fff;
  text-decoration:none;
  padding: 1.05rem 3.2rem;
  font-size: .70rem;
  letter-spacing: .25em;
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: transform .25s ease, opacity .25s ease;
}
.final-button:hover{
  transform: translateY(-1px);
  opacity: .92;
}
.site-footer{
  border-top: 1px solid rgba(0,0,0,0.30);
  padding: 2rem var(--padX);
  display:flex;
  justify-content: space-between;
  align-items:center;
  font-family: var(--serif);
  font-size: .65rem;
  letter-spacing: .20em;
  background: var(--paper);
}
.footer-right a{
  margin-left: 1.6rem;
  text-decoration:none;
  color: var(--ink);
  opacity:.85;
}
.footer-right a:hover{ opacity:1; text-decoration: underline; }

/* =========================
   DARK MODE
   ========================= */
body.dark{
  background: #0b0b0b;
  color: #ffffff;
}
body.dark .grain{ mix-blend-mode: screen; opacity: 0.09; }
body.dark .about,
body.dark .experimental,
body.dark .home-timeline,
body.dark .final-cta,
body.dark .site-footer{
  background: #0b0b0b;
}
body.dark .about-logo,
body.dark .about-nav a,
body.dark .section-title,
body.dark .footer-left,
body.dark .footer-right a{
  color:#fff;
}
body.dark .areas-list button{ color: rgba(255,255,255,0.55); }
body.dark .areas-list button::after{ background:#fff; }
body.dark .site-footer{ border-top: 1px solid rgba(255,255,255,0.18); }

/* FIX: iconos “blancos” en modo oscuro */
body.dark .icon-box img{
  filter: invert(1) brightness(1.55);
  opacity: .82;
}
body.dark .icon-box:hover img{ opacity: 1; }

/* =========================
   MOBILE (slider horizontal)
   ========================= */
@media (max-width: 768px){
  :root{ --padX: 18px; --padY: 58px; }

  .projects{
    height: 100svh;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-snap-stop: always;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .projects::-webkit-scrollbar{ display:none; }
  .project{
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
  }

  .projects-dots{ display: flex; }

  /* Icon marquee: MÁS LENTO + MÁS GRANDES en mobile */
  .icon-track{
    animation-duration: 34s; /* DESLIZA MÁS DESPACIO */
    gap: 64px;
  }
  .icon-box{
    width: 172px;
    height: 172px;
  }
  .icon-box img{
    opacity: 0.78;
    transform: scale(1.02);
  }

  /* quita aire extra visual bajo iconos en mobile */
  .experimental{
    padding-bottom: 22px;
  }

  .about-header{
    flex-direction: column;
    gap: 18px;
    margin-bottom: 46px;
  }
  .about-nav a{
    margin-left: 0;
    margin-right: 1.4rem;
    display: inline-block;
  }
  .about-content{
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .areas-list{
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 18px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }
  .areas-list button{ white-space: nowrap; }

  /* intro logo un poco más chico en móvil */
  .intro .logo{ width: min(280px, 72vw); }
}

/* =========================
   Reduced Motion (UX)
   ========================= */
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
  html{ scroll-behavior: auto; }
}




