/* ==========================================================================
   Tomás Ariel Alfaro — v3. Bone paper, ink, one terracotta.
   A calm editorial page with a 3D walk through the work.
   ========================================================================== */

:root {
  --bg: #f1eee8;
  --bg-2: #e8e4db;
  --ink: #14120e;
  --muted: #615c52;
  --line: rgba(20, 18, 14, 0.13);
  --accent: #a8442a;
  --on-accent: #f6f2ea;
  --night: #14120e;

  --f-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-sans: "Geist", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(0.16, 0.8, 0.12, 1);
  --step: 1400px; /* distance between scenes along the walk */
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--ink) var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-sans); font-size: 16px; line-height: 1.6; font-weight: 400;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
em { font-style: normal; color: var(--accent); }
.dot { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: 12px; top: -100px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { padding-left: var(--gutter); padding-right: var(--gutter); }
.num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

.h-serif { font-family: var(--f-serif); font-weight: 300; font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.02; letter-spacing: -0.02em; text-wrap: balance; font-variation-settings: "opsz" 72; }
.h-serif.big { font-size: clamp(2.6rem, 6.4vw, 6rem); line-height: 0.98; letter-spacing: -0.03em; }
.h-serif em, .hero-title em { font-weight: 300; }
.sec-lede { margin-top: 22px; max-width: 52ch; color: var(--muted); font-size: 17px; }
.note { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* Buttons: one shape, quiet until touched */
.btn {
  --mx: 0px; --my: 0px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; background: var(--ink); color: var(--bg);
  font: 500 14px/1 var(--f-sans); letter-spacing: 0.01em;
  text-decoration: none; border: 0; border-radius: 999px; cursor: pointer;
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform 0.5s var(--ease), background-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.btn:hover { background: var(--accent); color: var(--on-accent); }
.btn:active { transform: translate3d(var(--mx), calc(var(--my) + 1px), 0) scale(0.98); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn-small { padding: 10px 16px; font-size: 12px; }

.link-arrow {
  display: inline-block; margin-top: 18px; padding-bottom: 3px;
  font-size: 14px; text-decoration: none; color: var(--ink);
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.5s var(--ease), color 0.3s;
}
.link-arrow:hover { background-size: 0 1px; background-position: 100% 100%; color: var(--accent); }

/* Navigation */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  background: linear-gradient(var(--bg) 45%, transparent);
}
.brand { font-family: var(--f-serif); font-weight: 400; font-size: 20px; letter-spacing: -0.01em; text-decoration: none; }
.site-nav ul { display: flex; gap: clamp(16px, 2.6vw, 36px); }
.site-nav li a { font-size: 14px; text-decoration: none; color: var(--muted); transition: color 0.3s; padding: 6px 0; }
.site-nav li a:hover { color: var(--ink); }

/* ---------- Scenes: the flat reading (no JS, or reduced motion) ---------- */
.scene { padding: clamp(72px, 11vw, 140px) var(--gutter); }
.scene-in { max-width: 1180px; margin: 0 auto; }
.scene-hero { min-height: 100svh; display: flex; align-items: center; padding-top: 120px; }
.scene-hero .scene-in { width: 100%; }
.rail, .hud { display: none; }

.hero-title { font-family: var(--f-serif); font-weight: 300; font-size: clamp(3rem, 8.6vw, 6rem); line-height: 0.98; letter-spacing: -0.035em; font-variation-settings: "opsz" 72; text-wrap: balance; }
.hero-sub { margin-top: clamp(20px, 3vh, 32px); font-family: var(--f-serif); font-style: italic; font-weight: 300; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.15; color: var(--ink); }
.hero-id { margin-top: 16px; max-width: 46ch; color: var(--muted); font-size: 16px; }
.hero-cue { margin-top: clamp(28px, 5vh, 48px); }

.portrait { position: relative; width: min(100%, 360px); margin-bottom: 36px; }
.portrait-frame { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 50%; background: var(--bg-2); box-shadow: 0 40px 60px -28px rgba(20, 18, 14, 0.45); }
.portrait-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.portrait-back { display: none; }
.portrait-mono { position: absolute; inset: 0; display: none; place-items: center; font-family: var(--f-serif); font-weight: 300; font-size: clamp(4rem, 10vw, 7rem); letter-spacing: -0.04em; color: var(--muted); }
.portrait.no-photo img { display: none; }
.portrait.no-photo .portrait-mono { display: grid; }
.portrait-text { max-width: 46ch; }
.portrait-text p { margin-top: 20px; color: var(--muted); font-size: 17px; }

.scene-project .scene-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; align-items: center; }
.shot { position: relative; min-width: 0; }
.shot-main { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 3px; background: var(--bg-2); box-shadow: 0 40px 70px -30px rgba(20, 18, 14, 0.5); }
.shot-m { position: absolute; right: -4%; bottom: -9%; width: 17%; aspect-ratio: 9 / 19.5; object-fit: cover; object-position: top; border-radius: 10px; background: var(--bg-2); box-shadow: 0 30px 50px -20px rgba(20, 18, 14, 0.55), 0 0 0 5px var(--bg); }
.project-text { min-width: 0; }
.project-text .kind { margin-top: 10px; color: var(--accent); font-size: 14px; }
.project-text p:not(.kind):not(.note) { margin-top: 16px; max-width: 42ch; color: var(--muted); font-size: 16px; }
.eos-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.eos-strip img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-radius: 3px; background: var(--bg-2); box-shadow: 0 16px 28px -16px rgba(20, 18, 14, 0.45); }
.scene-eos .shot-main { aspect-ratio: 1339 / 697; object-position: top left; }

.serv-list { margin-top: clamp(28px, 4vw, 48px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 3.4vw, 56px); border-top: 1px solid var(--line); }
.serv-list li { padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.serv-list h3 { font-family: var(--f-serif); font-weight: 400; font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.15; letter-spacing: -0.01em; }
.serv-list p { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.serv-next { margin-top: 8px; }

/* ---------- Scenes: the walk (3D) ---------- */
.is3d .journey { height: 500vh; }
.is3d .stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; overflow: clip; perspective: 1100px; perspective-origin: calc(50% + var(--ox, 0px)) calc(46% + var(--oy, 0px)); }
.is3d .world { position: absolute; inset: 0; transform-style: preserve-3d; }
.is3d .scene {
  position: absolute; left: 50%; top: 50%; width: min(1180px, 90vw); min-height: 0; padding: 0; display: block;
  transform-style: preserve-3d;
  transform: translate3d(-50%, -50%, calc(var(--i) * var(--step) * -1));
}
.is3d .scene-in { max-width: none; transform-style: preserve-3d; transform: scale(var(--fit, 1)); transform-origin: 50% 50%; }
.is3d .scene.is-off { pointer-events: none; }
.is3d .scene-hero { padding-top: 0; }

.is3d .layer { opacity: var(--o, 1); transform: translateZ(var(--lz, 0px)); }
.is3d .shot.layer, .is3d .portrait.layer { opacity: 1; transform-style: preserve-3d; transform: none; }
.is3d .shot > *, .is3d .portrait > * { opacity: var(--o, 1); }
.is3d .shot-main { transform: translateZ(0); }
.is3d .shot-m { transform: translateZ(48px); }
.is3d .eos-strip { transform: translateZ(22px); }
.is3d .portrait-back { display: block; position: absolute; inset: 0; transform: rotate(var(--rot, 0deg)) translate3d(-22px, 22px, -40px); border: 1px solid var(--ink); border-radius: 50%; opacity: calc(var(--o, 1) * 0.35); }
.is3d .portrait-frame { transform: rotateX(var(--tiltx, 0deg)) rotateY(var(--tilty, 0deg)) translateZ(0); }

.is3d .scene-hero .scene-in { width: 100%; }
.is3d .scene-portrait .scene-in { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.is3d .portrait { margin: 0 auto; width: min(100%, 380px); }
.is3d .scene-project .scene-in { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(36px, 5.4vw, 88px); }
.is3d .scene-project.flip .scene-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
.is3d .scene-project.flip .shot { order: 2; }
.is3d .scene-project.flip .project-text { order: 1; }

/* Hairline frames the camera passes through: the corridor */
.is3d .rail {
  display: block; position: absolute; left: 50%; top: 50%; width: 150vw; height: 150vh; pointer-events: none;
  border: 1px solid var(--ink); opacity: calc(var(--o, 0) * 0.14);
  transform: translate3d(-50%, -50%, calc(var(--k) * -350px));
}
.is3d .hud { display: flex; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 22px; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); z-index: 5; }
.hud-name { min-width: 7.5em; }
.hud-bar { flex: 1; height: 1px; background: var(--line); position: relative; }
.hud-bar i { position: absolute; inset: 0; background: var(--ink); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---------- Sections after the walk ---------- */
.section { padding: clamp(72px, 11vh, 140px) 0; }
.lab { border-top: 1px solid var(--line); }
.lab-notice { margin-top: 18px; padding: 12px 16px; background: var(--bg-2); border-radius: 3px; font-size: 14px; color: var(--ink); max-width: 62ch; }
.lab-notice a { color: var(--accent); text-underline-offset: 3px; }
.lab-grid { display: grid; grid-template-columns: 1fr; gap: clamp(48px, 6vw, 88px) clamp(24px, 4vw, 64px); margin-top: clamp(48px, 7vw, 96px); }
.lab-cell { min-width: 0; }
.lab-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; padding-top: 14px; border-top: 1px solid var(--ink); }
.lab-head h3 { font-family: var(--f-serif); font-weight: 400; font-size: clamp(1.3rem, 1.8vw, 1.6rem); letter-spacing: -0.01em; }
.lab-stage {
  position: relative; min-height: 280px; border-radius: 3px;
  background: var(--bg-2); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(24px, 3vw, 40px); user-select: none;
}

/* 01 Spotlight: a soft light in a dark room */
.stage-spot { --x: 50%; --y: 50%; background: var(--night); min-height: 320px; cursor: crosshair; }
.stage-spot::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle 280px at var(--x) var(--y), rgba(226, 150, 108, 0.12), transparent 70%); }
.spot-text { font-family: var(--f-serif); font-weight: 300; font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.25; letter-spacing: -0.01em; }
.spot-dim { color: rgba(241, 238, 232, 0.08); }
.spot-lit {
  position: absolute; inset: 0; padding: clamp(24px, 3vw, 40px); display: flex; align-items: center; color: #f6f2ea;
  -webkit-mask-image: radial-gradient(circle 240px at var(--x) var(--y), #000 0%, #000 28%, transparent 100%);
          mask-image: radial-gradient(circle 240px at var(--x) var(--y), #000 0%, #000 28%, transparent 100%);
  pointer-events: none;
}
.stage-spot .spot-dim { display: block; padding: 0; }

/* 02 Hover reveal */
.stage-hover { justify-content: flex-start; min-height: 300px; }
.hr-list { width: 100%; position: relative; z-index: 2; }
.hr-list li { border-bottom: 1px solid var(--line); }
.hr-list button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: block; padding: 14px 0;
  font-family: var(--f-serif); font-weight: 300; font-size: clamp(2rem, 3.8vw, 3.2rem); letter-spacing: -0.025em; line-height: 1.05;
  color: var(--ink); transition: color 0.3s, padding-left 0.5s var(--ease);
}
.hr-list button:hover, .hr-list button:focus-visible, .hr-list button.on { color: var(--accent); padding-left: 12px; }
.hr-preview {
  position: absolute; left: 0; top: 0; width: min(44%, 280px); aspect-ratio: 16 / 10; pointer-events: none; opacity: 0; z-index: 1;
  transform: translate3d(var(--px, 50%), var(--py, 50%), 0) translate(-50%, -50%) scale(0.92);
  transition: opacity 0.35s var(--ease), transform 0.25s var(--ease);
  box-shadow: 0 24px 50px -14px rgba(20, 18, 14, 0.5);
}
.hr-preview img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.stage-hover.is-live .hr-preview { opacity: 1; transform: translate3d(var(--px), var(--py), 0) translate(-50%, -50%) scale(1); }

/* 03 Tilt */
.stage-tilt { perspective: 900px; }
.tilt-card {
  --rx: 0deg; --ry: 0deg; position: relative; width: min(220px, 70%); aspect-ratio: 9 / 19.5;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform 0.6s var(--ease);
  cursor: grab; touch-action: none; border-radius: 20px; overflow: hidden;
  box-shadow: 0 40px 60px -24px rgba(20, 18, 14, 0.5), 0 0 0 1px var(--line);
}
.tilt-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tilt-glare { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255, 255, 255, 0.28), transparent 55%); opacity: var(--go, 0); transition: opacity 0.4s; }
.tilt-card.live { transition: none; }

/* 04 Magnetic */
.stage-mag { gap: 20px; flex-wrap: wrap; }

/* 05 Cursor mask */
.stage-mask { padding: 0; min-height: 320px; cursor: none; touch-action: none; }
.stage-mask img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.mask-cover {
  position: absolute; inset: 0; background: color-mix(in srgb, var(--bg-2) 96%, transparent); --mx: 50%; --my: 50%; --r: 0px;
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--mx) var(--my), transparent 96%, #000 100%);
          mask-image: radial-gradient(circle var(--r) at var(--mx) var(--my), transparent 96%, #000 100%);
}

/* 06 Scramble */
.stage-scramble { justify-content: flex-start; }
.scramble { font-family: var(--f-serif); font-weight: 400; font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.25; color: var(--ink); cursor: pointer; min-height: 2.6em; max-width: 22ch; }
.scramble:hover, .scramble:focus-visible { color: var(--accent); }

/* 07 Distortion */
.stage-distort { min-height: 280px; }
.distort-word { display: flex; font-family: var(--f-serif); font-weight: 300; font-size: clamp(4rem, 11vw, 9rem); letter-spacing: -0.03em; line-height: 1; }
.distort-word span { display: inline-block; will-change: transform; transform-origin: 50% 100%; }

/* 08 Scroll reveal */
.stage-reveal { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
.rv-line { font-family: var(--f-serif); font-weight: 300; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.08; letter-spacing: -0.025em; }
.rv-line:nth-child(2) { color: var(--accent); padding-left: 2.2ch; font-style: italic; }
.rv-line:nth-child(3) { padding-left: 4.4ch; }
.js .rv-line[data-rv] { clip-path: inset(0 0 100% 0); transform: translate3d(0, 18px, 0); transition: clip-path 1s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--i) * 0.14s); }
.js .rv-line[data-rv].in { clip-path: inset(0 0 0 0); transform: none; }

/* 09 Parallax */
.stage-parallax { padding: 0; min-height: 320px; }
.px-frame { position: absolute; inset: 0; overflow: hidden; }
.px-frame img { position: absolute; left: 0; top: -30%; width: 100%; height: 160%; object-fit: cover; object-position: top; will-change: transform; }

/* 10 Image reveal */
.stage-imgreveal { flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 16px; padding: 0; min-height: 320px; }
.ir-frame { position: absolute; inset: 0; overflow: hidden; }
.ir-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.js .ir-frame { clip-path: inset(0 0 100% 0); transition: clip-path 1.4s var(--ease); }
.js .ir-frame.in { clip-path: inset(0 0 0 0); }
.ir-frame.instant { transition: none !important; }
#ir-replay { position: relative; margin: 0 0 16px 16px; background: var(--bg); }

/* 11 Smooth scroll */
.stage-smooth { display: block; padding: 0; min-height: 260px; height: 260px; cursor: ns-resize; overflow: hidden; }
.stage-smooth:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.smooth-inner { position: absolute; left: 0; right: 0; top: 0; padding: 28px clamp(20px, 3vw, 36px); will-change: transform; }
.smooth-inner p { font-family: var(--f-serif); font-weight: 300; font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 20px; }
.smooth-inner p:nth-child(odd) { color: var(--muted); }
.native-scroll .smooth-inner { position: relative; }

/* 12 Horizontal scroll */
.lab-hs-head { display: flex; align-items: baseline; gap: 14px; margin-top: clamp(96px, 12vw, 160px); }
.lab-hs-title { font-family: var(--f-serif); font-weight: 400; font-size: clamp(1.4rem, 2vw, 1.8rem); letter-spacing: -0.01em; }
.hscroll { position: relative; height: 150vh; margin-top: 28px; }
.hs-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; align-items: center; }
.hs-track { display: flex; gap: clamp(16px, 3vw, 36px); padding: 0 var(--gutter); will-change: transform; }
.hs-panel { flex: 0 0 min(74vw, 700px); height: min(58vh, 480px); display: flex; flex-direction: column; justify-content: space-between; padding: clamp(24px, 3vw, 44px); border-radius: 3px; background: var(--bg-2); }
.hs-panel span { font-family: var(--f-serif); font-weight: 300; font-size: clamp(3rem, 7vw, 6rem); letter-spacing: -0.035em; line-height: 0.95; }
.hs-panel p { font-size: clamp(16px, 1.6vw, 19px); max-width: 26ch; color: var(--muted); }
.hs-accent { background: var(--accent); color: var(--on-accent); }
.hs-accent span { color: var(--on-accent); }
.hs-accent p { color: var(--on-accent); }

/* Collaborations */
.collab { border-top: 1px solid var(--line); }
.modes { margin-top: clamp(40px, 6vw, 64px); border-top: 1px solid var(--ink); }
.modes li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: clamp(20px, 3vw, 30px) 0; border-bottom: 1px solid var(--line); align-items: baseline; transition: padding-left 0.6s var(--ease); }
.modes li:hover { padding-left: 10px; }
.modes h3 { font-family: var(--f-serif); font-weight: 300; font-size: clamp(1.7rem, 3vw, 2.6rem); letter-spacing: -0.02em; line-height: 1.05; }
.modes p { color: var(--muted); max-width: 56ch; }

/* Contact */
.contact { border-top: 1px solid var(--line); }
.contact-links { margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--ink); }
.contact-link { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 24px; padding: clamp(20px, 3vw, 30px) 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding-left 0.6s var(--ease), color 0.3s; }
.contact-link:hover { padding-left: 12px; color: var(--accent); }
.cl-label { font-size: 14px; color: var(--muted); }
.cl-value { font-family: var(--f-serif); font-weight: 300; font-size: clamp(1.7rem, 4.2vw, 3.4rem); letter-spacing: -0.02em; overflow-wrap: anywhere; }

.site-foot { padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }

/* ---------- Responsive ---------- */
@media (min-width: 900px) {
  .lab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-cell:nth-child(5n + 1) { grid-column: span 2; }
  .modes li { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 24px; }
  .scene-project .scene-in { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .scene-project.flip .scene-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
  .scene-project.flip .shot { order: 2; }
  .scene-project.flip .project-text { order: 1; }
  .scene-portrait .scene-in { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
  .scene-portrait .portrait { margin-bottom: 0; }
}
@media (max-width: 899px) {
  .is3d .scene-portrait .scene-in { grid-template-columns: minmax(0, 1fr); gap: 28px; justify-items: start; }
  .is3d .portrait { width: min(58vw, 280px); margin: 0 0 14px 22px; }
  .is3d .scene-project .scene-in { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .is3d .scene-project.flip .scene-in { grid-template-columns: minmax(0, 1fr); }
  .is3d .scene-project.flip .shot, .is3d .scene-project.flip .project-text { order: 0; }
  .serv-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .nav-opt { display: none; }
  .brand { font-size: 18px; }
  .serv-list p { display: none; }
  .serv-list li { padding: 12px 0; }
  .lab-stage { min-height: 240px; }
  .hr-preview { width: 58%; }
  .shot-m { right: 0; bottom: -7%; width: 20%; }
  .is3d .hero-id { font-size: 15px; }
}
@media (hover: none) { .tilt-card { cursor: default; } }

/* Reduced motion: the walk becomes a plain page and every effect rests.
   The lab can be switched back on by the visitor (html.force-motion). */
@media (prefers-reduced-motion: reduce) {
  :root:not(.force-motion) *, :root:not(.force-motion) *::before, :root:not(.force-motion) *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  :root:not(.force-motion).js .rv-line[data-rv], :root:not(.force-motion).js .ir-frame { clip-path: none; transform: none; }
  :root:not(.force-motion) .hscroll { height: auto; }
  :root:not(.force-motion) .hs-sticky { position: relative; height: auto; overflow-x: auto; padding: 24px 0; }
  :root:not(.force-motion) .hs-track { transform: none !important; }
  :root:not(.force-motion) .stage-mask { cursor: default; min-height: 0; }
  :root:not(.force-motion) .mask-cover { display: none; }
  :root:not(.force-motion) .stage-mask img { position: relative; height: auto; }
  :root:not(.force-motion) .px-frame img { top: 0; height: 100%; transform: none !important; }
  :root:not(.force-motion) .stage-smooth { overflow-y: auto; }
  :root:not(.force-motion) .smooth-inner { position: relative; }
}
.force-motion { scroll-behavior: smooth; }


/* ==========================================================================
   Premium layer (v3.1): depth of field, line reveals, cursor, intro, grain,
   nav preview, orbiting portrait ring. All of it rests under reduced motion.
   ========================================================================== */

/* Depth of field: distant scenes arrive soft and sharpen as the camera reaches them */
.is3d .scene:not(.is-sharp) .layer:not(.shot):not(.portrait),
.is3d .scene:not(.is-sharp) .shot > *,
.is3d .scene:not(.is-sharp) .portrait > * { filter: blur(var(--b, 0px)); }

/* Headings open line by line when their scene (or section) comes alive */
.fx .h-serif { clip-path: inset(0 0 100% 0); transform: translate3d(0, 0.35em, 0); transition: clip-path 1.1s var(--ease), transform 1.1s var(--ease); }
.fx .is-live .h-serif { clip-path: inset(-12% -3% -22% -3%); transform: none; }

/* Intro: the name draws a line, then the curtain lifts */
.intro { display: none; }
.fx .intro {
  display: grid; position: fixed; inset: 0; z-index: 200; background: var(--bg);
  place-content: center; justify-items: center; gap: 18px; clip-path: inset(0);
  transition: clip-path 1s var(--ease);
  animation: introOut 0.01s 4.5s forwards;
}
.intro span { font-family: var(--f-serif); font-weight: 300; font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -0.02em; }
.intro i { display: block; width: 120px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; animation: introLine 0.9s var(--ease) 0.1s forwards; }
.intro.is-done { clip-path: inset(0 0 100% 0); pointer-events: none; }
.intro.is-gone { display: none !important; }
@keyframes introLine { to { transform: scaleX(1); } }
@keyframes introOut { to { visibility: hidden; pointer-events: none; } }

/* Grain: a barely-there film over the paper */
.grain {
  position: fixed; inset: 0; z-index: 80; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
/* A warm light that follows the pointer, behind everything */
.has-cursor body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(circle 460px at var(--gx, 50%) var(--gy, 40%), rgba(255, 247, 233, 0.75), transparent 70%);
}

/* Cursor: a thin ring that grows on links and says "Ver" over the work */
.cursor { display: none; }
.has-cursor .cursor {
  display: grid; place-items: center; position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none;
  width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 1px solid var(--ink); border-radius: 50%; color: var(--on-accent);
  opacity: 0; transform: translate3d(var(--cx, 0px), var(--cy, 0px), 0);
  transition: width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease), background-color 0.3s, border-color 0.3s, opacity 0.3s;
}
.cursor span { font-size: 13px; opacity: 0; transition: opacity 0.25s; }
.cursor.is-on { opacity: 1; }
.cursor.is-link { width: 52px; height: 52px; margin: -26px 0 0 -26px; border-color: var(--accent); background: rgba(168, 68, 42, 0.1); }
.cursor.is-view { width: 88px; height: 88px; margin: -44px 0 0 -44px; background: var(--accent); border-color: var(--accent); }
.cursor.is-view span { opacity: 1; }
.cursor.is-hide { opacity: 0; }
.shot { display: block; }

/* Navigation: language switch and a preview of the work */
.lang-btn { font: 500 12px/1 var(--f-sans); letter-spacing: 0.04em; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer; transition: background-color 0.3s, color 0.3s; }
.lang-btn:hover { background: var(--ink); color: var(--bg); }
.nav-has { position: relative; }
.nav-preview { display: none; }
@media (hover: hover) and (pointer: fine) {
  .nav-preview {
    display: grid; grid-template-columns: repeat(4, 148px); gap: 10px; position: absolute; right: -96px; top: 100%;
    padding: 14px; margin-top: 8px; background: var(--bg); border-radius: 4px;
    box-shadow: 0 30px 60px -20px rgba(20, 18, 14, 0.35), 0 0 0 1px var(--line);
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
  }
  .nav-has:hover .nav-preview, .nav-has:focus-within .nav-preview { opacity: 1; visibility: visible; transform: none; }
  .nav-preview a { display: block; color: var(--ink); text-decoration: none; padding: 0; }
  .nav-preview img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 2px; transition: transform 0.6s var(--ease); }
  .nav-preview a:hover img { transform: scale(1.03); }
  .nav-preview span { display: block; margin-top: 6px; font-size: 13px; }
}

.hud-btn { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.hud-btn:hover { color: var(--ink); }
.foot-3d { display: none; }
.flat .foot-3d { display: inline; }
html:not(.is3d) .hud { display: none; }

/* A shorter page: tighter lab, two-column collaborations */
.lab-hs-head { margin-top: clamp(64px, 8vw, 110px); }
.contact-links { margin-top: clamp(28px, 4vw, 48px); }
.modes li { padding: clamp(14px, 2vw, 22px) 0; }
.modes { margin-top: clamp(28px, 4vw, 44px); }
@media (min-width: 1000px) {
  .collab-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
  .collab-grid .modes { margin-top: 0; }
  .modes li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
@media (min-width: 1100px) {
  .lab-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 28px; margin-top: 48px; }
  .lab-cell:nth-child(5n + 1) { grid-column: auto; }
  .lab-cell:first-child { grid-column: span 2; }
  .lab-stage { min-height: 230px; padding: 24px; }
  .stage-spot, .stage-mask, .stage-parallax, .stage-imgreveal { min-height: 260px; }
  .stage-distort { min-height: 230px; }
  .stage-smooth { height: 230px; min-height: 230px; }
  .spot-text { font-size: clamp(1.2rem, 1.9vw, 1.6rem); }
  .hr-list button { font-size: clamp(1.6rem, 2.4vw, 2.2rem); padding: 10px 0; }
  .distort-word { font-size: clamp(3rem, 6.4vw, 5.4rem); }
  .rv-line { font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
  .scramble { font-size: clamp(1.3rem, 1.8vw, 1.6rem); }
  .tilt-card { width: min(150px, 60%); }
  .hs-panel { height: min(52vh, 400px); }
}
.collab .h-serif.big { font-size: clamp(2.2rem, 4.2vw, 3.6rem); line-height: 1.04; }

/* ==========================================================================
   Asistente virtual flotante
   ========================================================================== */
.asst { position: fixed; right: 20px; bottom: 64px; z-index: 120; font-family: var(--f-sans); }
.asst [hidden] { display: none !important; }
.asst-launch {
  position: relative; display: block; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); cursor: pointer;
  box-shadow: 0 18px 34px -12px rgba(20, 18, 14, 0.55), 0 0 0 1px rgba(241, 238, 232, 0.12);
  transition: transform 0.4s var(--ease), box-shadow 0.4s;
}
.asst-launch img { width: 100%; height: 100%; border-radius: 50%; }
.asst-launch:hover { transform: translateY(-2px) scale(1.04); }
.asst-launch:active { transform: scale(0.97); }
.asst-ping { position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--accent); opacity: 0; pointer-events: none; }
.fx .asst-ping { animation: asstPing 3.2s var(--ease) 2s infinite; }
@keyframes asstPing { 0% { transform: scale(0.9); opacity: 0.7; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
.asst.is-open .asst-ping { display: none; }

.asst-nudge {
  position: absolute; right: 0; bottom: 74px; display: flex; align-items: flex-start; gap: 2px; width: max-content; max-width: min(260px, calc(100vw - 40px));
  background: var(--bg); border-radius: 14px 14px 4px 14px; box-shadow: 0 20px 40px -16px rgba(20, 18, 14, 0.4), 0 0 0 1px var(--line);
  animation: asstIn 0.6s var(--ease) both;
}
.asst-nudge-text { all: unset; box-sizing: border-box; cursor: pointer; padding: 12px 6px 12px 14px; font-size: 14px; line-height: 1.4; color: var(--ink); }
.asst-nudge-x { all: unset; box-sizing: border-box; cursor: pointer; padding: 8px 12px 8px 6px; font-size: 18px; line-height: 1; color: var(--muted); }
.asst-nudge-x:hover { color: var(--ink); }
@keyframes asstIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.asst-panel {
  position: absolute; right: 0; bottom: 0; width: 380px; height: min(580px, calc(100svh - 110px)); display: flex; flex-direction: column;
  background: var(--bg); border-radius: 16px; overflow: hidden;
  box-shadow: 0 40px 80px -24px rgba(20, 18, 14, 0.5), 0 0 0 1px var(--line);
  animation: asstIn 0.45s var(--ease) both;
}
.asst-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-bottom: 1px solid var(--line); }
.asst-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.asst-head-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.asst-head-txt strong { font-family: var(--f-serif); font-weight: 400; font-size: 18px; letter-spacing: -0.01em; }
.asst-head-txt span { font-size: 12.5px; color: var(--muted); }
.asst-head-wa, .asst-x { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--ink); background: transparent; border: 0; cursor: pointer; text-decoration: none; transition: background-color 0.25s, color 0.25s; }
.asst-head-wa:hover, .asst-x:hover { background: var(--bg-2); }

.asst-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; overscroll-behavior: contain; }
.asst-row { display: flex; align-items: flex-end; gap: 8px; }
.asst-row.is-me { justify-content: flex-end; }
.asst-mini { width: 26px; height: 26px; border-radius: 50%; flex: none; }
.asst-msg { max-width: 82%; padding: 10px 13px; font-size: 14.5px; line-height: 1.5; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.is-bot .asst-msg { background: var(--bg-2); color: var(--ink); border-bottom-left-radius: 4px; }
.is-me .asst-msg { background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; }
.asst-dots { display: inline-flex; gap: 4px; padding: 14px 14px; }
.asst-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: 0.5; }
.fx .asst-dots i { animation: asstDot 1.1s infinite; }
.asst-dots i:nth-child(2) { animation-delay: 0.15s; }
.asst-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes asstDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }

.asst-wa {
  align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 2px; padding: 13px 16px;
  background: var(--accent); color: var(--on-accent); border-radius: 999px; font-size: 14.5px; font-weight: 500; text-decoration: none;
  transition: transform 0.4s var(--ease), background-color 0.3s;
}
.asst-wa:hover { background: var(--ink); transform: translateY(-1px); }
.asst-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.asst-chip { font: 400 13.5px/1.2 var(--f-sans); color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 999px; padding: 8px 13px; cursor: pointer; transition: background-color 0.25s, color 0.25s; }
.asst-chip:hover { background: var(--ink); color: var(--bg); }
.asst-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.asst-form input { flex: 1; min-width: 0; font: 400 15px/1.2 var(--f-sans); color: var(--ink); background: var(--bg-2); border: 1px solid transparent; border-radius: 999px; padding: 12px 16px; }
.asst-form input:focus { outline: none; border-color: var(--ink); background: var(--bg); }
.asst-send { font: 500 14px/1 var(--f-sans); color: var(--bg); background: var(--ink); border: 0; border-radius: 999px; padding: 0 18px; cursor: pointer; transition: background-color 0.3s; }
.asst-send:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); }
.asst-send:disabled { opacity: 0.5; cursor: default; }
.asst-foot { padding: 0 16px 12px; font-size: 12px; color: var(--muted); line-height: 1.35; }

@media (max-width: 600px) {
  .asst { right: 14px; bottom: 58px; }
  .asst.is-open { right: 0; bottom: 0; left: 0; }
  .asst.is-open .asst-launch { display: none; }
  .asst-panel { right: 12px; left: 12px; bottom: 12px; width: auto; height: min(78svh, 600px); }
  .asst-form input { font-size: 16px; }
}


/* EOS gallery: browse the captures, enlarge them */
.eos-stage { position: relative; }
.eos-main-btn { all: unset; display: block; width: 100%; cursor: zoom-in; position: relative; }
.eos-main-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.eos-main-btn .shot-main { transition: opacity 0.22s; }
.eos-main-btn.is-swap .shot-main { opacity: 0; }
.eos-arrow {
  position: absolute; top: 50%; width: 40px; height: 40px; margin-top: -20px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer; color: var(--ink); background: var(--bg);
  box-shadow: 0 10px 24px -8px rgba(20, 18, 14, 0.5); transition: transform 0.3s var(--ease), background-color 0.25s, color 0.25s;
}
.eos-arrow:hover { background: var(--ink); color: var(--bg); }
.eos-arrow:active { transform: scale(0.94); }
.eos-prev { left: 10px; }
.eos-next { right: 10px; }
.eos-count { position: absolute; right: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px; font-size: 12px; color: var(--bg); background: rgba(20, 18, 14, 0.78); pointer-events: none; font-variant-numeric: tabular-nums; }
.eos-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.eos-thumb { all: unset; box-sizing: border-box; display: block; cursor: pointer; border-radius: 3px; opacity: 0.55; transition: opacity 0.3s, transform 0.4s var(--ease); }
.eos-thumb:hover { opacity: 0.9; transform: translateY(-2px); }
.eos-thumb[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--accent); }
.eos-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.eos-thumb img { display: block; width: 100%; }

.lb { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; background: rgba(20, 18, 14, 0.94); animation: asstIn 0.35s var(--ease) both; }
.lb[hidden] { display: none; }
.lb img { max-width: min(94vw, 1500px); max-height: 82vh; width: auto; height: auto; border-radius: 3px; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6); background: var(--bg-2); }
.lb-cap { position: absolute; left: 0; right: 0; bottom: 22px; padding: 0 70px; text-align: center; font-size: 14px; color: rgba(241, 238, 232, 0.85); }
.lb-btn { position: absolute; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: var(--ink); background: var(--bg); transition: transform 0.3s var(--ease), background-color 0.25s, color 0.25s; }
.lb-btn:hover { background: var(--accent); color: var(--on-accent); }
.lb-x { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; margin-top: -23px; }
.lb-next { right: 18px; top: 50%; margin-top: -23px; }
@media (max-width: 600px) {
  .eos-arrow { width: 36px; height: 36px; margin-top: -18px; }
  .lb-prev, .lb-next { top: auto; bottom: 64px; margin-top: 0; }
  .lb-prev { left: calc(50% - 56px); }
  .lb-next { right: calc(50% - 56px); }
  .lb-cap { bottom: 16px; padding: 0 16px; font-size: 13px; }
}
