.skip-link {
  position: absolute; left: 0; top: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent); color: var(--color-accent-ink);
  font-weight: 600; border-radius: 0 0 var(--radius-md) 0;
  transform: translateY(-110%); transition: transform .15s ease-out;
  z-index: 100;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  z-index: 20;
}
.site-header .brand {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.25rem, 0.6vw + 1rem, 1.75rem);
  line-height: 1; letter-spacing: -0.02em; text-decoration: none;
  color: #00ff37;
  display: inline-flex; align-items: center;
}
/* Figure mark: the artwork is already the brand green with a transparent
   ground, so it needs no tinting - just a height to sit on the header row. */
.brand__mark {
  display: block; width: auto;
  height: clamp(2.75rem, 1.8vw + 1.9rem, 3.5rem);
}
/* Nav is dead-centered in the header regardless of the brand / controls widths
   on either side, so it stays optically centered as those flex items change. */
.site-header nav {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
.site-header nav ul {
  display: flex;
  gap: clamp(var(--space-5), 3vw, var(--space-7));
}
.site-header nav a {
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;                  /* Switzer Medium */
  font-size: clamp(1.125rem, 0.9vw + 0.85rem, 1.75rem); /* up to 28px */
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #00ff37;
  display: inline-flex; align-items: center;
  transition: opacity .15s ease;
}
.site-header nav a:hover { opacity: 0.7; }

/* Below laptop size: stack the fixed header into four centered rows —
   row 1 brand, row 2 nav links, row 3 language picker, row 4 sound + light. */
@media (max-width: 1024px) {
  .site-header {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
  }
  .site-header nav {                 /* drop the absolute centering — flow as row 2 */
    position: static; transform: none;
  }
  .site-header__controls { flex-wrap: wrap; justify-content: center; }
  .site-header__controls .lang-picker {
    flex-basis: 100%;                /* language on its own row, toggles wrap below */
    justify-content: center;
  }
  /* No hover on touch/tablet — kill the sound + light tooltips entirely. */
  .site-header .nav-tooltip { display: none; }
}

main > section {
  padding-block: var(--space-8);
  padding-inline: clamp(var(--space-5), 6vw, var(--space-8));
  max-width: 96rem; margin-inline: auto;
}

.hero { position: relative; padding: 0; max-width: none; }
.hero__stage {
  position: relative;
  height: 90vh; height: 90svh;
  width: 100%;
  overflow: hidden;
  /* Poster still of the water scene painted BEHIND the canvas so the hero reads
     as the finished scene from first paint, not a flat fill. The canvas fades
     up over it once warmed (see scene.js), so the poster must live on the stage
     — not the canvas — or fading the canvas would hide the poster too. Deep
     water blue (≈ the shader's uBgFill) is the fallback while the poster
     decodes. Same image the reduced-motion path shows. */
  background: #0307bc url('/assets/PNGPNG.webp') center / cover no-repeat;
  isolation: isolate;
}
.hero__stage canvas,
.hero__stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* Canvas starts invisible (poster shows through) and is faded in by scene.js
   only after shaders compile + textures decode + one finished frame is drawn,
   so no cold warmup or placeholder frame is ever visible. */
.hero__stage canvas {
  opacity: 0;
  transition: opacity 450ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .hero__stage canvas { transition: none; }
}
/* Soft white "shoreline" glow where the hero meets the water band below. */
.hero__stage::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: clamp(3rem, 10vh, 7rem);
  background: linear-gradient(to top, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.10) 50%, transparent);
  pointer-events: none;
}
.hero__title {
  position: absolute; left: clamp(var(--space-5), 6vw, var(--space-8));
  bottom: clamp(var(--space-5), 6vw, var(--space-8));
  font-family: var(--font-display);
  font-size: var(--fs-h);
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -0.05em;
  color: var(--color-text);

  margin: 0;
  z-index: 1;
}

/* ---------- Welcome marquee (fills the ~10vh gap under the hero) ---------- */
.marquee {
  position: relative;
  padding: 0; max-width: none;
  height: 10vh; height: 10svh;
  overflow: hidden;
  display: flex; align-items: center;
}
.marquee::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 60%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.10) 50%, transparent);
  pointer-events: none;
  z-index: -1;
}
.marquee:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -4px;
}
.marquee__inner {
  --reveal: 100%;
  width: 100%;
  white-space: nowrap;
  /* soft rippled edges + entrance "water line" reveal from the bottom */
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 8%, #000 92%, transparent),
    linear-gradient(to top, #000 var(--reveal), transparent var(--reveal));
  mask-image:
    linear-gradient(to right, transparent, #000 8%, #000 92%, transparent),
    linear-gradient(to top, #000 var(--reveal), transparent var(--reveal));
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.marquee__track { display: inline-flex; will-change: transform; }
.marquee__group { display: inline-flex; align-items: center; }
.marquee__phrase {
  font-family: var(--font-display);
  font-weight: 500;                /* Switzer Medium */
  font-size: var(--fs-about);      /* matches the About copy */
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #fff;
}
.marquee__sep {
  flex: none;
  width: 0; height: 0;
  margin-inline: var(--space-5);
}

/* Copy block per the design spec: 900px measure, Switzer Semibold, 28/47
   taken down 10% (--fs-about) at Switzer Medium, centered, uppercase. --about-line is 47/28, so one empty line
   is exactly calc(var(--about-line) * 1em). */
.about { text-align: center; }
/* .about__intro is an h1 for semantics only — browsers default h1 to 2em bold,
   so it shares every type value with the paragraphs. .contact__lead rides along
   because the design wants it identical to the About copy. */
.about__intro,
.about__lead,
.contact__lead {
  max-width: 900px;
  margin-inline: auto;
  font-family: var(--font-sans);
  font-weight: 500;                              /* Switzer Medium */
  font-size: calc(var(--fs-about) * 0.9);        /* 10% under the marquee size */
  line-height: var(--about-line);
  letter-spacing: 0;
  text-transform: uppercase;
  color: #fff;
}
/* The design keeps every line on pure line-height flow, with a single empty
   line before the closing two lines. */
.about__lead:last-child { margin-top: calc(var(--about-line) * 1em); }
/* The copy's line breaks are part of the design, so the two long paragraphs
   carry hard breaks instead of wrapping wherever the measure happens to run
   out. Below 1024px the measure is too narrow to honour them - the break is
   switched off and the copy wraps naturally. The space that sets the two
   halves apart then sits after the <br>, where a forced break swallows it. */
.about__br { display: none; }
@media (min-width: 1025px) {
  .about__br { display: inline; }
}

.about__title, .works__title, .contact__title {
  font-family: var(--font-display);
  font-size: var(--fs-h);
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -0.05em;
  margin-bottom: var(--title-gap);
}
/* Same stacked-green treatment as .works__title / .contact__title. */
.about__title {
  color: #00ff37;
  width: min-content;
  line-height: 0.5;
  margin-inline: auto;
  text-align: center;
}

/* ---------- Selected works (pinned diagonal gallery) ---------- */
.works {
  position: relative;
  padding: 0;
  max-width: none;
  /* Tunable knobs (overridden live by the lil-gui dev panel; final values baked here). */
  --card-h: clamp(16rem, 34vh, 30rem);     /* fluid card height (desktop ≥768 only); width follows 3:2 */
  --card-w: calc(var(--card-h) * 3 / 2);   /* 3:2 landscape */
  --works-gap: 0;
  --works-tilt: 0deg;
  --row1-x: 8.75rem;                       /* per-row horizontal offset (the brick stagger) */
  --row2-x: -7rem;
  --row3-x: -0.75rem;
}
.works__stage {
  position: relative;
  height: 100vh; height: 100svh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}
/* Hover-ripple overlay. Sits BEHIND the tiles (negative z inside the stage's
   isolated stacking context). When JS adds .works--webgl the DOM thumbnails go
   transparent, so this canvas shows the rippling images in their rects while the
   caption text / borders stay crisp DOM on top. pointer-events stay on the tiles. */
.works__canvas {
  position: absolute;
  inset: 0;
  width: 100%;          /* canvas is a replaced element: inset:0 alone won't */
  height: 100%;         /* stretch it — it keeps its intrinsic 300x150 size  */
  z-index: -1;
  pointer-events: none;
}
.works--webgl .work-tile { background: transparent; }
.works--webgl .work-tile__media { opacity: 0; }

.works__title {
  position: absolute;
  top: clamp(var(--space-6), 9vh, var(--space-8));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  text-align: center;
  color: #00ff37;
  width: min-content;          /* box shrinks to widest word -> one word per row */
  line-height: 0.5;         /* tightened so the stacked words overlap a touch */
  pointer-events: none;
}
/* The slider is what GSAP moves — a pure horizontal (screen-space) translate, so the
   tilted track inside slides left/right without ever drifting off-screen vertically. */
.works__slider { will-change: transform; }
.works__track {
  display: grid;
  grid-auto-flow: column;                       /* fill column-by-column over 3 rows */
  grid-template-rows: repeat(3, var(--card-h));
  grid-auto-columns: var(--card-w);
  gap: var(--works-gap);
  rotate: var(--works-tilt);                    /* tilt lives here, inside the slider */
}
.works__item { list-style: none; }
/* Per-row horizontal stagger (brick offset). Rows cycle 1,2,3 down each column. */
.works__item:nth-child(3n + 1) { transform: translateX(var(--row1-x)); }
.works__item:nth-child(3n + 2) { transform: translateX(var(--row2-x)); }
.works__item:nth-child(3n)     { transform: translateX(var(--row3-x)); }

.work-tile {
  position: relative;
  display: block;
  width: 100%; height: 100%;
  padding: 0;
  color: inherit;
  background: var(--color-surface);
  border: 0;                 /* the artwork runs edge to edge - no outline */
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}
.work-tile__media {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.9);
  transition: transform .4s ease, filter .3s ease;
}
.work-tile:hover .work-tile__media,
.work-tile:focus-visible .work-tile__media { transform: scale(1.05); filter: saturate(1.05); }
.work-tile__overlay {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  display: grid;
  gap: var(--space-1);
  padding: var(--space-6) var(--space-4) var(--space-3);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.work-tile:hover .work-tile__overlay,
.work-tile:focus-visible .work-tile__overlay { opacity: 1; transform: none; }
.work-tile__label {
  font-family: var(--font-display);
  font-size: var(--fs-2);
  line-height: 1.1;
  color: #fff;
}
.work-tile__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Static fallback: reduced motion or narrow viewports (no pin / no scrub) */
.works--static .works__stage {
  height: auto;
  overflow: visible;
  display: block;
  padding-block: var(--space-8);
  padding-inline: clamp(var(--space-5), 6vw, var(--space-8));
}
.works--static .works__title {
  position: static;
  transform: none;
  text-align: left;
}
.works--static .works__track {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  grid-auto-columns: auto;
  grid-template-rows: none;
  rotate: none;
}
.works--static .works__item { transform: none; }
/* Mobile shows one tile per project. The desktop brick wall's decorative duplicates
   are the aria-hidden tiles (top/bottom rows), so hide exactly those — what's left is
   the middle row's six unique works: v3 · eug · aleva · dearfuture · chudo · last day on earth. */
.works--static .works__item[aria-hidden="true"] { display: none; }
.works--static .work-tile { aspect-ratio: 3 / 2; height: auto; }
/* No hover on touch — keep labels readable in the static layout. */
.works--static .work-tile__overlay { opacity: 1; transform: none; }

/* The section spans the full content width so the swimmer "pool" is wide; the
   form column itself stays at its old 44rem, centred. (Was: .contact capped at
   44rem, which made the whole section a narrow column.) */
.contact { position: relative; }
/* Form content sits IN FRONT of the swimmers. The form has no background of its
   own, so the only things that occlude the scene behind it are the input boxes
   (var(--color-surface)) — swimmers show through every other gap. */
.contact__title,
.contact__lead,
.inquiry,
.hire {
  position: relative;
  z-index: 1;
}
/* .hire: the Upwork CTA that replaces the form on NO_CONTACT_HOSTS. */
.inquiry, .hire { max-width: 44rem; margin-inline: auto; }
/* Swimmer "pool" canvas: full viewport width (breaks out of the section's
   max-width), section-bound vertically, BEHIND the form content, and never
   eats pointer events so the form stays fully usable. max-width:none undoes
   the reset.css canvas cap; html has overflow-x:clip for the 100vw overhang. */
.contact__burst {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  max-width: none;
  pointer-events: none;
  z-index: 0;
}
/* Same stacked-green treatment as .works__title: width:min-content puts each
   space-separated token on its own row, line-height tightens the stack. The
   locale strings use a non-breaking space to group the opening words so the
   break lands where we want (e.g. "Get in" / "touch"). */
.contact__title {
  color: #00ff37;
  width: min-content;
  line-height: 0.5;
  margin-inline: auto;     /* min-content box is narrow — center it in the section */
  text-align: center;
}
.contact__lead {
  text-align: center;
  margin-bottom: var(--space-6);
}

/* Dark is the default here so the sheet is right before the theme
   attribute lands; the light override sits below. */
.site-footer {
  --footer-fill: #000;
  position: relative;
  margin-top: clamp(4rem, 10vw, 8rem);
  padding: 0 clamp(var(--space-5), 6vw, var(--space-8));
  color: #fff;
  font-size: var(--fs-0);
  font-weight: 400;
  min-height: clamp(180px, 28vw, 320px);
}
.site-footer__curve {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  overflow: visible;
}
.site-footer__curve path { fill: var(--footer-fill); }
.site-footer__inner {
  position: relative;
  z-index: 1;
  padding: clamp(5rem, 12vw, 8rem) 0 clamp(2rem, 4vw, 3rem);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--space-4);
}
.site-footer__links { display: flex; gap: var(--space-5); }
.site-footer a {
  color: inherit;
  min-height: 24px; display: inline-flex; align-items: center;
  padding: var(--space-1) var(--space-2);
}

/* Light mode: white footer sheet, black ink. */
:root[data-theme="light"] .site-footer {
  --footer-fill: #fff;
  color: #020202;
}
