/* ==========================================================================
   Tokens
   ========================================================================== */
/* Inter, self-hosted so every device shows the same type. One variable file covers all weights.
   License: fonts/Inter-LICENSE.txt */
@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0d0d0d;
  --paper: #ffffff;
  --paper-tint: #f5f5f4;   /* very light gray, for contrast (home hero) */
  --body: #3d3d42;    /* all paragraph copy */
  --muted: #6e6e73;   /* labels: numbers, years, small captions */
  --muted-dark: #a1a1a6;
  --line: rgba(0, 0, 0, 0.1);
  --line-dark: rgba(255, 255, 255, 0.16);
  --accent: #8fd3ff;
  --radius: 14px;
  --gutter: clamp(20px, 4vw, 48px);
  --max: 1240px;
  --nav-h: 72px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-hand: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Links with an arrow (↗ ↑): no underline until hover, then it draws in from the left (and slides
   out to the right when the pointer leaves) */
.link-draw {
  padding-bottom: 0.2em;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 0 1px;
  transition: background-size 0.35s var(--ease), color 0.2s;
}
.link-draw:hover, .link-draw:focus-visible { background-position: 0 100%; background-size: 100% 1px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(96px, 14vw, 180px) 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.num {
  display: inline-block;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 40px;
}

.section-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.section-lede {
  max-width: 560px;
  margin-top: 24px;
  color: var(--body);
  font-size: 19px;
}

/* Placeholder copy: obvious on purpose, so nothing ships by accident */
mark.todo {
  background: #fff3b0;
  color: inherit;
  padding: 0 0.15em;
  border-radius: 3px;
}
.closing mark.todo { background: rgba(255, 243, 176, 0.18); }

/* ==========================================================================
   Image placeholders — put an <img> or <video> inside and it fills the box
   ========================================================================== */
.ph {
  position: relative;
  aspect-ratio: var(--ar, 16 / 10);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 60%),
    rgba(0, 0, 0, 0.06);
}
.ph::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: rgba(0, 0, 0, 0.4);
}
.ph > img, .ph > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ph:has(> img, > video)::after { display: none; }
.ph--dark { background: linear-gradient(160deg, #2a2a2a, #151515); }
.ph--dark::after { color: rgba(255, 255, 255, 0.4); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #333; }
.btn--ghost { border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--block { width: 100%; }
.btn--lg { height: 58px; padding: 0 32px; font-size: 16px; }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 var(--gutter);
  color: var(--ink);
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav--scrolled {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav--dark { color: var(--paper); }
.nav--dark.nav--scrolled { background: rgba(13, 13, 13, 0.6); box-shadow: 0 1px 0 var(--line-dark); }

.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.nav-logo { width: 28px; height: 28px; flex: none; }

/* Underlined MENU text button on the right */
.nav-menu {
  padding: 8px 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.nav-menu:hover { text-decoration-thickness: 2px; }

/* While the menu is open the nav sits on the dark menu: light text, no bar */
.menu-open .nav { color: var(--paper); background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.menu-open { overflow: hidden; }

/* ==========================================================================
   Full-screen menu
   ========================================================================== */
.menu {
  position: fixed;
  inset: 0;
  z-index: 49;                   /* under the nav, so the logo and Close stay visible */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: calc(var(--nav-h) + clamp(24px, 6vh, 72px)) var(--gutter) 32px;
  overflow-y: auto;
  background: var(--ink);
  color: var(--paper);
  /* Wipes down from the top */
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.6s var(--ease), visibility 0s 0.6s;
}
.menu.is-open { clip-path: inset(0); visibility: visible; transition: clip-path 0.6s var(--ease); }

.menu-links { display: flex; flex-direction: column; }
.menu-links a {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: fit-content;
  text-decoration: none;
  transition: opacity 0.25s;
}
.menu-num { padding-top: 1.1em; font-size: 13px; letter-spacing: 0.04em; color: var(--muted-dark); }
/* Each word rises out of a mask when the menu opens */
.menu-word { display: block; overflow: hidden; font-size: clamp(56px, 11vw, 150px); font-weight: 500; line-height: 1.02; letter-spacing: -0.045em; }
.menu-word > span { display: block; transform: translateY(105%); transition: transform 0.7s var(--ease); }
.menu.is-open .menu-word > span { transform: none; }
.menu.is-open a:nth-child(1) .menu-word > span { transition-delay: 0.15s; }
.menu.is-open a:nth-child(2) .menu-word > span { transition-delay: 0.22s; }
.menu.is-open a:nth-child(3) .menu-word > span { transition-delay: 0.29s; }
/* Hovering one link dims the others */
.menu-links:hover a { opacity: 0.35; }
.menu-links a:hover, .menu-links a:focus-visible { opacity: 1; }
.menu-links a[aria-current="page"] .menu-num::after { content: " ●"; }

.menu-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line-dark);
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.4s;
}
.menu.is-open .menu-meta { opacity: 1; transition-delay: 0.35s; }
.menu-meta a { justify-self: start; }

@media (max-width: 760px) {
  .menu-meta { grid-template-columns: 1fr 1fr; }
  .menu-num { padding-top: 0.6em; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
/* Full screen on a very light gray: the name, then a short intro, sitting a little above center */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--nav-h) 0 clamp(64px, 10vh, 120px);
  background: var(--paper-tint);
}
/* The name is an SVG of the lettering; JS draws each letter's outline, then fills it */
.hero-name-svg { display: block; width: clamp(300px, 62vw, 980px); max-width: 100%; height: auto; overflow: visible; fill: currentColor; }
.hero-intro { max-width: 30em; margin-top: clamp(32px, 4vw, 56px); font-size: clamp(20px, 2.1vw, 28px); line-height: 1.4; letter-spacing: -0.01em; }
/* Desktop: the intro runs a bit wider than the name */
@media (min-width: 1000px) { .hero-intro { max-width: 42em; } }

/* ==========================================================================
   What I bring
   ========================================================================== */
.bring-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(32px, 4vw, 64px);
  margin-top: clamp(48px, 6vw, 80px);
}
.bring-item { padding: 24px 0 32px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bring-item .num { display: flex; align-items: center; gap: 10px; }
.bring-item .num::before { content: ""; width: 12px; height: 12px; background: var(--c); }
.bring-item h3 { margin: 16px 0 12px; font-size: 24px; line-height: 1.25; font-weight: 500; letter-spacing: -0.02em; }
.bring-item p { color: var(--body); font-size: 17px; line-height: 1.55; }

/* Stacked: one shared line between items instead of two */
@media (max-width: 860px) {
  .bring-grid { grid-template-columns: 1fr; gap: 0; }
  .bring-item { border-bottom: 0; }
  .bring-item:last-child { border-bottom: 1px solid var(--line); }
}

/* ==========================================================================
   Work index
   ========================================================================== */
.work-intro { padding-bottom: 80px; }
.work-intro--dots { position: relative; overflow: hidden; }
@media (max-width: 760px) { .work-intro--dots .ah-dot { display: none; } }   /* the title fills the width */
.work-index { margin-top: 64px; border-top: 1px solid var(--line); }
.work-index a, .flyer {
  display: grid;
  grid-template-columns: 60px 1fr auto 40px;
  align-items: center;
  gap: 16px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: padding 0.35s var(--ease), color 0.35s var(--ease);
}
.wi-num { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wi-name { font-size: clamp(1.6rem, 3.4vw, 2.6rem); letter-spacing: -0.03em; line-height: 1.1; }
.wi-tag { font-size: 14px; color: var(--muted); }
.wi-arrow { justify-self: end; transition: transform 0.35s var(--ease); }
.work-index a:hover { padding-left: 12px; }
.work-index a:hover .wi-arrow { transform: translateY(4px); }
.work-index:hover a:not(:hover) { color: rgba(0, 0, 0, 0.35); }

.wi-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: 280px;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.5);
}
.wi-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 760px) {
  .work-index a, .flyer { grid-template-columns: 40px 1fr 24px; }
  .wi-tag { display: none; }
}

/* ==========================================================================
   Projects — sizes and colors match the current Figma site (1140px content)
   ========================================================================== */
.project { padding: 60px 0; }

/* Header: title over a gray line, then two columns. Left (3/5): a lead line (tagline, or the
   first sentence) with a + that opens the rest of the copy. Right (2/5): tags, level with the lead */
.project-head {
  display: grid;
  grid-template-columns: 3fr 2fr;
  grid-template-areas: "title title" "copy tags";
  gap: 28px clamp(24px, 6vw, 96px);
  padding-top: 48px;
}
/* Same space from the copy to the images as from the gray line to the copy */
.project-head + .media { margin-top: 28px; }
.project-title { display: contents; }   /* name and tags take their own grid cells */
.project-head h3 {
  grid-area: title;
  padding-bottom: 20px;
  border-bottom: 1px solid #dfe0ec;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.project-title .tags { grid-area: tags; align-self: start; justify-content: flex-end; }
.project-row { grid-area: copy; }
.project-row p { color: var(--body); font-size: 17px; line-height: 1.5; }
.project-lead + p { margin-top: 12px; }

/* + button (rounded square) at the end of the lead line; the + turns into × when open */
.project-more {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  vertical-align: -3px;
  border: 1px solid #cfd0dc;
  border-radius: 5px;
  background: none;
  transition: background-color 0.2s, border-color 0.2s;
}
.project-more::before, .project-more::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 1.5px;
  background: var(--muted-dark);
  transform: translate(-50%, -50%);
  transition: transform 0.3s ease, background-color 0.2s;
}
.project-more::after { transform: translate(-50%, -50%) rotate(90deg); }
.project-more:hover { border-color: var(--ink); background: var(--ink); }
.project-more:hover::before, .project-more:hover::after { background: var(--paper); }
.project-more[aria-expanded="true"]::before { transform: translate(-50%, -50%) rotate(45deg); }
.project-more[aria-expanded="true"]::after { transform: translate(-50%, -50%) rotate(135deg); }

/* The rest of the copy. Collapsed only with JS (otherwise always shown); slides open */
.project-copy p { padding-top: 12px; }
.js .project-copy {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.4s ease, visibility 0s 0.4s;
}
.js .project-copy > div { min-height: 0; overflow: hidden; }
.js .xp-row.is-open .project-copy { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 0.4s ease; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags li {
  padding: 4px 12px;
  border-radius: 8px;
  background: #f8f8f8;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  white-space: nowrap;
}

.media { display: grid; gap: 40px; margin-top: 40px; }
.media img, .media video { width: 100%; height: auto; }

/* --cols / --gap override the default two equal columns, e.g. style="--cols: 739fr 362fr" */
.row { display: grid; grid-template-columns: var(--cols, 1fr 1fr); gap: var(--gap, 40px); }
.stack { display: grid; gap: 40px; align-content: start; }

/* A rounded media box. --ar sets its shape; without it the image's own shape is used. */
.shot { position: relative; overflow: hidden; border-radius: 16px; aspect-ratio: var(--ar, auto); }
.shot--gray { background: #f8f8f8; }
.shot > video, .shot--fill > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* An image placed at an exact spot inside its box (positions are set inline, in %) */
.shot > .placed { position: absolute; object-fit: cover; }
.screen { border-radius: 4px; box-shadow: 0 4px 31px rgba(0, 0, 0, 0.05); }
.screen--outlined { outline: 1px solid #ededed; }

/* Kit: phone overlapping the product photo */
/* Kit: phone centered on a gray card (left), product photo (right); the card matches the photo's height */
.kit-card .kit-phone { position: absolute; top: 7%; left: 50%; height: 86%; width: auto; aspect-ratio: 926 / 1886; translate: -50% 0; }

/* The coded glucose phone (SVG); sizes are in the phone's own 926×1886 units */
.glucose text { font-family: var(--font); }
.gl-status { font-size: 29px; font-weight: 600; fill: #fff; }
.gl-title { font-size: 47px; letter-spacing: -0.5px; fill: #fff; }
.gl-tab { font-size: 22px; font-weight: 700; letter-spacing: 2.4px; fill: #a7a7a7; }
.gl-tab--active { fill: url(#gl-tab-text); }
.gl-num { font-size: 66px; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.gl-unit { font-size: 22px; fill: #8a8a8a; }
.gl-label { font-size: 26px; fill: #dcdcdc; }
.gl-axis { font-size: 19px; fill: #8f8f8f; }
.gl-date { font-size: 21px; }

/* Phone screens centered on a gray panel (Vaccine drive, BarkCam); size/spacing/corners adjustable per panel */
.phones { display: flex; align-items: center; justify-content: center; gap: var(--phone-gap, 7.3%); }
.media .phones > * { width: var(--phone-w, 22.9%); height: auto; border-radius: var(--phone-r, 16px); }
.vd-screen { display: block; }
.vd-screen text { font-family: var(--font); }

/* BarkCam: logo sketches and color palette */
.swatches {
  position: absolute;
  left: 10.5%;
  top: 74.5%;
  width: 78.2%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  font-size: 12px;
  line-height: 22px;
  letter-spacing: -0.4px;
  text-align: center;
  color: #3a3a3a;
}
.swatches span { display: block; aspect-ratio: 2 / 1; margin-bottom: 8px; }

/* Vanessa: control screens on a gray panel */
.screen--van { border-radius: 24px; box-shadow: 7px 7px 59px rgba(0, 0, 0, 0.33); }
.van-ui { height: auto; }
.van-ui text { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.van-ui .van-big { font-family: var(--font); }

/* The coded Qubit report screen (SVG, 2000×1256 units) */
.qubit-ui { display: block; width: 100%; height: auto; }
.qubit-ui text { font-family: var(--font); }

/* The coded Crew Clothing tag summary (SVG, 1098×822 units) */
.tag-ui { display: block; width: 100%; height: auto; }
.tag-ui text { font-family: var(--font); }
.tag-ui .tg-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre; }

/* Qubit: cards of icons and illustrations; each piece is placed inline (in %), so the card scales as one */
.icon-card {
  position: relative;
  aspect-ratio: 546 / 195;
  border: 1px solid #eaeaea;
  border-radius: 16px;
  background: #fff;
}
.media .icon-card img { position: absolute; }

@media (max-width: 760px) {
  .project { padding: 40px 0; }
  .project-head { grid-template-columns: 1fr; grid-template-areas: "title" "tags" "copy"; gap: 16px; padding-top: 32px; }
  .project-head + .media { margin-top: 20px; }
  .project-head h3 { font-size: 26px; }
  .project-title .tags { justify-content: flex-start; }
  .media, .stack { gap: 16px; margin-top: 24px; }
  .stack { margin-top: 0; }
  .row { grid-template-columns: 1fr; gap: 16px; }
  .shot--fill { aspect-ratio: var(--ar-mobile, auto); }
  .kit-card { aspect-ratio: 4 / 5; }   /* stacked, so it no longer takes the photo's height */
}

/* ==========================================================================
   Project tracker — mini nav. Lines on a rail at the left on wide screens
   (hover to see names); a pill at the bottom on smaller ones.
   Built by js/main.js.
   ========================================================================== */
/* Jumping to a project leaves room for the fixed nav */
.project { scroll-margin-top: calc(var(--nav-h) - 36px); }

.tracker {
  position: fixed;
  z-index: 45;
  left: calc(var(--gutter) - 20px);   /* lines start at the same x as the nav logo */
  top: 50%;
  transform: translateY(-50%);
  padding: 18px 20px;
  border-radius: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0s 0.25s, background-color 0.2s, box-shadow 0.2s;
}
.tracker.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s var(--ease), background-color 0.2s, box-shadow 0.2s;
}
/* Held back while the Selected work list flies into place */
.tracker.is-arriving { opacity: 0; visibility: hidden; }

.tracker-toggle { display: none; }

/* Headings and labels collapse to zero width until hover, so the idle rail is just lines.
   Headings keep their height, so the rail doesn't jump when they appear. */
.tracker-group {
  height: 26px;
  padding-top: 6px;
  margin-bottom: 6px;
  max-width: 0;
  overflow: hidden;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.2s, max-width 0.25s var(--ease);
}
/* Extra space between the Work and Side quests groups */
.tracker-list + .tracker-group { margin-top: 20px; }

.tracker-list a {
  display: flex;
  align-items: center;
  height: 24px;
  color: var(--muted);
  text-decoration: none;
}
/* Back to top / To the bottom: a small arrow above and below the lines */
.tracker-jump {
  display: flex;
  align-items: center;
  height: 24px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.tracker-jump--top { margin-bottom: 14px; }
.tracker-jump--bottom { margin-top: 14px; }
.tracker-jump-icon { flex: none; width: 28px; font-size: 13px; line-height: 1; opacity: 0.6; transition: opacity 0.2s; }
.tracker-jump:hover { color: var(--ink); }
.tracker-jump:hover .tracker-jump-icon { opacity: 1; }

/* Lines are full width but drawn at half size, so the current one grows without shifting anything */
.tracker-tick {
  flex: none;
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.35;
  transform: scaleX(0.5);
  transform-origin: left;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.tracker-label {
  max-width: 0;
  overflow: hidden;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  transition: max-width 0.25s var(--ease), opacity 0.2s, padding 0.25s var(--ease);
}
.tracker-list a:hover, .tracker-list a[aria-current] { color: var(--ink); }
.tracker-list a:hover .tracker-tick, .tracker-list a[aria-current] .tracker-tick { opacity: 1; transform: none; }

.tracker:hover, .tracker:focus-within {
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--line);
}
.tracker:hover .tracker-group, .tracker:focus-within .tracker-group { max-width: 220px; opacity: 1; }
.tracker:hover .tracker-label, .tracker:focus-within .tracker-label { max-width: 220px; padding-left: 12px; opacity: 1; }

@media (max-width: 1099px) {
  .tracker { left: 50%; top: auto; bottom: 16px; transform: translateX(-50%); padding: 0; }
  .tracker:hover, .tracker:focus-within { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

  .tracker-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  }
  .tracker-toggle-group, .tracker-toggle-count { color: rgba(255, 255, 255, 0.55); font-size: 13px; }
  .tracker-toggle-count b { font-weight: 500; color: var(--paper); }
  .tracker-toggle::after { content: "▴"; font-size: 11px; opacity: 0.6; }
  .tracker.is-open .tracker-toggle::after { content: "▾"; }

  .tracker-panel {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 240px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px 16px 10px;
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--line);
  }
  .tracker.is-open .tracker-panel { display: block; }
  .tracker-group { height: auto; max-width: none; padding: 10px 0 2px; margin-bottom: 4px; opacity: 1; }
  .tracker-list + .tracker-group { margin-top: 8px; }
  .tracker-list a, .tracker-jump { height: 36px; }
  .tracker-jump--top { margin-bottom: 0; }
  .tracker-jump--bottom { margin-top: 8px; }
  .tracker-label { max-width: none; padding-left: 12px; opacity: 1; }
}

/* Copies of the Selected work rows that fly into the tracker (js/main.js) */
.flyer {
  position: fixed;
  z-index: 46;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  pointer-events: none;
  transition: none;
}

/* ==========================================================================
   Process
   ========================================================================== */
.process-lede { max-width: 600px; color: var(--body); margin-top: 24px; font-size: 20px; line-height: 1.6; }
/* Three columns, each with a line above and below */
.process-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(32px, 5vw, 72px);
  margin-top: clamp(48px, 6vw, 80px);
}
.process-steps li { padding: 28px 0 32px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.process-icon { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.process-steps h3 { margin: 16px 0 10px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.process-steps p { color: var(--body); font-size: 17px; line-height: 1.6; }

@media (max-width: 860px) {
  .process-steps { grid-template-columns: 1fr; gap: 0; }
  .process-steps li { border-bottom: 0; }
  .process-steps li:last-child { border-bottom: 1px solid var(--line); }
}

/* ==========================================================================
   About
   ========================================================================== */
/* About hero: pinned while you scroll its height. Words loop behind the photo; each scroll
   step swaps the photo (js: initAboutHero). Taller section = more scrolling per photo. */
.about-hero { position: relative; height: 380vh; }
.ah-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.ah-marquee {
  position: absolute;
  top: 50%;
  left: 0;
  margin-top: -0.6em;            /* half the line height, so the words sit on the centre line */
  font-size: clamp(44px, 6vw, 96px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #333;
  white-space: nowrap;
}
.ah-track { display: flex; width: max-content; animation: ah-marquee 60s linear infinite; }
.ah-track > span { padding: 0 0.3em; }
.ah-star { display: flex; align-items: center; color: var(--ink); }
.ah-star svg { width: 0.5em; height: 0.5em; fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; }
@keyframes ah-marquee { to { transform: translateX(-33.3333%); } }  /* one of the three copies */

.ah-photos { position: relative; z-index: 1; width: clamp(200px, 22vw, 340px); aspect-ratio: 2 / 3; }
/* Opaque (a tint shows while a photo loads) so the words never show through. The incoming photo
   fades in over the previous one. */
.ah-photo { position: absolute; inset: 0; --ar: 2 / 3; border-radius: 16px; background-color: #e9e6e1; opacity: 0; }
.ah-photo.is-prev { opacity: 1; z-index: 1; }
.ah-photo.is-active { opacity: 1; z-index: 2; transition: opacity 0.45s ease; }

.ah-dot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 16px;
  height: 16px;
  background: var(--c);
  /* A slow idle float. Uses translate/rotate, so it adds to the scroll drift (GSAP sets transform) */
  animation: ah-float 7s ease-in-out infinite;
}
.ah-dot:nth-of-type(2n) { animation-duration: 9s; animation-delay: -3s; }
.ah-dot:nth-of-type(3n) { animation-duration: 8s; animation-delay: -5s; animation-direction: reverse; }
@keyframes ah-float {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  33% { translate: 3px -5px; rotate: 6deg; }
  66% { translate: -3px 3px; rotate: -4deg; }
}

@media (max-width: 760px) {
  .about-hero { height: 300vh; }
  .ah-photos { width: min(56vw, 260px); }
  .ah-dot { width: 12px; height: 12px; }
}

/* About page sections: even, tighter spacing than the home page */
.section.about, .section.philosophy, .section.process, .section.journey { padding: clamp(56px, 7vw, 96px) 0; }

/* Two columns: big title or photo on the left, text in a column starting at the middle */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.split--center { align-items: center; }
.split-sticky { position: sticky; top: calc(var(--nav-h) + 48px); }
.split-text { max-width: 560px; font-size: 18px; line-height: 1.6; }
.split-text p { color: var(--body); }
.split-text > p + p { margin-top: 16px; }
.small-title { margin-bottom: 20px; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }

.about-photo { --ar: 8 / 7; border-radius: 16px; background: #f4f4f4; }

/* Philosophy: the intro starts about level with the end of the title */
.philosophy-body { padding-top: clamp(64px, 10vw, 150px); }
.beliefs { margin-top: 32px; border-bottom: 1px solid var(--line); }
.belief { padding: 32px 0; border-top: 1px solid var(--line); }
.belief .num { display: flex; align-items: center; gap: 10px; }
.belief .num::before { content: ""; width: 12px; height: 12px; background: var(--c); }
.belief h3 { margin: 14px 0 10px; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.belief p { color: var(--body); }
/* With JS, the belief in the middle of the screen is full strength and the others step back */
.beliefs--focus .belief { opacity: 0.35; transition: opacity 0.5s ease; }
.beliefs--focus .belief.is-current { opacity: 1; }

/* Highlighter stroke behind a word. --hl (0–1) is how much is drawn; JS animates it */
.hl { position: relative; z-index: 0; white-space: nowrap; }
.hl::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.06em;
  right: -0.06em;
  bottom: 0.06em;
  height: 0.5em;
  background: var(--c);
  transform: scaleX(var(--hl, 1));
  transform-origin: left;
}

/* Journey: a table of years · company · one line, + opens the full description */
.xp { margin-top: clamp(40px, 5vw, 64px); border-bottom: 1px solid var(--line); }
.xp-row {
  display: grid;
  grid-template-columns: 2fr 3fr 7fr 20px;
  gap: 24px;
  align-items: start;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
.xp-date { padding-top: 3px; color: var(--muted); font-size: 16px; }
.xp-name { font-size: 22px; font-weight: 600; line-height: 1.3; }
.xp-desc p { max-width: 680px; color: var(--body); font-size: 18px; line-height: 1.6; }
.xp-row .project-more { margin: 4px 0 0; }
.journey .text-link { margin-top: 40px; }

/* Who I like to work with: a full-screen statement. With JS (.people--scrub) the section is taller
   and the stage stays pinned while the words darken. */
.people-stage { position: relative; min-height: 100vh; min-height: 100svh; display: grid; align-items: center; overflow: hidden; }
.people--scrub { height: 240vh; }
.people--scrub .people-stage { position: sticky; top: 0; height: 100vh; height: 100svh; }
.people-text .pw { color: #c9c9ce; }
.people-text { max-width: 980px; font-size: clamp(28px, 3.4vw, 44px); font-weight: 500; line-height: 1.4; letter-spacing: -0.015em; }

.text-link { display: inline-block; margin-top: 32px; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split-sticky { position: static; }
  .philosophy-body { padding-top: 0; }
  .xp-row { grid-template-columns: 1fr 20px; gap: 6px 16px; }
  .xp-row .project-more { grid-column: 2; grid-row: 1; }
  .xp-name, .xp-desc { grid-column: 1 / -1; }
  .people .ah-dot { display: none; }   /* the paragraph spans the full width here */
}

/* ==========================================================================
   Closing + footer
   ========================================================================== */
/* At least a full screen, so at the very bottom of the page it fills the window and the nav
   (which turns dark over this section) never sits on a thin strip of the white section above.
   The footer is pushed to the bottom. */
.closing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(120px, 16vw, 220px) 0 0;
  background: var(--ink);
  color: var(--paper);
}
.closing > .container:not(.footer) { padding-bottom: clamp(120px, 14vw, 200px); }
.closing-title {
  max-width: 12em;               /* wraps after "something" */
  font-size: clamp(2.6rem, 6vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
/* The highlighter under "good" sits low, through the bottom of the letters */
.closing-title .hl::before { bottom: -0.1em; height: 0.45em; }
.closing-actions { position: relative; margin-top: clamp(56px, 7vw, 96px); }
/* On hover it cycles through three of the square colors (the drawn underline follows) */
.closing-link { font-size: clamp(18px, 1.6vw, 22px); }
.closing-link:hover { animation: link-colors 2.4s linear infinite; }
@keyframes link-colors {
  0%, 100% { color: #9ff5e6; }
  33% { color: #fdeb71; }
  66% { color: #7b8ff7; }
}
/* Email pop-up under Get in touch (built by js/main.js) */
.mail-pop {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 5;
  width: max-content;
  max-width: min(380px, 100%);
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.mail-pop[hidden] { display: none; }
.mail-pop-address { font-size: 17px; font-weight: 500; }
.mail-pop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 14px; font-size: 14px; }
.mail-pop-copy { padding: 7px 14px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); font: inherit; }
.mail-pop-copy:hover { background: #333; }
.mail-pop a { text-decoration: underline; text-underline-offset: 3px; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  /* No side padding, so the text lines up with both ends of the line; the margins keep it in the
     same column as the content above */
  width: auto;
  margin: auto max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))) 0;
  padding: 28px 0;
  border-top: 1px solid var(--line-dark);
  font-size: 14px;
  color: var(--muted-dark);
}
.footer nav { display: flex; flex-wrap: wrap; gap: 16px 48px; }
.footer a:hover { color: var(--paper); }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
