/* ============================================================
   J_W_I_ — "Softly-lit graphite" design system
   A physical-but-contemporary interface language: matte
   machined surfaces under a single soft top light, one warm
   accent, a pastel-blue secondary, and a dark warm "sheet" material for long reading.
   Depth comes from light logic, not texture cosplay.
   ============================================================ */

/* ----------------------------- tokens ----------------------------- */
:root {
  /* materials — warm graphite chassis */
  --bg-0: #17181b;        /* deepest: code screens */
  --bg-1: #1e2024;        /* page background */
  --surface-0: #24262b;   /* raised panel */
  --surface-1: #2a2d33;   /* raised + hover */
  --surface-2: #31353c;   /* raised, strong hover */
  --inset-0: #1a1b1f;     /* recessed well */

  /* dark warm sheet (reading material) */
  --sheet: #262329;
  --sheet-hi: #2b2830;
  --sheet-ink: #e9e6de;
  --sheet-ink-soft: #aaa49a;
  --sheet-ink-faint: #948e84;
  --sheet-line: rgba(255, 255, 255, 0.08);

  /* lines & grooves */
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --edge-hi: rgba(255, 255, 255, 0.055);  /* machined top edge */
  --edge-hi-strong: rgba(255, 255, 255, 0.1);

  /* ink */
  --ink-0: #edeeef;
  --ink-1: #a9afb8;
  --ink-2: #7d838d;
  --ink-3: #828893;

  /* accents */
  --accent: #e5a13d;
  --accent-hi: #f0b45c;
  --accent-lo: #c9862a;
  --accent-ink: #221503;
  --accent-dim: rgba(229, 161, 61, 0.14);

  /* secondary accent — pastel blue (controls) */
  --blue: #8fb5dd;
  --blue-hi: #a9c9ea;
  --blue-lo: #6f99c6;
  --blue-ink: #132338;
  --blue-dim: rgba(143, 181, 221, 0.13);
  --blue-line: rgba(143, 181, 221, 0.32);

  --green: #4fc47c;
  --green-dim: rgba(79, 196, 124, 0.16);
  --red: #e05a52;

  /* code tokens */
  --tok: #c9ced6;
  --tok-kw: #e58b5a;
  --tok-type: #8cb8e8;
  --tok-str: #a6c78b;
  --tok-num: #d9b36a;
  --tok-com: #7c8798;

  /* elevation — one light source, from above */
  --elev-1:
    inset 0 1px 0 var(--edge-hi),
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 10px 24px -14px rgba(0, 0, 0, 0.55);
  --elev-2:
    inset 0 1px 0 var(--edge-hi-strong),
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 18px 40px -18px rgba(0, 0, 0, 0.65);
  --inset-1:
    inset 0 2px 8px rgba(0, 0, 0, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  --inset-screen:
    inset 0 2px 10px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-sheet:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 24px 64px -24px rgba(0, 0, 0, 0.7);

  /* radii — concentric: panel 14 / inner 8 / control 8 / chip 6 */
  --r-s: 6px;
  --r-m: 8px;
  --r-l: 14px;
  --r-xl: 18px;

  /* type */
  --font-display: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-mono: "Spline Sans Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* scale (rem) */
  --t-xs: 0.78rem;   /* 12.5 labels */
  --t-sm: 0.85rem;   /* 13.5 */
  --t-md: 0.95rem;   /* 15.2 */
  --t-lg: 1.06rem;   /* 17 */
  --t-xl: 1.25rem;   /* 20 */
  --t-2xl: 1.62rem;  /* 26 */
  --t-3xl: 2.12rem;  /* 34 */
  --t-4xl: 2.9rem;   /* 46 */

  /* spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  /* layout */
  --w-max: 1120px;
  --w-prose: 68ch;
  --w-prose-narrow: 60ch;
  --pad: clamp(20px, 5vw, 44px);
  --mast-h: 60px;

  /* motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-fast: 140ms;
  --t-med: 220ms;
}

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

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

body {
  margin: 0;
  padding: 0 var(--pad) clamp(48px, 7vw, 80px);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-0);
  background:
    radial-gradient(120% 480px at 50% 0%, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 70%),
    radial-gradient(140% 560px at 50% 100%, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0) 70%),
    linear-gradient(180deg, #222429 0%, var(--bg-1) 34%, #1b1c20 100%);
  background-color: var(--bg-1);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* fine brushed grain — barely there, fixed with the body */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg,
    rgba(255, 255, 255, 0.008) 0,
    rgba(255, 255, 255, 0.008) 1px,
    transparent 1px,
    transparent 3px);
}

main,
footer.site-foot {
  position: relative;
  z-index: 1;
}

::selection {
  background: rgba(229, 161, 61, 0.32);
  color: #fff;
}

a {
  color: var(--accent-hi);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

a:hover {
  color: var(--accent);
}

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

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

p {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  cursor: pointer;
}

code, pre, kbd {
  font-family: var(--font-mono);
}

/* ----------------------------- layout ----------------------------- */
.container {
  width: 100%;
  max-width: var(--w-max);
  margin-inline: auto;
}

.section {
  margin-block: var(--s-9);
}

.section:first-of-type {
  margin-block-start: var(--s-8);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  margin-block-end: var(--s-5);
}

.section-title {
  font-size: var(--t-2xl);
  letter-spacing: -0.02em;
}

.kicker {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

@media (max-width: 640px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
  }
}

.kicker .tick {
  color: var(--accent);
  margin-inline-end: 0.6em;
}

/* page title block (non-home pages) */
.page-head {
  display: grid;
  gap: var(--s-3);
  margin-block: var(--s-5) var(--s-6);
  max-width: 720px;
}

.page-head h1 {
  font-size: clamp(2rem, 5.2vw, var(--t-4xl));
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.page-head .lede {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-1);
  max-width: 58ch;
}

/* ----------------------------- masthead ----------------------------- */
.masthead {
  position: sticky;
  top: 0;
  margin-block-start: 10px;
  z-index: 50;
  background: rgba(30, 32, 36, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border-block-end: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mast-inner {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  height: 60px;
  max-width: var(--w-max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--ink-0);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand:hover {
  color: var(--ink-0);
}

.brand .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(79, 196, 124, 0.55);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  margin-inline-start: auto;
}

.nav a {
  position: relative;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-1);
  padding: 10px 2px;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--ink-0);
}

.nav a[aria-current="page"] {
  color: var(--ink-0);
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* mobile: second row, scrolls horizontally */
@media (max-width: 719px) {
  .mast-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: auto;
    padding-block: 10px 0;
  }

  .brand {
    justify-content: center;
  }

  .nav {
    margin-inline: calc(-1 * var(--pad));
    margin-block-start: 8px;
    overflow-x: auto;
    gap: var(--s-4);
    padding-inline: var(--pad);
    padding-block-end: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* wider trailing fade: clipped links visibly dissolve, hinting the row scrolls */
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 32px), transparent);
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    padding: 10px 4px;
  }
}

/* ----------------------------- surfaces ----------------------------- */
.panel {
  background: linear-gradient(180deg, var(--surface-1), var(--surface-0));
  border-radius: var(--r-l);
  box-shadow: var(--elev-1), inset 0 0 0 1px var(--line);
}

.inset {
  background: var(--inset-0);
  border-radius: var(--r-m);
  box-shadow: var(--inset-1);
}

.screen {
  background: var(--bg-0);
  border-radius: var(--r-m);
  box-shadow: var(--inset-screen);
}

.sheet {
  background: linear-gradient(180deg, var(--sheet-hi), var(--sheet) 120px);
  color: var(--sheet-ink);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sheet), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.sheet-pad {
  padding: clamp(28px, 6vw, 64px);
}

/* ----------------------------- buttons & links ----------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-0);
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-0));
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow:
    inset 0 1px 0 var(--edge-hi-strong),
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 8px 18px -10px rgba(0, 0, 0, 0.6);
  transition:
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
  text-align: center;
}

.btn:hover {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border-color: var(--line-strong);
  box-shadow:
    inset 0 1px 0 var(--edge-hi-strong),
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 12px 22px -10px rgba(0, 0, 0, 0.65);
}

.btn:active {
  transform: scale(0.96);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.4),
    0 1px 1px rgba(0, 0, 0, 0.3);
}

.btn:disabled {
  opacity: 0.65;
  cursor: default;
}

/* primary action — pastel blue, the site's secondary accent */
.btn-primary {
  color: var(--blue-ink);
  background: linear-gradient(180deg, var(--blue-hi), var(--blue));
  border-color: rgba(19, 35, 56, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 10px 22px -10px rgba(143, 181, 221, 0.5);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #b8d3ef, var(--blue-hi));
  border-color: rgba(19, 35, 56, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 14px 26px -10px rgba(143, 181, 221, 0.55);
}

.btn-primary:active {
  box-shadow:
    inset 0 2px 6px rgba(19, 35, 56, 0.35),
    0 1px 1px rgba(0, 0, 0, 0.35);
}

/* secondary action — blue-tinted glass over the chassis */
.btn-ghost {
  background: rgba(143, 181, 221, 0.07);
  border-color: var(--blue-line);
  box-shadow: none;
  color: #c4d8ef;
}

.btn-ghost:hover {
  background: var(--blue-dim);
  border-color: rgba(143, 181, 221, 0.55);
  color: #dbe8f7;
  box-shadow: none;
}

.btn-ghost:active {
  transform: scale(0.96);
  background: var(--blue-dim);
}

.btn-sm {
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 999px;
  gap: 6px;
}

.btn.ok {
  color: var(--green);
  border-color: rgba(79, 196, 124, 0.4);
  background: var(--green-dim);
}

/* link with trailing arrow, for external destinations */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--accent-hi);
  padding: 8px 2px;
  min-height: 36px;
}

.link-arrow .arr {
  transition: transform var(--t-fast) var(--ease);
}

.link-arrow:hover .arr {
  transform: translate(2px, -2px);
}

.link-arrow.external .arr {
  opacity: 0.7;
}

/* ----------------------------- prose (sheet) ----------------------------- */
.prose {
  font-family: var(--font-serif);
  font-size: 1.09rem;
  line-height: 1.78;
  color: var(--sheet-ink);
  max-width: var(--w-prose);
  font-optical-sizing: auto;
}

.prose > * + * {
  margin-block-start: 1.35em;
}

.prose strong {
  font-weight: 600;
}

.prose code {
  font-size: 0.84em;
  font-weight: 500;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  color: var(--sheet-ink);
  overflow-wrap: anywhere;
}

/* code figures — a dark screen sitting on the sheet */
.code {
  margin-block: 2em;
  margin-inline: 0; /* UA figures carry a 40px inline margin — flush with the text */
  max-width: 100%;
}

.code-bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--surface-1), var(--surface-0));
  border-radius: var(--r-m) var(--r-m) 0 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 1px 0 var(--edge-hi);
}

.code-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-1);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-bar .btn {
  margin-inline-start: auto;
}

.code-screen {
  background: var(--bg-0);
  border-radius: 0 0 var(--r-m) var(--r-m);
  box-shadow: var(--inset-screen);
  overflow-x: auto;
  padding: 18px 20px;
}

/* custom scrollbar for the code screens — the default OS bar looks out of place */
.code-screen,
.table-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-2) transparent;
}

.code-screen::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.code-screen::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.code-screen::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 99px;
}

.code-screen::-webkit-scrollbar-thumb:hover,
.table-scroll::-webkit-scrollbar-thumb:hover {
  background: #3d424b;
}

.code-screen pre {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--tok);
  tab-size: 4;
}

.tok-kw { color: var(--tok-kw); }
.tok-type { color: var(--tok-type); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-com { color: var(--tok-com); font-style: italic; }

/* on dark pages, code stands alone as a screen */
.page-dark .code {
  margin-block: 2.2em;
}

.page-dark .code-bar {
  border-radius: var(--r-m) var(--r-m) 0 0;
}

/* inline code on dark backgrounds */
.page-dark code,
.inset code {
  font-size: 0.84em;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--ink-0);
}

/* inline code on the dark warm sheet, even when the page is dark */
.sheet code {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  color: var(--sheet-ink);
  overflow-wrap: anywhere;
}

/* ----------------------------- data tables ----------------------------- */
.table-wrap {
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
  min-width: 640px;
}

.data-table th {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-align: left;
  padding: 12px var(--s-4);
  border-block-end: 1px solid var(--line-strong);
}

.data-table td {
  padding: 14px var(--s-4);
  border-block-end: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.6;
}

.data-table tbody tr:last-child td {
  border-block-end: none;
}

.data-table tbody tr {
  transition: background var(--t-fast) var(--ease);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.data-table td a {
  color: var(--accent-hi);
  text-decoration: underline;
  text-decoration-color: rgba(229, 161, 61, 0.35);
  text-underline-offset: 3px;
}

.data-table td a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* stacked spec cards on small screens */
@media (max-width: 640px) {
  .data-table {
    min-width: 0;
    display: block;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tbody {
    display: grid;
    gap: var(--s-4);
  }

  .data-table tr {
    background: var(--inset-0);
    border-radius: var(--r-m);
    box-shadow: var(--inset-1);
    padding: 6px var(--s-4) var(--s-4);
  }

  .data-table td {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: var(--s-3);
    padding: 8px 0;
    border-block-end: 1px solid var(--line);
  }

  .data-table tr td:last-child {
    border-block-end: none;
  }

  .data-table td::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-2);
    padding-top: 2px;
  }
}

/* ----------------------------- steps ----------------------------- */
.steps {
  display: grid;
  gap: var(--s-5);
}

.step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--s-4);
  position: relative;
}

.step-badge {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: linear-gradient(180deg, var(--surface-1), var(--surface-0));
  border-radius: var(--r-m);
  box-shadow:
    inset 0 1px 0 var(--edge-hi-strong),
    0 1px 2px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px var(--line);
  position: relative;
  z-index: 1;
}

.step::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 40px;
  bottom: calc(-1 * var(--s-5));
  width: 2px;
  border-radius: 2px;
  background: var(--line);
}

.step:last-child::before {
  display: none;
}

.step-body {
  padding-block-end: var(--s-1);
  min-width: 0;
}

.step-body h3 {
  font-size: var(--t-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-block-end: var(--s-2);
}

.step-body p {
  color: var(--ink-1);
  font-size: var(--t-md);
  max-width: 62ch;
}

.step-body h3 + p {
  margin-block-start: 0;
}

.step-body p + p,
.step-body p + .code,
.step-body .code + p {
  margin-block-start: var(--s-4);
}

/* screenshots in a recessed frame */
.shot {
  margin-block-start: var(--s-4);
  padding: 8px;
  background: var(--inset-0);
  border-radius: 10px;
  box-shadow: var(--inset-1), 0 1px 0 rgba(255, 255, 255, 0.05);
}

.shot img {
  display: block;
  width: 100%;
  max-width: 560px; /* full-bleed screenshots read too large in the guide steps */
  height: auto;
  margin-inline: auto;
  border-radius: var(--r-s);
  outline: 1px solid rgba(255, 255, 255, 0.08);
}

/* ----------------------------- home: hero ----------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
  margin-block: clamp(24px, 5vw, 56px) var(--s-8);
}

.hero-name {
  font-size: clamp(3.2rem, 9.5vw, 5.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.98;
  margin-block-end: var(--s-5);
}

/* light-from-above: the letters read as softly lit metal, not flat ink */
.hero-name {
  background: linear-gradient(180deg, #f7f8f9 0%, #c6cbd2 52%, #8f959e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-name .u {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  background: none;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-style: italic;
  color: var(--ink-1);
  margin-block-end: var(--s-5);
}

/* hero table of contents */
.toc {
  padding: var(--s-5);
}

.toc-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-block-end: var(--s-4);
}

.toc-list {
  display: grid;
  gap: 2px;
}

.toc a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: var(--s-2) var(--s-3);
  align-items: baseline;
  padding: 10px 12px;
  border-radius: var(--r-m);
  color: var(--ink-0);
  transition: background var(--t-fast) var(--ease);
}

.toc a:hover {
  background: rgba(255, 255, 255, 0.045);
}

.toc .n {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  transition: color var(--t-fast) var(--ease);
}

.toc a:hover .n {
  color: var(--accent);
}

.toc .t {
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: 0;
  color: var(--ink-1);
}

.toc .d {
  grid-column: 2;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.45;
}

/* ----------------------------- home: index rows ----------------------------- */
.index {
  display: grid;
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.index-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: var(--s-4) clamp(16px, 4vw, 48px);
  align-items: center;
  background: var(--bg-1);
  padding: clamp(18px, 3vw, 28px) var(--s-5);
  border-radius: 2px;
  transition: background var(--t-med) var(--ease);
}

.index-row:hover {
  background: var(--surface-0);
}

.index-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  transition: color var(--t-fast) var(--ease);
}

.index-row:hover .index-num {
  color: var(--accent);
}

.index-title {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.index-desc {
  font-size: var(--t-md);
  color: var(--ink-1);
  margin-block-start: 4px;
  max-width: 52ch;
}

.index-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-self: end;
  align-items: center;
}

@media (max-width: 860px) {
  .index-row {
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .index-links {
    grid-column: 2;
    justify-self: start;
    margin-block-start: var(--s-2);
  }
}

/* ----------------------------- support ----------------------------- */
.contact-panel {
  padding: clamp(24px, 5vw, 48px);
  display: grid;
  gap: var(--s-5);
  justify-items: start;
  max-width: 640px;
}

.contact-email {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-0);
  overflow-wrap: anywhere;
}

.contact-email:hover {
  color: var(--accent-hi);
}

/* ----------------------------- footer ----------------------------- */
.site-foot {
  margin-block-start: var(--s-9);
  border-block-start: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  padding-block: var(--s-6);
}

.foot-inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink-1);
}

.foot-brand .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.foot-links {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-inline-start: auto;
}

.foot-links a {
  font-size: 12.5px;
  color: var(--ink-2);
}

.foot-links a:hover {
  color: var(--ink-0);
}

.foot-copy {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  width: 100%;
}

/* ----------------------------- responsive ----------------------------- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--s-6);
  }

  .toc {
    max-width: 560px;
  }

  .section {
    margin-block: var(--s-7);
  }
}

@media (max-width: 480px) {
  .index-links .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ----------------------------- scroll reveal (fades in once, stays) ----------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .fade-io {
    opacity: 0;
    transform: translateY(8px);
    transition:
      opacity 340ms var(--ease),
      transform 340ms var(--ease);
  }

  .fade-io.is-in {
    opacity: 1;
    transform: none;
  }
}

/* intro fade — the lead + the blocks named in data-typewrite-then fade in
   together on load (no typing, no pauses) */
@media (prefers-reduced-motion: no-preference) {
  /* the hide is instant (no transition here) so the first paint never
     flashes visible → hidden; the fade plays only on the way in */
  .tw-rest {
    opacity: 0;
  }

  .tw-rest.tw-in {
    opacity: 1;
    transition: opacity 900ms var(--ease);
  }

  /* the lead fades in as the blocks below it do — together, no typing */
  .tw-lead {
    opacity: 0;
  }

  .tw-lead.tw-lead-in {
    opacity: 1;
    transition: opacity 900ms var(--ease);
  }
}

/* ----------------------------- entrance ----------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: rise 500ms var(--ease) both;
  }

  .reveal[data-delay="1"] { animation-delay: 80ms; }
  .reveal[data-delay="2"] { animation-delay: 160ms; }
  .reveal[data-delay="3"] { animation-delay: 240ms; }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
  }
}

/* ----------------------------- wizard (guide part 1) ----------------------------- */
[hidden] {
  display: none !important;
}

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

.wiz-shell {
  padding: clamp(20px, 4vw, 36px);
  outline: none;
}

.wizard-step.is-hidden,
.os-opt.is-hidden {
  display: none;
}

/* OS choice cards — selection is a control, so blue, not amber */
.os-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
  margin: 0 0 var(--s-3);
  padding: 0;
  border: 0;
}
.os-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  padding: 14px 16px;
  background: var(--inset-0);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--inset-1);
  cursor: pointer;
  transition:
    background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}
.os-card:hover {
  background: var(--surface-0);
  border-color: var(--line-strong);
}
.os-card:focus-within {
  border-color: var(--blue-line);
  box-shadow: var(--inset-1), 0 0 0 2px var(--blue-dim);
}
.os-card.is-selected {
  border-color: rgba(79, 196, 124, 0.55);
  box-shadow: var(--inset-1), 0 0 14px rgba(79, 196, 124, 0.12);
}
.os-name {
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--ink-0);
}
/* selection indicator: a dark dot that lights up green — the same green as the
   brand status dot, so "this is the active one" reads like the masthead does */
.os-dot {
  appearance: none;
  -webkit-appearance: none;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--bg-0);
  border: 1px solid var(--line-strong);
  box-shadow: none;
  transition:
    background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}
.os-dot:checked {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 6px rgba(79, 196, 124, 0.9), 0 0 16px rgba(79, 196, 124, 0.45);
}
.os-ver {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* per-OS download list */
.dl-list {
  list-style: none;
  margin: 0 0 var(--s-3);
  padding: 0;
  display: grid;
  gap: var(--s-3);
  font-size: var(--t-md);
}
.dl-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.dl-list a {
  color: var(--accent-hi);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(229, 161, 61, 0.4);
}
.dl-list a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.dl-src {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.step-note {
  font-size: var(--t-sm);
  color: var(--ink-2);
}

/* wizard footer: back / progress / next */
.wiz-controls {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-block-start: var(--s-6);
  padding-block-start: var(--s-5);
  border-block-start: 1px solid var(--line);
}
.wiz-progress {
  margin-inline: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

/* one-way step reveal, same 340ms language as .fade-io */
@media (prefers-reduced-motion: no-preference) {
  .wizard-step.wiz-enter {
    opacity: 0;
    transform: translateY(8px);
    transition:
      opacity 340ms var(--ease),
      transform 340ms var(--ease);
  }
  .wizard-step.wiz-enter.wiz-shown {
    opacity: 1;
    transform: none;
  }
}

/* stacked wizard shell on narrow screens */
@media (max-width: 480px) {
  .os-grid {
    grid-template-columns: 1fr;
  }
  .wiz-controls {
    flex-wrap: wrap;
  }
  .wiz-progress {
    order: 3;
    width: 100%;
    text-align: center;
    margin-block-start: var(--s-2);
  }
}

/* ----------------------------- reduced motion ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .nav a,
  .link-arrow .arr {
    transition: none;
    animation: none;
  }

  .btn:active {
    transform: none;
  }

  .reveal {
    animation: none;
  }
}
