/* frds.io: an editorial look, white paper and ink with one accent colour. Plain CSS:
   layers, nesting, light-dark() tokens, popovers for the phone menu and for
   enlarging screenshots, scroll-driven reveals and cross-document view
   transitions where the browser has them. */

@layer reset, flow, fonts, tokens, base, layout, components, pages, motion;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, ul, ol, dl, dd, figure, pre, blockquote { margin: 0; }
  ul[class], ol[class] { padding: 0; list-style: none; }
  img, picture { display: block; max-inline-size: 100%; block-size: auto; }
  button { font: inherit; color: inherit; }
  table { border-collapse: collapse; }
}

@layer fonts {
  @font-face {
    font-family: "Source Serif 4"; font-style: normal; font-display: swap; font-weight: 200 900;
    src: url("fonts/source-serif-4.woff2") format("woff2");
  }
  @font-face {
    font-family: "Source Serif 4"; font-style: italic; font-display: swap; font-weight: 200 900;
    src: url("fonts/source-serif-4-italic.woff2") format("woff2");
  }
  @font-face {
    font-family: "Source Sans 3"; font-style: normal; font-display: swap; font-weight: 200 900;
    src: url("fonts/source-sans-3.woff2") format("woff2");
  }
  @font-face {
    font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800;
    src: url("fonts/jetbrains-mono.woff2") format("woff2");
  }
}

@layer tokens {
  :root {
    color-scheme: light dark;
    --serif: "Source Serif 4", "Iowan Old Style", "Charter", Georgia, serif;
    --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, Consolas, monospace;
    --wrap: 76rem;
    --radius: 10px;
    --night-ink: #f2f2f0;
    --shadow: 0 1px 0 light-dark(#0000000a, #00000040), 0 18px 50px -24px light-dark(#10182033, #00000099);
  }

  /* The system's theme, unless the visitor picks one with the toggle in the header. */
  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"] { color-scheme: dark; }

  /* White paper and near-black ink with one accent, the blue of the M on
     mingze-gao.com (#0088ff), and a dark theme to match. */
  :root {
    --paper: light-dark(#ffffff, #0d1117);
    --paper-deep: light-dark(#f3f6fa, #131a23);
    --card: light-dark(#ffffff, #18212c);
    --ink: light-dark(#111722, #e8eef6);
    --ink-soft: light-dark(#3b4656, #b6c2d1);
    --muted: light-dark(#647083, #8b98aa);
    --rule: light-dark(#e0e6ee, #242e3a);
    --rule-strong: light-dark(#c4cfdc, #344152);
    --accent: light-dark(#0088ff, #3d9eff);
    --accent-ink: light-dark(#0064c8, #7cbcff);
    --accent-display: light-dark(#0088ff, #4aa6ff);
    --accent-wash: light-dark(#e3f1ff, #0f2a47);
    --night: #0c1420;
    --night-muted: #a7b6c9;
    --code-key: #7cbcff;
    --code-str: #e9d28f;
  }

}

@layer base {
  html { scroll-padding-block-start: 5.5rem; -webkit-text-size-adjust: 100%; }
  @media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
  body {
    font-family: var(--sans); font-size: 1.125rem; line-height: 1.6;
    color: var(--ink); background: var(--paper);
    font-size-adjust: from-font; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  }
  h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -0.012em; text-wrap: balance; font-optical-sizing: auto; }
  h3 { font-family: var(--sans); font-weight: 650; letter-spacing: 0; line-height: 1.3; }
  p, li, dd { text-wrap: pretty; }
  a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
  a:hover { text-decoration-thickness: 2px; }
  code { font-family: var(--mono); font-size: 0.84em; }
  :not(pre) > code { background: var(--paper-deep); border: 1px solid var(--rule); padding: 0.05em 0.35em; border-radius: 5px; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
  ::selection { background: var(--accent-wash); }
  .visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .skip {
    position: absolute; inset-inline-start: 1rem; inset-block-start: -4rem; z-index: 100;
    background: var(--card); padding: 0.5rem 1rem; border-radius: 8px;
    &:focus { inset-block-start: 1rem; }
  }
}

@layer layout {
  .wrap { inline-size: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
  .narrow { --wrap: 48rem; }
  .center { text-align: center; justify-content: center; margin-inline: auto; }
}

@layer components {
  /* Header */
  .site-header {
    position: sticky; inset-block-start: 0; z-index: 50;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(12px);
    border-block-end: 1px solid var(--rule);
    view-transition-name: site-header;
  }
  .header-row { display: flex; align-items: center; gap: 1.5rem; min-block-size: 4.25rem; }
  .brand {
    display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none;
    .brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.55rem; letter-spacing: -0.02em; }
    .brand-full {
      font-size: 0.68rem; line-height: 1.15; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
      padding-inline-start: 0.6rem; border-inline-start: 1px solid var(--rule-strong);
      @media (width < 34rem) { display: none; }
    }
  }
  .site-header nav { margin-inline-start: auto; }
  .site-menu {
    display: flex; align-items: center; gap: 0.25rem 1.75rem;
    a:not(.button) { color: var(--ink-soft); text-decoration: none; font-weight: 550; padding-block: 0.35rem; border-block-end: 2px solid transparent; }
    a:not(.button):hover { color: var(--ink); border-color: var(--rule-strong); }
    a[aria-current]:not(.button) { color: var(--ink); border-color: var(--accent); }
  }
  .menu-button { display: none; }
  .theme-toggle {
    order: 3; display: grid; place-items: center; inline-size: 2.5rem; block-size: 2.5rem; padding: 0;
    border: 1px solid var(--rule-strong); border-radius: 999px; background: transparent; color: var(--ink-soft); cursor: pointer;
    svg { grid-area: 1 / 1; inline-size: 1.15rem; block-size: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
    .icon-moon { fill: currentColor; stroke: none; }
    &:hover { color: var(--ink); border-color: var(--ink-soft); }
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon, :root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
  /* Screenshots come in both themes; only the one in use is shown (and loaded). */
  :root:not([data-theme="light"]) .for-light, :root[data-theme="light"] .for-dark { display: none; }
  @media (width >= 48rem) {
    .site-menu[popover] {
      position: static; inset: auto; margin: 0; padding: 0; border: 0;
      background: none; color: inherit; overflow: visible; display: flex;
    }
  }
  @media (width < 48rem) {
    .theme-toggle { order: 0; margin-inline-start: auto; }
    .menu-button {
      display: grid; place-items: center;
      inline-size: 2.75rem; block-size: 2.75rem; border: 1px solid var(--rule-strong);
      border-radius: 8px; background: transparent; cursor: pointer; anchor-name: --menu-button;
    }
    .menu-icon, .menu-icon::before, .menu-icon::after {
      display: block; inline-size: 1.1rem; block-size: 2px; background: currentColor; border-radius: 2px; content: "";
    }
    .menu-icon { position: relative; }
    .menu-icon::before { position: absolute; inset-block-start: -6px; }
    .menu-icon::after { position: absolute; inset-block-start: 6px; }
    .site-header nav { margin: 0; }
    .site-menu[popover] {
      inset: auto; inset-block-start: 4.75rem; inset-inline-end: 1rem;
      inset-block-start: anchor(--menu-button bottom);
      margin-block-start: 0.5rem; flex-direction: column; align-items: stretch; gap: 0.15rem;
      min-inline-size: 15rem; padding: 0.6rem;
      background: var(--card); color: var(--ink);
      border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow);
      a:not(.button) { display: block; padding: 0.65rem 0.75rem; border: 0; border-radius: 6px; }
      a:not(.button):hover { background: var(--paper-deep); }
      .button { inline-size: 100%; margin-block-start: 0.35rem; }
      &:not(:popover-open) { display: none; }
    }
  }

  /* Buttons and links. Solid colours only, so no gradient edge can show. */
  .button {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.7rem 1.35rem; border-radius: 8px; font-weight: 650; text-decoration: none; line-height: 1.2;
    border: 0; transition: background-color 0.15s ease, translate 0.15s ease;
    &:hover { translate: 0 -1px; }
    &.small { padding: 0.5rem 1rem; font-size: 0.98rem; }
    &.large { padding: 0.95rem 1.6rem; font-size: 1.08rem; }
    &.ink { background: var(--ink); color: var(--paper); &:hover { background: var(--accent-ink); color: #fff; } }
    &.paper { background: var(--night-ink); color: var(--night); &:hover { background: #fff; } }
    &.line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-strong); &:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent-ink); } }
    svg { inline-size: 1.15em; block-size: 1.15em; fill: currentColor; flex: none; }
  }
  .text-link {
    font-weight: 650; color: var(--ink); text-decoration: none; border-block-end: 1.5px solid var(--rule-strong);
    &:hover { border-color: var(--accent); color: var(--accent-ink); }
    &.light { color: var(--night-ink); border-color: #ffffff55; &:hover { color: #fff; border-color: #fff; } }
  }
  .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-block-start: 2rem; }

  .eyebrow {
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink);
    display: flex; align-items: center; gap: 0.75rem;
    &::before { content: ""; inline-size: 1.75rem; block-size: 1px; background: currentColor; }
  }
  .section-head {
    max-inline-size: 46rem; margin-block-end: 3rem;
    h2 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); margin-block-start: 0.9rem; }
  }

  .ticks {
    display: grid; gap: 0.6rem; margin-block-start: 1.5rem;
    li { position: relative; padding-inline-start: 1.6rem; color: var(--ink-soft); }
    li::before {
      content: ""; position: absolute; inset-inline-start: 0.1rem; inset-block-start: 0.62em;
      inline-size: 0.7rem; block-size: 0.38rem; border: solid var(--accent); border-width: 0 0 2px 2px; rotate: -45deg;
    }
  }

  /* Screenshots: an app window, with a button that enlarges it. */
  .shot {
    position: relative; margin: 0;
    .shot-open {
      display: block; inline-size: 100%; padding: 0; border: 1px solid var(--rule-strong); border-radius: var(--radius);
      overflow: clip; background: var(--card); box-shadow: var(--shadow); cursor: zoom-in;
      img { inline-size: 100%; aspect-ratio: 16 / 10; }
    }
    .shot-hint {
      position: absolute; inset-block-end: 0.75rem; inset-inline-end: 0.75rem;
      padding: 0.25rem 0.6rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600;
      background: color-mix(in srgb, var(--ink) 82%, transparent); color: var(--paper);
      opacity: 0; transition: opacity 0.15s ease; pointer-events: none;
    }
    &:hover .shot-hint, &:focus-within .shot-hint { opacity: 1; }
  }
  .zoom-view {
    inset: 0; margin: auto; padding: 0; border: 0; background: transparent;
    inline-size: min(96vw, 1600px); max-block-size: 94dvh; overflow: auto;
    img { inline-size: 100%; block-size: auto; border-radius: 8px; box-shadow: 0 30px 80px #000a; }
    &::backdrop { background: #100d0bd9; backdrop-filter: blur(4px); }
    .zoom-close {
      position: sticky; inset-block-start: 0.5rem; margin-inline-start: auto; margin-block-end: 0.5rem; display: block;
      padding: 0.4rem 0.9rem; border-radius: 6px; border: 0; background: #f3eee6; color: #191612; font-weight: 650; cursor: pointer;
    }
  }

  pre.code {
    font-family: var(--mono); font-size: 0.86rem; line-height: 1.7;
    padding: 1.1rem 1.25rem; border-radius: 8px; overflow: auto; margin-block-start: 1.5rem;
    background: var(--night); color: var(--night-ink);
    b { color: var(--code-key); font-weight: 600; }
    i { color: var(--code-str); font-style: normal; }
  }
}

@layer pages {
  section { padding-block: clamp(4rem, 2.5rem + 6vw, 8rem); }

  /* Hero */
  .hero {
    padding-block: clamp(3.5rem, 2rem + 6vw, 7rem) clamp(4rem, 2rem + 6vw, 7rem);
    h1 {
      font-size: clamp(2.8rem, 1.2rem + 6.2vw, 6.2rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.02;
      margin-block: 1.4rem 1.6rem; max-inline-size: 14ch;
      em { font-style: italic; font-weight: 500; color: var(--accent-display, var(--accent-ink)); }
    }
    .lede { font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem); color: var(--ink-soft); max-inline-size: 44rem; line-height: 1.55; }
    .meta { margin-block-start: 1.5rem; color: var(--muted); font-size: 0.95rem; }
  }
  /* The title on the left and a live lineage graph on the right. */
  .hero-flow { display: none; }
  @media (min-width: 760px) {
    .hero-flow { display: block; aspect-ratio: 1 / 1.08; max-inline-size: 36rem; margin-block-start: 3rem; }
  }
  @media (min-width: 1100px) {
    .hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); align-items: center; }
    .hero h1 { font-size: clamp(3.4rem, 1rem + 4.4vw, 5.4rem); }
    .hero-flow { max-inline-size: none; margin-block-start: 0; }
  }
  .hero-flow {
    border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-deep); overflow: clip;
    opacity: 0; transition: opacity 0.4s ease;
    &.is-ready { opacity: 1; }
    .hf { inline-size: 100%; block-size: 100%; display: flex; flex-direction: column; }
    .hf-canvas { flex: 1; min-block-size: 0; }
    .react-flow {
      --xy-background-color: transparent;
      --xy-background-pattern-color: var(--rule-strong);
      --xy-edge-stroke: var(--rule-strong);
      --xy-edge-stroke-width: 1.4;
      --xy-attribution-background-color: transparent;
      font-family: var(--sans);
    }
    .react-flow__handle { opacity: 0; pointer-events: none; }
    .react-flow__node { cursor: grab; &.dragging { cursor: grabbing; } }
    .react-flow__edge.is-lit path { stroke: var(--accent); stroke-width: 2; }
    .react-flow__edge.is-lit .react-flow__edge-path { stroke: var(--accent); }
    .react-flow__edge.is-dimmed { opacity: 0.45; }
    .react-flow__attribution a { color: var(--muted); }
  }
  .hf-node {
    inline-size: 150px; padding: 0.45rem 0.6rem 0.45rem 0.7rem; border-radius: 7px;
    background: var(--card); color: var(--ink); border: 1px solid var(--rule-strong); border-inline-start: 4px solid var(--kind);
    box-shadow: 0 1px 2px light-dark(#0000000d, #00000040);
    display: grid; gap: 0.1rem; text-align: start;
    transition: opacity 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease;
    &.kind-dataset { --kind: var(--accent); }
    &.kind-script { --kind: light-dark(#c98a12, #e7b04d); }
    &.kind-output { --kind: light-dark(#7a5fc0, #a993ea); }
    .hf-name { font-family: var(--mono); font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hf-note { font-size: 11px; color: var(--muted); white-space: nowrap; }
    &.is-selected { box-shadow: 0 0 0 2px var(--accent), 0 8px 24px -10px light-dark(#0064c855, #000c); }
    &.is-upstream, &.is-downstream { background: var(--accent-wash); }
    &.is-dimmed { opacity: 0.5; }
  }
  .hf-bar {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap;
    padding: 0.6rem 0.9rem; border-block-end: 1px solid var(--rule); background: var(--card); font-size: 0.82rem;
    .hf-title { font-weight: 650; color: var(--ink); span { font-weight: 400; color: var(--muted); } }
  }
  .hf-caption {
    padding: 0.65rem 0.9rem; border-block-start: 1px solid var(--rule); background: var(--card);
    font-size: 0.88rem; color: var(--ink-soft); line-height: 1.4; min-block-size: 3.2em;
  }

  /* Questions */
  .questions { background: var(--paper-deep); border-block: 1px solid var(--rule); }
  .question-list {
    display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: clip;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    counter-reset: q;
    li { background: var(--card); padding: 1.75rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 0.85rem; counter-increment: q; }
    li::before { content: counter(q, decimal-leading-zero); font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
    blockquote { font-family: var(--serif); font-size: 1.45rem; line-height: 1.25; font-weight: 500; font-style: italic; }
    blockquote code { font-style: normal; font-size: 0.72em; }
    p { color: var(--ink-soft); font-size: 1rem; }
    a { margin-block-start: auto; font-weight: 650; font-size: 0.95rem; text-decoration: none; }
    a::after { content: " →"; }
  }

  /* Features: the words in two columns, the screenshot full width below. */
  .feature + .feature { border-block-start: 1px solid var(--rule); }
  .feature-grid { display: grid; gap: 3rem; }
  .feature-text {
    display: grid; align-items: start;
    h2 { font-size: clamp(1.9rem, 1.35rem + 1.8vw, 2.8rem); margin-block: 0.9rem 1rem; }
    > p:not(.eyebrow) { color: var(--ink-soft); }
    @media (width > 60rem) {
      grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 5rem;
      > .eyebrow { grid-column: 1; grid-row: 1; }
      > h2 { grid-column: 1; grid-row: 2 / span 2; margin-block: 0.9rem 0; }
      > p:not(.eyebrow) { grid-column: 2; grid-row: 2; font-size: 1.15rem; margin-block-start: 0.9rem; }
      > :is(ul, pre, dl) { grid-column: 2; grid-row: 3; margin-block-start: 1.25rem; }
    }
  }
  .feature .shot .shot-open { box-shadow: 0 1px 0 #0000000a, 0 30px 70px -30px light-dark(#3b2a1a66, #000000bb); }
  .health { background: var(--card); }
  .health .feature-grid { align-items: center; @media (width > 60rem) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 5rem; } }
  .health .feature-text { display: block; h2 { margin-block-end: 1rem; } }
  .checks {
    margin-block-start: 1.75rem;
    dt { font-weight: 700; padding-block-start: 0.85rem; border-block-start: 1px solid var(--rule); }
    dd { color: var(--ink-soft); padding-block-end: 0.85rem; }
  }
  .health-figure {
    justify-self: center; inline-size: min(100%, 26rem); margin: 0;
    img { border: 1px solid var(--rule-strong); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--card); }
  }

  /* More */
  .more { background: var(--paper-deep); border-block: 1px solid var(--rule); }
  .more-grid {
    display: grid; grid-template-columns: 1fr; column-gap: 3rem;
    @media (width > 40rem) { grid-template-columns: repeat(2, 1fr); }
    @media (width > 62rem) { grid-template-columns: repeat(3, 1fr); }
    border-block-start: 1px solid var(--rule-strong);
    li { padding-block: 1.6rem; border-block-end: 1px solid var(--rule); }
    h3 { font-size: 1.12rem; margin-block-end: 0.4rem; }
    p { color: var(--ink-soft); font-size: 1rem; }
  }
  .formats {
    margin-block-start: 3.5rem; display: grid; gap: 1rem; grid-template-columns: minmax(12rem, 1fr) 3fr; align-items: baseline;
    @media (width < 52rem) { grid-template-columns: 1fr; }
    h3 { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
    .symbols { display: none; }
    .format-groups { display: grid; gap: 1rem; margin: 0; }
    .format-groups > div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem; align-items: baseline; }
    dt { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
    dd { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
    span {
      display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.75rem 0.3rem 0.55rem;
      border: 1px solid var(--rule-strong); border-radius: 999px; font-size: 0.95rem; font-weight: 550; background: var(--card);
    }
    span svg { inline-size: 1.05rem; block-size: 1.05rem; fill: none; stroke: var(--kind); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .kind-data { --kind: var(--accent); }
    .kind-code { --kind: light-dark(#c98a12, #e7b04d); }
    .kind-doc { --kind: light-dark(#7a5fc0, #a993ea); }
  }

  /* Editions */
  .editions-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); max-inline-size: 56rem; }
  .edition {
    display: flex; flex-direction: column; padding: 2rem 2rem 1.75rem; border-radius: var(--radius);
    border: 1px solid var(--rule-strong); background: var(--card);
    h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
    .price { font-family: var(--serif); font-size: 2.4rem; font-weight: 600; letter-spacing: -0.02em; margin-block-start: 0.75rem; line-height: 1.1; }
    .edition-note { color: var(--muted); font-size: 0.98rem; }
    .ticks { margin-block: 1.5rem 2rem; }
    > :last-child { margin-block-start: auto; align-self: start; }
    &.pro { background: var(--paper-deep); border-style: dashed; }
  }

  /* FAQ */
  .faq { border-block-start: 1px solid var(--rule); }
  .faq details {
    border-block-end: 1px solid var(--rule);
    &:first-of-type { border-block-start: 1px solid var(--rule-strong); }
    summary {
      cursor: pointer; padding-block: 1.15rem; font-weight: 650; font-size: 1.12rem;
      display: flex; justify-content: space-between; gap: 1rem; list-style: none;
      &::-webkit-details-marker { display: none; }
      &::after { content: "+"; font-family: var(--mono); color: var(--accent); font-size: 1.3rem; line-height: 1; }
    }
    &[open] summary::after { content: "−"; }
    p { color: var(--ink-soft); padding-block-end: 1.25rem; max-inline-size: 42rem; }
  }

  /* Closing call to action */
  .cta { padding: 0; background: var(--night); color: var(--night-ink); }
  .cta-inner {
    padding-block: clamp(4rem, 8vw, 7rem); text-align: center;
    h2 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.6rem); }
    p { color: var(--night-muted); margin-block-start: 1rem; font-size: 1.15rem; }
  }

  /* Download and Python pages */
  .page-hero {
    padding-block: clamp(3.5rem, 6vw, 5.5rem) 2rem;
    img { margin: 0 auto 1.5rem; }
    h1 { font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4rem); margin-block: 1rem; }
    .lede { margin-inline: auto; color: var(--ink-soft); font-size: 1.25rem; max-inline-size: 38rem; }
    .eyebrow { justify-content: center; }
    .meta { margin-block-start: 1rem; color: var(--muted); font-size: 0.95rem; }
  }
  .page-hero + section { padding-block-start: 1.5rem; }
  .symbols { position: absolute; inline-size: 0; block-size: 0; overflow: hidden; }

  /* Download: the right download for the visitor's computer, then every platform. */
  .dl-hero {
    position: relative; isolation: isolate; padding-block: clamp(3.5rem, 2rem + 5vw, 6.5rem); overflow: clip;
    /* The dotted canvas of the lineage graph, fading out. */
    &::before {
      content: ""; position: absolute; inset: 0; z-index: -1;
      background-image: radial-gradient(var(--rule-strong) 1.1px, transparent 1.4px); background-size: 22px 22px;
      mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 20%, transparent 75%);
    }
  }
  .dl-grid {
    display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center;
    @media (width > 62rem) { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  }
  .dl-copy {
    h1 { font-size: clamp(2.8rem, 1.6rem + 4.4vw, 5rem); letter-spacing: -0.025em; line-height: 1.02; }
    h1 em { font-style: italic; font-weight: 500; color: var(--accent-display, var(--accent-ink)); }
    .lede { margin-block: 1.25rem 2rem; font-size: clamp(1.15rem, 1rem + 0.5vw, 1.35rem); color: var(--ink-soft); max-inline-size: 30rem; }
  }
  .dl-card {
    display: grid; justify-items: start; gap: 0.9rem; padding: 1.6rem 1.75rem; max-inline-size: 32rem;
    border: 1px solid var(--rule-strong); border-radius: calc(var(--radius) + 4px); background: var(--card); box-shadow: var(--shadow);
    &[hidden] { display: none; }
    h2 { font-size: 1.6rem; line-height: 1.15; }
    > p:not([class]) { color: var(--ink-soft); }
    .dl-button { font-size: 1.15rem; padding: 1.05rem 1.7rem; }
  }
  .dl-detected {
    display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-ink);
    &::before { content: ""; inline-size: 0.5rem; block-size: 0.5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
    &[hidden] { display: none; }
  }
  .dl-fine { color: var(--muted); font-size: 0.92rem; }
  .dl-alt {
    display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; padding-block-start: 0.9rem; border-block-start: 1px solid var(--rule); inline-size: 100%;
    font-size: 0.95rem; color: var(--muted);
    a { color: var(--ink-soft); font-weight: 600; text-decoration: none; &:hover { color: var(--accent-ink); text-decoration: underline; } }
  }
  .dl-shot { margin: 0; }

  .dl-all { background: var(--paper-deep); border-block: 1px solid var(--rule); }
  .os-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
  .os {
    display: grid; align-content: start; gap: 1rem; padding: 1.5rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--card);
    header { display: flex; align-items: center; gap: 0.7rem; }
    header svg { inline-size: 1.6rem; block-size: 1.6rem; fill: var(--ink); }
    h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; }
    .os-yours { margin-inline-start: auto; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--accent-wash); color: var(--accent-ink); font-size: 0.78rem; font-weight: 700; }
    .os-yours[hidden] { display: none; }
    .os-req { color: var(--muted); font-size: 0.95rem; }
    .os-files { display: grid; padding: 0; list-style: none; }
    .os-files li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.75rem; border-block-start: 1px solid var(--rule); font-weight: 600; }
    small { font-family: var(--mono); font-size: 0.8rem; font-weight: 500; color: var(--muted); margin-inline-start: 0.3rem; }
    .soon { font-size: 0.85rem; font-weight: 600; color: var(--muted); padding: 0.25rem 0.65rem; border: 1px dashed var(--rule-strong); border-radius: 999px; white-space: nowrap; }
    &.is-yours { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
  }

  .step-row {
    display: grid; gap: 1.25rem 2rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); padding: 0; list-style: none; counter-reset: step;
    li { counter-increment: step; padding-block-start: 1.25rem; border-block-start: 2px solid var(--ink); }
    li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--serif); font-size: 2.6rem; font-weight: 600; line-height: 1; color: var(--accent-display, var(--accent-ink)); margin-block-end: 0.9rem; }
    h3 { font-size: 1.2rem; margin-block-end: 0.4rem; }
    p { color: var(--ink-soft); }
  }
  .dl-footnote { margin-block-start: 3.5rem; color: var(--muted); }

  /* Prose */
  .prose {
    > * + * { margin-block-start: 1rem; }
    h1 { font-size: clamp(2.2rem, 1.6rem + 2.2vw, 3.1rem); }
    h2 { font-size: 1.7rem; margin-block-start: 2.75rem; }
    h3 { font-size: 1.15rem; margin-block-start: 2rem; }
    p, li, td { color: var(--ink-soft); }
    :is(ul, ol):not([class]) { padding-inline-start: 1.25rem; li + li { margin-block-start: 0.4rem; } }
    pre:not(.code) { font-family: var(--mono); font-size: 0.86rem; padding: 1rem 1.15rem; border-radius: 8px; overflow: auto; background: var(--night); color: var(--night-ink); }
    pre code { background: none; border: 0; padding: 0; color: inherit; }
    kbd { font-family: var(--mono); font-size: 0.8em; padding: 0.1em 0.45em; border-radius: 5px; border: 1px solid var(--rule-strong); border-block-end-width: 2px; background: var(--card); color: var(--ink); }
    table { inline-size: 100%; font-size: 1rem; }
    th, td { text-align: start; padding: 0.6rem 0.75rem; border-block-end: 1px solid var(--rule); vertical-align: top; }
    th { color: var(--ink); font-weight: 650; }
    .grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-block: 2rem; }
    .card {
      padding: 1.25rem 1.35rem; border-radius: var(--radius); border: 1px solid var(--rule-strong); background: var(--card);
      h3 { margin: 0 0 0.3rem; } p { margin: 0; font-size: 1rem; }
      position: relative;
      h3 a { text-decoration: none; color: var(--ink); } h3 a::after { content: " →"; color: var(--accent); }
      /* The whole card is the link. */
      h3 a::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
      &:hover { border-color: var(--accent); h3 a { color: var(--accent-ink); } }
      &:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
      h3 a:focus-visible { outline: none; }
    }
    figure.shot { margin-block: 1.75rem; }
  }

  /* Guide pages */
  .docs-shell {
    display: grid; gap: 2.5rem; padding-block: 3rem 5rem;
    @media (width > 56rem) { grid-template-columns: 14rem minmax(0, 1fr); }
    @media (width > 80rem) { grid-template-columns: 14rem minmax(0, 1fr) 13rem; }
  }
  .docs-nav {
    font-size: 1rem;
    h2 { font-family: var(--sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-block-end: 0.75rem; }
    ol { display: grid; gap: 0.1rem; padding: 0; list-style: none; counter-reset: g; }
    li { counter-increment: g; }
    a {
      display: flex; gap: 0.6rem; padding: 0.45rem 0.7rem; border-radius: 6px; color: var(--ink-soft); text-decoration: none; font-weight: 550;
      &::before { content: counter(g); font-family: var(--mono); font-size: 0.78rem; color: var(--muted); padding-block-start: 0.2rem; min-inline-size: 1ch; }
      &:hover { background: var(--paper-deep); color: var(--ink); }
      &[aria-current] { background: var(--card); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
    }
    @media (width > 56rem) { position: sticky; inset-block-start: 6rem; align-self: start; }
    @media (width <= 56rem) { ol { display: flex; flex-wrap: wrap; gap: 0.4rem; } a { border: 1px solid var(--rule); } }
  }
  .docs-main { max-inline-size: 46rem; min-inline-size: 0; }
  .crumbs {
    font-size: 0.92rem; color: var(--muted); margin-block-end: 1.25rem;
    a { color: var(--muted); }
    span::before { content: "/"; margin-inline: 0.5rem; color: var(--rule-strong); }
  }
  .docs-toc {
    font-size: 0.92rem; align-self: start; position: sticky; inset-block-start: 6rem;
    h2 { font-family: var(--sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-block-end: 0.6rem; }
    ul { display: grid; gap: 0.35rem; border-inline-start: 1px solid var(--rule); padding-inline-start: 0.9rem; list-style: none; margin: 0; }
    a { color: var(--ink-soft); text-decoration: none; &:hover { color: var(--accent-ink); } }
    @media (width <= 80rem) { display: none; }
  }
  .pager {
    display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; margin-block-start: 4rem;
    a {
      display: grid; gap: 0.15rem; padding: 1rem 1.25rem; border: 1px solid var(--rule-strong); border-radius: var(--radius);
      background: var(--card); text-decoration: none; color: var(--ink); font-weight: 650; font-size: 1.08rem;
      small { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
      &:hover { border-color: var(--accent); }
    }
    .next { grid-column: 2; text-align: end; }
  }

  /* Footer */
  .site-footer { background: var(--night); color: var(--night-muted); padding-block: 4rem 2rem; font-size: 0.98rem; }
  .cta + .site-footer, .cta ~ .site-footer { border-block-start: 1px solid #ffffff1a; }
  .site-footer .brand { color: var(--night-ink); }
  .footer-base a { color: var(--night-ink); text-decoration: none; &:hover { text-decoration: underline; } }
  .footer-grid {
    display: grid; gap: 2.5rem; grid-template-columns: 2fr repeat(3, 1fr);
    @media (width < 52rem) { grid-template-columns: repeat(2, 1fr); }
    h2 { font-family: var(--sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--night-ink); margin-block-end: 0.9rem; }
    ul { display: grid; gap: 0.5rem; padding: 0; list-style: none; }
    a:not(.brand) { color: var(--night-muted); text-decoration: none; &:hover { color: var(--night-ink); text-decoration: underline; } }
  }
  .footer-brand { @media (width < 52rem) { grid-column: 1 / -1; } p { margin-block-start: 0.9rem; max-inline-size: 22rem; } }
  .footer-base {
    margin-block-start: 3rem; padding-block-start: 1.5rem; border-block-start: 1px solid #ffffff1f;
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; font-size: 0.88rem;
  }
}

@layer pages {
  h2 em {
    font-style: italic; font-weight: 500; color: var(--accent-display, var(--accent-ink));
    background: linear-gradient(currentColor, currentColor) no-repeat 0 94% / 100% 0.07em;
    padding-block-end: 0.04em;
  }
}

@layer motion {
  @view-transition { navigation: auto; }
  @media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

  @media (prefers-reduced-motion: no-preference) {
    @supports ((animation-timeline: view()) and (animation-range: entry)) {
      @keyframes rise { from { opacity: 0; translate: 0 2rem; } }
      .feature-grid > *, .question-list li, .more-grid li {
        animation: rise linear backwards;
        animation-timeline: view();
        animation-range: entry 0% entry 35%;
      }
    }
    @supports (animation-timeline: view()) {
      @keyframes underline { from { background-size: 0 0.07em; } }
      @keyframes lean { from { letter-spacing: 0.04em; opacity: 0.4; } }
      h2 em {
        animation: underline linear both, lean linear both;
        animation-timeline: view(), view();
        animation-range: entry 60% cover 40%, entry 40% cover 32%;
      }
    }
    .site-menu[popover], .zoom-view {
      transition: opacity 0.18s ease-out, display 0.18s allow-discrete, overlay 0.18s allow-discrete;
      @starting-style { &:popover-open { opacity: 0; } }
    }
  }
}
