:root {
  /* Paleta sacada del fondo de Foto_perfil.png */
  --black: #0f1015; /* entre el fondo de la foto (#111317 arriba, #0c0e12 abajo) y el azul noche */
  --surface: #11131c;
  --sand: #e3e8f0;
  --muted: rgba(227, 232, 240, .5);
  --hairline: rgba(227, 232, 240, .2);
  --accent: #1d5bff;
  --accent-deep: #0041b4;
  --teal: #017a9f;
  --teal-bright: #19b4d8;

  --gutter: 24px;
  --col-right: 39.6vw;
  --ease-out: cubic-bezier(.32, .72, 0, 1);
  --font: "Geist", Arial, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
}

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

html { background: var(--black); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: transparent; /* the color lives on html; .page-bg (fixed, z -1) carries the light */
  color: var(--sand);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection { background: var(--accent); color: var(--sand); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.label { font-size: 14px; line-height: 1.35; text-transform: uppercase; font-weight: 400; }
.is-muted { color: var(--muted); }
.playfair-o { font-family: var(--serif); font-style: italic; font-weight: 400; }

.line { height: 1px; width: 100%; background: var(--hairline); transform-origin: left center; }

/* ---------- Fondo continuo: la misma luz que la foto (azul a la izquierda, turquesa abajo a la derecha) ---------- */
.page-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, #121419 0%, var(--black) 45%, #0c0e12 100%);
}
.page-glow { position: absolute; display: block; border-radius: 50%; will-change: transform, opacity; }
.page-glow.is-blue {
  left: -30vmax; top: calc(55% - 35vmax); width: 70vmax; height: 70vmax;
  background: radial-gradient(closest-side, rgba(0, 65, 177, .34), rgba(4, 50, 135, .14) 55%, transparent);
  animation: glow-blue 22s ease-in-out infinite alternate;
}
.page-glow.is-teal {
  right: -30vmax; top: calc(68% - 32vmax); width: 64vmax; height: 64vmax;
  background: radial-gradient(closest-side, rgba(0, 82, 113, .32), rgba(2, 57, 79, .12) 55%, transparent);
  animation: glow-teal 27s ease-in-out infinite alternate;
}
@keyframes glow-blue { to { transform: translate(6vmax, -6vmax) scale(1.1); opacity: .8; } }
@keyframes glow-teal { to { transform: translate(-6vmax, 5vmax) scale(.92); opacity: .85; } }

/* ---------- Cursor ---------- */
.cursor-canvas { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 91; pointer-events: none;
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--accent); opacity: 0;
  transition: width .25s var(--ease-out), height .25s var(--ease-out), background-color .25s;
}
.cursor-dot.is-link { width: 1rem; height: 1rem; background: var(--sand); }
@media (hover: none), (pointer: coarse) { .cursor-canvas, .cursor-dot { display: none; } }

/* ---------- Nav ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; justify-content: flex-end; align-items: center;
  padding: var(--gutter);
  pointer-events: none;
}
.nav-button {
  pointer-events: auto;
  display: flex; align-items: center; gap: .6rem;
  height: 64px; padding: 0 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background-color .3s var(--ease-out);
}
.nav-button:hover { background: rgba(255, 255, 255, .16); }
.menu-icon { position: relative; width: 14px; height: 14px; display: block; }
.menu-dot {
  position: absolute; top: 50%; left: 50%;
  width: 4px; height: 4px; margin: -2px 0 0 -2px;
  background: var(--accent); display: block;
}
.js .navbar { opacity: 0; }
.no-motion .navbar { opacity: 1; }

/* ---------- Menu ---------- */
.menu {
  position: fixed; inset: 0; z-index: 50;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  background: var(--black);
}
.menu-link {
  font-size: 8.4vw; line-height: 1; letter-spacing: -.03em; text-transform: uppercase;
  display: block; overflow: hidden;
}

/* Stagger link hover */
.stagger-link__inner { position: relative; display: inline-block; overflow: hidden; vertical-align: top; }
.stagger-link__layer { display: block; white-space: nowrap; }
.stagger-link__layer--hover { position: absolute; inset: 0; }
.stagger-link__char { display: inline-block; }

/* ---------- Hero + about ---------- */
.page-wrapper { position: relative; }
.hero-about { position: relative; }

.seq-wrap {
  position: absolute; inset: 0; z-index: 0;
  display: flex; justify-content: center; align-items: flex-start;
  padding-right: 16vw;
  pointer-events: none;
  overflow-x: clip; /* solo en horizontal: evita scroll lateral en móvil; en vertical la luz se derrama sin corte */
}
.seq-element {
  position: sticky; top: var(--gutter);
  width: 35vw; height: 100vh;
  isolation: isolate;
}
/* Luz que continúa la iluminación de la foto (azul a la izquierda, turquesa a la derecha) fuera del encuadre */
.seq-aura {
  position: absolute; inset: -25% -70%; z-index: 0;
  /* the box edges must never show: fade to zero before reaching them */
  -webkit-mask-image: radial-gradient(closest-side, #000 45%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 45%, transparent 100%);
}
.aura {
  position: absolute; display: block; border-radius: 50%;
  will-change: transform, opacity;
}
.aura.is-blue {
  left: 8%; top: 22%; width: 55%; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(29, 91, 255, .55), rgba(0, 65, 180, .22) 55%, transparent);
  animation: aura-blue 16s ease-in-out infinite alternate;
}
.aura.is-teal {
  right: 6%; top: 42%; width: 50%; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(25, 180, 216, .42), rgba(1, 122, 159, .18) 55%, transparent);
  animation: aura-teal 19s ease-in-out infinite alternate;
}
.aura.is-deep {
  left: 30%; top: -5%; width: 45%; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(0, 65, 180, .3), transparent);
  animation: aura-deep 23s ease-in-out infinite alternate;
}
@keyframes aura-blue { from { transform: translate(0, 0) scale(1); opacity: .85; } to { transform: translate(6%, -8%) scale(1.15); opacity: 1; } }
@keyframes aura-teal { from { transform: translate(0, 0) scale(1.1); opacity: 1; } to { transform: translate(-8%, 6%) scale(.92); opacity: .75; } }
@keyframes aura-deep { from { transform: translate(-6%, 0) scale(.9); opacity: .6; } to { transform: translate(8%, 10%) scale(1.1); opacity: 1; } }

/* La foto se funde con el fondo: sin tarjeta, bordes difuminados y su fondo oscuro deja pasar la luz */
.seq-photo {
  position: absolute; inset: 0; z-index: 1; overflow: hidden;
  mix-blend-mode: lighten;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 62%, transparent 100%), linear-gradient(to right, transparent 0, #000 16%, #000 84%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 62%, transparent 100%), linear-gradient(to right, transparent 0, #000 16%, #000 84%, transparent 100%);
  mask-composite: intersect;
}
.seq-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.js .seq-photo { clip-path: inset(100% 0 0 0); }
.js .seq-aura { opacity: 0; }
.no-motion .seq-photo { clip-path: none; }
.no-motion .seq-aura { opacity: 1; }

/* Grano fino sobre toda la página: une la textura de la foto con el fondo */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 80; pointer-events: none;
  opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--gutter) var(--gutter) 80px;
}
.header-top { display: flex; justify-content: space-between; }
.header-intro {
  display: grid; grid-template-columns: 1fr var(--col-right); gap: var(--gutter);
  align-items: start; margin-bottom: var(--gutter);
}
.header-intro__right { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--gutter); }
.intro-tagline { max-width: 285px; }

.hero-title {
  margin-top: var(--gutter);
  font-size: 13.5vw; font-weight: 400; line-height: .9; letter-spacing: -.026em;
  text-transform: uppercase; text-align: right;
}
.hero-name, .hero-domain { display: block; width: max-content; margin-left: auto; }
.hero-domain { color: var(--accent); }
/* Room so the mask doesn't clip the overhang of the italic O */
.hero-title .split-mask-line-mask { padding-inline: .1em; margin-inline: -.1em; }
.js [data-stagger-char] { visibility: hidden; }
.no-motion [data-stagger-char] { visibility: visible; }

.about {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr var(--col-right); gap: var(--gutter);
  padding: 190px var(--gutter) 230px;
}
.about-list { display: flex; flex-direction: column; }
.about-row {
  position: relative;
  display: flex; justify-content: space-between; gap: var(--gutter);
  padding: 22px 0;
}
.about-row > span:last-child { text-align: right; }
.about-row .line.is-top { position: absolute; top: 0; left: 0; }

.button {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: .375em;
  margin-top: 64px;
  padding: .75em .75em .75em 1em;
  border-radius: .5em;
  background: var(--accent); color: var(--sand);
  font-size: 14px; line-height: 1; text-transform: uppercase;
  transition: background-color .5s var(--ease-out), color .5s var(--ease-out);
}
.button-text { position: relative; display: block; overflow: hidden; height: 1em; }
.button-text > span { display: block; transition: transform .5s var(--ease-out); }
.button-dot { width: .5em; height: .5em; border-radius: .25em; background: currentColor; transition: transform .5s var(--ease-out); }
@media (hover: hover) {
  .button:hover { background: var(--sand); color: var(--black); }
  .button:hover .button-text > span { transform: translateY(-100%); }
  .button:hover .button-dot { transform: rotate(45deg) scale(1.2); }
}

/* ---------- Statement ---------- */
.statement { padding: 190px var(--gutter) 290px; }
.heading-2 {
  font-size: 8.5vw; font-weight: 400; line-height: .9; letter-spacing: -.035em;
  text-transform: uppercase; margin-bottom: 48px;
}
.quote-author { margin: -16px 0 48px; }
.two-col {
  display: grid; grid-template-columns: 3fr 9fr; gap: var(--gutter);
  padding-top: 32px;
}
.text-2-col { columns: 2; column-gap: var(--gutter); }

/* ---------- Lo que me mueve (esfera) ---------- */
.stuff {
  position: relative; overflow: hidden;
  height: 100vh; height: 100svh; min-height: 560px;
  touch-action: pan-y; /* scroll vertical normal; arrastre horizontal gira */
  cursor: grab; user-select: none; -webkit-user-select: none;
  outline: none;
}
.stuff.is-dragging { cursor: grabbing; }
.stuff:focus-visible { outline: 2px solid var(--accent); outline-offset: -8px; }
.stuff-glow {
  position: absolute; left: 50%; top: 50%; width: min(80vw, 760px); aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0, 65, 180, .35), rgba(1, 122, 159, .12) 60%, transparent);
}
.stuff-title { position: absolute; top: var(--gutter); left: var(--gutter); z-index: 2; }
.stuff-caption {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: var(--gutter); z-index: 2;
  text-align: center; pointer-events: none;
}
.stuff-sphere { list-style: none; position: absolute; inset: 0; }
.stuff-item {
  --size: clamp(72px, 9vw, 150px);
  position: absolute; left: 0; top: 0; width: var(--size);
  transform-origin: 50% 50%; will-change: transform, opacity;
}
.stuff-btn { display: block; width: 100%; border-radius: 6px; cursor: inherit; }
.stuff-item img {
  width: 100%; height: auto; pointer-events: none; border-radius: 6px;
  -webkit-user-drag: none; box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
}
.stuff-item.is-text { width: auto; }
.stuff-item.is-text .stuff-btn span {
  display: block; white-space: nowrap;
  padding: .6em .9em; border-radius: 999px;
  background: rgba(227, 232, 240, .08); border: 1px solid var(--hairline);
  font-size: 14px; line-height: 1; text-transform: uppercase;
}
.stuff:not(.is-ready) .stuff-sphere {
  /* Sin JS: rejilla simple */
  position: static; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
  padding: 96px var(--gutter);
}
.stuff:not(.is-ready) .stuff-item { position: static; }

/* Ficha de detalle */
.stuff-dialog {
  margin: auto; width: min(880px, calc(100vw - 2 * var(--gutter))); max-height: calc(100svh - 2 * var(--gutter));
  padding: 0; border: 1px solid var(--hairline); border-radius: 8px;
  background: var(--surface); color: var(--sand);
  display: none; grid-template-columns: 2fr 3fr; overflow: auto;
}
.stuff-dialog[open] { display: grid; animation: dialog-in .5s var(--ease-out); }
.stuff-dialog::backdrop { background: rgba(13, 14, 21, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.stuff-dialog__media { position: relative; min-height: 240px; background: radial-gradient(closest-side, rgba(0, 65, 180, .35), transparent) center / 100% 100% no-repeat; }
.stuff-dialog__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stuff-dialog__name {
  position: absolute; inset: 0; display: grid; place-items: center; padding: var(--gutter);
  font-size: 40px; line-height: 1; text-transform: uppercase; letter-spacing: -.02em; text-align: center;
}
.stuff-dialog__body { padding: 56px 32px 32px; max-width: 65ch; }
.stuff-name { font-size: 48px; font-weight: 400; line-height: 1; letter-spacing: -.03em; text-transform: uppercase; }
.stuff-sub { margin-top: 10px; color: var(--teal-bright); }
.stuff-dialog__body p:not(.label) { margin-top: 18px; color: rgba(227, 232, 240, .82); }
.stuff-link { margin-top: 32px; }
.stuff-dialog__body .stuff-credit { margin-top: 32px; font-size: 12px; color: var(--muted); }
.stuff-credit a { text-decoration: underline; text-underline-offset: 2px; }
.stuff-close {
  position: absolute; top: 16px; right: 16px; z-index: 1;
  padding: .6em .9em; border-radius: 6px; background: rgba(255, 255, 255, .1);
  transition: background-color .3s var(--ease-out);
}
.stuff-close:hover { background: rgba(255, 255, 255, .18); }
@media (max-width: 767px) {
  .stuff-dialog[open] { display: block; } /* en rejilla las filas se encogían y el texto pisaba la foto */
  .stuff-dialog__media { min-height: 0; aspect-ratio: 4 / 3; }
  .stuff-dialog__body { padding: 24px 20px 28px; }
  .stuff-name { font-size: 36px; }
}

/* ---------- Work ---------- */
.work-intro { padding: 338px var(--gutter) 0; } /* mismo aire que entre la frase y «Lo que me mueve» */
.heading-extreme {
  font-size: 16.5vw; font-weight: 400; line-height: .9; letter-spacing: -.05em;
  text-transform: uppercase; text-align: center;
}

.carousel { position: relative; height: 100vh; height: 100svh; outline: none; }
.carousel:focus-visible { outline: 2px solid var(--accent); outline-offset: -8px; }
.carousel-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.carousel[data-pointer="grab"] .carousel-canvas { cursor: grab; }
.carousel[data-pointer="grabbing"] .carousel-canvas { cursor: grabbing; }
.carousel-caption {
  position: absolute; top: 14%; left: 0; right: 0; z-index: 2;
  text-align: center; pointer-events: none;
}
.carousel-caption [data-carousel-content] { display: flex; flex-direction: column; align-items: center; gap: 4px; }
[data-carousel-content] { text-shadow: 0 2px 6px rgba(0,0,0,.55), 0 6px 32px rgba(0,0,0,.6); }
.carousel-title { font-size: 72px; line-height: 1.2; text-transform: uppercase; letter-spacing: -.02em; }
.carousel-meta { color: var(--muted); }
.carousel-counter { position: absolute; bottom: 9%; left: 0; right: 0; text-align: center; color: var(--muted); }

/* Sin WebGL: fila con scroll horizontal */
.carousel-items {
  list-style: none; display: flex; gap: 40px; height: 100%;
  align-items: center; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 var(--gutter);
}
.carousel-items li { flex: none; width: min(78vw, 960px); scroll-snap-align: center; }
.carousel-items a { display: flex; flex-direction: column; gap: 12px; }
.carousel-items img { width: 100%; height: auto; border-radius: 14px; }
.carousel-items .carousel-title { font-size: 32px; }
.carousel:not(.is-gl) .carousel-caption, .carousel:not(.is-gl) .carousel-counter { display: none; }
.carousel.is-gl .carousel-canvas { display: block; }
.carousel.is-gl .carousel-items { display: none; }

/* ---------- Footer ---------- */
.section-footer { padding: var(--gutter); }
.footer-base {
  position: relative; overflow: hidden;
  min-height: 720px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--gutter) var(--gutter) 0;
  border-radius: 8px;
  background: var(--surface);
}
.footer-gradient {
  position: absolute; left: -22%; bottom: -45%; z-index: 0;
  width: 75%; aspect-ratio: 1.2;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent) 0%, var(--accent-deep) 35%, rgba(1, 122, 159, .55) 65%, transparent 100%);
  filter: blur(40px);
  pointer-events: none;
}
.footer-gradient::after {
  content: ""; position: absolute; right: -60%; bottom: 10%;
  width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(25, 180, 216, .6), transparent);
}
.footer-row { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: var(--gutter); }
.footer-bottom { position: relative; z-index: 1; }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; }
.footer-col.is-right { align-items: flex-end; text-align: right; }
.footer-gap { margin-top: 18px; }
.footer-bottom .line { margin-top: 18px; }

.marquee { position: relative; overflow: hidden; margin: 0 calc(var(--gutter) * -1); }
.marquee-track { display: flex; width: max-content; }
.marquee-item { flex: none; display: flex; padding-right: 4vw; }
.marquee-text { font-size: 15vw; line-height: 1.2; white-space: nowrap; text-transform: uppercase; letter-spacing: -.03em; }
.marquee-text .is-accent { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  :root { --col-right: 50vw; }
  .text-2-col { columns: 1; }
}
@media (max-width: 767px) {
  :root { --gutter: 16px; }
  .seq-wrap { padding-right: 0; }
  .seq-element { width: 60vw; height: 50vh; }
  .header-intro, .about, .two-col { grid-template-columns: 1fr; }
  .header-intro__right { flex-direction: row; }
  .hero-title { font-size: 15vw; }
  .about { padding: 120px var(--gutter) 160px; }
  .statement { padding: 120px var(--gutter) 160px; }
  .work-intro { padding-top: 208px; }
  .menu-link { font-size: 10vw; } /* «Lo que me mueve» es el más largo: a 15vw se salía */
  .carousel-title { font-size: 40px; }
  .footer-base { min-height: 0; gap: 56px; }
  .footer-bottom .footer-row { flex-direction: column; gap: 18px; }
  .footer-col.is-right { align-items: flex-start; text-align: left; }
  .footer-col a { overflow-wrap: anywhere; }
  .nav-button { height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .seq-photo { clip-path: none; }
  .js .seq-aura { opacity: 1; }
  .aura, .page-glow { animation: none; }
  .js .navbar { opacity: 1; }
  .js [data-stagger-char] { visibility: visible; }
}
