/* ==========================================================================
   Unai María de Amorrortu — Portfolio
   Design reference: Figma "Unai — Portfolio 2026" / V1 (1920 × 1080)
   Every size is expressed in --u (1 design px at 1920 wide) so the whole
   composition scales like the frame.
   ========================================================================== */

:root {
  --u: calc(100vw / 1920);

  --bg: #e8e8e4;
  --ink: #000;
  --ink-50: rgba(0, 0, 0, 0.5);
  --ink-20: rgba(0, 0, 0, 0.2);
  --ink-10: rgba(0, 0, 0, 0.1);
  --line-shade: 0, 0, 0;          /* rgb of the grey part of the lines */
  --line-light: 255, 255, 255;    /* rgb of their highlight */
  --highlight: #001fd0;
  --bar: #001797;
  --bar-ink: #8090e8;

  --fs: max(11px, calc(16 * var(--u)));
  --lh: 0.89;
  --tracking: -0.05em;

  --ease: cubic-bezier(0.77, 0, 0.18, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* geometry from the frame */
  --pad-x: calc(70 * var(--u));
  --top: calc(81 * var(--u));
  --row-pitch: calc(66 * var(--u));
  --player-w: calc(1024 * var(--u));
  --player-h: calc(var(--player-w) * 2104 / 3840);
  /* SCROLL reel (Paz's mock-up, 28/10) */
  --home-w: calc(902 * var(--u));   /* 784 × 1.15 (29/10) */
  --home-h: calc(538 * var(--u));   /* 468 × 1.15 */
}

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

html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: var(--tracking);
  -webkit-font-smoothing: antialiased;
  text-transform: uppercase;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: var(--cur-hover); text-transform: inherit; }
ol, dl, dd, dt, p, figure { margin: 0; padding: 0; }
video { display: block; }

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
}

/* -------------------------------------------------------------------------- */
/* Texture layers                                                             */
/* -------------------------------------------------------------------------- */
/* fine animated grain. It sits UNDER the views, so it covers the page background
   but never the videos; the reel neighbours get the same grain inside the WebGL
   shader (fading in as they leave the centre), and the bars get it via ::after.
   The tile (--grain) is generated in app.js. */
.grain,
.bar::after,
.index-bar__line::after,
.contact::before {
  background-image: var(--grain);
  background-size: 256px 256px;
  mix-blend-mode: overlay;
  opacity: 0.22;
  pointer-events: none;
  animation: grain 0.5s steps(1) infinite;
}
.grain {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.bar::after,
.index-bar__line::after {
  content: "";
  position: absolute;
  inset: 0;
}
@keyframes grain {
  0%   { background-position: 0 0; }
  17%  { background-position: -83px 41px; }
  33%  { background-position: 57px -112px; }
  50%  { background-position: -131px -29px; }
  67%  { background-position: 98px 77px; }
  83%  { background-position: -22px 133px; }
}
@media (prefers-reduced-motion: reduce) { .grain, .bar::after, .contact::before { animation: none; } }

.center-line {
  position: absolute;
  transition: opacity 0.5s var(--ease-out);
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(0, 0, 0, 0.28);
  transform: translateX(-0.5px);
}

/* no centre line in the scroll view */
body[data-view="home"] .center-line { opacity: 0; }

/* -------------------------------------------------------------------------- */
/* Nav                                                                        */
/* -------------------------------------------------------------------------- */
.nav {
  position: absolute;
  top: calc(16 * var(--u));
  left: calc(220 * var(--u));
  display: flex;
  gap: calc(70 * var(--u));
  font-weight: 800;
  white-space: nowrap;
  z-index: 10;
}
.nav a { position: relative; transition: color 0.3s; }
.nav a:hover { color: var(--highlight); }
.nav a.is-current::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.25em;
  height: 1px;
  background: currentColor;
}

/* -------------------------------------------------------------------------- */
/* Views                                                                      */
/* -------------------------------------------------------------------------- */
.view {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out), visibility 0s 0.5s;
}
.view.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.6s var(--ease-out) 0.1s, visibility 0s;
}

/* text roll used for captions */
.roll { display: inline-block; animation: roll-in 0.7s var(--ease-out) both; }
@keyframes roll-in {
  from { opacity: 0; transform: translateY(0.7em); }
  to   { opacity: 1; transform: none; }
}

/* ========================================================================== */
/* 1 · HOME — vertical reel                                                   */
/* ========================================================================== */
.reel {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: var(--cur);
}
.reel:active { cursor: var(--cur-hover); }

/* WebGL layer: draws the (bending) videos; the DOM items stay on top, invisible, for clicks */
.reel-gl {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.reel--gl .reel__item { background: transparent; }
.reel--gl .reel__item video { opacity: 0; }

.reel {
  --reel-cx: 50%;
  --reel-w: var(--home-w);
  --reel-h: var(--home-h);
}
.reel__item {
  position: absolute;
  left: var(--reel-cx);
  top: 50%;
  width: var(--reel-w);
  height: var(--reel-h);
  margin-left: calc(var(--reel-w) / -2);
  margin-top: calc(var(--reel-h) / -2);
  background: #0b0b0c;
  overflow: hidden;
  will-change: transform, filter;
  transform-origin: center center;
  cursor: var(--cur-hover);
  z-index: 2;
}
.reel__item video,
.reel__item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* [PLAY] that follows the cursor (app.js → cursor); no arrow over the centre video */
.cursor-play {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 30;
  pointer-events: none;
  color: #fff;
  mix-blend-mode: difference;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  will-change: transform;
}
.cursor-play.is-on { opacity: 1; }
body.cursor-hidden .reel__item.is-center,
body.cursor-hidden .project__screen { cursor: none; }

.reel-caption {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
/* captions sit beside the centred video, aligned to its BOTTOM edge (29/10):
   left = number (N04); right = title (16, extra bold), role and year (16, regular) */
.reel-caption__left,
.reel-caption__right {
  font-variant-numeric: tabular-nums;
  position: absolute;
  bottom: calc(50% - var(--home-h) / 2);
  display: flex;
  flex-direction: column;
  gap: calc(5 * var(--u));
  white-space: nowrap;
}
.reel-caption__left  { right: calc(50% + var(--home-w) / 2 + 28 * var(--u)); align-items: flex-end; text-align: right; }
.reel-caption__right { left: calc(50% + var(--home-w) / 2 + 28 * var(--u)); align-items: flex-start; }
.reel-caption__role,
.reel-caption__year { color: var(--ink-50); font-weight: 400; }
.reel-caption__num { font-weight: 400; }
.reel-caption__title { font-weight: 800; }
/* the number sits at the top corner of the video; title/role/year at the bottom */
.reel-caption__left { top: calc(50% - var(--home-h) / 2); bottom: auto; }

.reel-hint {
  position: absolute;
  left: var(--pad-x);
  bottom: calc(24 * var(--u));
  color: var(--ink-50);
  z-index: 3;
}

/* ========================================================================== */
/* 2 · INDEX — list (left) + reel (right)                                     */
/* ========================================================================== */
.index-head {
  position: absolute;
  top: calc(28 * var(--u));
  left: calc(61 * var(--u));
  right: calc(72 * var(--u));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-weight: 800;
  line-height: 0.85;
  z-index: 6;
}
.index-head a { transition: color 0.3s; }
.index-head a:hover { color: var(--highlight); }

.index-mask {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(663 * var(--u));
  z-index: 3;
  -webkit-mask-image: linear-gradient(to bottom, transparent calc(70 * var(--u)), #000 calc(100 * var(--u)), #000 calc(100% - 40 * var(--u)), transparent);
          mask-image: linear-gradient(to bottom, transparent calc(70 * var(--u)), #000 calc(100 * var(--u)), #000 calc(100% - 40 * var(--u)), transparent);
}
.index {
  list-style: none;
  position: absolute;
  top: calc(111 * var(--u));
  left: calc(61 * var(--u));
  width: calc(560 * var(--u));
  will-change: transform;
}

.row {
  position: relative;
  height: var(--row-pitch);
  cursor: var(--cur-hover);
  opacity: 0;
  transform: translateY(calc(14 * var(--u)));
  transition: opacity 0.6s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 35ms);
}
body.index-open .row { opacity: 1; transform: none; }
.row__line { position: relative; display: block; height: 1em; white-space: nowrap; }
/* row (29/10, Paz's capture): title · role on the line, year below;
   the number only appears at the end of the blue bar */
.row__title,
.row__role { color: var(--ink-20); transition: color 0.35s; }
.row__role { position: absolute; top: 0; left: calc(370 * var(--u)); }
.row__year {
  display: block;
  margin-top: calc(5 * var(--u));
  color: var(--ink-20);
  white-space: nowrap;
  transition: color 0.35s;
}
/* active row: the text on the blue bar goes extra bold — title white, role #8090E8; year black regular */
.row.is-active .row__line { font-weight: 800; }
.row.is-active .row__title { color: #fff; }
.row.is-active .row__role { color: var(--bar-ink); }
.row.is-active .row__year { color: var(--ink); }

/* long blue bar (glides between rows) */
.index-bar {
  position: absolute;
  top: 0;
  left: calc(61 * var(--u));
  right: calc(30 * var(--u));
  height: 1em;
  z-index: 2;            /* under the list text, over the reel */
  pointer-events: none;
  will-change: transform;
}
.index-bar__line {
  position: absolute;
  left: 0;
  top: -0.06em;
  bottom: -0.06em;
  width: calc(1722 * var(--u));
  background: var(--highlight);
  transform-origin: left center;
  animation: bar-in 0.9s var(--ease) both;
}
body:not(.index-open) .index-bar__line { animation: none; transform: scaleX(0); }
@keyframes bar-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.index-bar__num {
  position: absolute;
  top: 0;
  left: calc(1733 * var(--u));
  white-space: nowrap;
}
.index-mask { z-index: 3; }

.index-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(663 * var(--u));
  width: 1px;
  /* same as the Scroll 1 lines (grey at the ends → white highlight in the middle), at 40% */
  background: linear-gradient(to bottom,
    rgba(var(--line-shade), 0.3) 0%, rgba(var(--line-shade), 0.1) 30%, rgba(var(--line-light), 0) 44%,
    rgba(var(--line-light), 0.95) 50%,
    rgba(var(--line-light), 0) 56%, rgba(var(--line-shade), 0.1) 70%, rgba(var(--line-shade), 0.3) 100%);
  opacity: 0.4;
  z-index: 1;
}

.reel--index {
  --reel-cx: calc(1266 * var(--u));
  --reel-w: calc(769 * var(--u));
  --reel-h: calc(var(--reel-w) * 2104 / 3840);
  z-index: 1;
}
.reel-gl--index { z-index: 0; }
.reel--index .reel__item::after { content: none; }

/* SCROLL header: name + INDEX below (same spot as the INDEX header) */
.home-head {
  position: absolute;
  top: calc(28 * var(--u));
  left: calc(61 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(32 * var(--u));
  font-weight: 800;
  line-height: 0.85;
  z-index: 6;
}
.home-head a { transition: color 0.3s; }
.home-head a:hover { color: var(--highlight); }

/* background lines (drawn by app.js → createLines) */
.home-lines {
  will-change: transform;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* chrome in SCROLL and INDEX: thin full-height edge bars without text, no nav */
body[data-view="home"] .nav { opacity: 0; pointer-events: none; }


/* chrome while in the index: thin edge bars, no centre line, no nav text clash */
body[data-view="index"] .center-line { opacity: 0; }
body[data-view="index"] .nav { opacity: 0; pointer-events: none; }
.bar { transition: top 0.6s var(--ease), bottom 0.6s var(--ease), left 0.6s var(--ease), right 0.6s var(--ease); }
.bar > * { transition: opacity 0.3s; }


/* ========================================================================== */
/* 3 · PROJECT — full-bleed (Paz's design 30/10)                              */
/* ========================================================================== */
.view--project { background: #000; color: #fff; }
/* no sidebars / nav / centre line over the piece */
body[data-view="project"] .bar,
body[data-view="project"] .nav,
body[data-view="project"] .center-line { opacity: 0; pointer-events: none; }

.project__screen { position: absolute; inset: 0; cursor: var(--cur-hover); }
.project__screen video { width: 100%; height: 100%; object-fit: cover; }
.view--project.is-active .project__screen { animation: screen-in 0.9s var(--ease) both; }
@keyframes screen-in { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }

/* darkening so the text reads on any image */
.project__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 45%),
    linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 40%);
}

/* [BACK] — mono, between corner brackets */
.project__back {
  position: absolute;
  top: calc(41 * var(--u));
  right: calc(54 * var(--u));
  padding: calc(5 * var(--u)) calc(10 * var(--u));
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: calc(12 * var(--u));
  letter-spacing: 0;
  line-height: 1;
  z-index: 3;
  transition: color 0.3s;
}
.project__back::before,
.project__back::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(5 * var(--u));
  border: 1px solid currentColor;
}
.project__back::before { left: 0; border-right: 0; }
.project__back::after { right: 0; border-left: 0; }
.project__back:hover { color: var(--bar-ink); }

/* info, bottom-left */
.project__info {
  position: absolute;
  left: calc(60 * var(--u));
  bottom: calc(58 * var(--u));
  width: calc(300 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: calc(12 * var(--u));
  line-height: 1;
  z-index: 3;
  pointer-events: none;           /* hovering the text still shows [PLAY] over the piece */
}
.project__info button { pointer-events: auto; }
.project__num { color: rgba(255, 255, 255, 0.6); }
.project__title { font-size: calc(24 * var(--u)); line-height: 0.9; margin-top: calc(6 * var(--u)); }
.project__role { font-weight: 500; margin-top: calc(9 * var(--u)); }
.project__desc {
  margin-top: calc(9 * var(--u));
  max-width: calc(218 * var(--u));
  text-transform: none;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: rgba(255, 255, 255, 0.8);
}
.project__meta { margin-top: calc(22 * var(--u)); display: flex; flex-direction: column; gap: calc(7 * var(--u)); }
.project__meta div { display: flex; gap: calc(9 * var(--u)); }
.project__meta dt { color: rgba(255, 255, 255, 0.6); }
.project__meta dd { text-transform: none; }
.project__stills-toggle {
  margin-top: calc(34 * var(--u));
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: calc(12 * var(--u));
  letter-spacing: 0;
  color: #fff;
}
.project__stills-toggle i {
  width: calc(9 * var(--u));
  height: calc(9 * var(--u));
  border-radius: 50%;
  background: var(--highlight);
  border: 1px solid var(--highlight);
  transition: background 0.3s;
}
.project__stills-toggle[aria-pressed="false"] i { background: transparent; border-color: rgba(255, 255, 255, 0.6); }
.project__time { margin-top: calc(57 * var(--u)); color: rgba(255, 255, 255, 0.7); font-variant-numeric: tabular-nums; }

/* stills strip, bottom-right; scrolls sideways, runs off the right edge */
.project__stills {
  position: absolute;
  left: calc(837 * var(--u));
  right: 0;
  bottom: calc(114 * var(--u));
  height: calc(200 * var(--u));
  display: flex;
  gap: calc(8 * var(--u));
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  z-index: 3;
  transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease);
}
.project__stills::-webkit-scrollbar { display: none; }
.pstill { flex: 0 0 auto; height: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #111; }
.pstill img { width: 100%; height: 100%; object-fit: cover; display: block; }
.view--project.is-active:not(.stills-off) .pstill { animation: still-in 0.7s var(--ease) both; animation-delay: calc(var(--k) * 0.07s); }
@keyframes still-in { from { opacity: 0; transform: translateY(calc(20 * var(--u))); } to { opacity: 1; transform: none; } }
.view--project.stills-off .project__stills { opacity: 0; transform: translateY(calc(20 * var(--u))); pointer-events: none; }

/* idle (4 s without moving the mouse): only the piece stays */
.project__back,
.project__info,
.project__timeline,
.project__shade { transition: opacity 0.8s var(--ease-out), color 0.3s; }
.view--project.is-idle .project__back,
.view--project.is-idle .project__info,
.view--project.is-idle .project__stills,
.view--project.is-idle .project__timeline,
.view--project.is-idle .project__shade { opacity: 0; pointer-events: none; }
.view--project.is-idle .project__info button { pointer-events: none; }
body.is-idle .cursor-play { opacity: 0 !important; }
body.is-idle, body.is-idle .project__screen { cursor: none; }

/* timeline: full width blue line near the bottom */
.project__timeline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(37 * var(--u));
  height: calc(7 * var(--u));
  background: rgba(0, 31, 208, 0.35);
  cursor: var(--cur-hover);
  z-index: 3;
}
.project__timeline::before {     /* a taller invisible hit area */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  bottom: -10px;
}
.project__timeline span {
  position: absolute;
  inset: 0;
  background: var(--highlight);
  transform-origin: left center;
  transform: scaleX(0);
}

/* -------------------------------------------------------------------------- */
/* Side bars                                                                  */
/* -------------------------------------------------------------------------- */
/* sidebar 1 (left): name at the top, ART DIRECTOR AND FILMMAKER at the bottom.
   sidebar 2 (right): SOUND at the bottom (CONTACT moved under [About me], 30/10).
   (rotated 180°: the first child sits at the bottom) */
.bar {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(28 * var(--u)) 0;
  background: var(--bar);
  color: var(--bar-ink);
  font-weight: 500;
  letter-spacing: -0.02em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  z-index: 10;
}
.bar--left  { left: 0; width: calc(30 * var(--u)); }
.bar--right { right: 0; width: calc(30 * var(--u)); }
.bar__group { display: flex; align-items: center; gap: calc(48 * var(--u)); }
.bar strong { font-weight: 800; }
.bar a, .bar button { transition: color 0.3s; }
.bar a:hover, .bar button:hover { color: #fff; }

.toggle span { text-transform: none; transition: color 0.3s; }
.toggle[aria-pressed="false"] [data-off],
.toggle[aria-pressed="true"] [data-on] { color: #fff; }



/* -------------------------------------------------------------------------- */
/* Bracket buttons (mono, between corner brackets): [ABOUT ME], [CONTACT], [back to projects] */
/* -------------------------------------------------------------------------- */
.bracket-btn {
  position: absolute;
  padding: calc(2 * var(--u)) calc(10 * var(--u));
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: calc(14 * var(--u));
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: none;
  color: var(--ink);
  transition: color 0.3s, opacity 0.4s var(--ease-out);
}
.bracket-btn::before,
.bracket-btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(5 * var(--u));
  border: 1px solid currentColor;
}
.bracket-btn::before { left: 0; border-right: 0; }
.bracket-btn::after { right: 0; border-left: 0; }
.bracket-btn:hover { color: var(--highlight); }

/* ● INDEX (05/11, top-left): turns the INDEX list on / off over SCROLL.
   Same mono 14u as ABOUT ME / CONTACT; the dot works like ● STILLS
   (outlined = off, blue = on). */
.index-toggle {
  position: absolute;
  top: calc(26 * var(--u));
  left: calc(61 * var(--u));
  z-index: 7;
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: calc(14 * var(--u));
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  transition: opacity 0.4s var(--ease-out), color 0.3s;
}
.index-toggle:hover { color: var(--highlight); }
.index-toggle i {
  width: calc(9 * var(--u));
  height: calc(9 * var(--u));
  border-radius: 50%;
  border: 1px solid var(--ink-50);
  background: transparent;
  transition: background 0.3s, border-color 0.3s;
}
.index-toggle:hover i { border-color: var(--highlight); }
.index-toggle[aria-pressed="true"] i { background: var(--highlight); border-color: var(--highlight); }
body[data-view="project"] .index-toggle,
body.about-open .index-toggle { opacity: 0; pointer-events: none; }

/* [About me] top-right in Scroll 1 and INDEX */
/* ABOUT ME / CONTACT (top-right): the mirror of the SCROLL/INDEX switch — same mono 14u,
   same rows (22u pitch), right-aligned, no brackets; on hover the text goes blue and a blue
   dot appears on its right (like the switch's dot) */
.cta-stack {
  position: absolute;
  top: calc(26 * var(--u));
  right: calc(61 * var(--u));
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: calc(22 * var(--u) - 14 * var(--u));
}
.cta-link {
  position: relative;
  padding-right: calc(17 * var(--u));
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: calc(14 * var(--u));
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  transition: color 0.3s, opacity 0.4s var(--ease-out);
}
.cta-link::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: calc(9 * var(--u));
  height: calc(9 * var(--u));
  margin-top: calc(-4.5 * var(--u));
  border-radius: 50%;
  background: var(--highlight);
  transform: scale(0);
  transition: transform 0.35s var(--ease);
}
.cta-link:hover { color: var(--highlight); }
.cta-link:hover::after { transform: scale(1); }
/* [CONTACT] under [ABOUT ME], same bracket style, right edges aligned */
body[data-view="project"] .cta-about,
body.about-open .cta-about,
body[data-view="project"] .cta-contact,
body.about-open .cta-contact { opacity: 0; pointer-events: none; }

/* About overlay: the REEL centred over the blurred page (sidebars stay sharp on top) */
.about {
  position: absolute;
  inset: 0;
  z-index: 9;                       /* under the sidebars (10) */
  background: rgba(232, 232, 228, 0.78);
  -webkit-backdrop-filter: blur(40px);
          backdrop-filter: blur(40px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease-out), visibility 0s 0.6s;
}
.about.is-open { opacity: 1; visibility: visible; transition: opacity 0.6s var(--ease-out), visibility 0s; }
.about__close { top: calc(26 * var(--u) - 2 * var(--u)); right: calc(61 * var(--u)); }
.about__frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(1283 * var(--u));
  height: calc(677 * var(--u));
  transform: translate(-50%, -50%) scale(0.96);
  transition: transform 0.9s var(--ease);
}
.about.is-open .about__frame { transform: translate(-50%, -50%); }
.about__screen { position: absolute; inset: 0; background: #0b0b0c; cursor: var(--cur-hover); }
body.cursor-hidden .about__screen { cursor: none; }
.about__screen video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* timeline right under the video */
.about__timeline {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: calc(7 * var(--u));
  background: rgba(0, 31, 208, 0.3);
  cursor: var(--cur-hover);
}
.about__timeline::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; bottom: -8px; }
.about__timeline span { position: absolute; inset: 0; background: var(--highlight); transform-origin: left center; transform: scaleX(0); }
/* viewfinder corners */
.about__corner {
  position: absolute;
  width: calc(18 * var(--u));
  height: calc(18 * var(--u));
  border: 0 solid rgba(0, 0, 0, 0.55);
}
.about__corner--tl { left: calc(-8 * var(--u)); top: calc(-8 * var(--u)); border-left-width: 2px; border-top-width: 2px; }
.about__corner--tr { right: calc(-8 * var(--u)); top: calc(-8 * var(--u)); border-right-width: 2px; border-top-width: 2px; }
.about__corner--bl { left: calc(-8 * var(--u)); bottom: calc(-16 * var(--u)); border-left-width: 2px; border-bottom-width: 2px; }
.about__corner--br { right: calc(-8 * var(--u)); bottom: calc(-16 * var(--u)); border-right-width: 2px; border-bottom-width: 2px; }

@media (max-width: 820px) {
  .bracket-btn { font-size: 12px; padding: 2px 8px; }
  .about__close { top: 12px; right: 16px; }
  .cta-stack { top: 14px; right: 16px; gap: 6px; }
  .cta-link { font-size: 12px; padding-right: 14px; }
  .cta-link::after { width: 8px; height: 8px; margin-top: -4px; }
  .about__frame { width: calc(100vw - 32px); height: calc((100vw - 32px) * 9 / 16); }
}

/* -------------------------------------------------------------------------- */
/* Pre-loader (js/loader.js)                                                  */
/* -------------------------------------------------------------------------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  transition: opacity 0.6s var(--ease-out);
}
.loader::before {               /* same grain as the page */
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  background-size: 256px 256px;
  mix-blend-mode: overlay;
  opacity: 0.22;
  animation: grain 0.5s steps(1) infinite;
  pointer-events: none;
}
/* Paz's reference (30/10): the count [28] at the top-LEFT of the square,
   the name (2 lines, extra bold, bigger) at the bottom-RIGHT of the square */
.loader__pct {
  position: absolute;
  right: calc(50% + 75 * var(--u) + 24 * var(--u));
  top: calc(50% - 75 * var(--u));
  font-size: calc(18 * var(--u));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: opacity 0.4s var(--ease-out);
}
.loader__name {
  position: absolute;
  left: calc(50% + 75 * var(--u) + 18 * var(--u));
  bottom: calc(50% - 75 * var(--u));
  font-size: calc(24 * var(--u));
  font-weight: 800;
  line-height: 0.85;
  white-space: nowrap;
  transition: opacity 0.4s var(--ease-out);
}
.loader.is-out .loader__pct,
.loader.is-out .loader__name { opacity: 0; }

/* the flashing square; on Scroll 1 it grows into the centre video */
.loader__img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(150 * var(--u));
  height: calc(150 * var(--u));
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: #0b0b0c;
  transition: width 0.75s var(--ease), height 0.75s var(--ease);
}
.loader__img canvas,
.loader__img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.loader__img img { opacity: 0; }
.loader__img img.is-on { opacity: 1; }
.loader.is-grow .loader__img { width: var(--home-w); height: var(--home-h); }
.loader.is-gone { opacity: 0; pointer-events: none; }

@media (max-width: 820px) {
  .loader__img { width: 110px; height: 110px; }
  .loader__pct { right: calc(50% + 55px + 10px); top: calc(50% - 55px); }
  .loader__name { left: calc(50% + 55px + 10px); bottom: calc(50% - 55px); font-size: 16px; }
}

/* -------------------------------------------------------------------------- */
/* Contact                                                                    */
/* -------------------------------------------------------------------------- */
.contact {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  display: flex;
  align-items: center;
  padding: 0 var(--pad-x);
  animation: fade-in 0.5s var(--ease-out) both;
}
.contact[hidden] { display: none; }
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
}
.contact__close {
  position: absolute;
  top: calc(16 * var(--u) + 4px);
  right: calc(70 * var(--u));
  z-index: 2;
}
.contact__list {
  position: relative;
  width: calc(816 * var(--u));
  display: grid;
  gap: calc(33 * var(--u));
}
.contact__list div { display: flex; }
.contact__list dt { width: calc(450 * var(--u)); color: var(--ink-50); }
.contact__list dd a { background: linear-gradient(var(--highlight), var(--highlight)) left center / 0 100% no-repeat; transition: background-size 0.5s var(--ease); }
.contact__list dd a:hover { background-size: 100% 100%; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }


/* -------------------------------------------------------------------------- */
/* Small screens                                                              */
/* -------------------------------------------------------------------------- */
@media (max-width: 820px) {
  :root {
    --u: calc(100vw / 820);
    --fs: 12px;
    --pad-x: 16px;
    --top: 56px;
    --row-pitch: 46px;
    --player-w: calc(100vw - 32px);
    --home-w: var(--player-w);
    --home-h: calc(var(--home-w) * 468 / 784);
  }
  .index-toggle { left: 16px; top: 14px; font-size: 12px; gap: 6px; }
  .index-toggle i { width: 8px; height: 8px; }
  .center-line, .bar--left { display: none; }
  .bar--right {
    top: auto; bottom: 0; left: 0; right: 0; width: auto; height: 28px;
    writing-mode: horizontal-tb; transform: none; padding: 0 16px;
  }
  .nav { left: 16px; top: 14px; gap: 22px; }
  .reel-hint { bottom: 40px; }
  /* mobile: caption back above the centred video */
  .reel-caption__left,
  .reel-caption__right { top: auto; bottom: calc(50% + var(--home-h) / 2 + 8px); }
  .reel-caption__left  { right: auto; left: 16px; align-items: flex-start; text-align: left; }
  .reel-caption__right { left: auto; right: 16px; align-items: flex-end; text-align: right; }
  .reel, .reel-gl { -webkit-mask-image: linear-gradient(to bottom, transparent 30px, #000 70px, #000 calc(100% - 60px), transparent calc(100% - 28px));
                  mask-image: linear-gradient(to bottom, transparent 30px, #000 70px, #000 calc(100% - 60px), transparent calc(100% - 28px)); }

  .index-mask { width: 100%; }
  .index { width: calc(100vw - 32px); left: 16px; top: 72px; }
  .index-head { left: 16px; right: 16px; top: 14px; }
  .row__role { left: 55%; }
  .row__year { margin-top: 4px; }
  .index-divider, .reel--index, .reel-gl--index, .index-bar__num { display: none; }
  .index-bar { display: none; }
  /* mobile has no hover: the list is the navigation, full contrast */
  .row .row__title { color: var(--ink); }
  .row .row__role, .row .row__year { color: var(--ink-50); }
  .bar__group { gap: 16px; }

  /* project (mobile): the piece on top, info + stills below, timeline under the piece */
  .view--project { overflow-y: auto; display: flex; flex-direction: column; }
  .project__screen { order: 1; }
  .project__timeline { order: 2; }
  .project__info { order: 3; }
  .project__stills { order: 4; }
  .project__stills-toggle, .project__back { font-size: 11px; }
  .project__stills-toggle i { width: 8px; height: 8px; }
  .project__info { flex: 0 0 auto; }
  .project__stills { flex: 0 0 120px; }
  .project__screen { position: relative; inset: auto; margin-top: 56px; aspect-ratio: 16 / 9; height: auto; }
  .project__shade { display: none; }
  .project__back { top: 16px; right: 16px; font-size: 11px; padding: 4px 8px; }
  .project__timeline { position: relative; bottom: auto; height: 4px; }
  .project__info { position: relative; left: auto; bottom: auto; width: auto; padding: 20px 16px 0; font-size: 12px; }
  .project__title { font-size: 22px; }
  .project__desc { max-width: none; }
  .project__time { margin-top: 20px; }
  .project__stills { position: relative; left: auto; bottom: auto; height: 120px; margin: 20px 0 60px 16px; }

  .contact__list, .contact__list dt { width: auto; }
  .contact__list dt { min-width: 40%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* -------------------------------------------------------------------------- */
/* Mobile fixes (02/11)                                                       */
/* -------------------------------------------------------------------------- */
@media (max-width: 820px) {
  /* INDEX: no blue band on mobile, so the "active" row must not go white */
  .row.is-active .row__line { font-weight: inherit; }
  .row.is-active .row__title { color: var(--ink); }
  .row.is-active .row__role,
  .row.is-active .row__year { color: var(--ink-50); }
  /* pre-loader: the [%] was ~8px on a phone */
  .loader__pct { font-size: 12px; }
  /* ABOUT ME: the reel always fits on screen (also with the phone sideways) */
  .about__frame {
    width: min(calc(100vw - 32px), calc((100svh - 110px) * 16 / 9));
    height: calc(min(calc(100vw - 32px), calc((100svh - 110px) * 16 / 9)) * 9 / 16);
  }
}
/* phone sideways: the piece fits the screen height instead of overflowing */
@media (max-width: 820px) and (orientation: landscape) {
  .project__screen {
    width: min(100vw, calc((100svh - 56px) * 16 / 9));
    align-self: center;
  }
}

/* -------------------------------------------------------------------------- */
/* Scroll engine (js/scroll.js) + ?debug panel — 05/11                        */
/* -------------------------------------------------------------------------- */
/* invisible box Lenis scrolls; each reel reads its position */
.scroll-proxy { position: fixed; inset: 0; overflow: hidden; visibility: hidden; pointer-events: none; z-index: -1; }
.debug-toast {
  position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%); z-index: 99999;
  background: #111; color: #fff; font: 12px/1 "Geist Mono", monospace; padding: 10px 14px; border-radius: 6px;
}

/* -------------------------------------------------------------------------- */
/* SCROLL + INDEX in one view (05/11)                                         */
/* -------------------------------------------------------------------------- */
/* the list, the blue bar and the divider only show with ● INDEX on */
.index-mask, .index-bar, .index-divider { transition: opacity 0.6s var(--ease-out); }
body:not(.index-open) .index-mask,
body:not(.index-open) .index-bar,
body:not(.index-open) .index-divider { opacity: 0; pointer-events: none; }
body.index-open .index-mask { transition-delay: 0.25s; }
/* the reel slides right (app.js animates its size / position); the caption and
   the background lines step aside */
.reel-caption, .home-lines { transition: opacity 0.5s var(--ease-out); }
body.index-open .reel-caption,
body.index-open .home-lines { opacity: 0; pointer-events: none; }
body.index-open .reel { z-index: 1; }      /* under the blue bar, like the old INDEX */
body.index-open .reel-gl { z-index: 0; }
@media (max-width: 820px) {
  /* phone: no room for both — the list replaces the reel */
  .reel, .reel-gl { transition: opacity 0.5s var(--ease-out); }
  body.index-open .reel,
  body.index-open .reel-gl { opacity: 0; pointer-events: none; }
}
/* the (invisible) ABOUT ME / CONTACT box was covering [BACK] in the project view */
body[data-view="project"] .cta-stack { pointer-events: none; }

/* CONTACT without the noise (05/11) */
.contact::before { content: none; animation: none; }

/* ABOUT ME — option B "Cine" (chosen by Paz 05/11): the REEL goes from blue bar to
   blue bar in 16:9 (never cropped), black bands above / below, blue viewfinder corners */
.about { background: #000; -webkit-backdrop-filter: none; backdrop-filter: none; }
.about__frame {
  width: min(calc(100vw - 60 * var(--u)), calc((100svh - 90 * var(--u)) * 16 / 9));
  height: calc(min(calc(100vw - 60 * var(--u)), calc((100svh - 90 * var(--u)) * 16 / 9)) * 9 / 16);
}
.about__corner { border-color: var(--highlight); }
.about__close { color: #fff; z-index: 2; }
.about__close:hover { color: var(--bar-ink); }
@media (max-width: 820px) {
  /* phone: edge to edge (16:9), still fits when the phone is sideways */
  .about__frame {
    width: min(100vw, calc((100svh - 110px) * 16 / 9));
    height: calc(min(100vw, calc((100svh - 110px) * 16 / 9)) * 9 / 16);
  }
  .about__corner { display: none; }
}

/* [BACK] always reads: it inverts what's under it (white on dark, black on light) */
.project__back { color: #fff; mix-blend-mode: difference; }
.project__back:hover { color: #fff; opacity: 0.6; }

/* ABOUT ME: no blue viewfinder corners around the video (06/11) */
.about__corner { display: none; }

/* -------------------------------------------------------------------------- */
/* ● DATA SHEET (06/11, was ● STILLS): the strip shows the stills and then    */
/* Unai's vertical videos (9:16) — they play on hover (tap on a phone)        */
/* -------------------------------------------------------------------------- */
.project__hero { position: absolute; inset: 0; }
/* the verticals: a row of three, bigger, right above the stills strip */
.project__verts {
  position: absolute;
  left: calc(837 * var(--u));
  bottom: calc(330 * var(--u));      /* stills strip: bottom 114 + height 200 + 16 gap */
  height: calc(460 * var(--u));
  display: flex;
  gap: calc(8 * var(--u));
  z-index: 3;
  transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease);
}
.vert { flex: 0 0 auto; height: 100%; aspect-ratio: 9 / 16; position: relative; overflow: hidden; background: #111; cursor: var(--cur-hover); }
.view--project.is-active:not(.stills-off) .project__verts .vert { animation: still-in 0.7s var(--ease) both; animation-delay: calc(var(--k) * 0.07s); }
.view--project.stills-off .project__verts { opacity: 0; transform: translateY(calc(20 * var(--u))); pointer-events: none; }
.view--project.is-idle .project__verts { opacity: 0; pointer-events: none; }
.vert img, .vert video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.vert video { opacity: 0; transition: opacity 0.4s var(--ease-out); }
.vert.is-playing video { opacity: 1; }
.vert figcaption {
  position: absolute;
  left: calc(8 * var(--u));
  right: calc(8 * var(--u));
  bottom: calc(8 * var(--u));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: calc(6 * var(--u));
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: calc(11 * var(--u));
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}
.vert figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vert figcaption i {
  flex: 0 0 auto;
  width: calc(8 * var(--u));
  height: calc(8 * var(--u));
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  transition: background 0.3s, border-color 0.3s;
}
.vert.is-playing figcaption i { background: var(--highlight); border-color: var(--highlight); }
@media (max-width: 820px) {
  .project__hero { position: relative; inset: auto; display: flex; flex-direction: column; }
  .project__verts { position: relative; left: auto; bottom: auto; order: 4; height: 260px; margin: 20px 0 0 16px; overflow-x: auto; scrollbar-width: none; }
  .project__stills { order: 5; }
  .vert figcaption { font-size: 9px; left: 6px; right: 6px; bottom: 6px; }
  .vert figcaption i { width: 6px; height: 6px; }
}

/* -------------------------------------------------------------------------- */
/* PHONE (09/11)                                                              */
/* -------------------------------------------------------------------------- */
.bar__name, .m-info { display: none; }
@media (max-width: 820px) {
  /* the blue strip at the bottom: just blue + the name (no grain) */
  .bar--right::after { content: none; }
  .bar--right { justify-content: flex-start; }
  .bar__name {
    display: block;
    font-size: 11px;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--bar-ink);
  }
  .bar__group { display: none; }

  /* no INDEX on the phone: only ABOUT ME / CONTACT at the top */
  .index-toggle { display: none; }

  /* tapping the centre project: its info right here (app.js → openInfo) */
  .m-info {
    display: flex;
    position: absolute;
    left: 16px;
    right: 16px;
    top: 0;
    z-index: 4;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    font-size: 12px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out);
  }
  body.m-info-open .m-info { opacity: 1; transition-delay: 0.15s; }
  .m-info__desc { flex: 1 1 55%; max-width: 60%; text-transform: none; color: rgba(0, 0, 0, 0.75); }
  .m-info__desc[hidden] { display: block; visibility: hidden; }
  .m-info__meta { flex: 0 0 auto; display: grid; gap: 4px; text-align: right; }
  .m-info__meta div { display: flex; justify-content: flex-end; gap: 10px; }
  .m-info__meta dd { text-transform: none; }
}
@media (max-width: 820px) {
  /* 09/11: with a project's info open, the text moves away from the video, towards
     the screen edges — N° / title / role / year up top, description + credits at the
     bottom, right above the blue strip. The video stays alone in the middle. */
  .reel-caption__left,
  .reel-caption__right {
    bottom: auto;
    top: calc(50% - var(--home-h) / 2 - 8px);
    transform: translateY(-100%);
    transition: top 0.7s var(--ease), transform 0.7s var(--ease);
  }
  body.m-info-open .reel-caption__left,
  body.m-info-open .reel-caption__right { top: 64px; transform: none; }
  .m-info { top: auto; bottom: 48px; }
}
.m-dark { display: none; }
@media (max-width: 820px) {
  /* 09/11: ABOUT ME on the left, CONTACT on the right, one row at the top */
  .cta-stack { left: 16px; right: 16px; flex-direction: row; justify-content: space-between; align-items: center; gap: 0; }
  .cta-link { padding-right: 0; }
  .cta-link::after { display: none; }

  /* 09/11: a project's info open → the screen goes black (back to normal when you scroll on) */
  .m-dark {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;                 /* over the background lines, under the video canvas */
    background: #0b0b0b;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s var(--ease-out);
  }
  body.m-info-open .m-dark { opacity: 1; }
  .reel-caption__num, .reel-caption__title, .reel-caption__role, .reel-caption__year,
  .m-info__desc, .m-info__meta, .cta-link { transition: color 0.6s var(--ease-out), opacity 0.4s var(--ease-out); }
  body.m-info-open .reel-caption__num,
  body.m-info-open .reel-caption__title,
  body.m-info-open .m-info__meta,
  body.m-info-open .cta-link { color: #fff; }
  body.m-info-open .reel-caption__role,
  body.m-info-open .reel-caption__year { color: rgba(255, 255, 255, 0.55); }
  body.m-info-open .m-info__desc { color: rgba(255, 255, 255, 0.75); }
}
.bar__role { display: none; }
@media (max-width: 820px) {
  /* 09/11: blue strip — ART DIRECTOR AND FILMMAKER left, the name in bold right */
  .bar--right { justify-content: space-between; }
  .bar__role { display: block; font-size: 11px; line-height: 1; letter-spacing: -0.02em; font-weight: 400; color: var(--bar-ink); }
  .bar__name strong { font-weight: 800; }
  /* 09/11: ABOUT ME / CONTACT in blue (a lighter blue over the black of a project's info) */
  .cta-link { color: var(--highlight); }
  body.m-info-open .cta-link { color: var(--bar-ink); }
}
@media (max-width: 820px) {
  /* blue strip: the name (bold) first on the left, ART DIRECTOR AND FILMMAKER on the right */
  .bar__name { order: 1; }
  .bar__role { order: 2; }
}
@media (max-width: 820px) {
  /* 09/11: with WebGL the fade at the top/bottom is drawn by the shader (opaque, so the
     background lines don't show through); the CSS mask stays only for the no-WebGL fallback */
  .reel--gl ~ .reel-gl, .reel-gl { -webkit-mask-image: none; mask-image: none; }
}
@media (max-width: 820px) {
  /* 09/11: description + PRODUCTORA / AGENCIA in the same grey as the role ("DIRECCIÓN CREATIVA") */
  .m-info__desc, .m-info__meta { color: var(--ink-50); }
  body.m-info-open .m-info__desc,
  body.m-info-open .m-info__meta { color: rgba(255, 255, 255, 0.55); }
}

/* -------------------------------------------------------------------------- */
/* ● INFO (09/11, desktop) — was ● DATA SHEET. Click: the piece pauses and    */
/* darkens, the info goes to the top-left, the blue timeline rises and turns  */
/* into a divider (342u); below it STILLS and REELS, three across.            */
/* -------------------------------------------------------------------------- */
.psheet-shade, .psheet { display: none; }
body.p-info .cursor-play { opacity: 0 !important; }
@media (min-width: 821px) {
  /* the old strip (verticals + stills) is replaced by the sheet on desktop */
  .project__verts, .project__stills { display: none; }

  .psheet-shade {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 2;
    background: rgba(0, 0, 0, 0.82);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s var(--ease-out);
  }
  .view--project.is-info .psheet-shade { opacity: 1; pointer-events: auto; }
  .view--project.is-info .project__shade { opacity: 0; }

  /* info block: top-left, no credits / time */
  .view--project.is-info .project__info { bottom: auto; top: calc(63 * var(--u)); animation: info-in 0.6s var(--ease) both; }
  .view--project.is-info .project__meta,
  .view--project.is-info .project__time { display: none; }
  .view--project.is-info .project__role { font-weight: 400; color: rgba(255, 255, 255, 0.6); }
  .project__stills-toggle { transition: color 0.3s; }
  .view--project.is-info .project__stills-toggle { color: var(--highlight); }
  @keyframes info-in { from { opacity: 0; transform: translateY(calc(-12 * var(--u))); } to { opacity: 1; transform: none; } }

  /* the timeline rises to 342u and becomes a full blue divider */
  .project__timeline { transition: transform 0.9s var(--ease), opacity 0.8s var(--ease-out); }
  .project__timeline span { transition: transform 0.6s var(--ease); }
  .view--project.is-info .project__timeline {
    transform: translateY(calc(-100vh + (37 + 7 + 339) * var(--u)));
    pointer-events: none;
  }
  .view--project.is-info .project__timeline span { transform: scaleX(1) !important; }

  /* the sheet: STILLS / REELS labels on the left, the grid (3 × 355u) on the right */
  .psheet {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(346 * var(--u));
    bottom: 0;
    z-index: 3;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    padding: calc(42 * var(--u)) calc(65 * var(--u)) calc(80 * var(--u)) calc(66 * var(--u));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease-out);
  }
  .psheet::-webkit-scrollbar { display: none; }
  .view--project.is-info .psheet { opacity: 1; pointer-events: auto; transition-delay: 0.35s; }
  .psheet__row { display: flex; justify-content: space-between; align-items: flex-start; }
  .psheet__row + .psheet__row { margin-top: calc(42 * var(--u)); }
  .psheet__label { font-size: calc(24 * var(--u)); font-weight: 400; line-height: 1; letter-spacing: -0.03em; color: #fff; margin-top: calc(6 * var(--u)); }
  .psheet__grid { display: grid; grid-template-columns: repeat(3, calc(355 * var(--u))); gap: calc(25 * var(--u)); }
  .psheet__still { aspect-ratio: 16 / 9; overflow: hidden; background: #111; }
  .psheet__still img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .psheet__grid--reels .vert { height: auto; width: 100%; aspect-ratio: 9 / 16; }
  .psheet__grid--reels .vert figcaption { font-size: calc(12 * var(--u)); left: calc(12 * var(--u)); right: calc(12 * var(--u)); bottom: calc(12 * var(--u)); }
  .view--project.is-info .psheet__still,
  .view--project.is-info .psheet__grid--reels .vert { animation: still-in 0.7s var(--ease) both; animation-delay: calc(0.35s + var(--k) * 0.06s); }

  /* while INFO is open nothing fades out */
  .view--project.is-info.is-idle .project__back,
  .view--project.is-info.is-idle .project__info,
  .view--project.is-info.is-idle .project__timeline { opacity: 1; pointer-events: auto; }
}

@media (min-width: 821px) {
  /* 09/11 (later): the four stills in one row (4 × 260u) and the reels below on the same
     columns (260u wide, 9:16) — at 16:9 everything fits without scrolling */
  .psheet__grid { grid-template-columns: repeat(4, calc(260 * var(--u))); }
  .psheet__label { color: var(--highlight); }
  .psheet { overflow: hidden; }          /* Lenis scrolls it when it doesn't fit */
  .psheet__inner { min-height: 100%; }
}
@media (min-width: 821px) { .psheet { padding-bottom: calc(30 * var(--u)); } }
@media (min-width: 821px) {
  /* 09/11 (later): the divider higher, at 265u; everything is laid out from it:
     the info sits 42u ABOVE the line, STILLS start 42u BELOW it */
  .view--project.is-info .project__timeline { transform: translateY(calc(-100vh + (37 + 7 + 265) * var(--u))); }
  .view--project.is-info .project__info { top: auto; bottom: calc(100vh - (265 - 42) * var(--u)); }
  .psheet { top: calc(272 * var(--u)); }
}
/* no focus box around ● INFO / ● INDEX after a mouse click (the keyboard still gets it) */
.project__stills-toggle:focus:not(:focus-visible),
.index-toggle:focus:not(:focus-visible) { outline: none; }
@media (min-width: 821px) {
  /* 09/11 (later, 2): STILLS / REELS like the INFO label (Geist Mono 12u), white, on top
     of their grid; everything grouped on the left, aligned with the info (60u). The
     column size follows the screen height so the whole sheet always fits in one screen:
     stills 16:9 + reels 9:16 on the same columns. */
  .psheet {
    --col: min(calc(268 * var(--u)), calc((100vh - (272 + 172) * var(--u)) / 2.34));
    padding: calc(40 * var(--u)) calc(60 * var(--u)) 0;
  }
  .psheet__row { flex-direction: column; justify-content: flex-start; gap: calc(14 * var(--u)); }
  .psheet__row + .psheet__row { margin-top: calc(36 * var(--u)); }
  .psheet__label {
    margin: 0;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: calc(12 * var(--u));
    letter-spacing: 0;
    line-height: 1;
    color: #fff;
  }
  .psheet__grid { grid-template-columns: repeat(4, var(--col)); gap: calc(20 * var(--u)); }
}
@media (min-width: 821px) {
  /* 09/11 (later, 3): the STILLS / REELS group sits on the RIGHT (right margin 60u);
     the labels stay on top of their grid, at the group's left edge */
  .psheet__inner { width: fit-content; margin-left: auto; }
}
@media (min-width: 821px) {
  /* 09/11 (later, 4): labels back on the LEFT (60u, in line with the info), the grids
     grouped on the RIGHT */
  .psheet__inner { width: auto; margin-left: 0; }
  .psheet__row { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 0; }
}
@media (min-width: 821px) {
  /* labels no longer take a line above each grid → a bit more room for the images (still one screen) */
  .psheet { --col: min(calc(290 * var(--u)), calc((100vh - (272 + 132) * var(--u)) / 2.34)); }
}


/* -------------------------------------------------------------------------- */
/* 09/11 — INDEX: sidebar 2 slides out on desktop                             */
/* -------------------------------------------------------------------------- */
@media (min-width: 821px) {
  /* just fades out (09/11 later — the slide flipped it: .bar is rotated 180°) */
  /* it "runs out" downwards: the top edge slides down to the bottom, same 1 s ease as the reel
     moving into INDEX (09/11 later). .bar is rotated 180°, so the local bottom is the visual top. */
  .bar--right { clip-path: inset(0 0 0 0); transition: clip-path 1s var(--ease); }
  body.index-open .bar--right { clip-path: inset(0 0 100% 0); pointer-events: none; }
}

/* -------------------------------------------------------------------------- */
/* 09/11 — ABOUT ME (desktop), Paz's layout: page background, intro line at   */
/* the top-left, the REEL with grey viewfinder corners + blue timeline,       */
/* portrait + links on the right. The stage (1920×1080 units) scales to fit   */
/* both width and height. Phone keeps the "Cine" version.                     */
/* -------------------------------------------------------------------------- */
@media (min-width: 821px) {
  .about { z-index: 11; background: var(--bg); }          /* over the sidebars */
  .about::before {
    content: ""; position: absolute; inset: 0;
    background-image: var(--grain); background-size: 256px 256px;
    mix-blend-mode: overlay; opacity: 0.22; pointer-events: none;
    animation: grain 0.5s steps(1) infinite;
  }
  .about__stage {
    --a: min(var(--u), calc(100vh / 1080));
    position: absolute; left: 50%; top: 50%;
    width: calc(1920 * var(--a)); height: calc(1080 * var(--a));
    transform: translate(-50%, -50%);
  }
  .about__intro {
    position: absolute; margin: 0;
    left: calc(98 * var(--a)); top: calc(147 * var(--a));
    font-size: calc(28 * var(--a)); line-height: 0.9; font-weight: 500;
    letter-spacing: -0.05em; text-transform: none; color: var(--ink);
  }
  .about__frame {
    left: calc(92 * var(--a)); top: calc(243 * var(--a));
    width: calc(1304 * var(--a)); height: calc(690 * var(--a));
    transform: scale(0.98); transform-origin: 50% 50%;
  }
  .about.is-open .about__frame { transform: none; }
  .about__corner { display: block; border-color: rgba(0, 0, 0, 0.45); }
  .about__close { color: var(--ink); }
  .about__close:hover { color: var(--highlight); }
  .about__photo {
    position: absolute; margin: 0;
    left: calc(1457 * var(--a)); top: calc(750 * var(--a));
    width: calc(158 * var(--a)); height: calc(187 * var(--a));
    background: #2b2b2b center / cover no-repeat;
  }
  .about__links {
    position: absolute; margin: 0; padding: 0; list-style: none;
    left: calc(1673 * var(--a)); bottom: calc(140 * var(--a));
    font-size: calc(20 * var(--a)); line-height: calc(28 * var(--a));
    letter-spacing: -0.04em; text-transform: none; color: var(--ink);
  }
  .about__links a { transition: color 0.3s; }
  .about__links a:hover { color: var(--highlight); }
}
@media (max-width: 820px) {
  .about__intro, .about__photo, .about__links { display: none; }
}


/* 09/11 (later): ABOUT ME without grain; only the ABOUT CTA (CONTACT removed) */
.about::before { content: none; animation: none; }
.cta-contact { display: none; }
@media (max-width: 820px) { .cta-stack { justify-content: flex-end; } }

/* 09/11 (later): ABOUT ME transition — tied to the scroll and the pre-loader: the centre video
   shrinks back into a 150u square, which opens into the REEL frame (app.js → about.flip animates left/top/width/height) while the page fades in
   around it and the rest of the content comes in one after another. Closing: the content
   goes, the frame shrinks back onto the centre video and the page fades away.
   Phone: a plain fade (as before). */
@media (min-width: 821px) {
  .about { opacity: 1; background-color: rgba(232, 232, 228, 0);
    transition: background-color 0.9s var(--ease-out) 0.3s, visibility 0s 1.6s; }
  .about.is-open { background-color: var(--bg); transition: background-color 0.5s var(--ease-out), visibility 0s; }
  /* closing: the page stays covered until the frame is back on the centre video, then it all fades */
  .about.closing { background-color: var(--bg); visibility: visible; transition: none; }
  .about.fade-out { opacity: 0; visibility: visible; transition: opacity 0.45s var(--ease-out); }
  .about:not(.is-open) { pointer-events: none; }   /* never catches clicks while it goes away */
  .about__intro, .about__frame, .about__photo, .about__links, .about__close {
    opacity: 0;
    transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease), color 0.3s;
  }
  .about__intro  { transform: translateY(calc(30 * var(--a))); }
  .about__frame  { transform: scale(0.98); }
  .about__photo  { transform: translateY(calc(30 * var(--a))); }
  .about__links  { transform: translateY(calc(30 * var(--a))); }
  .about__close  { transform: translateY(calc(-10 * var(--u))); }
  .about.is-open .about__intro,
  .about.is-open .about__frame,
  .about.is-open .about__photo,
  .about.is-open .about__links,
  .about.is-open .about__close { opacity: 1; transform: none; }
  .about.is-open .about__intro { transition-delay: 1.6s; }
  .about.is-open .about__photo { transition-delay: 1.7s; }
  .about.is-open .about__links { transition-delay: 1.8s; }
  .about.is-open .about__close { transition-delay: 1.85s; }
  .about:not(.is-open) .about__intro, .about:not(.is-open) .about__photo,
  .about:not(.is-open) .about__links, .about:not(.is-open) .about__close { transition-duration: 0.35s; transition-delay: 0s; }
  /* the frame IS the centre video while it travels: always visible, no scale */
  .about--flip .about__frame,
  .about--flip:not(.is-open) .about__frame { opacity: 1; transform: none; transition-delay: 0s; }
  /* corners + timeline appear once it has landed */
  .about__corner, .about__timeline { transition: opacity 0.5s var(--ease-out); }
  .about:not(.is-open) .about__corner, .about:not(.is-open) .about__timeline { opacity: 0; transition-duration: 0.25s; }
  .about.is-open .about__corner, .about.is-open .about__timeline { opacity: 1; transition-delay: 2.1s; }
  /* the still of the scroll's centre video, shown while the frame travels to / from the square */
  .about__ghost { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
    opacity: 0; transition: opacity 0.14s linear; pointer-events: none; }
  .about.ghost-on .about__ghost { opacity: 1; }
}
@media (max-width: 820px) { .about__ghost { display: none; } }

/* -------------------------------------------------------------------------- */
/* 10/11 — ABOUT ME on the phone, same design as desktop (replaces "Cine"):    */
/* light page, intro line, the REEL full width (16:9) with corners + timeline, */
/* portrait + links below. Content comes in one after another. Phone sideways: */
/* only the reel, as big as fits.                                              */
/* -------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .about { z-index: 11; background: var(--bg); }
  .about__close { color: var(--ink); }
  .about__close:hover { color: var(--highlight); }
  .about__stage {
    position: absolute; inset: 0;
    padding: 76px 16px 40px;
    display: grid;
    grid-template-columns: 112px 1fr;
    grid-template-areas: "intro intro" "frame frame" "photo links";
    align-content: center;
    row-gap: 28px; column-gap: 16px;
  }
  .about__intro {
    display: block; grid-area: intro; margin: 0;
    font-size: 20px; line-height: 0.95; font-weight: 500;
    letter-spacing: -0.05em; text-transform: none; color: var(--ink);
  }
  .about__frame,
  .about.is-open .about__frame {
    grid-area: frame; position: relative; left: auto; top: auto;
    width: 100%; height: auto; aspect-ratio: 16 / 9;
    transform: none;
  }
  .about__timeline { height: 4px; }
  .about__corner { display: block; width: 12px; height: 12px; border-color: rgba(0, 0, 0, 0.45); }
  .about__corner--tl, .about__corner--bl { left: -6px; }
  .about__corner--tr, .about__corner--br { right: -6px; }
  .about__corner--tl, .about__corner--tr { top: -6px; }
  .about__corner--bl, .about__corner--br { bottom: -12px; }
  .about__photo {
    display: block; grid-area: photo; margin: 0; margin-top: 8px;
    width: 112px; aspect-ratio: 158 / 187;
    background: #2b2b2b center / cover no-repeat;
  }
  .about__links {
    display: block; grid-area: links; align-self: end;
    margin: 0; padding: 0; list-style: none;
    font-size: 15px; line-height: 21px; letter-spacing: -0.04em;
    text-transform: none; color: var(--ink);
  }
  .about__links a { transition: color 0.3s; }
  .about__links a:hover { color: var(--highlight); }
  /* coming in, one after another */
  .about__intro, .about__frame, .about__photo, .about__links, .about__close {
    opacity: 0; transform: translateY(14px);
    transition: opacity 0.8s var(--ease-out), transform 0.9s var(--ease), color 0.3s;
  }
  .about__frame { transform: translateY(14px) scale(0.98); }
  .about.is-open .about__intro, .about.is-open .about__frame, .about.is-open .about__photo,
  .about.is-open .about__links, .about.is-open .about__close { opacity: 1; transform: none; }
  .about.is-open .about__frame { transition-delay: 0.15s; }
  .about.is-open .about__intro { transition-delay: 0.3s; }
  .about.is-open .about__photo { transition-delay: 0.4s; }
  .about.is-open .about__links { transition-delay: 0.48s; }
  .about.is-open .about__close { transition-delay: 0.5s; }
  .about:not(.is-open) .about__intro, .about:not(.is-open) .about__frame, .about:not(.is-open) .about__photo,
  .about:not(.is-open) .about__links, .about:not(.is-open) .about__close { transition-duration: 0.3s; transition-delay: 0s; }
}
/* phone sideways: just the reel, as big as fits */
@media (max-width: 820px) and (orientation: landscape) {
  .about__stage { padding: 44px 16px 20px; grid-template-areas: "frame frame"; justify-items: center; }
  .about__intro, .about__photo, .about__links { display: none; }
  .about__frame, .about.is-open .about__frame { width: min(100%, calc((100svh - 80px) * 16 / 9)); }
}
/* touch screens: no sticky hover colour on [BACK] after tapping ABOUT (same spot) */
@media (hover: none) { .about__close:hover { color: var(--ink); } }


/* -------------------------------------------------------------------------- */
/* 10/11 — selected text in blue; the mouse pointer is a blue dot             */
/* (over links / buttons: the normal hand). Every                             */
/* "cursor: pointer" in this file uses var(--cur-hover).                      */
/* -------------------------------------------------------------------------- */
::selection { background: var(--highlight); color: #fff; }
:root { --cur: auto; --cur-hover: pointer; }
@media (pointer: fine) {
  :root {
    --cur: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14'%3E%3Ccircle cx='7' cy='7' r='5' fill='%23001fd0'/%3E%3C/svg%3E") 7 7, auto;
    --cur-hover: pointer;   /* the normal hand over anything clickable (10/11) */
  }
  html, body { cursor: var(--cur); }
  a, label, summary, [role="button"] { cursor: var(--cur-hover); }
}
/* 10/11: the longer role (AUDIOVISUAL CREATIVE DIRECTOR) still fits the phone strip on small phones */
@media (max-width: 400px) {
  .bar__role, .bar__name, .bar__name strong { font-size: min(11px, 2.75vw); }
  .bar--right { gap: 8px; }
}

/* 10/11 (phone): ABOUT ME — the portrait + links sit at the bottom of the screen; the reel stays
   exactly where it was (an invisible spacer keeps their old slot in the centred grid).
   ABOUT in the header stands out more: bold and a bit bigger. */
@media (max-width: 820px) {
  .about__stage::after { content: ""; grid-area: photo; height: calc(112px * 187 / 158 + 8px); }
  /* grid-area: auto — an absolutely positioned grid child would use its grid area as containing block */
  .about__photo { grid-area: auto; position: absolute; left: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); margin: 0; }
  .about__links { grid-area: auto; position: absolute; left: calc(16px + 112px + 16px); right: 16px;
    bottom: calc(24px + env(safe-area-inset-bottom) - 4px); }
  .cta-about { font-weight: 700; font-size: 14px; letter-spacing: 0; }
}
@media (max-width: 820px) and (orientation: landscape) {
  .about__stage::after { display: none; }
}
