/* ═══════════════════════════════════════════════════════════════════════
   aura / styles.css
   One dark theme, one accent (crimson), three fonts:
   Anton (the giant name), Bodoni Moda (section titles), Manrope (body).
   Only transform and opacity animate. Reduced motion = everything at rest.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0708;
  --bg-2: #130c0d;
  --ink: #f3ebe4;
  --ink-2: rgba(243, 235, 228, 0.64);
  --ink-3: rgba(243, 235, 228, 0.38);
  --line: rgba(243, 235, 228, 0.12);
  --line-2: rgba(243, 235, 228, 0.22);
  --glass: rgba(255, 255, 255, 0.035);
  --red: #c3182e;
  --red-ink: #ee5a6c;   /* the brand red is 3.1:1 on the dark glass; small red text uses this one (5.4:1) */
  --red-deep: #7d0d1d;
  --red-glow: #ff4040;
  --font-hero: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  --font-display: "Bodoni Moda", "Didot", "Playfair Display", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --bar-h: 60px;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --radius: 4px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  overflow-x: clip;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }

::selection { background: var(--red); color: #fff; }
html { scrollbar-color: #5a1620 var(--bg); scrollbar-width: thin; }

/* heading lines: the mask each line rises out of (padding keeps italic descenders and serifs unclipped) */
/* flow-root keeps the lines' negative margins inside the heading, so nothing after it moves */
.scene .display:has(.ln) { display: flow-root; }
.ln { display: block; overflow: clip; padding: 0.08em 0.06em 0.14em 0; margin: -0.08em 0 -0.14em; }
.ln-in { display: block; will-change: transform; }

:focus-visible { outline: 2px solid var(--red-glow); outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* film grain, fixed, never repaints the scroller */
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  mix-blend-mode: screen;
}

/* vignette so every section reads as a stage */
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* the lamp that follows the pointer */
.spot {
  position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none;
  width: 70vmax; height: 70vmax; margin: -35vmax 0 0 -35vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 190, 0.07), rgba(255, 120, 110, 0.03) 35%, transparent 65%);
  mix-blend-mode: screen;
  opacity: 0;
  will-change: transform;
}
@media (pointer: coarse) { .spot { width: 90vmax; height: 90vmax; margin: -45vmax 0 0 -45vmax; } }

/* Three.js embers and dust: a fixed WebGL layer, pointer-events off, created only when motion is allowed */
.embers { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 1.6s; }
.embers.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .embers { display: none; } }

/* ── shared text styles ────────────────────────────────────────────── */
.caps {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--ink);
}
.display em {
  font-style: italic;
  font-weight: 400;
  color: var(--red);
  text-transform: none;
  letter-spacing: 0.02em;
  padding-bottom: 0.08em;
}
.display-lc {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.05;
  color: var(--ink);
}
.sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-2);
  line-height: 1.35;
  padding-bottom: 0.15em;
}
.hairline { height: 1px; background: var(--line); }

/* ── sections ──────────────────────────────────────────────────────── */
.scene {
  position: relative;
  min-height: 100dvh;
  padding: clamp(4rem, 9vh, 6rem) var(--gutter) calc(var(--bar-h) + 2rem);
  scroll-snap-align: start;
  isolation: isolate;
  overflow: clip;
}
.scene > .inner {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100dvh - clamp(4rem, 9vh, 6rem) - var(--bar-h) - 2rem);
}

/* optional room backdrop a section can carry */
.backdrop {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 78%, transparent 100%);
}
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10, 7, 8, 0.1), rgba(10, 7, 8, 0.75) 70%);
}

/* halftone develop: the figure is seen through a grid of dots whose radius grows until they merge.
   The default radius already covers the whole cell, so without JS the picture is simply there. */
@property --dot { syntax: "<length>"; inherits: false; initial-value: 9px; }
.scene:not(.hero) .figure img {
  -webkit-mask: radial-gradient(circle at center, #000 var(--dot), transparent calc(var(--dot) + 0.7px)) 0 0 / 11px 11px;
  mask: radial-gradient(circle at center, #000 var(--dot), transparent calc(var(--dot) + 0.7px)) 0 0 / 11px 11px;
}

/* ── full-bleed scene: the picture fills the section, the text sits on a gradient on the other side ── */
/* The picture never shows an edge: it dissolves into the page on all four sides (two fades, intersected), so when a
   scene rises, recedes or is scaled by the scroll, no rectangle of photo ever appears against the next scene. */
.scene-img {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-size: cover; background-position: var(--focus, 30% 50%); background-repeat: no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 74%, transparent 100%), linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 74%, transparent 100%), linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-composite: intersect;
}
.scene-img::after { content: ""; position: absolute; inset: 0; }
.scene-left .scene-img::after { background: linear-gradient(90deg, rgba(10, 7, 8, 0.1) 0%, rgba(10, 7, 8, 0.5) 42%, rgba(10, 7, 8, 0.88) 72%, rgba(10, 7, 8, 0.94) 100%); }
.scene-right .scene-img::after { background: linear-gradient(270deg, rgba(10, 7, 8, 0.1) 0%, rgba(10, 7, 8, 0.5) 42%, rgba(10, 7, 8, 0.88) 72%, rgba(10, 7, 8, 0.94) 100%); }
.has-scene > .backdrop { display: none; }
.has-scene .figure { visibility: hidden; }            /* the slot stays, the cutout is not drawn */
.has-scene.projects .scene-img::after { background: radial-gradient(80% 70% at 50% 45%, rgba(10, 7, 8, 0.35), rgba(10, 7, 8, 0.8)); }
.has-scene.projects .halo, .has-scene.projects .rings, .has-scene.projects .floorglow { display: none; }   /* the picture carries the stage light */
.has-scene.journey .scene-img::after { background: linear-gradient(180deg, rgba(10, 7, 8, 0.75), rgba(10, 7, 8, 0.45) 45%, rgba(10, 7, 8, 0.85)); }
@media (max-width: 959px) {
  /* phones: the character keeps the top of the screen, the text reads on a darker lower part */
  .scene-left .scene-img::after, .scene-right .scene-img::after { background: linear-gradient(180deg, rgba(10, 7, 8, 0.15) 0%, rgba(10, 7, 8, 0.55) 30%, rgba(10, 7, 8, 0.9) 52%, rgba(10, 7, 8, 0.95) 100%); }
  /* the picture is 58vh tall and the section is taller, so its fade is measured in vh, not in percent of the
     section: it dissolves into the page colour exactly where the picture ends (no hard edge under the character) */
  .scene-img { background-size: auto 58vh; background-position: var(--focus, 30% 50%) 0; background-color: transparent; background-repeat: no-repeat; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 13vh, #000 34vh, transparent 57vh), linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); -webkit-mask-composite: source-in; mask-image: linear-gradient(180deg, transparent 0, #000 13vh, #000 34vh, transparent 57vh), linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); mask-composite: intersect; }
  .scene-left .scene-img::after, .scene-right .scene-img::after { background: linear-gradient(180deg, rgba(10, 7, 8, 0.05) 0, rgba(10, 7, 8, 0.15) 30vh, rgba(10, 7, 8, 0.6) 50vh); }
}

/* scene mode layouts: the character is in the picture's left third, so nothing readable may sit there */
@media (min-width: 960px) {
  /* experience: the character owns the left 40%; heading, numbers and timeline stack on the right */
  .has-scene.experience > .inner, .has-scene.experience > .inner:has(.figure[hidden]) { grid-template-columns: minmax(0, 4.8fr) minmax(0, 7.2fr); grid-template-rows: auto auto; align-content: center; row-gap: 1.2rem; }
  .has-scene.experience .figure { display: none; }
  .has-scene.experience .lead { grid-column: 2; grid-template-columns: minmax(0, 1fr) auto; align-items: end; align-content: normal; gap: 0.5rem 1.5rem; }
  .has-scene.experience .lead > div:first-child { display: contents; }      /* heading on its own row, intro beside the numbers */
  .has-scene.experience .lead .display { grid-column: 1 / -1; }
  .has-scene.experience .lead .display { font-size: clamp(1.5rem, 2.4vw, 2.2rem); }
  .has-scene.experience .lead .display .ln { display: inline-block; margin-right: 0.3em; }
  .has-scene.experience .lead p { margin-top: 0.4rem !important; max-width: 46ch; font-size: 0.85rem; }
  .has-scene.experience .stats { gap: 1.2rem; grid-template-columns: repeat(3, minmax(0, 7.5rem)); }   /* labels wrap under their number, so the intro keeps its width */
  .has-scene.experience .stats div span { letter-spacing: 0.1em; }
  .has-scene.experience .stats div b { font-size: 1.5rem; }
  .has-scene.experience .timeline { grid-column: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 0.55rem; }
  .has-scene.experience .xcard { height: 100%; }
  .has-scene.experience .xcard:nth-child(even)::before { display: none; }
  /* certifications: heading in one row above the wall, both to the right of the character */
  .has-scene.certs > .inner { grid-template-columns: minmax(0, 3.3fr) minmax(0, 8.7fr); grid-template-rows: auto auto; align-content: center; row-gap: 1.4rem; }
  .has-scene.certs .lead { grid-column: 2; display: block; }
  .has-scene.certs .lead .figure { display: none; }
  .has-scene.certs .lead .display { font-size: clamp(1.5rem, 2.5vw, 2.3rem); }
  .has-scene.certs .lead .display .ln { display: inline-block; margin-right: 0.3em; }
  .has-scene.certs .lead .sub { margin-top: 0.5rem; }
  .has-scene.certs .wall { grid-column: 2; }
}
@media (max-width: 959px) {
  /* phones: the picture owns the top of the section, all text starts below the character */
  .has-scene .figure { display: none; }
  .has-scene > .inner { padding-top: 52vh; }
}

/* short desktop windows: the experience cards tighten so the scene still fits one screen where it can */
@media (min-width: 960px) and (max-height: 800px) {
  .has-scene.experience > .inner { row-gap: 0.7rem; }
  .has-scene.experience .xcard { padding: 0.5rem 0.8rem 0.6rem; }
  .has-scene.experience .xcard h3 { font-size: 1rem; }
  .has-scene.experience .xcard p { font-size: 0.75rem; line-height: 1.35; margin-top: 0.25rem; }
  .has-scene.experience .tags { margin-top: 0.35rem; }
  .has-scene.experience .lead p { font-size: 0.8rem; }
}

/* the projects stage picture has no person in it, so the wall's own figure stays drawn */
.has-scene.projects .figure { visibility: visible; }
@media (max-width: 959px) {
  .has-scene.projects > .inner { padding-top: 0; }
  .has-scene.projects .scene-img { background-size: cover; background-position: 50% 50%; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 78%, transparent 100%); -webkit-mask-composite: source-over; mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 78%, transparent 100%); mask-composite: add; }
}

/* phones: a grid track must be allowed to shrink below its content, or a long line pushes cards past the edge */
@media (max-width: 959px) {
  .experience > .inner, .experience > .inner:has(.figure[hidden]) { grid-template-columns: minmax(0, 1fr); }
  .experience .lead, .experience .timeline, .skills .main, .certs .lead { min-width: 0; }
  .xcard, .panel, .frame, .ccard { min-width: 0; overflow-wrap: anywhere; }
}

/* photo slot (transparent-background cutouts) */
.figure {
  position: relative;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}
.figure img { width: 100%; height: 100%; object-fit: contain; object-position: bottom center; }
.figure[hidden] { display: none; }

/* ═══════════════════════════ sound + bar ═══════════════════════════ */
.sound {
  position: fixed; top: max(14px, env(safe-area-inset-top)); right: var(--gutter); z-index: 51;
  display: grid; place-items: center;
  width: 58px; height: 44px; padding: 0;
  color: var(--ink-2);
  background: none;
  border: 0;
  transition: color 0.3s ease, opacity 0.3s ease;
}
.sound .eq { display: flex; align-items: flex-start; gap: 4px; width: 36px; height: 40px; }
.sound .eq i { --level: 0.32; position: relative; width: 4px; height: 40px; flex: 0 0 4px; }
.sound .eq i::before, .sound .eq i::after { content: ""; position: absolute; left: 0; width: 100%; height: 18px; border-radius: 3px; transform: scaleY(var(--level)); }
.sound .eq i::before { bottom: 20px; transform-origin: bottom; background: var(--red-ink); box-shadow: 0 0 8px rgba(238, 90, 108, 0.18); }
.sound .eq i::after { top: 20px; transform: scaleY(var(--level)) scaleY(-1); transform-origin: top; background: linear-gradient(180deg, rgba(238, 90, 108, 0.26), rgba(238, 90, 108, 0.02)); opacity: 0.78; }
.sound .eq i:nth-child(even)::before { background: var(--ink); box-shadow: 0 0 8px rgba(243, 235, 228, 0.14); }
.sound .eq i:nth-child(even)::after { background: linear-gradient(180deg, rgba(243, 235, 228, 0.25), rgba(243, 235, 228, 0.02)); }
.sound.playing { color: var(--ink); }
.sound.playing .eq i::before, .sound.playing .eq i::after { transition: transform 90ms linear, opacity 220ms ease; }
.sound:not(.playing) .eq i::before, .sound:not(.playing) .eq i::after { transition: transform 260ms var(--ease-out), opacity 260ms ease; }
.sound:hover { color: var(--ink); }
.sound:focus-visible { outline: 2px solid var(--red-ink); outline-offset: 3px; }
.sound[hidden] { display: none; }
.sound.cued { width: 58px; padding: 0; overflow: visible; }
.sound-cue { position: fixed; right: calc(var(--gutter) + 58px + 0.7rem); top: calc(max(14px, env(safe-area-inset-top)) + 22px); display: grid; gap: 0.16rem; width: max-content; transform: translateY(-50%); color: var(--ink-2); text-align: right; font: 600 0.56rem/1 var(--font-body); letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; pointer-events: none; }
.sound-cue b { color: var(--ink); font-weight: 700; }
.sound-cue small { color: var(--red-ink); font-size: 0.46rem; font-weight: 700; letter-spacing: 0.2em; }
.sound-cue::after { content: ""; position: absolute; top: 50%; left: calc(100% + 0.35rem); width: 0.36rem; height: 1px; background: var(--red-ink); opacity: 0.8; }
.sound:not(.cued) .sound-cue { display: none; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: var(--bar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(10, 7, 8, 0) 0%, rgba(10, 7, 8, 0.85) 40%);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(243, 235, 228, 0.06);
}
.bar .progress { position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--red); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.bar .roles {
  display: flex; flex-direction: column; gap: 1px;
  font-size: 0.75rem; letter-spacing: 0.26em; text-transform: uppercase; font-weight: 600;
  color: var(--ink-3); line-height: 1.3;
}
.bar nav { display: flex; gap: clamp(0.8rem, 2.2vw, 2rem); }
.bar nav a {
  position: relative;
  padding: 0.5rem 0;
  font-size: 0.75rem; letter-spacing: 0.26em; text-transform: uppercase; font-weight: 600;
  color: var(--ink-3);
  transition: color 0.3s;
  white-space: nowrap;
}
.bar nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--red); transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}
.bar nav a:hover { color: var(--ink); }
.bar nav a[aria-current="true"] { color: var(--ink); }
.bar nav a[aria-current="true"]::after { transform: scaleX(1); }
.bar .dots { display: flex; justify-content: flex-end; gap: 18px; }
.bar .dots button {
  position: relative;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-3); padding: 0;
  transition: transform 0.3s, background 0.3s;
}
/* the dot stays 6px; the target around it is 24px (WCAG 2.2 target size) */
.bar .dots button::after { content: ""; position: absolute; inset: -9px; }
.bar .dots button[aria-current="true"] { background: var(--red); transform: scale(1.35); }

@media (max-width: 759px) {
  :root { --bar-h: 96px; }
  .bar { grid-template-columns: 1fr; padding: 0; }
  .bar .roles, .bar .dots { display: none; }
  /* two centred rows: every section stays reachable without a hidden scroll strip */
  .bar nav { flex-wrap: wrap; justify-content: center; gap: 0 1.1rem; padding: 0.2rem 0.75rem; }
  .bar nav a { padding: 0.85rem 0.15rem; font-size: 0.78rem; letter-spacing: 0.18em; }
  @media (max-width: 374px) { .bar nav { gap: 0 0.7rem; padding: 0.2rem 0.4rem; } .bar nav a { letter-spacing: 0.12em; } }   /* 360 px phones: two rows, not three (the third fell below the screen) */
}

/* ═══════════════════════════ 01 hero ═══════════════════════════════ */
.hero { padding-top: 0; padding-bottom: 0; }
.hero > .inner {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  max-width: none;
}
.hero .welcome {
  align-self: end;
  padding-bottom: min(17vh, 11vw);
  display: flex; gap: 1rem; align-items: center;
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 1.3vw, 1.05rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.hero .welcome em { color: var(--red); font-style: normal; }
.hero .welcome::before, .hero .welcome::after {
  content: "\00b7\00a0\00b7\00a0\00b7"; color: var(--ink-3); letter-spacing: 0.1em;
}

.stage {
  --hero-fs: clamp(5.5rem, 23vw, 21rem);
  --drop: calc(var(--hero-fs) * 0.86 * 0.075);   /* how far in front of the letters his feet stand */
  --fig-h: min(50vh, 31vw);                       /* his height; the shadow clip below needs it too */
  position: relative;
  width: 100%;
  display: grid; place-items: end center;
  line-height: 0;
}
.name {
  position: relative; z-index: 1;
  font-family: var(--font-hero);
  font-size: var(--hero-fs);
  line-height: 0.86;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--red);
  filter: drop-shadow(0 0 40px rgba(195, 24, 46, 0.25));
  user-select: none;
}
/* the gradient sits on each letter: background-clip:text does not reach inline-block children */
.name span {
  display: inline-block; will-change: transform, opacity;
  background: linear-gradient(180deg, #e6233c 0%, #b8162b 48%, #6e0b19 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.hero .figure {
  position: absolute; z-index: 2; bottom: calc(var(--drop) * -1); left: 50%;
  transform: translateX(-50%);
  height: var(--fig-h);
  width: auto;
  -webkit-mask-image: none; mask-image: none;
}
.hero .figure img { height: 100%; width: auto; }
/* red rim light from the lettering behind him, and a softer red halo */
.hero .figure img.me { filter: drop-shadow(0 0 1.5px rgba(255, 86, 100, 0.9)) drop-shadow(0 0 26px rgba(225, 30, 55, 0.4)); }
/* contact shadow on the wet floor */
.hero .figure::before {
  content: ""; position: absolute; z-index: -1; left: 4%; right: 4%; bottom: -1.2%; height: 5.5%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.75), transparent 70%); filter: blur(4px);
}
/* his shadow on the lettering: a halftone dot print of his own silhouette, thrown to the right */
.hero .figure .cast, .hero .figure .bounce { position: absolute; inset: 0; pointer-events: none; }
.hero .figure .cast {
  transform: translate(11%, -2.5%) scale(1.03, 1.0); transform-origin: bottom center;
  background: rgba(14, 0, 6, 0.78); filter: blur(0.8px);
  /* three layers intersected: the dot grid, his silhouette, and "only below the top edge of the letters" */
  --cut: calc(var(--fig-h) - var(--drop) - var(--hero-fs) * 0.86 + 14px);
  -webkit-mask-image: radial-gradient(circle at center, #000 44%, transparent 47%), var(--me-src), linear-gradient(180deg, transparent var(--cut), #000 calc(var(--cut) + 18px));
  -webkit-mask-size: 6px 6px, 100% 100%, 100% 100%; -webkit-mask-repeat: repeat, no-repeat, no-repeat; -webkit-mask-composite: source-in, source-in;
  mask-image: radial-gradient(circle at center, #000 44%, transparent 47%), var(--me-src), linear-gradient(180deg, transparent var(--cut), #000 calc(var(--cut) + 18px));
  mask-size: 6px 6px, 100% 100%, 100% 100%; mask-repeat: repeat, no-repeat, no-repeat; mask-composite: intersect, intersect;
}
/* red light bouncing up from the floor onto his legs, strongest at the feet */
.hero .figure .bounce {
  background: linear-gradient(0deg, rgba(236, 40, 62, 0.62), rgba(236, 40, 62, 0.18) 38%, transparent 62%); mix-blend-mode: screen;
  -webkit-mask-image: var(--me-src); -webkit-mask-size: 100% 100%; mask-image: var(--me-src); mask-size: 100% 100%;
}
/* smoke drifting in front of his shins and feet: he stands in the room, not on a sticker */
.mist {
  position: absolute; z-index: 3; left: -12%; right: -12%; bottom: calc(var(--drop) * -1 - 3%); height: 34%; pointer-events: none;
  background:
    radial-gradient(38% 60% at 14% 70%, rgba(200, 44, 58, 0.5), transparent 70%),
    radial-gradient(34% 55% at 42% 80%, rgba(170, 30, 48, 0.42), transparent 70%),
    radial-gradient(40% 62% at 74% 72%, rgba(205, 48, 62, 0.46), transparent 70%),
    radial-gradient(30% 50% at 96% 80%, rgba(170, 30, 48, 0.4), transparent 70%);
  filter: blur(16px);
  -webkit-mask-image: linear-gradient(0deg, #000 15%, transparent 92%); mask-image: linear-gradient(0deg, #000 15%, transparent 92%);
  animation: mistDrift 16s ease-in-out infinite alternate;
}
@keyframes mistDrift { from { transform: translateX(-3.5%); } to { transform: translateX(3.5%); } }
@media (prefers-reduced-motion: reduce) { .mist { animation: none; } }

/* reflection in the wet floor */
.floor {
  position: absolute; left: 0; right: 0; top: 100%;
  height: 34vh;
  pointer-events: none;
  overflow: hidden;
}
.floor .reflect {
  position: absolute; left: 50%; top: 0;
  transform: translateX(-50%) scaleY(-1);
  transform-origin: center;
  width: 100%;
  display: grid; place-items: end center;
  opacity: 0.32;
  filter: blur(2px);
  -webkit-mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, transparent 65%);
  mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, transparent 65%);
}
.floor .reflect .name { filter: none; }
.floor .reflect .figure { position: static; transform: none; margin-bottom: var(--drop); }   /* his reflection starts at his feet, not at the letters' base */
.floor .glow {
  position: absolute; left: 50%; top: 0; width: 120vw; height: 100%;
  transform: translateX(-50%);
  background: radial-gradient(60% 55% at 50% 0%, rgba(195, 24, 46, 0.35), rgba(195, 24, 46, 0.08) 45%, transparent 70%);
}

.hero .backdrop {
  opacity: 0.85;
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 70%, transparent 100%);
}
.hero .backdrop::after { background: radial-gradient(70% 60% at 50% 55%, transparent 30%, rgba(10, 7, 8, 0.7) 100%); }

/* until the intro has chosen what to show first, the finished hero stays invisible (class removed by app.js) */
.hero.pre .inner, .hero.pre .markers, .hero.pre .fog { opacity: 0; }

/* intro film: sits over the still backdrop, fades out when it ends */
.hero-video {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 40%;
  opacity: 0; transition: opacity 1.1s ease; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 78%, transparent 100%);
}
.hero-video.on { opacity: 1; }
.hero:has(.hero-video.on) .markers { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .hero-video { display: none; } }

/* red fog */
.fog {
  position: absolute; z-index: 0; pointer-events: none;
  width: 60vw; height: 60vw; max-width: 900px; max-height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 64, 64, 0.28), rgba(195, 24, 46, 0.12) 40%, transparent 70%);
  filter: blur(40px);
  mix-blend-mode: screen;
  will-change: transform;
}
.fog.a { left: 10%; bottom: 10%; animation: fogA 22s ease-in-out infinite alternate; }
.fog.b { right: 8%; bottom: 20%; animation: fogB 27s ease-in-out infinite alternate; }
@keyframes fogA { from { transform: translate3d(-6%, 4%, 0) scale(1); } to { transform: translate3d(10%, -8%, 0) scale(1.18); } }
@keyframes fogB { from { transform: translate3d(8%, 6%, 0) scale(1.1); } to { transform: translate3d(-12%, -4%, 0) scale(0.92); } }

/* side markers */
.markers {
  position: absolute; top: 50%; z-index: 3;
  display: grid; gap: 14px;
  transform: translateY(-50%);
}
.markers.left { left: var(--gutter); }
.markers.right { right: var(--gutter); }
.markers i {
  width: 7px; height: 9px; display: block;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  opacity: 0.85;
}
.markers.left i { clip-path: polygon(0 0, 100% 50%, 0 100%); }
.markers.right i { clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.markers i:nth-child(1) { animation: blink 3.2s 0s ease-in-out infinite; }
.markers i:nth-child(2) { animation: blink 3.2s 0.25s ease-in-out infinite; }
.markers i:nth-child(3) { animation: blink 3.2s 0.5s ease-in-out infinite; }
.markers i:nth-child(4) { animation: blink 3.2s 0.75s ease-in-out infinite; }
.markers i:nth-child(5) { animation: blink 3.2s 1s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }

@media (max-width: 759px) {
  .markers { display: none; }
  .stage { --hero-fs: clamp(5.5rem, 40vw, 21rem); --fig-h: 38vh; }
  .hero .welcome { padding-bottom: 26vh; font-size: 0.78rem; letter-spacing: 0.3em; }
  .hero .welcome::before, .hero .welcome::after { display: none; }
  .fog { filter: blur(24px); animation: none !important; }
  .floor { height: 22vh; }
}

/* ═══════════════════════════ 02 journey ════════════════════════════ */
.journey > .inner { display: grid; grid-template-rows: auto auto auto; align-content: center; gap: 0.5rem; }
.journey .head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 2rem; }
.journey .head .display { font-size: clamp(1.4rem, 2.6vw, 2.2rem); max-width: 10ch; }
.journey .head .sub { text-align: right; }

.dial {
  position: relative;
  width: min(100%, calc(var(--dial-h, 44vh) * 16 / 9));
  margin-top: -9vh;      /* only the thin needle crosses the heading area */
  aspect-ratio: 16 / 9;
  margin: 0 auto;
}
.dial svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dial .ring { fill: none; stroke: var(--ink); stroke-opacity: 0.07; }
.dial .arc { fill: none; stroke: var(--line-2); stroke-width: 1.2; }
.dial .arc-lit { fill: none; stroke: var(--red); stroke-width: 1.6; filter: drop-shadow(0 0 6px rgba(255, 64, 64, 0.6)); }
.dial .tick { stroke: var(--ink-3); stroke-width: 1; }
.dial .needle { stroke: var(--ink); stroke-width: 1; stroke-opacity: 0.7; }
.dial .needle-lit { stroke: var(--red-glow); stroke-width: 2; filter: drop-shadow(0 0 8px rgba(255, 64, 64, 0.9)); }
.dial .bead { fill: #fff; filter: drop-shadow(0 0 10px rgba(255, 80, 80, 0.95)); }
.dial .year-label {
  font-family: var(--font-display); font-size: 30px; letter-spacing: 0.08em;
  fill: var(--ink-2); text-anchor: middle; transition: fill 0.4s;
}
.dial .year-label.on { fill: var(--ink); }
.dial .year-label.next { fill: var(--red); }

.jrow { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: clamp(0.5rem, 1vw, 0.9rem); align-items: start; margin-top: -4vh; }
.jrow .jcard { margin-top: calc(var(--drop, 0) * 2.2rem); }
.jcard {
  position: relative;
  padding: 0.8rem 0.9rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 13, 14, 0.9), rgba(10, 7, 8, 0.85));
  backdrop-filter: blur(6px);
  transition: border-color 0.5s, box-shadow 0.5s;
  will-change: transform, opacity;
}
.jcard::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: var(--red); transform: scaleX(0); transition: transform 0.5s var(--ease-out);
}
.jcard.on { border-color: var(--line-2); box-shadow: 0 30px 60px -30px rgba(195, 24, 46, 0.5); }
.jcard.on::before { transform: scaleX(1); }
.jcard .y { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; color: var(--ink); }
.jcard .t { margin-top: 0.3rem; font-size: 0.75rem; letter-spacing: 0.24em; text-transform: uppercase; font-weight: 600; color: var(--red-ink); }
.jcard ul { margin: 0.6rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.18rem; }
.jcard li { font-size: 0.75rem; color: var(--ink-2); line-height: 1.35; }
.jcard.next { border-color: rgba(195, 24, 46, 0.5); }

.dial .stagefloor {
  position: absolute; left: 50%; bottom: -6%; width: 46%; aspect-ratio: 5 / 1;
  transform: translateX(-50%);
  border: 1px solid var(--line); border-radius: 50%;
  pointer-events: none;
}
.dial .stagefloor::before {
  content: ""; position: absolute; inset: 22% 18%;
  border: 1px solid var(--line); border-radius: 50%;
}

/* phone: the arc stays as a picture, cards become a swipe row */
.journey .rail { display: none; }
@media (max-width: 959px) {
  .journey > .inner { grid-template-rows: auto auto auto; align-content: start; }
  .journey .head { grid-template-columns: 1fr; }
  .journey .head .sub { text-align: left; }
  .dial { --dial-h: 40vh; }
  .jrow, .dial .stagefloor { display: none; }
  .dial { margin-top: 0; }
  .dial .year-label { font-size: 56px; }
  .dial .tick { stroke-width: 2; }
  .dial .arc-lit { stroke-width: 3; }
  .dial .bead { r: 12; }
  .journey .rail {
    display: flex; gap: 0.8rem; overflow-x: auto; padding: 0.5rem 0 1rem;
    scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .journey .rail::-webkit-scrollbar { display: none; }
  .journey .rail .jcard { flex: 0 0 72%; scroll-snap-align: start; }
}

/* ═══════════════════════════ 03 skills ═════════════════════════════ */
.skills > .inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: stretch;
}
.skills .side { position: relative; display: grid; grid-template-rows: 1fr auto; }
.skills .side .figure { height: min(62vh, 560px); align-self: end; }
.skills .side .quote {
  position: relative; z-index: 2; align-self: end;
  padding-top: 1rem;
  font-family: var(--font-display); font-style: italic; font-size: clamp(1.1rem, 1.7vw, 1.5rem);
  color: var(--ink); line-height: 1.25;
}
.skills .side .quote small { display: block; margin-top: 0.5rem; }

.skills .main { display: grid; grid-template-rows: auto auto 1fr; gap: 1rem; }
.skills .main .display { font-size: clamp(2.6rem, 5.5vw, 4.6rem); letter-spacing: 0.1em; }
.skills > .inner:has(.side .figure[hidden]) { grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); }
.skills .side { align-content: end; }
.panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  align-content: start;
}
.panel {
  position: relative;
  padding: 0.7rem 0.9rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  will-change: transform, opacity;
}
.panel::before {
  content: ""; position: absolute; inset: -1px auto auto 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, var(--red), transparent 70%);
  opacity: 0; transition: opacity 0.4s;
}
.panel:hover::before { opacity: 1; }
.panel .ph { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; }
.panel .ph b { font-family: var(--font-display); font-weight: 500; font-size: 0.95rem; letter-spacing: 0.04em; white-space: nowrap; }
.panel .ph span { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.panel .tiles { margin-top: 0.6rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 0.55rem 0.3rem; justify-items: center; }
.tile {
  display: grid; justify-items: center; gap: 0.3rem;
  width: 100%; max-width: 84px;
  will-change: transform, opacity;
}
.tile .ic {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.04em; color: var(--ink-2);
}
.tile .ic img { width: 22px; height: 22px; opacity: 0.95; }
.tile small { font-size: 0.72rem; color: var(--ink-2); text-align: center; line-height: 1.25; letter-spacing: -0.01em; hyphens: manual; overflow-wrap: break-word; }

@media (max-width: 959px) {
  .skills > .inner, .skills > .inner:has(.side .figure[hidden]) { grid-template-columns: 1fr; }
  .skills .side { display: contents; }
  .skills .side .figure { order: 0; }
  .skills .main { order: 1; }
  .skills .side .quote { order: 2; padding-top: 1.5rem; }
  .skills .side { grid-template-rows: auto; }
  .skills .side .figure { height: 34vh; }
  .panels { grid-template-columns: 1fr; }
}

/* ═══════════════════════════ 04 experience ═════════════════════════ */
.experience > .inner {
  display: grid;
  grid-template-columns: minmax(0, 3.4fr) minmax(0, 3fr) minmax(0, 5.6fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: stretch;
}
.experience .lead { display: grid; align-content: space-between; gap: 2rem; }
.experience .lead .display { font-size: clamp(2rem, 3.6vw, 3.4rem); }
.experience .lead p { color: var(--ink-2); max-width: 36ch; font-size: 0.95rem; }
.experience .stats { display: grid; grid-template-columns: repeat(3, auto); gap: 1.5rem; justify-content: start; }
.experience .stats div b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 2rem; line-height: 1; }
.experience .stats div span { display: block; margin-top: 0.3rem; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }

.experience .figure { height: min(74vh, 640px); align-self: end; }

.timeline { position: relative; padding-left: 2.2rem; display: grid; gap: 0.6rem; align-content: center; }
.experience > .inner:has(.figure[hidden]) { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
.experience > .inner:has(.figure[hidden]) .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.experience > .inner:has(.figure[hidden]) .xcard:nth-child(even)::before { display: none; }
.timeline::before {
  content: ""; position: absolute; left: 0.5rem; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, var(--red), var(--line) 60%, transparent);
  transform-origin: top;
  transform: scaleY(var(--draw, 1));
}
.xcard {
  position: relative;
  padding: 0.65rem 0.9rem 0.75rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--glass);
  will-change: transform, opacity;
}
.xcard::before {
  content: ""; position: absolute; left: calc(-2.2rem + 0.5rem - 4px); top: 1.25rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--red);
  box-shadow: 0 0 10px rgba(255, 64, 64, 0.6);
}
.xcard .yr { position: absolute; right: 1rem; top: 0.8rem; font-family: var(--font-display); font-size: 0.95rem; color: var(--ink-3); letter-spacing: 0.06em; }
.xcard h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; letter-spacing: 0.02em; padding-right: 3.5rem; }
.xcard .org { margin-top: 0.15rem; font-size: 0.75rem; color: var(--red-ink); letter-spacing: 0.04em; }
.xcard p { margin-top: 0.35rem; font-size: 0.76rem; color: var(--ink-2); line-height: 1.4; }
.tags { margin-top: 0.45rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tags span {
  padding: 0.22rem 0.55rem; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
}

@media (max-width: 1099px) {
  .experience > .inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .experience .figure { display: none; }
}
@media (max-width: 759px) {
  .experience > .inner, .experience > .inner:has(.figure[hidden]) { grid-template-columns: 1fr; }
  .experience > .inner:has(.figure[hidden]) .timeline { grid-template-columns: 1fr; }
  .experience .stats { grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
}

/* ═══════════════════════════ 05 projects (holodeck) ════════════════ */
.projects { padding-left: 0; padding-right: 0; }
.projects > .inner { max-width: none; display: grid; grid-template-rows: auto 1fr; }
.projects .head { padding: 0 var(--gutter); display: flex; justify-content: space-between; align-items: end; gap: 2rem; }
.projects .head .display { font-size: clamp(1.4rem, 2.6vw, 2.2rem); }
.projects .head .sub { text-align: right; }

.deck {
  position: relative;
  min-height: 70vh;
  --u: min(1.3vmin, 0.5vw);    /* one deck unit, tied to both sides of the window */
  perspective: calc(300 * var(--u));
  perspective-origin: 50% 46%;
  display: grid; place-items: center;
}
.deck .floorglow {
  position: absolute; left: 50%; bottom: 0; width: 90vw; height: 42%;
  transform: translateX(-50%);
  background: radial-gradient(50% 70% at 50% 100%, rgba(255, 150, 90, 0.18), rgba(195, 24, 46, 0.08) 45%, transparent 75%);
  pointer-events: none;
}
.deck .rings {
  position: absolute; left: 50%; bottom: 3%; width: 60vw; max-width: 760px; aspect-ratio: 4 / 1;
  transform: translateX(-50%);
  border: 1px solid var(--line-2); border-radius: 50%;
  pointer-events: none;
}
.deck .rings::before, .deck .rings::after {
  content: ""; position: absolute; border: 1px solid var(--line); border-radius: 50%;
}
.deck .rings::before { inset: 18% 14%; }
.deck .rings::after { inset: 36% 30%; }

.deck .figure {
  position: absolute; left: 50%; bottom: 4%; height: 34%;
  transform: translateX(-50%);
  -webkit-mask-image: none; mask-image: none;
  z-index: 3;
}
.deck .figure img { height: 100%; width: auto; filter: brightness(0.35) contrast(1.2); }

.ringwrap { position: absolute; inset: 0; transform-style: preserve-3d; }
.ringscroll, .ring3d { position: absolute; inset: 0; transform-style: preserve-3d; }
.sc-in { position: absolute; inset: 0; display: block; overflow: hidden; will-change: transform, opacity; }
.sc-in::before {
  content: ""; position: absolute; inset: -40% -60%; z-index: 2; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.16) 50%, transparent 60%);
  transform: translateX(-70%);
  transition: transform 0.9s var(--ease-out);
}
@keyframes sheen { 0%, 70% { transform: translateX(-70%); } 100% { transform: translateX(70%); } }
/* the sheen crosses a screen once, when the hand reaches it, instead of looping on every screen forever */
.screen:hover .sc-in::before, .screen:focus-visible .sc-in::before { transform: translateX(70%); }

.screen {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--w, 52) * var(--u));
  margin-left: calc(var(--w, 52) * -0.5 * var(--u));
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
  background: #16100f;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.4s, border-color 0.4s;
  cursor: pointer;
  padding: 0; text-align: left;
  will-change: transform, opacity;
}
.screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.6s var(--ease-out), filter 0.4s; filter: saturate(0.85) brightness(0.92); }
.sc-in::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10, 7, 8, 0.85));
}
.screen .cap {
  position: absolute; left: 0.8rem; right: 0.8rem; bottom: 0.7rem; z-index: 1;
  display: grid; gap: 0.1rem;
}
.screen .cap b { font-family: var(--font-display); font-weight: 500; font-size: 1rem; letter-spacing: 0.02em; color: var(--ink); line-height: 1.1; }
.screen .cap span { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2); }
.screen:hover, .screen:focus-visible { border-color: var(--ink-2); box-shadow: 0 40px 80px -20px rgba(195, 24, 46, 0.45); }
.screen:hover img { transform: scale(1.04); filter: saturate(1) brightness(1); }

/* ── projects drum: the viewer stands inside a cylinder of screens; scroll turns it ── */
.deck { --u: min(1.02vh, 0.5vw); --r: calc(130 * var(--u)); perspective: calc(340 * var(--u)); perspective-origin: 50% 42%; }
.deck .ringwrap { transform: translateZ(var(--r)); }
.deck .screen {
  width: calc(48 * var(--u)); margin-left: calc(-24 * var(--u));
  transform: translateY(calc(-19 * var(--u))) rotateY(var(--a, 0deg)) translateZ(calc(var(--r) * -1));
  backface-visibility: hidden;                              /* the half of the drum behind the viewer is not drawn */
  filter: brightness(calc(0.35 + 0.65 * var(--f, 1)));      /* screens dim as they turn away */
}
.deck .sc-in::after { display: none; }                      /* no caption fade: the readout carries the words */
/* the readout: one typographic caption for whichever project faces the viewer */
.now { position: absolute; left: var(--gutter); bottom: 3%; z-index: 4; width: min(40vw, 560px); display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1.1rem; row-gap: 0.25rem; align-items: end; text-align: left; }
.now-kind, .now-title, .now-sum { grid-column: 2; }
.now > * { will-change: transform, opacity; }
.now-count { grid-row: 1 / span 3; align-self: center; display: grid; justify-items: start; gap: 0.3rem; overflow: clip; }
.now-n { font-family: var(--font-hero); font-weight: 400; font-size: clamp(2.6rem, 5vw, 4.4rem); line-height: 0.9; color: var(--red); display: inline-block; }
.now-count small { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.24em; color: var(--ink-2); }
.now-kind { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-2); }
.now-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.3rem, 2.2vw, 1.9rem); line-height: 1.05; color: var(--ink); text-wrap: balance; }
.now-sum { font-size: 0.82rem; line-height: 1.4; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.now-side { position: absolute; right: var(--gutter); bottom: 3%; z-index: 4; display: grid; justify-items: end; gap: 1rem; }
.now-go {
  padding: 0.75rem 1.3rem; border: 1px solid var(--red); border-radius: var(--radius); background: var(--red); color: #fff;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; transition: transform 0.2s;
}
.now-go:hover { transform: translateY(-2px); }
.now-go:active { transform: scale(0.98); }
.ticks { display: flex; gap: 6px; align-items: center; }
.ticks i { width: 16px; height: 2px; background: var(--line-2); transition: width 0.4s var(--ease-out), background-color 0.3s; }
.ticks i.on { width: 38px; background: var(--red); }

.projects .rail { display: none; }
@media (max-width: 959px) {
  /* phones: the same pinned drum as desktop, sized to the screen's width; the readout sits under it */
  .projects .head { flex-direction: column; align-items: flex-start; }
  .projects .head .sub { text-align: left; }
  .projects > .inner { grid-template-rows: auto 1fr; }
  .deck { --u: min(1.7vw, 1.15vh); --r: calc(92 * var(--u)); perspective: calc(250 * var(--u)); perspective-origin: 50% 27%; min-height: 0; }
  .deck .ringwrap { inset: 0 0 46% 0; }
  .deck .screen { width: calc(46 * var(--u)); margin-left: calc(-23 * var(--u)); transform: translateY(calc(-11 * var(--u))) rotateY(var(--a, 0deg)) translateZ(calc(var(--r) * -1)); }
  .now { left: var(--gutter); right: var(--gutter); bottom: 20%; width: auto; }
  .now-sum { font-size: 0.9rem; }
  .now-side { left: var(--gutter); right: var(--gutter); bottom: 4%; display: flex; justify-content: space-between; align-items: center; }
  .now-go { min-height: 44px; font-size: 0.8rem; padding: 0.75rem 1.4rem; }
  .now-kind, .now-count small { font-size: 0.8rem; }
}
@media (max-width: 959px) and (prefers-reduced-motion: reduce) {
  /* no scroll-driven drum when motion is reduced: the screens become a plain swipe row */
  .deck { display: none; }
  .projects .rail {
    display: flex; gap: 0.9rem; overflow-x: auto; padding: 1.5rem var(--gutter) 1rem; align-self: center; align-items: flex-start;
    scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .projects .rail::-webkit-scrollbar { display: none; }
  .projects .rail .screen { position: static; margin: 0; flex: 0 0 82%; width: auto; transform: none; scroll-snap-align: center; }
}

/* ═══════════════════════════ 06 certifications (the wall) ══════════ */
.certs > .inner {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}
.certs .lead { display: grid; grid-template-rows: auto auto 1fr; gap: 1.2rem; }
.certs .lead .display { font-size: clamp(2.2rem, 4.2vw, 4rem); }
.certs .lead .figure { height: min(50vh, 460px); align-self: end; }

.wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.7rem, 1.3vw, 1.1rem);
  align-content: center;
}
.frame {
  position: relative;
  padding: 0; text-align: left;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: #0d0909;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.9);
  transition: transform 0.5s var(--ease-out), border-color 0.4s;
  will-change: transform, opacity;
}
.frame .lamp {
  position: absolute; left: 20%; right: 20%; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 220, 180, 0.9), transparent);
  pointer-events: none;
}
.frame .cone {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(90% 70% at 50% -10%, rgba(255, 214, 170, 0.28), transparent 60%);
  opacity: 0.6; transition: opacity 0.4s;
}
.frame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; filter: brightness(0.82) saturate(0.9); transition: filter 0.4s; }
.frame .meta { padding: 0.45rem 0.65rem 0.5rem; border-top: 1px solid var(--line); }
.frame .meta b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-family: var(--font-display); font-weight: 500; font-size: 0.78rem; overflow: hidden; letter-spacing: 0.02em; line-height: 1.2; }   /* two lines: the longer titles (Agentic AI Certified Foundations Associate) read in full */
.frame .meta span { display: block; margin-top: 0.15rem; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.frame:hover, .frame:focus-visible { transform: translateY(-6px); border-color: rgba(255, 220, 180, 0.5); }
.frame:hover .cone { opacity: 1; }
.frame:hover img { filter: brightness(1) saturate(1); }

@media (min-width: 1100px) {
  .wall { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.8rem; }
  .certs > .inner { grid-template-columns: minmax(0, 3.2fr) minmax(0, 8.8fr); }
}
@media (max-width: 959px) {
  .certs > .inner { grid-template-columns: 1fr; }
  .certs .lead .figure { display: none; }
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ═══════════════════════════ 07 contact ════════════════════════════ */
.contact > .inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(1.5rem, 4vw, 5rem);
  align-items: end;
}
.contact .figure { height: min(78vh, 680px); }
.contact .main { display: grid; gap: 1.8rem; padding-bottom: 4vh; }
.contact > .inner:has(.figure[hidden]) { grid-template-columns: 1fr; }
.contact > .inner:has(.figure[hidden]) .main { max-width: 820px; }
.contact .display { font-size: clamp(3rem, 7vw, 6.4rem); }
.contact .cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.ccard {
  position: relative; overflow: hidden;
  display: grid; gap: 0.25rem; align-content: start;
  padding: 1rem 1rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--glass);
  transition: border-color 0.4s, transform 0.4s var(--ease-out);
  will-change: transform, opacity;
}
.ccard::after {
  content: "\2197"; position: absolute; right: 0.8rem; bottom: 0.7rem;
  font-size: 0.8rem; color: var(--ink-3); transition: color 0.3s, transform 0.3s;
}
.ccard .l { font-family: var(--font-display); font-weight: 500; font-size: 1.1rem; letter-spacing: 0.03em; }
.ccard .v { font-size: 0.75rem; color: var(--ink-2); overflow-wrap: anywhere; padding-right: 1.2rem; }
.ccard:hover { border-color: var(--line-2); transform: translateY(-3px); }
.ccard:hover::after { color: var(--red); transform: translate(2px, -2px); }
.contact .open { color: var(--ink-2); font-size: 0.92rem; max-width: 50ch; }
.contact .links { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.contact .links a { font-size: 0.75rem; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line-2); padding-bottom: 0.25rem; transition: color 0.3s, border-color 0.3s; }
.contact .links a:hover { color: var(--ink); border-color: var(--red); }
.contact .foot { font-size: 0.75rem; color: var(--ink-3); max-width: 60ch; }

@media (max-width: 959px) {
  .contact > .inner { grid-template-columns: 1fr; }
  .contact .figure { height: 36vh; }
  .contact .cards { grid-template-columns: 1fr; }
}

/* ═══════════════════════════ modal ═════════════════════════════════ */
dialog.modal {
  width: min(92vw, 1040px);
  max-height: 88dvh;
  padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--bg-2); color: var(--ink);
  overflow: auto;
}
dialog.modal::backdrop { background: rgba(5, 3, 4, 0.78); backdrop-filter: blur(6px); }
.modal .top { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1.2rem; background: rgba(19, 12, 13, 0.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.modal .top .caps { color: var(--ink-3); }
.modal .close { padding: 0.45rem 0.8rem; border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 0.75rem; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 600; }
.modal .close:hover { border-color: var(--ink-2); }
.modal .body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.6rem; padding: 1.4rem; }
.modal .body.single { grid-template-columns: 1fr; }
.modal .shot { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #000; align-self: start; }
.modal .shot img { width: 100%; height: auto; }
/* a project shown by its number instead of a screenshot (same 16:10 frame as the shots) */
.fig-shot { display: flex; flex-direction: column; justify-content: space-between; width: 100%; height: 100%; aspect-ratio: 16 / 10; padding: 7%; background: radial-gradient(90% 90% at 0% 0%, rgba(195, 24, 46, 0.45), transparent 62%), #0d0a0b; color: var(--ink); text-align: left; }
.fig-shot b { font: 400 clamp(2.4rem, 9vw, 7rem)/0.86 var(--font-hero); letter-spacing: 0.01em; }
.screen .fig-shot { aspect-ratio: auto; }
.screen .fig-shot b { font-size: clamp(2rem, 5vw, 5.5rem); }
.fig-shot span { max-width: 24ch; font-size: clamp(0.75rem, 1vw, 0.95rem); line-height: 1.35; color: rgba(243, 235, 228, 0.78); }
.modal h3 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.5rem, 3vw, 2.4rem); line-height: 1.05; letter-spacing: 0.02em; }
.modal .kind { margin-top: 0.3rem; font-size: 0.75rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--red-ink); font-weight: 600; }
.modal p { margin-top: 0.8rem; color: var(--ink-2); font-size: 0.9rem; line-height: 1.55; }
.modal .mstats { margin-top: 1rem; display: flex; gap: 1.4rem; flex-wrap: wrap; }
.modal .mstats div b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; line-height: 1; }
.modal .mstats div span { display: block; margin-top: 0.2rem; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.modal .tags { margin-top: 1rem; }
.modal .go { display: inline-block; margin-top: 1.4rem; padding: 0.7rem 1.1rem; border: 1px solid var(--red); border-radius: var(--radius); background: var(--red); color: #fff; font-size: 0.75rem; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 700; transition: transform 0.2s; }
.modal .go:hover { transform: translateY(-1px); }
.modal .go:active { transform: scale(0.98); }
@media (max-width: 759px) { .modal .body { grid-template-columns: 1fr; } }

/* ═══════════════════════════ reduced motion ════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fog.a, .fog.b, .markers i, .ringwrap, .sc-in::before { animation: none; }
  .spot { display: none; }
  .sound[aria-pressed="true"] .eq i { transform: scaleY(0.6); }
  .markers i { opacity: 0.6; }
  * { transition-duration: 0.01ms !important; }
}

/* ═══════════════════════════ phone readability + tap sizes ═════════ */
@media (max-width: 759px) {
  .caps, .modal .top .caps { font-size: 0.8rem; }
  .sound { top: max(0.9rem, env(safe-area-inset-top)); right: var(--gutter); }
  .sound.cued { width: 58px; padding: 0; }
  .sound-cue { top: calc(max(0.9rem, env(safe-area-inset-top)) + 22px); }
  .jcard .t { font-size: 0.8rem; }
  .jcard li { font-size: 0.86rem; }
  .jcard .y { font-size: 1.8rem; }
  .panel .ph span { font-size: 0.78rem; white-space: normal; text-align: right; }
  .tile { width: 66px; }
  .tile .ic { width: 40px; height: 40px; }
  .tile small { font-size: 0.8rem; }
  .tags span { font-size: 0.78rem; padding: 0.3rem 0.6rem; }
  .xcard .org { font-size: 0.82rem; }
  .xcard p { font-size: 0.9rem; }
  .xcard .yr { font-size: 1rem; }
  .experience .stats div span { font-size: 0.78rem; }
  .screen .cap b { font-size: 1.1rem; }
  .screen .cap span { font-size: 0.78rem; }
  .frame .meta b { font-size: 0.86rem; white-space: normal; }
  .frame .meta span { font-size: 0.78rem; }
  .ccard .v { font-size: 0.88rem; }
  .ccard { min-height: 64px; }
  .contact .links { gap: 0.4rem 1.2rem; }
  .contact .links a { font-size: 0.8rem; padding: 0.75rem 0; }
  .contact .foot { font-size: 0.8rem; }
  .modal .close { padding: 0.75rem 1rem; font-size: 0.75rem; min-height: 44px; }
  .modal .mstats div span { font-size: 0.78rem; }
  .modal .kind { font-size: 0.8rem; }
  .modal p { font-size: 0.95rem; }
  .sub { font-size: 1.1rem; }
}

/* ── keyboard and touch (2026-10-23 audit) ───────────────────────────── */
.journey .rail:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
/* on touch the nav links are text-height: grow the target without growing the bar */
@media (pointer: coarse) {
  .bar nav a::before { content: ""; position: absolute; inset: -8px -6px; }
}

/* tablet and small laptop: the 12px labels need the whole bar, so the brand sits left, the links right, and the dots (a duplicate of the links) step aside */
@media (min-width: 760px) and (max-width: 1100px) {
  .bar { grid-template-columns: auto 1fr; column-gap: 1.5rem; }
  .bar .dots { display: none; }
  .bar nav { justify-content: flex-end; gap: 1rem; }
  .bar nav a { letter-spacing: 0.14em; }
}

/* ── performance on phones (2026-10-23) ────────────────────────────────────────────────────── */
/* a scene that is not on screen does not animate (JS toggles .live; see initMotion) */
.scene:not(.live), .scene:not(.live) *, .scene:not(.live) *::before, .scene:not(.live) *::after { animation-play-state: paused !important; }
/* backdrop-filter re-blurs everything behind it on every scroll frame; on a touch screen the glass is a more opaque fill instead */
@media (pointer: coarse) {
  .bar { backdrop-filter: none; background: linear-gradient(180deg, rgba(10, 7, 8, 0.82) 0%, rgba(10, 7, 8, 0.96) 40%); }
  .jcard { backdrop-filter: none; }
  /* the drum: no glint sliding across eight screens at once and no extra compositing layer per screen (each cost style work on every frame under a finger) */
  .sc-in { will-change: auto; }
  .sc-in::before { display: none; }
  /* scroll tweens write transform on these every frame; a CSS transition on transform made each write restart a half-second ease (a visible lag and an animation per frame) */
  .frame, .ccard { transition: border-color 0.4s; }
}

/* ── phone journey, the deck (2026-10-23: "more animation and design on mobile") ───────────────────────────────────
   Pinned on a phone the cards no longer sit in a row with empty screen under them. The arc is drawn larger, one big card is
   in front, two ghost cards show the years still to come, and a red light slides along with the needle. Only transform and
   opacity move. (A phone too short for the scene, or reduced motion, keeps the swipe row above.) */
.journey .reel-glow { display: none; }
@media (max-width: 959px) {
  .journey.is-reel > .inner { position: relative; grid-template-rows: auto auto minmax(0, 1fr); align-content: start; padding-bottom: calc(var(--bar-h) + 0.6rem); }
  .journey.is-reel .head .display { max-width: 16ch; }
  .journey.is-reel .dial { margin-top: 0.4rem; }
  .journey.is-reel .dial svg { transform: scale(1.26); transform-origin: 50% 62%; }
  .journey.is-reel .reel-glow {
    display: block; position: absolute; left: -35%; width: 170%; bottom: 4%; aspect-ratio: 1; z-index: 0; pointer-events: none;
    background: radial-gradient(closest-side, rgba(195, 24, 46, 0.26), rgba(195, 24, 46, 0.07) 55%, transparent 72%);
  }
  .journey.is-reel .head, .journey.is-reel .dial { position: relative; z-index: 1; }
  .journey.is-reel .rail {
    position: relative; z-index: 1; display: block; overflow: visible; padding: 0; margin: 1.6rem 0.1rem 0;
    height: clamp(15rem, 35vh, 19.5rem); scroll-snap-type: none;
  }
  .journey.is-reel .rail::before, .journey.is-reel .rail::after {
    content: ""; position: absolute; inset: 0; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(20, 13, 14, 0.55);
  }
  .journey.is-reel .rail::before { transform: translateY(0.9rem) scale(0.95); opacity: 0.75; }
  .journey.is-reel .rail::after { transform: translateY(1.7rem) scale(0.9); opacity: 0.4; z-index: -1; }
  .journey.is-reel .rail .jcard { position: absolute; inset: 0; flex: none; z-index: 1; padding: 1.2rem 1.3rem 1.3rem; }
  .journey.is-reel .rail .jcard::after {
    content: attr(data-n); position: absolute; right: 1.3rem; top: 1.35rem; font-size: 0.75rem; letter-spacing: 0.22em; color: var(--ink-3); font-variant-numeric: tabular-nums;
  }
  .journey.is-reel .jcard .y { font-size: clamp(3rem, 15vw, 3.8rem); letter-spacing: -0.01em; }
  .journey.is-reel .jcard .t { margin-top: 0.6rem; font-size: 0.8rem; }
  .journey.is-reel .jcard ul { margin-top: 0.9rem; gap: 0.35rem; }
  .journey.is-reel .jcard li { font-size: 0.95rem; line-height: 1.4; }
  .journey.is-reel .jcard li::before { content: ""; display: inline-block; width: 0.35rem; height: 1px; margin: 0 0.5rem 0.28em 0; background: var(--red-ink); }
  /* the pinned deck must fit the SMALL viewport (browser bar showing): sizes follow svh, not the tallest screen */
  .journey.is-reel { padding-top: clamp(3rem, 7svh, 4.5rem); padding-bottom: 0; }
  .journey.is-reel .dial { --dial-h: min(40vh, 30svh); }
  .journey.is-reel .rail { height: clamp(12rem, 31svh, 19.5rem); margin-top: clamp(0.8rem, 2.5svh, 1.6rem); }
  .journey.is-reel .jcard .y { font-size: clamp(2.4rem, 7.5svh, 3.8rem); }
}

@media (max-width: 959px) and (max-height: 720px) {
  /* short phones: tighter card text so the whole scene stays on one screen */
  .journey.is-reel .jcard { padding: 0.9rem 1.1rem 1rem; }
  .journey.is-reel .jcard ul { margin-top: 0.5rem; gap: 0.2rem; }
  .journey.is-reel .jcard li { font-size: 0.85rem; line-height: 1.35; }
  .journey.is-reel .head .sub { display: none; }
}

/* ── Sound on: the restart curtain, and the button stepping aside off the hero (2026-10-24) ── */
.snd-curtain { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: #050304; opacity: 0; visibility: hidden; transition: opacity 0.38s ease, visibility 0s linear 0.38s; }
.snd-curtain.on { opacity: 1; visibility: visible; transition: opacity 0.38s ease, visibility 0s; }
.snd-curtain:not(.on) { transition-duration: 0.9s, 0s; transition-delay: 0s, 0.9s; }
.snd-curtain .eq { display: inline-flex; align-items: flex-end; gap: 5px; height: 34px; }
.snd-curtain .eq i { width: 4px; height: 100%; background: var(--red-ink); border-radius: 2px; transform-origin: bottom; animation: eq 0.474s ease-in-out infinite alternate; }
.snd-curtain .eq i:nth-child(2) { animation-delay: -0.12s; } .snd-curtain .eq i:nth-child(3) { animation-delay: -0.24s; }
.snd-curtain .eq i:nth-child(4) { animation-delay: -0.36s; } .snd-curtain .eq i:nth-child(5) { animation-delay: -0.06s; }
@keyframes eq { from { transform: scaleY(0.2); } to { transform: scaleY(1); } }
.sound { transition: opacity 0.5s ease, transform 0.5s var(--ease-out), visibility 0s, color 0.3s, border-color 0.3s; }
.sound.away {
  opacity: 0.62;
  transform: translateY(-2px);
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.5s ease, transform 0.5s var(--ease-out), color 0.3s, border-color 0.3s;
}

/* press feedback: every control gives a little under the finger (2026-10-24 motion pass) */
/* .screen is left out on purpose: the projects drum sets its 3D transform on .deck .screen, a press would overwrite it */
.sound:active, .bar nav a:active, .ccard:active, .frame:active { transform: scale(0.97); transition-duration: 0.08s; }
@media (prefers-reduced-motion: reduce) { .sound:active, .bar nav a:active, .ccard:active, .frame:active { transform: none; } }
