/* fonts.css */
/*
 * Self-hosted variable fonts, latin subset only.
 *
 * Served from this origin rather than fonts.gstatic.com: a third-party font
 * request costs a DNS lookup, a TLS handshake and a round trip before a single
 * glyph can be drawn, and browsers no longer share a cross-site font cache, so
 * the "someone else already downloaded it" argument for a CDN no longer holds.
 * All three families together are under 100 KB.
 *
 * `font-display: swap` means text paints immediately in the fallback and
 * re-renders once the real face lands — never a blank page waiting on a font.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../fonts/outfit.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* tokens.css */
/*
 * Design tokens — the single source every other stylesheet reads from.
 *
 * Both schemes are declared here: "Midnight Aurora" (dark, the default) and
 * "Daylight" (light). Nothing below this file names a raw colour, so retuning
 * the palette is a change in one place.
 */

:root {
  /* ── Brand accents, shared by both schemes ───────────────────────────── */
  --primary: #4f8cff;
  --secondary: #a26bff;
  --tertiary: #22d3b6;
  --amber: #ffb84d;

  --primary-deep: #2563eb;
  --secondary-deep: #7c3aed;
  --tertiary-deep: #0d9488;

  /* ── Gradients ───────────────────────────────────────────────────────── */
  --brand-gradient: linear-gradient(135deg, var(--primary), var(--secondary), var(--tertiary));
  --button-gradient: linear-gradient(90deg, var(--primary), var(--secondary));
  --headline-gradient: linear-gradient(90deg, #7fb2ff, #a26bff, #22d3b6);
  --shimmer-gradient: linear-gradient(100deg, #7fb2ff 0%, #a26bff 28%, #22d3b6 55%, #7fb2ff 80%);

  /* ── Type ────────────────────────────────────────────────────────────── */
  --font-display: "Outfit", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Fluid scale: each size interpolates between its phone and desktop value
     across the viewport, so nothing steps at a breakpoint. */
  --text-display: clamp(2.375rem, 1.1rem + 5.6vw, 4.75rem);
  --text-section: clamp(1.75rem, 1.15rem + 2.6vw, 2.75rem);
  --text-card: clamp(1.1875rem, 1.12rem + 0.3vw, 1.375rem);
  --text-subtitle: clamp(1.0625rem, 0.98rem + 0.4vw, 1.3125rem);
  --text-body: clamp(0.9375rem, 0.9rem + 0.22vw, 1.0625rem);
  --text-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --text-mono: clamp(0.72rem, 0.69rem + 0.12vw, 0.8125rem);

  /* ── Shape ───────────────────────────────────────────────────────────── */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --radius-pill: 999px;

  /* ── Layout ──────────────────────────────────────────────────────────── */
  --content-width: 1180px;
  --gutter: clamp(1.25rem, 0.6rem + 2.8vw, 5rem);
  --section-gap: clamp(4.5rem, 3rem + 6vw, 7.5rem);
  --nav-height: 86px;

  /* ── Motion ──────────────────────────────────────────────────────────── */
  --ease-entrance: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --ease-overshoot: cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease-smooth: cubic-bezier(0.33, 1, 0.68, 1);
  --fast: 190ms;
  --medium: 340ms;
  --slow: 620ms;
  --reveal: 760ms;

  /* ── Dark scheme (the default) ───────────────────────────────────────── */
  color-scheme: dark;
  --bg: #060910;
  --bg-alt: #0a0f1c;
  --surface: #101827;
  --surface-high: #162033;
  --glass: rgba(255, 255, 255, 0.078);
  --glass-strong: rgba(255, 255, 255, 0.122);
  --border: rgba(255, 255, 255, 0.102);
  --border-strong: rgba(255, 255, 255, 0.2);
  --ink: #eaf0fb;
  --ink-soft: #9eabc4;
  --ink-muted: #6e7c93;
  --shadow: rgba(0, 0, 0, 0.6);
  --grid-line: rgba(234, 240, 251, 0.035);
  --aurora-alpha: 0.3;
  --vignette-alpha: 0.55;
  --sheen: rgba(255, 255, 255, 0.16);
}

/* ── Light scheme ──────────────────────────────────────────────────────── */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fc;
  --bg-alt: #edf1f9;
  --surface: #ffffff;
  --surface-high: #f8faff;
  --glass: rgba(255, 255, 255, 0.7);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --border: rgba(16, 24, 40, 0.078);
  --border-strong: rgba(16, 24, 40, 0.141);
  --ink: #0b1220;
  --ink-soft: #475569;
  --ink-muted: #636f82;
  --shadow: rgba(11, 18, 32, 0.1);
  --grid-line: rgba(11, 18, 32, 0.05);
  --aurora-alpha: 0.2;
  --vignette-alpha: 0.25;
  --sheen: rgba(255, 255, 255, 0.55);

  /* The dark scheme's accents are tuned to glow against near-black. On a pale
     background the same colours read as washed out, so headline gradients
     switch to the deep variants, which hold their contrast. */
  --headline-gradient: linear-gradient(90deg, var(--primary-deep), var(--secondary-deep), var(--tertiary-deep));
  --shimmer-gradient: linear-gradient(
    100deg,
    var(--primary-deep) 0%,
    var(--secondary-deep) 28%,
    var(--tertiary-deep) 55%,
    var(--primary-deep) 80%
  );
}

/* base.css */
/*
 * Reset, typography, page chrome and the animated backdrop.
 */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* A mobile browser turns an overscroll at the top of the page into a
     pull-to-refresh. Nothing here wants to be reloaded mid-scroll. */
  overscroll-behavior-y: none;
  /* `clip` rather than `hidden`: it contains decoration that reaches past the
     edge without turning the root into a scroll container, which would break
     position:fixed and smooth scrolling. */
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
/*
 * `height: auto` is not optional here.
 *
 * Every image carries width and height attributes so the browser can reserve
 * its box before the file arrives. Those attributes are presentational hints —
 * real CSS — so constraining only the width in a rule elsewhere leaves the
 * attribute's height standing, and the image renders at, say, 52 by 320.
 */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

::selection {
  background: color-mix(in srgb, var(--secondary) 35%, transparent);
  color: var(--ink);
}

/* ── Skip link ─────────────────────────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface-high);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  transform: translate(-50%, -160%);
  transition: transform var(--medium) var(--ease-entrance);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

/* ── The backdrop ──────────────────────────────────────────────────────── */
/*
 * Three drifting colour clouds, a faint technical grid and a vignette that
 * keeps text readable. All of it is CSS gradients on two fixed layers, so it
 * costs the compositor a couple of static bitmaps and nothing per frame — the
 * drift itself runs as a transform, which never repaints.
 */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* The clouds inside are deliberately larger than the viewport so they have
     somewhere to drift. Without this they widen the page instead. */
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 55%, var(--bg) 100%);
}

.backdrop__aurora {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(38% 38% at 18% 16%, color-mix(in srgb, var(--primary) calc(var(--aurora-alpha) * 100%), transparent) 0%, transparent 70%),
    radial-gradient(34% 34% at 86% 30%, color-mix(in srgb, var(--secondary) calc(var(--aurora-alpha) * 100%), transparent) 0%, transparent 70%),
    radial-gradient(36% 36% at 55% 88%, color-mix(in srgb, var(--tertiary) calc(var(--aurora-alpha) * 100%), transparent) 0%, transparent 70%);
  animation: aurora-drift 26s linear infinite;
  will-change: transform;
}

@keyframes aurora-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  33%  { transform: translate3d(2.5%, -2%, 0) scale(1.04); }
  66%  { transform: translate3d(-2%, 2.5%, 0) scale(1.02); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

.backdrop__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
}

.backdrop__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    closest-side at 50% 50%,
    transparent 55%,
    color-mix(in srgb, var(--bg) calc(var(--vignette-alpha) * 100%), transparent) 100%
  );
}

/* Desktop only: a soft glow that trails the pointer. Positioned from JS. */
.spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--primary) 16%, transparent),
    color-mix(in srgb, var(--secondary) 6%, transparent) 45%,
    transparent 100%
  );
  transition: opacity var(--medium) ease;
  will-change: transform;
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.shell {
  width: min(100%, calc(var(--content-width) + var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/*
 * The navigation is fixed, so it is out of flow and takes up no room. Without
 * this the first section of every page renders underneath it.
 */
main {
  display: block;
  padding-top: calc(var(--nav-height) + clamp(0.75rem, 0.5rem + 1.5vw, 1.75rem));
}

.section + .section { margin-top: var(--section-gap); }
.stack-sm > * + * { margin-top: 0.75rem; }
.stack > * + * { margin-top: 1.25rem; }

/* ── Typography helpers ────────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--primary);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--button-gradient);
}

.section-title {
  font-size: var(--text-section);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.gradient-text {
  background: var(--headline-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 40rem;
  font-size: var(--text-body);
  color: var(--ink-soft);
}

.muted { color: var(--ink-muted); font-size: var(--text-small); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Reduced motion ────────────────────────────────────────────────────── */
/*
 * Everything decorative stops. Content still arrives — the reveal utility
 * below is written so that "no animation" means "already in place", never
 * "invisible forever".
 */
@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;
  }

  .spotlight { display: none; }
}

/* components.css */
/*
 * The reusable pieces: navigation, buttons, cards, tags, meters, footer.
 */

/* ── Scroll progress ───────────────────────────────────────────────────── */
.progress {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  z-index: 60;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
  background: var(--brand-gradient);
  box-shadow: 0 0 12px color-mix(in srgb, var(--secondary) 65%, transparent);
}

/* ── Navigation ────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 3px 0 auto;
  z-index: 50;
  padding: 18px var(--gutter) 0;
  transition: padding var(--medium) var(--ease-smooth);
}
.nav.is-scrolled { padding-top: 10px; }

.nav__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(100%, var(--content-width));
  margin-inline: auto;
  padding: 10px 14px 10px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: background var(--medium) var(--ease-smooth),
    border-color var(--medium) var(--ease-smooth),
    box-shadow var(--medium) var(--ease-smooth);
}
/* Frosted only once there is something behind it to frost — a permanent
   backdrop-filter is one of the most expensive things a page can hold. */
.nav.is-scrolled .nav__inner {
  background: var(--glass);
  border-color: var(--border);
  box-shadow: 0 12px 30px var(--shadow);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ink);
}
.nav__logo img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  padding: 2px;
  background: var(--button-gradient);
  object-fit: cover;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--secondary) 25%, transparent);
  transition: transform var(--medium) var(--ease-overshoot),
    box-shadow var(--medium) var(--ease-smooth);
}
.nav__logo:hover img {
  transform: rotate(-7deg);
  box-shadow: 0 8px 26px color-mix(in srgb, var(--secondary) 55%, transparent);
}

.nav__links {
  display: none;
  margin-inline: auto;
}
.nav__link {
  position: relative;
  display: inline-block;
  padding: 8px 12px 9px;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color var(--fast) var(--ease-smooth), transform var(--fast) var(--ease-smooth);
}
.nav__link::after {
  content: "";
  position: absolute;
  inset: auto 12px 0;
  height: 2px;
  border-radius: 2px;
  background: var(--button-gradient);
  transform: scaleX(0);
  transition: transform var(--medium) var(--ease-entrance);
}
.nav__link:hover { color: var(--ink); transform: translateY(-1px); }
.nav__link:hover::after { transform: scaleX(1); }
.nav__link.is-active {
  color: var(--primary);
  font-weight: 600;
}
.nav__link.is-active::after {
  transform: scaleX(1);
  box-shadow: 0 0 10px color-mix(in srgb, var(--primary) 55%, transparent);
}

.nav__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
/* Scoped to .nav so it outranks `.btn { display: inline-flex }`, which is
   declared further down this file at the same specificity. */
.nav .nav__cta { display: none; }
.nav .nav__menu { display: inline-flex; }

@media (min-width: 1080px) {
  .nav__links { display: flex; }
  .nav__actions { margin-left: 0; }
  .nav .nav__cta { display: inline-flex; }
  .nav .nav__menu { display: none; }
}

/* ── Drawer ────────────────────────────────────────────────────────────── */
.drawer { position: fixed; inset: 0; z-index: 90; }
.drawer[hidden] { display: none; }

.drawer__scrim {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--medium) ease;
}
.drawer.is-open .drawer__scrim { opacity: 1; }

.drawer__panel {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: min(340px, 88vw);
  padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform var(--medium) var(--ease-entrance);
  overflow-y: auto;
}
.drawer.is-open .drawer__panel { transform: none; }

.drawer__head { display: flex; align-items: center; gap: 12px; }
.drawer__head img { width: 40px; height: 40px; border-radius: 12px; padding: 2px; background: var(--button-gradient); object-fit: cover; }
.drawer__head > div { flex: 1; min-width: 0; }
.drawer__head .muted { margin: 0; }
.drawer__name { margin: 0; font-family: var(--font-display); font-weight: 600; color: var(--ink); }

.drawer__links { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.drawer__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  transition: background var(--fast) ease, color var(--fast) ease;
}
.drawer__link svg { width: 20px; height: 20px; color: var(--ink-soft); }
.drawer__link:hover { background: var(--glass); }
.drawer__link.is-active { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-weight: 600; }
.drawer__link.is-active svg { color: var(--primary); }
/* Items fan in one after another once the panel is open. */
.drawer.is-open .drawer__link {
  animation: drawer-in var(--medium) var(--ease-entrance) backwards;
  animation-delay: calc(var(--i) * 45ms + 80ms);
}
@keyframes drawer-in {
  from { opacity: 0; transform: translateX(26px); }
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  --accent: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform var(--fast) var(--ease-smooth), box-shadow var(--medium) var(--ease-smooth),
    background var(--medium) var(--ease-smooth), border-color var(--medium) var(--ease-smooth);
}
.btn__icon { display: inline-flex; transition: transform var(--fast) var(--ease-smooth); }
.btn__icon svg { width: 18px; height: 18px; }
.btn:hover .btn__icon { transform: translateX(4px); }
.btn--sm { padding: 11px 20px; font-size: 0.875rem; }
.btn--block { width: 100%; }

.btn--primary {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--button-gradient);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--secondary) 28%, transparent);
}
.btn--primary:hover {
  box-shadow: 0 14px 34px color-mix(in srgb, var(--secondary) 55%, transparent);
}
/* A band of light crosses the button once, as the pointer arrives. */
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 55%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(0);
  opacity: 0;
}
.btn--primary:hover::after { animation: sheen 820ms var(--ease-smooth); }
@keyframes sheen {
  0% { transform: translateX(0); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: translateX(340%); opacity: 0; }
}

.btn--ghost {
  color: var(--accent);
  border: 1px solid var(--border-strong);
  background: transparent;
}
.btn--ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.btn--ghost .btn__icon svg { width: 17px; height: 17px; }
.btn--ghost:hover .btn__icon { transform: none; }

.icon-btn {
  --accent: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink-soft);
  background: var(--glass);
  border: 1px solid var(--border);
  transition: color var(--fast) ease, background var(--fast) ease,
    border-color var(--fast) ease, box-shadow var(--medium) ease, transform var(--fast) var(--ease-smooth);
}
.icon-btn svg { display: block; width: 19px; height: 19px; }
.icon-btn:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent);
  transform: translateY(-2px);
}
.nav .icon-btn { width: 42px; height: 42px; }

/* The theme toggle swaps its two glyphs rather than swapping markup. Both
   wrappers have to be flex: an inline span sits on the text baseline, which
   lifts the glyph off the button's centre. */
.icon-btn__on,
.icon-btn__off { display: inline-flex; align-items: center; justify-content: center; }
.icon-btn__off { display: none; }
:root[data-theme="light"] .icon-btn__on { display: none; }
:root[data-theme="light"] .icon-btn__off { display: inline-flex; }
[data-theme-toggle] { --accent: var(--amber); }
:root[data-theme="light"] [data-theme-toggle] { --accent: var(--secondary); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row--center { justify-content: center; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  --accent: var(--primary);
  position: relative;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--shadow) 28%, transparent);
  transition: transform var(--medium) var(--ease-smooth), border-color var(--medium) ease,
    background var(--medium) ease, box-shadow var(--medium) ease;
}
.card--hover:hover,
.card--project:hover {
  background: var(--glass-strong);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 18px 42px color-mix(in srgb, var(--accent) 22%, transparent);
  transform: translateY(-4px);
}
/* A glow that follows the pointer across the card. Coordinates come from JS;
   with no pointer, --glow stays 0 and nothing is painted. */
.card--hover::before,
.card--project::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: var(--glow, 0);
  background: radial-gradient(
    190px circle at var(--gx, 50%) var(--gy, 50%),
    color-mix(in srgb, var(--accent) 16%, transparent),
    transparent 70%
  );
  transition: opacity var(--medium) ease;
  pointer-events: none;
}

.card__head { display: flex; align-items: baseline; gap: 1rem; }
.card__title { font-size: var(--text-card); font-weight: 600; flex: 1; }
.card__index { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink-muted); }
.card__tagline { margin-top: 6px; font-size: 0.875rem; font-weight: 600; color: var(--accent); }
.card__text { margin-top: 14px; font-size: 0.9375rem; }
.card__body { padding: 26px; }
.card--project { padding: 0; overflow: hidden; }

.card__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color var(--fast) ease;
}
.card__more svg { width: 17px; height: 17px; transition: transform var(--fast) var(--ease-smooth); }
.card__more:hover { color: var(--accent); }
.card__more:hover svg { transform: translateX(5px); }

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.card__icon svg { width: 24px; height: 24px; }

.rule { height: 1px; margin: 22px 0; border: 0; background: var(--border); }

/* ── Project artwork ───────────────────────────────────────────────────── */
.artwork {
  position: relative;
  display: grid;
  place-items: center;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 28%, transparent),
    color-mix(in srgb, var(--accent-alt) 12%, transparent) 55%,
    transparent
  );
}
.artwork--tall { height: 280px; border-radius: var(--radius-lg); }
.artwork__glow {
  position: absolute;
  top: -40px;
  right: -30px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-alt) 35%, transparent), transparent);
}
.artwork__icon {
  width: 100px;
  height: 100px;
  border-radius: 26px;
  object-fit: cover;
  box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 45%, transparent);
}
.artwork--tall .artwork__icon { width: 132px; height: 132px; border-radius: 32px; }
.artwork__kind { position: absolute; top: 16px; left: 16px; }
.artwork__live {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tertiary);
  background: color-mix(in srgb, var(--tertiary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tertiary) 35%, transparent);
}
.artwork__live svg { width: 12px; height: 12px; }

.kind {
  --accent: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  backdrop-filter: blur(8px);
}
.kind--dense { padding: 6px 10px; font-size: 0.75rem; }
.kind svg { width: 15px; height: 15px; }

/* ── Tags ──────────────────────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tag {
  --accent: var(--primary);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  color: color-mix(in srgb, var(--accent) 80%, var(--ink));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
}

/* ── Meters ────────────────────────────────────────────────────────────── */
.meter { --accent: var(--primary); }
.meter + .meter { margin-top: 18px; }
.meter__head { display: flex; align-items: baseline; gap: 10px; }
.meter__label { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.meter__detail { flex: 1; font-size: 0.8125rem; color: var(--ink-muted); }
.meter__value { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); }
.meter__track {
  height: 7px;
  margin-top: 9px;
  border-radius: var(--radius-pill);
  background: var(--glass);
  border: 1px solid var(--border);
  overflow: hidden;
}
.meter__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--tertiary)));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1.1s var(--ease-entrance);
}
.is-revealed .meter__fill,
.meter.is-visible .meter__fill { transform: scaleX(var(--level)); }

/* ── Stats ─────────────────────────────────────────────────────────────── */
.stat { --accent: var(--primary); }
.stat__value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 1.2rem + 2.4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat__label { display: block; margin-top: 6px; font-size: var(--text-small); color: var(--ink-soft); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.footer {
  margin-top: var(--section-gap);
  padding: clamp(2.5rem, 2rem + 3vw, 4rem) 0 2.5rem;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-alt) 60%, transparent);
}
.footer__top {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .footer__top { grid-template-columns: 2fr 1fr 1fr; gap: 3rem; }
}
.footer__brand .lead { margin-top: 1rem; max-width: 30rem; font-size: var(--text-small); }
.footer__social { display: flex; gap: 10px; margin-top: 1.25rem; }
.footer__heading {
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.footer__nav, .footer__contact { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
/* Seven links in one column is a lot of phone; two columns halves it. */
@media (max-width: 759px) {
  .footer__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
  .footer__heading { grid-column: 1 / -1; margin-bottom: 0; }
  .footer__top { gap: 1.75rem; }
}
.footer__nav a, .footer__contact a {
  font-size: var(--text-small);
  color: var(--ink-soft);
  transition: color var(--fast) ease, transform var(--fast) ease;
}
.footer__nav a:hover, .footer__contact a:hover { color: var(--primary); transform: translateX(3px); }
.footer__legal { font-size: var(--text-small); color: var(--ink-muted); }

/* ── Back to top ───────────────────────────────────────────────────────── */
.to-top {
  position: fixed;
  right: clamp(1rem, 2vw, 1.875rem);
  bottom: calc(clamp(1rem, 2vw, 1.875rem) + env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  background: var(--button-gradient);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--secondary) 40%, transparent);
  opacity: 0;
  transform: translateY(90px);
  pointer-events: none;
  transition: opacity var(--medium) ease, transform var(--medium) var(--ease-overshoot);
}
.to-top svg { width: 20px; height: 20px; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* ── CTA band ──────────────────────────────────────────────────────────── */
.cta {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: clamp(2.5rem, 2rem + 3vw, 3.75rem) clamp(1.5rem, 1rem + 3vw, 3.5rem);
  text-align: center;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary) 16%, transparent),
    color-mix(in srgb, var(--secondary) 10%, transparent) 50%,
    color-mix(in srgb, var(--tertiary) 14%, transparent)
  );
}
.cta .lead { max-width: 32rem; }
.cta .btn-row { margin-top: 1rem; }

/*
 * `<picture>` is a wrapper the layout never asked for: it is inline by
 * default, so a portrait or a card icon would sit on a text baseline with a
 * few stray pixels underneath it. Making it a plain block that fills its slot
 * hands the sizing back to the `img` rules, exactly as before it was there.
 */
picture {
  display: contents;
}

/* pages.css */
/*
 * Page-level layout: the hero, the grids, the timeline, the case study.
 */

/* ── Grids ─────────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px)  { .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid--3 { grid-template-columns: repeat(3, 1fr); }
                             .grid--4 { grid-template-columns: repeat(4, 1fr); } }

.stack-lg > * + * { margin-top: 22px; }

.section-header { max-width: 42rem; }
.section-header .eyebrow + .section-title { margin-top: 18px; }
.section-header .section-title + .lead { margin-top: 16px; }
.section-header--center { max-width: 44rem; margin-inline: auto; text-align: center; }
.section-header--center .eyebrow { justify-content: center; }
.section-header--center .lead { margin-inline: auto; }

.section-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}
.section-header-row + * { margin-top: 2.75rem; }
.section-header + .grid,
.section-header + .stack-lg,
.section-header + .timeline,
.section-header + .rows,
.section-header + .card,
.section-header + .chips { margin-top: 2.75rem; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  gap: clamp(2rem, 1rem + 5vw, 3rem);
  align-items: center;
  padding-top: clamp(0.5rem, 0.25rem + 2vw, 2.5rem);
  padding-bottom: clamp(1.5rem, 1rem + 3vw, 3.75rem);
}
@media (min-width: 940px) {
  .hero { grid-template-columns: 6fr 5fr; }
  .hero__portrait { order: 2; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--tertiary);
  background: color-mix(in srgb, var(--tertiary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tertiary) 32%, transparent);
}
.badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tertiary);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--tertiary) 70%, transparent);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero__greeting { margin-top: 18px; font-family: var(--font-display); font-size: var(--text-subtitle); }
.hero__name { margin-top: 10px; font-size: var(--text-display); font-weight: 800; letter-spacing: -0.04em; }

/* A slow band of light travels across the name. Pure background-position, so
   it never triggers layout or paint of anything around it. */
.shimmer {
  background: var(--shimmer-gradient);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer {
  to { background-position: 260% 0; }
}

.hero__role {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  min-height: 2.5rem;
  font-family: var(--font-display);
  font-size: var(--text-subtitle);
  font-weight: 600;
  color: var(--ink);
}
.hero__bar {
  width: 3px;
  height: 1.9rem;
  border-radius: 2px;
  background: var(--button-gradient);
  flex: none;
}
.type::after {
  content: "";
  display: inline-block;
  width: 2.5px;
  height: 1.05em;
  margin-left: 4px;
  vertical-align: -0.16em;
  border-radius: 2px;
  background: var(--primary);
  animation: caret 1.06s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0.05; } }

.hero__tagline { margin-top: 20px; max-width: 34rem; }
.hero .btn-row { margin-top: 26px; }
.hero__links { margin-top: 20px; }

/* ── Portrait ──────────────────────────────────────────────────────────── */
/*
 * Five layers, back to front: a halo, a ring of dashes turning one way, a
 * gradient stroke turning the other, one lit dot orbiting the lot, and the
 * photograph.
 *
 * `container-type: size` is what lets the dot's orbit scale with the
 * portrait. Its radius has to be a length — a percentage in `translate` is
 * measured against the dot itself, which would park it six pixels from the
 * centre — and `cqmin` is a length that follows the container.
 */
@property --ring-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@property --dash-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.hero .portrait {
  /* On a phone the portrait was 349px of a 844px screen before a word of the
     page had been read. It stays the focal point at two thirds the size. */
  width: min(64%, 400px);
}
@media (min-width: 940px) {
  .hero .portrait { width: min(100%, 400px); }
}

.portrait {
  container-type: size;
  /* Deliberately not a grid. Every layer here is positioned against the box
     itself, and a grid invented a second row for the photograph — which sat it
     twenty pixels below the rings that are supposed to circle it. Concentric
     is the whole point, so nothing is left to auto-placement. */
  position: relative;
  width: min(100%, 400px);
  margin-inline: auto;
  aspect-ratio: 1;
}

.portrait__halo,
.portrait__dashes,
.portrait__ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.portrait__halo {
  inset: 0;
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--primary) 26%, transparent) 40%,
    color-mix(in srgb, var(--secondary) 9%, transparent) 72%,
    transparent 100%
  );
}

/* 56 dashes, the same count the design has always used. */
.portrait__dashes {
  inset: 1%;
  background: repeating-conic-gradient(
    from var(--dash-angle),
    var(--ink) 0deg 2.9deg,
    transparent 2.9deg 6.4286deg
  );
  opacity: 0.18;
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.6px), #000 calc(100% - 1.6px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.6px), #000 calc(100% - 1.6px));
  animation: dash-turn 23s linear infinite reverse;
}

.portrait__ring {
  inset: 5%;
  background: conic-gradient(
    from var(--ring-angle),
    var(--primary),
    var(--secondary),
    var(--tertiary),
    var(--primary)
  );
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  animation: ring-turn 14s linear infinite;
  opacity: 0.95;
}

.portrait__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--tertiary);
  box-shadow: 0 0 18px color-mix(in srgb, var(--tertiary) 75%, transparent);
  animation: dot-orbit 14s linear infinite;
  pointer-events: none;
}

.portrait--soft .portrait__ring { opacity: 0.6; }
.portrait--soft .portrait__halo { opacity: 0.7; }

.portrait img {
  /* Sized and placed explicitly against the portrait box.
     `inset: 10%` on its own is not enough: an <img> is a replaced element, so
     `width: auto` takes the file's intrinsic width and the opposing inset is
     dropped as over-constrained — which left it full-size and pushed into the
     corner. Percentages here resolve against the portrait, which has a
     definite size in both axes. */
  position: absolute;
  top: 10%;
  left: 10%;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  box-shadow: 0 24px 60px color-mix(in srgb, var(--secondary) 30%, transparent);
  z-index: 1;
}

@keyframes ring-turn { to { --ring-angle: 360deg; } }
@keyframes dash-turn { to { --dash-angle: 360deg; } }
/*
 * The dot rides the dashed ring, not the gap beside it.
 *
 * The dashes sit at `inset: 1%`, so their box has a radius of 49% of the
 * portrait, and the mask leaves a 1.6px stroke on the inside of that edge —
 * putting the centre of the dashed line at 49% minus 0.8px. The dot's orbit
 * is written as exactly that, so the two stay locked together at any size.
 */
@keyframes dot-orbit {
  from { transform: rotate(0deg) translateY(calc(0.8px - 49cqmin)); }
  to   { transform: rotate(360deg) translateY(calc(0.8px - 49cqmin)); }
}

/* ── Ticker ────────────────────────────────────────────────────────────── */
.ticker {
  overflow: hidden;
  padding: 18px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ticker__belt {
  display: flex;
  width: max-content;
  animation: ticker 38s linear infinite;
  /* Nudged by the scroll, via a variable main.js writes. */
  translate: var(--shove, 0px) 0;
  transition: translate 420ms var(--ease-smooth);
  will-change: transform;
}
.ticker:hover .ticker__belt { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }

.ticker__run { display: flex; }
.ticker__run li {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 168px;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.09em;
  color: var(--ink-muted);
  white-space: nowrap;
}
.ticker__run li span { color: color-mix(in srgb, var(--primary) 55%, transparent); font-size: 0.6875rem; }

/* ── Stats ─────────────────────────────────────────────────────────────── */
.stats {
  display: grid;
  gap: 24px 16px;
  grid-template-columns: repeat(2, 1fr);
  padding: clamp(20px, 2vw, 30px) clamp(16px, 2vw, 32px);
}
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* ── Service cards ─────────────────────────────────────────────────────── */
/*
 * Icon beside the words rather than above them. Three stacked cards with a
 * centred icon and a paragraph each is most of a phone screen for three
 * sentences; side by side it is a third of that, and reads the same.
 */
@media (max-width: 639px) {
  .services .card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 14px;
    padding: 16px;
  }
  .services .card__icon { width: 44px; height: 44px; border-radius: 13px; }
  .services .card__icon svg { width: 21px; height: 21px; }
  .services .card__title { margin-top: 0 !important; font-size: 1rem; }
  .services .card__text { margin-top: 5px; font-size: 0.875rem; }
  .services .card__icon { grid-row: span 2; }
}

/* ── Split layouts ─────────────────────────────────────────────────────── */
.split { display: grid; gap: clamp(2rem, 1rem + 4vw, 3rem); align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 5fr 7fr; }
  .split--wide { grid-template-columns: 7fr 5fr; }
  .split--case { grid-template-columns: 1fr 1fr; align-items: start; }
}
.split__body .section-header { max-width: none; }
.split__side { position: sticky; top: calc(var(--nav-height) + 20px); }

.card--tight { padding: 22px; }
.card__value { margin-top: 4px; font-family: var(--font-display); font-weight: 600; color: var(--ink); word-break: break-word; }

/* ── Featured tiles ────────────────────────────────────────────────────── */
/*
 * Two across on a phone, three on a laptop. Each tile is the project's icon,
 * its name and one line — the case study behind it carries everything else, so
 * the section stays a glance rather than a scroll.
 */
.tiles {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px)  { .tiles { grid-template-columns: repeat(3, 1fr); gap: 18px; } }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 1px solid var(--border);
  transition: transform var(--medium) var(--ease-smooth), border-color var(--medium) ease,
    background var(--medium) ease, box-shadow var(--medium) ease;
}
/* The project's own colour washes up from behind its icon. */
.tile::before {
  content: "";
  position: absolute;
  inset: -40% 0 auto;
  height: 120%;
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--accent) 26%, transparent),
    transparent
  );
  opacity: 0.55;
  transition: opacity var(--medium) ease;
  pointer-events: none;
}
.tile:hover {
  transform: translateY(-4px);
  background: var(--glass-strong);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--accent) 22%, transparent);
}
.tile:hover::before { opacity: 1; }

.tile__art {
  position: relative;
  display: grid;
  place-items: center;
  padding: 10px 0 4px;
}
.tile__art img {
  width: clamp(52px, 13vw, 72px);
  aspect-ratio: 1;
  border-radius: 22%;
  object-fit: cover;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 45%, transparent);
}

.tile__body { position: relative; display: grid; gap: 3px; }
.tile__name {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}
.tile__tagline {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--ink-muted);
}
.tile__body { min-height: 0; }
/* Pushed to the bottom so the badges line up across a row whose taglines
   wrap to different numbers of lines. */
.tile__kind { position: relative; margin-top: auto; padding-top: 4px; }
.tile__kind .kind {
  padding: 4px 9px;
  font-size: 0.6875rem;
}
.tile__kind .kind svg { width: 12px; height: 12px; }

/* ── Projects page ─────────────────────────────────────────────────────── */
.banner { padding: 20px 26px; }
.banner__facts { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.banner__facts li { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 0.9375rem; }
.banner__facts svg { width: 20px; height: 20px; color: var(--accent); flex: none; }

.group-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.group-head .muted { white-space: nowrap; }
@media (max-width: 560px) { .group-head .rule { display: none; } }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  transition: color var(--fast) ease;
}
.back-link svg { width: 17px; height: 17px; transform: rotate(180deg); transition: transform var(--fast) var(--ease-smooth); }
.back-link:hover { color: var(--primary); }
.back-link:hover svg { transform: rotate(180deg) translateX(4px); }

/* ── Feature list ──────────────────────────────────────────────────────── */
.features { display: grid; gap: 14px; margin-top: 22px; }
.features li { display: flex; gap: 14px; align-items: flex-start; }
.features__tick {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 50%;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
}
.features__tick svg { width: 14px; height: 14px; }

/* ── Timeline ──────────────────────────────────────────────────────────── */
.timeline { position: relative; display: grid; gap: 24px; padding-left: 34px; }
.timeline::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 9px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--secondary), var(--tertiary));
  opacity: 0.35;
}
.timeline__item { position: relative; }
.timeline__marker {
  position: absolute;
  top: 26px;
  left: -34px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s ease-out infinite;
}
.timeline__head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.timeline__head .tag { flex: none; }

/* ── Chips ─────────────────────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--border);
  transition: transform var(--fast) var(--ease-overshoot), border-color var(--fast) ease, color var(--fast) ease;
}
.chip:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary) 55%, transparent); color: var(--primary); }

/* ── Orbit (skills page) ───────────────────────────────────────────────── */
.orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 340px);
  margin-inline: auto;
  aspect-ratio: 1;
}
.orbit__ring { position: absolute; border-radius: 50%; border: 1px solid var(--border); }
.orbit__ring--inner { inset: 18%; }
.orbit__ring--outer { inset: 4%; }
.orbit__core {
  display: grid;
  place-items: center;
  gap: 2px;
  width: 32%;
  aspect-ratio: 1;
  border-radius: 50%;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--button-gradient);
  box-shadow: 0 0 40px color-mix(in srgb, var(--secondary) 35%, transparent);
}
.orbit__core svg { width: 24px; height: 24px; }

/*
 * An arm is a box the size of one ring. Rotating it swings its top edge around
 * the circle, and the chip rides that edge. `inset` is a percentage of the
 * orbit, which is what makes this scale with the container — unlike a
 * percentage translate, which would measure against the chip itself.
 */
.orbit__arm {
  /* Its share of the circle. Everything below is written in terms of this. */
  --base: calc(var(--i) * (360deg / var(--n)));

  position: absolute;
  display: grid;
  justify-items: center;
  align-items: start;
  rotate: var(--base);
  animation: orbit-spin var(--dur) linear infinite;
  pointer-events: none;
}
.orbit__arm--in  { inset: 18%; }
.orbit__arm--out { inset: 4%; }

.orbit__chip {
  /* Centred on the ring line rather than hanging off it. */
  translate: 0 -50%;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  white-space: nowrap;
  color: var(--ink);
  background: var(--surface-high);
  border: 1px solid var(--border-strong);
  /* Turns against the arm by exactly as much as the arm turns, so the label
     stays upright the whole way round. */
  rotate: calc(var(--base) * -1);
  animation: orbit-counter var(--dur) linear infinite;
}

/* The outer ring turns the other way. The chip has to reverse with it —
   if only one of the pair flipped, the labels would spin on the spot. */
.orbit__arm--out,
.orbit__arm--out .orbit__chip { animation-direction: reverse; }

/*
 * Both keyframes start from the element's own angle rather than from zero.
 * A bare `to { rotate: 360deg }` would make the arm at 120° travel 240° in the
 * same time as the arm at 0° travels 360°, and they would bunch together
 * within one lap.
 */
@keyframes orbit-spin {
  from { rotate: var(--base); }
  to   { rotate: calc(var(--base) + 360deg); }
}
@keyframes orbit-counter {
  from { rotate: calc(var(--base) * -1); }
  to   { rotate: calc(var(--base) * -1 - 360deg); }
}

/* ── Contact ───────────────────────────────────────────────────────────── */
.contact-head { display: grid; justify-items: center; gap: 1.5rem; text-align: center; }
.contact-card .card__more { color: var(--ink-muted); font-size: 0.8125rem; }
.contact-card:hover .card__more { color: var(--accent); }

/* motion.css */
/*
 * Motion: entrances, page transitions and the states JavaScript toggles.
 *
 * The hidden half of a reveal lives behind `.will-reveal`, a class only the
 * script adds. Without JavaScript — or before it has run — no rule here
 * applies and the page is simply visible. A stylesheet that hides content and
 * waits for a script to bring it back is one failed request away from a blank
 * page.
 */

.will-reveal {
  opacity: 0;
  translate: 0 46px;
  scale: var(--reveal-scale, 1);
  transition:
    opacity var(--reveal) var(--ease-entrance) var(--reveal-delay, 0ms),
    translate var(--reveal) var(--ease-entrance) var(--reveal-delay, 0ms),
    scale var(--reveal) var(--ease-entrance) var(--reveal-delay, 0ms);
  will-change: opacity, translate;
}

.will-reveal[data-reveal="left"]  { translate: -42px 0; }
.will-reveal[data-reveal="right"] { translate: 42px 0; }
.will-reveal[data-reveal="up"]    { translate: 0 -40px; }
.will-reveal[data-reveal="none"]  { translate: 0 0; --reveal-scale: 0.96; }

/*
 * `.will-reveal.is-revealed`, not `.is-revealed`.
 *
 * The directional rules above are `.will-reveal[data-reveal="left"]` — a class
 * and an attribute, which outranks a lone class. A bare `.is-revealed` loses
 * that contest, and every block revealed from the side stays parked 42px off
 * to one side forever, pushing the page sideways.
 */
.will-reveal.is-revealed {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  /* Released once it has arrived: a permanent `will-change` keeps a layer
     alive for every revealed block on the page, which on a long page is a
     great many layers doing nothing. */
  will-change: auto;
}

/* ── Page transitions ──────────────────────────────────────────────────── */
/*
 * Two implementations of the same idea. Browsers with the View Transitions API
 * cross-fade the documents themselves — smoother than anything script can do,
 * and it survives the back button for free. Everywhere else, the outgoing page
 * is faded by hand in the last moment before the browser navigates.
 */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: page-out 180ms var(--ease-smooth) both;
}
::view-transition-new(root) {
  animation: page-in 380ms var(--ease-entrance) both;
}

@keyframes page-out {
  to { opacity: 0; transform: translateY(-14px) scale(0.99); }
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
}

/* ── Focus safety ──────────────────────────────────────────────────────── */
/*
 * A block that has not been revealed yet is transparent but still focusable.
 * Tabbing into one would scroll the page to something nobody can see, so a
 * focus inside it reveals it immediately.
 */
.will-reveal:focus-within {
  opacity: 1 !important;
  translate: 0 0 !important;
  scale: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
  .will-reveal,
  .will-reveal[data-reveal] {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }
  @view-transition { navigation: none; }
}
