/* site.css: every style for the one page portfolio (DESIGN.md sections 4 to 9).
   Section 3 (reel) and section 4 (TrustBlacklist) mount their own scoped styles from JS
   (REEL_CSS in js/reel.js, #tbl-css in js/blacklist.js); they read the tokens below. */

/* ------------------------------------------------------------ fonts */
/* Latin subsets in WOFF2 (about 9 KB each, made with pyftsubset from the TTFs, which stay as a fallback). */
@font-face { font-family: Poppins; src: url("../assets/fonts/Poppins-Regular.woff2") format("woff2"), url("../assets/fonts/Poppins-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url("../assets/fonts/Poppins-Medium.woff2") format("woff2"), url("../assets/fonts/Poppins-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url("../assets/fonts/Poppins-SemiBold.woff2") format("woff2"), url("../assets/fonts/Poppins-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url("../assets/fonts/Poppins-Bold.woff2") format("woff2"), url("../assets/fonts/Poppins-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

/* ------------------------------------------------------------ tokens */
:root {
  /* hero theme (unchanged names and defaults; the hero script writes these) */
  --accent: #c9c2b8;
  --tint-strength: 0;

  /* surfaces */
  --bg: #0B0D12;
  --bg-2: #11141B;
  --ink: #F2F4F7;
  --ink-dim: rgba(242, 244, 247, .64);
  --ink-faint: rgba(242, 244, 247, .38);
  --line: rgba(242, 244, 247, .14);
  --card: rgba(11, 13, 18, .46);
  --accent-glow: color-mix(in srgb, var(--accent) 38%, transparent);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);

  /* brand constants (Brand CI v2.0), never themed */
  --tf-blue: #006bf1;
  --tf-blue-deep: #0038db;
  --tf-royal: #175df1;
  --tf-light: #69adff;
  --tf-light-2: #6cb1ff;
  --tf-ink: #1c1c2e;
  --tf-muted: #6b6b85;
  --tf-canvas: #f7f8fa;
  --tf-border: #e7e8ec;
  --tf-gradient: linear-gradient(135deg, #0038db 0%, #006bf1 50%, #6cb1ff 100%);

  /* TrustBlacklist, used only inside section 4 */
  --tbl-red: #ff1a45;

  /* masterpiece pass (SPEC.md 0.3): the four skill families, print paper and ink, board and chalk */
  --fam-learn: #5fd39a; --fam-organise: #b58cff; --fam-make: #3d8bff; --fam-think: #ff8a4c;
  --paper: #f3ecd9; --key: #16131a;
  --slate: #162021; --chalk: #f1eee4;

  /* shape */
  --r: 8px; --r-lg: 12px; --r-pill: 999px;
  --shadow-lg: 0 8px 30px rgba(28, 28, 46, .12);

  /* layout */
  --gutter: clamp(16px, 5vw, 72px);
  --header-h: 56px;

  /* motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.33, 1, .68, 1);
  --t-micro: 180ms; --t-ui: 320ms; --t-reveal: 900ms;

  /* display size, shared by the section words */
  --display: clamp(64px, 15vw, 248px);
}
@media (max-width: 820px) { :root { --gutter: 16px; --header-h: 52px; } }

/* ------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); overflow-x: clip; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { font: 400 16px/1.55 Poppins, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
@media (max-width: 820px) { body { font-size: 15px; } }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
a { color: inherit; }
main { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip:focus { position: fixed; left: 16px; top: 16px; width: auto; height: auto; margin: 0; clip: auto; overflow: visible; z-index: 200; padding: 10px 14px; background: var(--bg-2); color: var(--ink); border: 1px solid var(--accent); border-radius: var(--r); text-decoration: none; font-size: 14px; }
:where(a, button, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* two voices plus small type */
.display { margin: 0; font-size: var(--display); font-weight: 700; letter-spacing: -.055em; line-height: .82; }
.statement { margin: 0; font-size: clamp(22px, 2.4vw, 34px); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; max-width: 26ch; text-wrap: balance; }
.body { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink-dim); max-width: 52ch; }
.label { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--ink-dim); }
.micro { margin: 0; font-size: 11px; letter-spacing: .08em; line-height: 1.3; color: var(--ink-faint); }
@media (max-width: 820px) { .body { font-size: 15px; } }

/* ================================================================ 5.0 preloader */
/* Brand intro (built by js/main.js, preloader section). Layers, back to front: the #preloader ground,
   two curtain halves split on the mark's 45 degree diagonal, the Trust Blue glow, the seam light,
   the lock ring, the mark, the meta row (progress line, name, counter). */
.preloader { position: fixed; inset: 0; z-index: 100; overflow: hidden; background: var(--bg); --pl-mark: clamp(84px, 13vmin, 128px); }
.preloader.pl-open { background: transparent; pointer-events: none; }

/* shown by the HTML alone, before the scripts arrive (slow connections): a faint breathing mark */
.pl-boot { position: absolute; left: 50%; top: 50%; width: var(--pl-mark); height: var(--pl-mark); margin: calc(var(--pl-mark) / -2) 0 0 calc(var(--pl-mark) / -2); opacity: .16;
  animation: plBreathe 1600ms ease-in-out infinite alternate; }
@keyframes plBreathe { from { opacity: .08; } to { opacity: .22; } }
.pl-live .pl-boot { animation: plBootOut 420ms var(--ease-soft) forwards; }
@keyframes plBootOut { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pl-boot { animation: none; } }

.pl-half { position: absolute; left: calc(50% - 80vmax); width: 160vmax; height: 80vmax; background: var(--bg); transform: rotate(45deg); will-change: transform; }
.pl-a { top: calc(50% - 80vmax); transform-origin: 50% 100%; }
.pl-b { top: 50%; transform-origin: 50% 0; }
.pl-open .pl-half { transition: transform 540ms cubic-bezier(.66, 0, .16, 1) 20ms, box-shadow 200ms linear; }
.pl-open .pl-a { transform: rotate(45deg) translateY(-82vmax); box-shadow: inset 0 -1px 0 rgba(108, 177, 255, .7); }
.pl-open .pl-b { transform: rotate(45deg) translateY(82vmax); box-shadow: inset 0 1px 0 rgba(108, 177, 255, .7); }

.pl-glow { position: absolute; left: 50%; top: 50%; width: 120vmin; height: 120vmin; margin: -60vmin 0 0 -60vmin; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(0, 107, 241, .42) 0%, rgba(0, 101, 238, .36) 10%, rgba(0, 90, 233, .29) 21%, rgba(0, 72, 225, .21) 33%,
    rgba(0, 56, 219, .15) 44%, rgba(0, 62, 223, .1) 56%, rgba(0, 76, 229, .062) 68%, rgba(0, 92, 235, .032) 80%, rgba(0, 104, 240, .012) 91%, rgba(0, 107, 241, 0) 100%); }
/* dither: a tiled grain at a few percent breaks the 8 bit steps of the dark glow */
/* grey noise centred on mid grey with overlay averages to no change, so it adds grain, not light;
   the mask fades it out before the edge of the disc */
.pl-glow::after { content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: .07; mix-blend-mode: overlay;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%); mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 160px 160px; }
.pl-open .pl-glow { opacity: 0 !important; transition: opacity 360ms var(--ease-soft); }

.pl-seam { position: absolute; left: calc(50% - 80vmax); top: 50%; width: 160vmax; height: 2px; margin-top: -1px; opacity: 0; transform: rotate(45deg) scaleX(.15); pointer-events: none;
  background: linear-gradient(90deg, rgba(108, 177, 255, 0), rgba(108, 177, 255, .9) 40%, #fff 50%, rgba(108, 177, 255, .9) 60%, rgba(108, 177, 255, 0));
  box-shadow: 0 0 18px 2px rgba(0, 107, 241, .55); }
.pl-open .pl-seam { animation: plSeam 560ms cubic-bezier(.3, .7, .2, 1) forwards; }
@keyframes plSeam { 0% { opacity: 0; transform: rotate(45deg) scaleX(.15); } 22% { opacity: 1; transform: rotate(45deg) scaleX(1); } 100% { opacity: 0; transform: rotate(45deg) scaleX(1); } }

.pl-ring { position: absolute; left: 50%; top: 50%; width: var(--pl-mark); height: var(--pl-mark); margin: calc(var(--pl-mark) / -2) 0 0 calc(var(--pl-mark) / -2);
  border: 1px solid rgba(108, 177, 255, .7); border-radius: 50%; opacity: 0; pointer-events: none; }
.pl-lock .pl-ring { animation: plRing 820ms cubic-bezier(.16, 1, .3, 1) 150ms both; }
@keyframes plRing { 0% { opacity: .85; transform: scale(.9); } 100% { opacity: 0; transform: scale(3.4); } }

.pl-markwrap { position: absolute; left: 50%; top: 50%; width: var(--pl-mark); height: var(--pl-mark); margin: calc(var(--pl-mark) / -2) 0 0 calc(var(--pl-mark) / -2); transform-origin: 50% 50%; }
.pl-svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 50%; }
.pl-pieces polygon { opacity: 0; }
.pl-ghost polygon { fill: none; stroke: rgba(108, 177, 255, .42); stroke-width: 7; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: plDraw 560ms var(--ease-out) forwards; }
.pl-ghost polygon.is-locked { stroke-dashoffset: 0; animation: plHit 460ms ease-out forwards; }
@keyframes plDraw { to { stroke-dashoffset: 0; } }
@keyframes plHit { 0% { stroke: #fff; stroke-width: 12; opacity: 1; } 100% { stroke: rgba(108, 177, 255, .4); stroke-width: 7; opacity: 0; } }
.pl-sheen-bar { transform: translateX(-760px); mix-blend-mode: screen; }

.pl-meta { position: absolute; left: 50%; top: calc(50% + var(--pl-mark) / 2 + 30px); width: min(220px, 60vw); transform: translateX(-50%); }
.pl-track { position: relative; height: 1px; background: var(--line); overflow: hidden; }
.pl-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--tf-blue-deep), var(--tf-blue) 55%, var(--tf-light-2)); }
.pl-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; font-size: 11px; font-weight: 500; letter-spacing: .16em; line-height: 1.2; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.pl-name { color: var(--ink-faint); }
.pl-count { color: var(--ink-dim); }
.pl-lock .pl-meta, .pl-open .pl-meta { opacity: 0; transform: translate(-50%, 8px); transition: opacity 140ms var(--ease-soft), transform 260ms var(--ease-out); }

/* reduced motion: a still mark, then a short opacity fade */
.pl-still .pl-pieces polygon { opacity: 1; }
.pl-still .pl-ghost, .pl-still .pl-sheen { display: none; }
.preloader.pl-fade { opacity: 0; transition: opacity 200ms linear; }

html.is-loading { overflow: hidden; }

/* ================================================================ 5.0 header */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg-2) 78%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
  transform: translateY(-100%); visibility: hidden; transition: transform var(--t-ui) var(--ease-out), visibility 0s linear var(--t-ui); }
.site-header.is-shown { transform: none; visibility: visible; transition: transform var(--t-ui) var(--ease-out), visibility 0s; }
.site-header .brand-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; min-height: 44px; }
.site-header .brand-link img { width: 22px; height: 22px; display: block; }
.site-header nav { display: flex; align-items: center; gap: 28px; }
.site-header nav a.nav-link { position: relative; font-size: 13px; color: var(--ink-dim); text-decoration: none; padding: 6px 0; transition: color var(--t-micro) var(--ease-soft); }
.site-header nav a.nav-link:hover { color: var(--ink); }
.site-header nav a.nav-link.is-active { color: var(--ink); }
.site-header nav a.nav-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--t-ui) var(--ease-out); }
.site-header nav a.nav-link.is-active::after { transform: none; }
.pill { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border: 1px solid var(--accent); border-radius: var(--r-pill); color: var(--accent); text-decoration: none;
  font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; line-height: 1; transition: background-color var(--t-ui) var(--ease-soft), color var(--t-ui) var(--ease-soft); }
.pill:hover { background: var(--accent); color: var(--bg); }
/* the header's "See the skills" steps aside while the skills section is already in view */
.site-header .pill { transition: background-color var(--t-ui) var(--ease-soft), color var(--t-ui) var(--ease-soft), opacity var(--t-ui) var(--ease-soft), visibility 0s; }
.site-header.in-skills .pill { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--t-ui) var(--ease-soft), visibility 0s linear var(--t-ui); }
@media (max-width: 820px) {
  .site-header { padding: 0 16px; }
  .site-header nav a.nav-link { display: none; }
  .pill { min-height: 44px; }
}

/* ================================================================ 5.1 hero (behaviour unchanged, shell restyled) */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; background: #4a4542; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero .tint { position: absolute; inset: 0; background: var(--accent); opacity: var(--tint-strength); mix-blend-mode: soft-light; pointer-events: none; transition: background .5s, opacity .5s; }
.hero .shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, #0B0D12 0%, rgba(11,13,18,0) 14%),
              linear-gradient(90deg, rgba(11,13,18,.88) 0%, rgba(11,13,18,.62) 30%, rgba(11,13,18,0) 56%),
              linear-gradient(0deg, rgba(11,13,18,.55) 0%, rgba(11,13,18,0) 26%); }

.hero .panel { position: absolute; left: clamp(16px, 5vw, 72px); top: 50%; transform: translateY(-50%); width: min(40vw, 520px); z-index: 2; }
.hero .who { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); margin: 0 0 18px; }
.hero .who-mark { flex: none; width: 18px; height: 18px; display: block; }

.hero .tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hero .tab { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: 14px; color: var(--ink-dim); transition: background .3s, color .3s; white-space: nowrap; }
.hero .tab:hover { color: var(--ink); }
.hero .tab[aria-selected="true"] { background: var(--accent); color: var(--bg); font-weight: 600; }
.hero .tab:focus-visible, .hero .sw:focus-visible, .hero .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.hero .copy { margin-top: 26px; transition: opacity .35s, transform .35s; }
.hero .copy.out { opacity: 0; transform: translateY(8px); }
.hero .kicker { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; transition: color .5s; }
.hero h1 { font-size: clamp(34px, 4.6vw, 64px); line-height: 1.02; letter-spacing: -.03em; margin: 0 0 14px; font-weight: 600; text-wrap: balance; }
.hero .sub { margin: 0 0 22px; color: var(--ink-dim); max-width: 44ch; text-wrap: pretty; }

.hero .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hero .card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); text-decoration: none; color: inherit;
  opacity: 0; transform: translateY(10px); transition: opacity .45s, transform .45s, border-color .3s; }
.hero .card.in { opacity: 1; transform: none; }
.hero .card:hover { border-color: var(--accent); }
.hero .ico { flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); transition: background .5s, color .5s; }
.hero .ico svg { width: 18px; height: 18px; }
.hero .card b { display: block; font-size: 14px; font-weight: 600; line-height: 1.25; }
.hero .card span { display: block; font-size: 12px; color: var(--ink-dim); line-height: 1.3; }

.hero .theme { position: absolute; top: 16px; right: 16px; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hero .sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--c); }
.hero .sw[aria-pressed="true"] { border-color: var(--ink); }
.hero .theme input { width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.hero .ai-label { position: absolute; right: 16px; bottom: 14px; z-index: 2; font-size: 11px; letter-spacing: .08em; color: var(--ink-dim); }
.hero .loading { position: absolute; left: clamp(16px, 5vw, 72px); bottom: 14px; z-index: 2; font-size: 11px; letter-spacing: .08em; color: var(--ink-dim); transition: opacity .4s; }
.hero .loading.done { opacity: 0; }

/* install buttons: one row under the mode copy, the same on every mode. Brand marks are the
   official files in assets/brand (claude.svg, openai.svg), inlined. Both brands sit on a neutral
   pill: ChatGPT is black with the white blossom, Claude is Anthropic ivory with the spark in its
   own #D97757 (text #141413 on #F0EEE6 is 15.6:1).
   data-public="false" (the repo is not public yet): the buttons stay hidden and .inst-soon shows.
   The row fades in after the headline and the first cards (hero.js adds .in). */
.hero .install { position: relative; margin-top: 22px; }
.hero.has-stagger .install { opacity: 0; transform: translateY(8px); }
.hero.has-stagger .install.in { opacity: 1; transform: none; transition: opacity .5s var(--ease-soft), transform .6s var(--ease-out); }
.hero .install[data-public="false"] .inst-row, .hero .install[data-public="false"] .inst-pop { display: none; }
.hero .install[data-public="true"] .inst-soon { display: none; }
.hero .inst-soon { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; }
.hero .inst-see { display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; border: 1px solid rgba(242, 244, 247, .34); border-radius: var(--r-pill);
  background: var(--card); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: border-color var(--t-micro), box-shadow var(--t-ui) var(--ease-soft); }
.hero .inst-see:hover { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.hero .inst-see:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hero .inst-soon-t { font-size: 13px; line-height: 1.4; color: var(--ink-dim); }
.hero .inst-l-short { display: none; }
.hero .inst-k { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); margin: 0 0 10px; }
.hero .inst-row { display: flex; flex-wrap: wrap; gap: 8px 6px; }
.hero .inst-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: 0; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--t-micro), border-color var(--t-micro), box-shadow var(--t-ui) var(--ease-soft); }
.hero .inst-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hero .inst-logo, .hero .inst-ico { flex: none; width: 16px; height: 16px; display: block; }
.hero .inst-claude { background: #D97757; border-color: #D97757; color: #fff; }
.hero .inst-claude .inst-logo { color: #fff; }
.hero .inst-claude:hover { background: #E08766; border-color: #E08766; box-shadow: 0 0 0 5px rgba(217, 119, 87, .3); }
.hero .inst-gpt { background: #000; border-color: rgba(255, 255, 255, .24); color: #fff; }
.hero .inst-gpt:hover { background: #161616; border-color: rgba(255, 255, 255, .5); box-shadow: 0 0 0 5px rgba(255, 255, 255, .1); }
.hero .inst-copy { background: var(--card); border-color: rgba(242, 244, 247, .34); color: var(--ink); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hero .inst-copy:hover { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.hero .inst-copy .inst-ico-done { display: none; }
.hero .inst-copy.is-copied { border-color: var(--accent); }
.hero .inst-copy.is-copied .inst-ico-copy { display: none; }
.hero .inst-copy.is-copied .inst-ico-done { display: block; color: var(--accent); }

.hero .inst-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 4; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-2); box-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
.hero .inst-pop[hidden] { display: none; }
.hero .inst-pop-k { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.hero .inst-pop-text { display: block; width: 100%; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(242, 244, 247, .05); color: var(--ink);
  font: 400 13px/1.5 Poppins, ui-sans-serif, system-ui, sans-serif; resize: none; }
.hero .inst-pop-text:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hero .inst-pop-text::selection { background: var(--accent); color: var(--bg); }
.hero .inst-pop-hint { margin: 8px 0 0; font-size: 12px; color: var(--ink-dim); padding-right: 76px; }
.hero .inst-pop kbd { font: inherit; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); }
.hero .inst-pop-close { position: absolute; right: 14px; bottom: 11px; min-height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; font-size: 12px; cursor: pointer; }
.hero .inst-pop-close:hover { border-color: var(--accent); }

/* short desktop windows: give the taller panel room */
@media (min-width: 821px) and (max-height: 780px) {
  .hero .copy { margin-top: 18px; }
  .hero h1 { margin-bottom: 10px; }
  .hero .sub { margin-bottom: 16px; }
  .hero .cards { gap: 8px; }
  .hero .card { padding: 9px 12px; }
  .hero .install { margin-top: 16px; }
  .hero .inst-k { margin-bottom: 8px; }
}

@media (max-width: 820px) {
  .hero .shade { background: linear-gradient(0deg, #0B0D12 0%, rgba(11,13,18,.82) 38%, rgba(11,13,18,0) 66%); }
  .hero .panel { top: auto; bottom: 48px; transform: none; left: 16px; right: 16px; width: auto; }   /* clears the AI credit by about 20px */
  .hero .who { margin-bottom: 12px; }
  .hero .tabs { display: flex; }
  .hero .tab { flex: 1; padding: 8px 6px; font-size: 13px; }
  .hero .copy { margin-top: 16px; }
  .hero h1 { font-size: 32px; }
  .hero .sub { font-size: 14px; margin-bottom: 14px; }
  .hero .card { padding: 9px 10px; gap: 9px; border-radius: 12px; }
  .hero .card span { display: none; }
  .hero .ico { width: 28px; height: 28px; border-radius: 8px; }
  .hero .ai-label { bottom: 8px; }
  .hero .loading { left: 16px; bottom: 8px; }
  .hero .install { margin-top: 14px; }
  .hero .inst-k { margin-bottom: 8px; font-size: 11px; }
}
@media (max-width: 560px) {
  .hero .inst-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .hero .inst-btn { min-height: 42px; padding: 0 8px; gap: 6px; font-size: 13px; }
  .hero .inst-pre, .hero .inst-l-full { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hero .inst-l-short { display: inline; }
  .hero .inst-see { min-height: 40px; padding: 0 14px; font-size: 13px; }
  .hero .inst-soon-t { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .copy, .hero .card, .hero .tab, .hero .tint, .hero .inst-btn, .hero .inst-see, .hero.has-stagger .install { transition: none; }
}

/* ================================================================ after the hero */
.after-hero { position: relative; background: var(--bg); }

/* ================================================================ 5.2 brand moment */
.brand { position: relative; height: 170vh; }
.brand-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.brand-gl, .brand-halo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.brand-copy { position: absolute; z-index: 2; left: var(--gutter); bottom: clamp(40px, 9vh, 96px); width: min(42vw, 600px); }
.brand-copy .label { margin-bottom: 18px; }
.brand-copy .wordmark { display: block; width: fit-content; border-radius: var(--r); }
.brand-copy .wordmark:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.brand-copy .wordmark svg { width: clamp(260px, 36vw, 620px); height: auto; display: block; overflow: visible; }
.brand-copy .statement { margin: 22px 0 12px; }
.brand-fallback { pointer-events: none; }
@media (max-width: 820px) {
  .brand { height: 150vh; height: 150svh; }
  .brand-copy { left: 16px; right: 16px; width: auto; bottom: clamp(28px, 6vh, 56px); }
  .brand-copy .wordmark svg { width: min(260px, 100%); }
  .brand-copy .statement { margin: 16px 0 10px; }
}

/* ================================================================ 5.4b cases (js/cases.js; each case brings its own sheet) */
.cases-section { position: relative; background: var(--bg); }
.cases-ph .cases-head { padding: clamp(72px, 12vh, 140px) var(--gutter) 40px; display: grid; gap: 16px; }
.cases-spacer { position: relative; height: calc(100vh + 360vh); }
.cases-spacer-hold { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; place-items: center; }
.cases-loading { color: var(--ink-faint); }
@media (max-width: 820px) { .cases-spacer { height: calc(100vh + 302.4vh); height: calc(100svh + 302.4svh); } }

/* the case switcher (ARIA tabs) */
.case-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.case-tabs [role="tab"] { display: grid; gap: 4px; min-height: 44px; padding: 10px 14px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card);
  color: var(--ink-dim); font: inherit; cursor: pointer; transition: border-color var(--t-micro) var(--ease-soft); }
.case-tabs [role="tab"] .label { color: var(--ink-faint); transition: color var(--t-micro) var(--ease-soft); }
.case-tabs [role="tab"] b { font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--ink-dim); transition: color var(--t-micro) var(--ease-soft); }
.case-tabs [role="tab"]:hover b { color: var(--ink); }
.case-tabs [role="tab"][aria-selected="true"] { border-color: var(--accent); }
.case-tabs [role="tab"][aria-selected="true"] .label { color: var(--accent); }
.case-tabs [role="tab"][aria-selected="true"] b { color: var(--ink); }
.case-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* on the pinned stage: one compact row in the free top band */
.case-tabs.is-pinned { position: absolute; z-index: 5; top: calc(var(--header-h) + 16px); left: var(--gutter); margin: 0; flex-wrap: nowrap; }
.case-tabs.is-pinned [role="tab"] { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; }
@media (max-width: 1380px) { .case-tabs.is-pinned [role="tab"] b { display: none; } }
@media (min-width: 821px) {
  /* case-plan's copy column starts near the top band; move it under the tabs */
  .cases-section .cases.case-plan .case-stage.has-tabs .case-col { top: calc(var(--header-h) + 76px); }
}
@media (max-width: 820px) {
  .case-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .case-tabs [role="tab"] { height: 44px; padding: 0 6px; place-content: center; text-align: center; }
  .case-tabs [role="tab"] .label { font-size: 11px; letter-spacing: .08em; }
  .case-tabs [role="tab"] b { display: none; }
}
/* 0.3 s dissolve between cases: stage layers and the step list fade, the tabs stay */
.cases-section.is-fade .case-stage > :not(.case-tabs), .cases-section.is-fade .case-steps, .cases-section.is-fade .case-static { transition: opacity 300ms linear; }
.cases-section.is-switching .case-stage > :not(.case-tabs), .cases-section.is-switching .case-steps, .cases-section.is-switching .case-static { opacity: 0; }

/* ================================================================ 5.5 skills */
.skills { position: relative; overflow: hidden; min-height: 92vh; padding: clamp(72px, 12vh, 140px) var(--gutter) calc(var(--display) * .82 + clamp(40px, 6vh, 72px)); }
.skills-fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; z-index: 0; }
.skills > :not(.skills-fx) { position: relative; z-index: 1; }
.skills .label { margin-bottom: 22px; }
.skills .statement { margin-bottom: 16px; }
.skill-cats { list-style: none; margin: clamp(40px, 7vh, 72px) 0 clamp(36px, 6vh, 56px); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); max-width: 1280px; }
.skill-cats li { position: relative; display: grid; gap: 8px; align-content: start; padding-top: 18px; }
.skill-cats li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); transition: background-color var(--t-ui) var(--ease-soft); }
.skill-cats li:hover::before { background: var(--accent); }
.skill-cats .idx { font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-variant-numeric: tabular-nums; }
.skill-cats b { font-size: 20px; font-weight: 600; line-height: 1.25; }
.skill-cats span:not(.idx) { font-size: 15px; color: var(--ink-dim); line-height: 1.5; max-width: 34ch; }
.btn-accent { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 16px 24px; border-radius: var(--r-pill); background: var(--accent); color: var(--bg); text-decoration: none; font-size: 15px; font-weight: 600; line-height: 1; transition: box-shadow var(--t-ui) var(--ease-soft); }
.btn-accent:hover { box-shadow: 0 0 0 6px var(--accent-soft); }
.btn-accent.is-soon { cursor: default; }
.btn-accent.is-soon:hover { box-shadow: none; }
.btn-accent svg { flex: none; }
.btn-accent .arrow { transition: transform var(--t-ui) var(--ease-soft); }
.btn-accent:hover .arrow, .btn-accent:focus-visible .arrow { transform: translateX(4px); }
.skills-word { position: absolute !important; z-index: 0 !important; left: var(--gutter); bottom: 0; color: var(--ink); opacity: .08; white-space: nowrap; pointer-events: none; user-select: none; }
.skills-word .ch { display: inline-block; }
.skills.is-ready .skills-word .ch { transform: translateY(40%); opacity: 0; transition: transform var(--t-reveal) var(--ease-out), opacity var(--t-reveal) var(--ease-out); transition-delay: calc(var(--i) * 30ms); }
.skills.is-ready.is-in .skills-word .ch { transform: none; opacity: 1; }
@media (max-width: 820px) {
  .skill-cats { grid-template-columns: 1fr; }
}

/* ================================================================ 5.6 footer */
.site-footer { position: relative; padding: clamp(72px, 14vh, 160px) var(--gutter) 32px; border-top: 1px solid var(--line); display: grid; gap: 18px; }
.footer-mark { display: block; width: 100%; height: 120px; margin-bottom: clamp(16px, 4vh, 40px); }
.footer-name { font-size: clamp(56px, 11vw, 180px); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 12px 0 28px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--ink-dim); text-decoration: none; transition: color var(--t-micro) var(--ease-soft); }
.site-footer nav a:hover { color: var(--ink); }
@media (max-width: 820px) { .footer-mark { height: 88px; } }

/* ================================================================ 8. reduced motion */
@media (prefers-reduced-motion: reduce) {
  .brand { height: auto; }
  .brand-stage { position: relative; }
  .site-header, .site-header.is-shown, .site-header nav a.nav-link::after, .pill, .site-header .pill, .site-header.in-skills .pill, .btn-accent, .btn-accent .arrow, .skill-cats li::before { transition: none; }
  .skills.is-ready .skills-word .ch { transform: none; opacity: 1; transition: none; }
}

/* ================================================================ masterpiece pass: shared bits (SPEC.md E.5 step 1)
   .made-with: the chip that names the skill a piece of work came from (A.5).
   .join: the one line that closes a section, at statement size (A.4). */
.made-with { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; margin-top: 14px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; line-height: 1.2; color: var(--ink-dim); text-decoration: none;
  transition: color var(--t-micro) var(--ease-soft), border-color var(--t-micro) var(--ease-soft); }
.made-with svg { flex: none; transition: transform var(--t-ui) var(--ease-out); }
.made-with:hover { color: var(--ink); border-color: var(--accent); }
.made-with:hover svg { transform: translateX(3px); }
.made-with:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (pointer: coarse) { .made-with { min-height: 44px; } }
.join { margin: 0; font-size: clamp(22px, 2.4vw, 34px); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; max-width: 26ch; text-wrap: balance; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .made-with, .made-with svg { transition: none; } }

#install { scroll-margin-top: calc(var(--header-h) + 24px); }   /* the footer link "Install the skills" lands on the coda title */

/* How it works: the section's closing line, after the pinned track (SPEC.md A.4) */
.cases-section > .cases-join { margin: 0 var(--gutter); padding: clamp(72px, 10vh, 112px) 0; }
