/*
 * The public site: the landing page, the guides, and whatever else gets served
 * to someone who is not signed in.
 *
 * Loaded after base.css. The first block re-points base.css's token names at
 * this palette - so .banner, .badge and anything else shared would follow the
 * public skin if it ever appeared here - and then adds the tokens only the
 * public site has: an accent, the inverted section, the fluid type ramp.
 *
 * Fonts are declared here rather than in their own file because this is the
 * only surface that uses them. Re-download the .woff2 files with
 * scripts/fetch-fonts.sh; both families are variable, so one file per subset
 * covers every weight and the `font-weight` ranges below say so.
 */

/* latin */
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/public/vendor/fonts/public-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/public/vendor/fonts/public-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(/public/vendor/fonts/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(/public/vendor/fonts/jetbrains-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@layer tokens {
  :root {
    /* ── The marketing skin, over base.css's names ─────────────────────── */
    --font-sans: "Public Sans", Helvetica, Arial, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

    --ink: #0f172a;
    --ink-body: #33405a;
    --ink-muted: #5b6577;
    --ink-faint: #8a93a3;
    --ink-ghost: #a6adba;
    --ink-hover: #26334c;

    --line: #ecedf1; /* between sections */
    --line-strong: #e2e5ea; /* above a feature column */
    --line-card: #e7e9ee; /* around a card or panel */
    --line-field: #dfe2e9; /* inputs and secondary buttons */
    --line-soft: #eef0f3; /* inside a panel */
    --line-faint: #f4f5f7; /* between table rows */

    --surface: #fff;
    --wash: #fafafb; /* the alternating section background */
    --panel: #fbfbfc; /* the fake browser chrome bar */

    --accent: #e8405a;

    /* The inverted "you can take it with you" section. */
    --night: #0f172a;
    --night-deep: #0b1220;
    --night-edge: #24314b;
    --night-rule: #1b2740;
    --night-text: #aab4c6;
    --night-faint: #8a97b0;
    --night-code: #dbe3f0;
    --night-green: #7fd1a3;

    /* ── Fluid type ───────────────────────────────────────────────────── */
    /* Sized against the viewport so the page scales continuously instead of
       stepping at breakpoints. */
    --text-hero: clamp(38px, 7.4vw, 76px);
    --text-lede: clamp(17px, 2.2vw, 21px);
    --text-title: clamp(30px, 4.4vw, 46px);
    --text-title-lg: clamp(30px, 4.6vw, 48px);
    --text-subhead: clamp(16px, 2vw, 18.5px);
    --text-prose: clamp(16px, 1.9vw, 17.5px);
    --text-price: clamp(40px, 5.5vw, 54px);
    --text-code: clamp(11px, 2.4vw, 13px);

    /* ── Rhythm ───────────────────────────────────────────────────────── */
    --gutter: clamp(20px, 5vw, 40px);
    --shell: 1160px;
    --section-y: clamp(64px, 9vw, 120px);
    --section-y-sm: clamp(56px, 8vw, 104px);
    --stack: clamp(36px, 5vw, 60px);
    --header-h: 68px;

    /* The width at which the nav has room for every link plus both buttons -
       between the usual tablet and desktop breakpoints, so it gets its own. */
    --nav-breakpoint: 1060px;
  }
}

@layer base {
  body {
    background: var(--surface);
    color: var(--ink);
  }

  /* Anchor links land below the sticky header rather than under it. */
  :target {
    scroll-margin-block-start: calc(var(--header-h) + 1rem);
  }
}

@layer components {
  /* ══ Layout primitives ════════════════════════════════════════════════ */

  .shell {
    max-inline-size: var(--shell);
    margin-inline: auto;
  }

  .section {
    padding: var(--section-y) var(--gutter);
    border-block-start: 1px solid var(--line);
  }

  .section--sm {
    padding-block: var(--section-y-sm);
  }

  .section--wash {
    background: var(--wash);
  }

  .section--dark {
    border-block-start: 0;
    background: var(--night);
    color: #fff;
  }

  /* Every multi-column band on the page is this one grid, told how narrow a
     column may get before it wraps. */
  .cols {
    display: grid;
    gap: var(--col-gap, clamp(28px, 4vw, 52px));
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--col-min, 280px)), 1fr));
  }

  .eyebrow {
    margin-block-end: 18px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }

  .section-title {
    font-size: var(--text-title);
    line-height: 1.08;
    letter-spacing: -0.035em;
    font-weight: 700;
  }

  .section-lede {
    margin-block-start: 20px;
    max-inline-size: 620px;
    font-size: var(--text-subhead);
    line-height: 1.6;
    color: var(--ink-muted);
  }

  .section-intro {
    max-inline-size: 720px;
  }

  /* ══ Calls to action ══════════════════════════════════════════════════ */

  .cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 26px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 15.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms, border-color 120ms;
  }

  .cta--primary {
    background: var(--ink);
    color: #fff;

    &:hover {
      background: var(--ink-hover);
      color: #fff;
    }
  }

  .cta--secondary {
    background: var(--surface);
    border-color: var(--line-field);
    color: var(--ink);

    &:hover {
      border-color: var(--ink);
    }
  }

  .cta--sm {
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 14.5px;
  }

  /* ══ Header ═══════════════════════════════════════════════════════════ */

  .site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 50;
    border-block-end: 1px solid var(--line);
    /* Slightly translucent so content scrolling under it stays suggested
       rather than hidden. */
    background: rgb(255 255 255 / 0.88);
    backdrop-filter: saturate(180%) blur(12px);
  }

  .site-header__bar {
    max-inline-size: var(--shell);
    margin-inline: auto;
    block-size: var(--header-h);
    padding-inline: var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  .site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;

    & img {
      block-size: 26px;
      inline-size: auto;
    }
  }

  .site-logo__suffix {
    padding-inline-start: 10px;
    border-inline-start: 1px solid var(--line-strong);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink-muted);
  }

  .site-nav {
    display: none;
    align-items: center;
    gap: 26px;
  }

  .site-nav__link {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ink-muted);
    white-space: nowrap;

    &:hover {
      color: var(--ink);
    }
  }

  .site-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
  }

  .site-header__signin {
    display: none;
    padding: 9px 12px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ink-muted);
    white-space: nowrap;

    &:hover {
      color: var(--ink);
    }
  }

  .burger {
    display: grid;
    place-content: center;
    gap: 4px;
    inline-size: 40px;
    block-size: 40px;
    border: 1px solid var(--line-card);
    border-radius: 8px;

    & span {
      display: block;
      inline-size: 16px;
      block-size: 1.5px;
      background: var(--ink);
    }
  }

  .mobile-menu {
    display: grid;
    padding: 8px var(--gutter) 20px;
    border-block-start: 1px solid var(--line-faint);
    background: var(--surface);

    & a {
      padding-block: 12px;
      font-size: 16px;
      font-weight: 500;
    }

    & a:not(:last-child) {
      border-block-end: 1px solid var(--line-faint);
    }
  }

  /* Above the breakpoint the full nav appears and the burger goes away. */
  @media (width >= 1060px) {
    .site-nav,
    .site-header__signin {
      display: flex;
    }

    .burger,
    .mobile-menu {
      display: none;
    }
  }

  /* ══ Hero ═════════════════════════════════════════════════════════════ */

  .hero {
    padding: clamp(64px, 11vw, 136px) var(--gutter) clamp(48px, 7vw, 80px);
  }

  .hero__intro {
    max-inline-size: 900px;
    margin-inline: auto;
    text-align: center;
  }

  .hero__title {
    font-size: var(--text-hero);
    line-height: 1.02;
    letter-spacing: -0.04em;
    font-weight: 700;
  }

  .hero__lede {
    margin: clamp(20px, 3vw, 28px) auto 0;
    max-inline-size: 600px;
    font-size: var(--text-lede);
    line-height: 1.55;
    color: var(--ink-muted);

    & a {
      color: var(--ink);
      text-decoration: underline;
      text-decoration-color: #c9ced8;
      text-underline-offset: 3px;
    }
  }

  .hero__actions {
    margin-block-start: clamp(28px, 4vw, 40px);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .hero__note {
    margin-block-start: 18px;
    font-size: 14px;
    color: var(--ink-faint);
  }

  .hero__showcase {
    max-inline-size: var(--shell);
    margin: clamp(48px, 7vw, 84px) auto 0;
  }

  /* ── The fake browser window around the storefront screenshot ───────── */

  .browser {
    overflow: hidden;
    border: 1px solid var(--line-card);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 24px 60px -32px rgb(15 23 42 / 0.28);
  }

  .browser__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-block-end: 1px solid var(--line-soft);
    background: var(--panel);
  }

  .browser__dot {
    inline-size: 9px;
    block-size: 9px;
    border-radius: var(--radius-pill);
    background: var(--line-strong);
  }

  .browser__url {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-inline-start: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-faint);

    &::before {
      content: "";
      inline-size: 6px;
      block-size: 6px;
      border-radius: var(--radius-pill);
      background: var(--accent);
    }
  }

  .browser__screen {
    aspect-ratio: 16 / 9;
    min-block-size: 220px;
    overflow: hidden;
    background: #0a2450;

    & img {
      inline-size: 100%;
      block-size: 100%;
      object-fit: cover;
      object-position: 50% 0;
    }
  }

  .showcase-caption {
    margin-block-start: 16px;
    text-align: center;
    font-size: 13.5px;
    color: var(--ink-faint);
  }

  /* Stands in for a screenshot that has not been dropped in yet. Hatched so it
     reads as a deliberate placeholder rather than a broken image. */
  .placeholder {
    display: grid;
    place-items: center;
    block-size: 100%;
    padding: 24px;
    background-color: var(--wash);
    background-image: repeating-linear-gradient(
      135deg,
      var(--line-faint) 0 10px,
      var(--wash) 10px 20px
    );
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }

  .browser__screen:has(.placeholder) {
    background: none;
  }

  /* ══ Feature columns ══════════════════════════════════════════════════ */

  .lede-col {
    display: grid;
    gap: 18px;
    max-inline-size: 560px;
    font-size: var(--text-prose);
    line-height: 1.62;
    color: var(--ink-muted);
  }

  .lede-col__last {
    color: var(--ink);
  }

  .point__title {
    margin-block-end: 10px;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.025em;
  }

  .point__body {
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-muted);
  }

  /* The twelve-up "what you get" grid, each item under its own rule. */
  .feature {
    border-block-start: 1px solid var(--line-strong);
    padding-block-start: 18px;
  }

  .feature__title {
    margin-block-end: 8px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  .feature__body {
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--ink-muted);
  }

  /* ══ Comparison table ═════════════════════════════════════════════════ */

  .compare {
    margin-block-start: clamp(36px, 5vw, 64px);
    overflow-x: auto;
    border: 1px solid var(--line-card);
    border-radius: 14px;
    background: var(--surface);
  }

  .compare table {
    min-inline-size: 640px;
    font-size: 15px;
  }

  .compare :is(th, td) {
    padding: 14px 20px;
  }

  .compare thead :is(th, td) {
    padding-block: 16px;
    border-block-end: 1px solid var(--line-soft);
  }

  .compare tbody tr:not(:last-child) :is(th, td) {
    border-block-end: 1px solid var(--line-faint);
  }

  /* Us in the first data column, the alternatives greyed after it. */
  .compare__label {
    color: var(--ink-muted);
  }

  .compare__ours {
    inline-size: 24%;
    font-weight: 700;
    color: var(--ink);
  }

  .compare__theirs {
    inline-size: 24%;
    font-weight: 500;
    color: var(--ink-faint);
  }

  .compare tbody .compare__ours {
    font-weight: 500;
  }

  /* ══ Page builder panel ═══════════════════════════════════════════════ */

  .builder {
    margin-block-start: clamp(32px, 5vw, 56px);
    overflow: hidden;
    border: 1px solid var(--line-card);
    border-radius: 16px;
    background: var(--surface);
  }

  .builder__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-block-end: 1px solid var(--line-soft);
    background: var(--panel);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-faint);
  }

  .builder__chips {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 12.5px;
  }

  .chip {
    padding: 4px 10px;
    border: 1px solid var(--line-card);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink-muted);
  }

  .chip--bare {
    border-color: transparent;
    background: none;
    color: var(--ink-faint);
  }

  .chip--solid {
    padding: 5px 12px;
    border-color: transparent;
    background: var(--ink);
    font-weight: 600;
    color: #fff;
  }

  /* Explicit columns rather than auto-fit: the preview spans two of them,
     which would conjure a phantom column when auto-fit collapses to one and
     push the panel wider than the page. */
  .builder__body {
    display: grid;
    grid-template-columns: 1fr;

    @media (width >= 48rem) {
      grid-template-columns: 1fr 2fr;
    }
  }

  .builder__rail {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 18px;
    border-block-end: 1px solid var(--line-soft);

    @media (width >= 48rem) {
      border-block-end: 0;
      border-inline-end: 1px solid var(--line-soft);
    }
  }

  .builder__rail-label {
    margin-block-end: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-ghost);
  }

  .builder__section {
    padding: 9px 12px;
    border: 1px solid var(--line-card);
    border-radius: 8px;
    background: var(--surface);
    font-size: 14px;
  }

  .builder__section--add {
    border-style: dashed;
    border-color: var(--line-field);
    background: none;
    color: var(--ink-faint);
  }

  .builder__preview {
    min-block-size: 280px;

    & img {
      inline-size: 100%;
      block-size: 100%;
      object-fit: cover;
      object-position: 50% 0;
    }
  }

  /* ══ Growth columns ═══════════════════════════════════════════════════ */

  .growth-col {
    display: grid;
    align-content: start;
    gap: 22px;
  }

  .growth-col__label {
    padding-block-end: 12px;
    border-block-end: 1px solid var(--ink);
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
  }

  .growth-col .feature__title {
    margin-block-end: 7px;
  }

  /* ══ No lock-in ═══════════════════════════════════════════════════════ */

  .selfhost__title {
    color: #fff;
  }

  .selfhost__body {
    margin-block-start: 20px;
    max-inline-size: 460px;
    font-size: var(--text-subhead);
    line-height: 1.6;
    color: var(--night-text);
  }

  .selfhost__aside {
    margin-block-start: 22px;
    max-inline-size: 460px;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--night-text);
  }

  /* The self-hosting docs live here rather than in the nav: this section is
     where leaving is the subject, and the nav of a page arguing that we run
     the server is the wrong place to offer server instructions. */
  .selfhost__link {
    display: inline-block;
    margin-block-start: 10px;
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--night-edge);
    text-underline-offset: 3px;

    &:hover {
      text-decoration-color: currentColor;
    }
  }

  .code-card {
    min-inline-size: 0;
    overflow: hidden;
    border: 1px solid var(--night-edge);
    border-radius: 14px;
    background: var(--night-deep);
  }

  .code-card__title {
    padding: 10px 16px;
    border-block-end: 1px solid var(--night-rule);
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6f7d97;
  }

  .code-card pre {
    padding: 18px 16px;
    overflow-x: auto;
    font-size: var(--text-code);
    line-height: 1.85;
    color: var(--night-code);
  }

  .code-card__comment {
    color: #6f7d97;
  }

  .code-card__out {
    color: var(--night-green);
  }

  /* ══ Pricing ══════════════════════════════════════════════════════════ */

  .pricing {
    margin-block-start: clamp(32px, 4.5vw, 56px);
    display: grid;
    align-items: start;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  }

  .plan-card {
    padding: clamp(24px, 3.4vw, 36px);
    border: 1px solid var(--line-card);
    border-radius: 16px;
    background: var(--wash);
  }

  /* The plan we steer people towards: solid border, white ground, badge. */
  .plan-card--featured {
    border-color: var(--ink);
    background: var(--surface);
  }

  .plan-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .plan-card__name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.025em;
  }

  .plan-card__badge {
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
  }

  .plan-card__price {
    margin-block-start: 12px;
    display: flex;
    align-items: baseline;
    gap: 6px;

    & b {
      font-size: var(--text-price);
      font-weight: 700;
      letter-spacing: -0.04em;
    }

    & span {
      font-size: 16px;
      color: var(--ink-faint);
    }
  }

  .plan-card__tagline {
    margin-block: 10px 24px;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--ink-muted);
  }

  .plan-card__features {
    display: grid;
    gap: 10px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink-body);
  }

  .plan-card .cta {
    margin-block-start: 28px;
    inline-size: 100%;
    padding-block: 13px;
  }

  .pricing-note {
    margin-block-start: 24px;
    max-inline-size: 640px;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ink-faint);

    & a {
      text-decoration: underline;
      text-decoration-color: var(--line-field);
      text-underline-offset: 3px;

      &:hover {
        color: var(--ink);
      }
    }
  }

  /* ══ Claim your address ═══════════════════════════════════════════════ */

  .claim {
    max-inline-size: 660px;
    margin-inline: auto;
    text-align: center;
  }

  .claim__title {
    font-size: var(--text-title-lg);
    line-height: 1.06;
    letter-spacing: -0.035em;
    font-weight: 700;
  }

  .claim__lede {
    margin-block-start: 18px;
    font-size: var(--text-subhead);
    line-height: 1.6;
    color: var(--ink-muted);
  }

  .claim__form {
    margin: 32px auto 0;
    max-inline-size: 500px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .claim__field {
    flex: 1 1 260px;
    min-inline-size: 0;
    display: flex;
    align-items: center;
    block-size: 50px;
    padding-inline-end: 14px;
    border: 1px solid var(--line-field);
    border-radius: 10px;
    background: var(--surface);

    &:focus-within {
      border-color: var(--ink);
    }

    & input {
      flex: 1 1 auto;
      min-inline-size: 0;
      block-size: 48px;
      padding-inline: 15px 4px;
      border: 0;
      background: none;
      font-size: 16px;
      color: var(--ink);

      &::placeholder {
        color: var(--ink-ghost);
      }

      &:focus {
        outline: none;
      }
    }
  }

  .claim__suffix {
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--ink-faint);
  }

  .claim__submit {
    block-size: 50px;
    padding-inline: 24px;
  }

  .claim__note {
    margin-block-start: 14px;
    font-size: 13.5px;
    color: var(--ink-faint);
  }

  /* ══ Footer ═══════════════════════════════════════════════════════════ */

  .site-footer {
    padding: 36px var(--gutter);
    border-block-start: 1px solid var(--line);
  }

  .site-footer__inner {
    max-inline-size: var(--shell);
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .site-footer__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: var(--ink-faint);

    & img {
      block-size: 20px;
      inline-size: auto;
    }
  }

  .site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: var(--ink-muted);

    & a:hover {
      color: var(--ink);
    }
  }

  /* ══ Documentation pages ══════════════════════════════════════════════ */
  /* The guides, and whatever long-form pages follow them. Quieter than the
     landing page on purpose: this is read, not scanned. */

  .doc-header {
    padding: clamp(48px, 7vw, 88px) var(--gutter) clamp(32px, 4vw, 48px);
    border-block-end: 1px solid var(--line);
    background: var(--wash);
  }

  .doc-header__title {
    font-size: var(--text-title);
    line-height: 1.08;
    letter-spacing: -0.035em;
    font-weight: 700;
  }

  .doc-header__lede {
    margin-block-start: 16px;
    max-inline-size: 640px;
    font-size: var(--text-subhead);
    line-height: 1.6;
    color: var(--ink-muted);

    & a {
      color: var(--ink);
      text-decoration: underline;
      text-decoration-color: var(--line-field);
      text-underline-offset: 3px;
    }
  }

  .doc-layout {
    /* The gutter sits *inside* the shell here, so the shell has to grow by it
       for the content to line up with the page heading above - which puts its
       gutter outside a nested .shell. Without this everything below the header
       is inset by one gutter and looks subtly broken. */
    max-inline-size: calc(var(--shell) + var(--gutter) * 2);
    padding: clamp(40px, 6vw, 72px) var(--gutter) var(--section-y);
    display: grid;
    gap: clamp(32px, 5vw, 64px);
    align-items: start;

    /* One column until there is genuinely room for a sidebar beside the text
       without squeezing the measure below something readable. */
    @media (width >= 62rem) {
      grid-template-columns: 200px minmax(0, 1fr);
    }
  }

  .doc-sidebar {
    @media (width >= 62rem) {
      position: sticky;
      inset-block-start: calc(var(--header-h) + 32px);
    }
  }

  .doc-sidebar__title {
    margin-block-end: 14px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }

  .doc-nav {
    display: grid;
    gap: 2px;
    border-inline-start: 1px solid var(--line-strong);

    & a {
      padding: 7px 0 7px 14px;
      margin-inline-start: -1px;
      border-inline-start: 1px solid transparent;
      font-size: 14.5px;
      color: var(--ink-muted);

      &:hover {
        color: var(--ink);
        border-inline-start-color: var(--ink-faint);
      }
    }
  }

  .doc-content {
    min-inline-size: 0;
  }

  .doc-section {
    /* Clears the sticky header when an anchor is followed. */
    scroll-margin-block-start: calc(var(--header-h) + 24px);

    & + & {
      margin-block-start: clamp(44px, 6vw, 72px);
      padding-block-start: clamp(44px, 6vw, 72px);
      border-block-start: 1px solid var(--line);
    }
  }

  .doc-section__title {
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1.15;
    letter-spacing: -0.03em;
    font-weight: 700;
  }

  .doc-section__lede {
    margin-block-start: 14px;
    max-inline-size: 680px;
    font-size: 16.5px;
    line-height: 1.65;
    color: var(--ink-muted);

    & a {
      color: var(--ink);
      text-decoration: underline;
      text-decoration-color: var(--line-field);
      text-underline-offset: 3px;
    }
  }

  /* The numbered first-run walkthrough. */
  .steps {
    margin-block-start: 28px;
    display: grid;
    gap: 16px;
    counter-reset: step;
    max-inline-size: 680px;

    & li {
      position: relative;
      padding-inline-start: 40px;
      font-size: 16px;
      line-height: 1.6;
      color: var(--ink-muted);
      counter-increment: step;
    }

    /* A counter rather than a real <ol> marker, so the number can be a fixed
       column the text hangs off rather than a floating glyph. */
    & li::before {
      content: counter(step);
      position: absolute;
      inset-inline-start: 0;
      inset-block-start: 1px;
      display: grid;
      place-items: center;
      inline-size: 26px;
      block-size: 26px;
      border-radius: var(--radius-pill);
      background: var(--ink);
      font-family: var(--font-mono);
      font-size: 12px;
      font-weight: 500;
      color: #fff;
    }

    & strong {
      color: var(--ink);
    }
  }

  /* Term-and-explanation pairs: the bulk of every section. */
  .topics {
    margin-block-start: 28px;
    display: grid;
    gap: 0;

    & > div {
      display: grid;
      gap: 6px;
      padding-block: 20px;
      border-block-start: 1px solid var(--line-soft);

      @media (width >= 48rem) {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 24px;
      }
    }

    & dt {
      font-size: 15.5px;
      font-weight: 700;
      letter-spacing: -0.02em;
      color: var(--ink);
    }

    & dd {
      font-size: 15.5px;
      line-height: 1.65;
      color: var(--ink-muted);
    }

    & strong {
      font-weight: 600;
      color: var(--ink-body);
    }
  }

  .note {
    margin-block-start: 28px;
    max-inline-size: 680px;
    padding: 16px 18px;
    border: 1px solid var(--line-card);
    border-inline-start: 3px solid var(--accent);
    border-radius: 10px;
    background: var(--wash);
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--ink-muted);

    & code {
      font-family: var(--font-mono);
      font-size: 13.5px;
      color: var(--ink);
    }
  }

  .note__label {
    margin-block-end: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
  }

  .doc-header__aside {
    margin-block-start: 14px;
    font-size: 14.5px;
    color: var(--ink-faint);

    & a {
      color: var(--ink);
      text-decoration: underline;
      text-decoration-color: var(--line-field);
      text-underline-offset: 3px;
    }
  }

  /* Body copy inside a ported section, which arrives as bare <p> and <ul>. */
  .doc-section :is(p, ul, ol) {
    max-inline-size: 680px;
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-muted);
  }

  .doc-section :is(p, ul, ol, .terminal, .doc-table-wrap, .dirs, .note) + :is(p, ul, ol, .terminal, .doc-table-wrap, .dirs, .note) {
    margin-block-start: 20px;
  }

  .doc-section ul {
    display: grid;
    gap: 10px;
    padding-inline-start: 20px;
    list-style: disc;
  }

  .doc-section :is(h2, h3) + * {
    margin-block-start: 14px;
  }

  .doc-section h3 {
    margin-block-start: 32px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
  }

  .doc-section :is(p, li) code,
  .doc-table code,
  .note code {
    padding-inline: 5px;
    padding-block: 1px;
    border-radius: 5px;
    background: var(--line-faint);
    font-family: var(--font-mono);
    font-size: 0.88em;
    color: var(--ink-body);
  }

  .doc-section a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--line-field);
    text-underline-offset: 3px;

    &:hover {
      text-decoration-color: currentColor;
    }
  }

  /* ── Terminal ─────────────────────────────────────────────────────────── */
  /* Dark even on a light page: a command you paste into a shell should look
     like a shell, not like prose. */

  .terminal {
    overflow: hidden;
    border: 1px solid var(--night-edge);
    border-radius: 12px;
    background: var(--night-deep);
  }

  .terminal__bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border-block-end: 1px solid var(--night-rule);
  }

  .terminal__dot {
    inline-size: 9px;
    block-size: 9px;
    border-radius: var(--radius-pill);
    background: var(--night-edge);
  }

  .terminal__label {
    margin-inline-start: 6px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6f7d97;
  }

  .terminal pre {
    padding: 18px 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: var(--text-code);
    line-height: 1.85;
    color: var(--night-code);
  }

  /* Emitted by the source markup: .k is a command, .c a comment. */
  .terminal .k {
    color: var(--night-green);
  }

  .terminal .c {
    color: #6f7d97;
  }

  /* ── Tables ───────────────────────────────────────────────────────────── */

  .doc-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line-card);
    border-radius: 12px;
  }

  .doc-table {
    min-inline-size: 480px;
    font-size: 15px;

    & :is(th, td) {
      padding: 12px 16px;
      text-align: start;
      vertical-align: top;
    }

    & thead th {
      border-block-end: 1px solid var(--line-soft);
      font-family: var(--font-mono);
      font-size: 11.5px;
      font-weight: 500;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--ink-faint);
    }

    & tbody tr:not(:first-child) :is(th, td) {
      border-block-start: 1px solid var(--line-faint);
    }

    & td:first-child {
      white-space: nowrap;
      color: var(--ink);
    }

    & td:not(:first-child) {
      color: var(--ink-muted);
    }
  }

  /* ── Directory listing ────────────────────────────────────────────────── */

  .dirs {
    display: grid;
    border: 1px solid var(--line-card);
    border-radius: 12px;
    overflow: hidden;
  }

  .dirs__item {
    display: grid;
    gap: 2px;
    padding: 12px 16px;
    font-size: 15px;

    @media (width >= 40rem) {
      grid-template-columns: 190px minmax(0, 1fr);
      gap: 20px;
      align-items: baseline;
    }

    &:not(:first-child) {
      border-block-start: 1px solid var(--line-faint);
    }

    & > code {
      font-family: var(--font-mono);
      font-size: 13.5px;
      color: var(--ink);
    }

    & > span {
      color: var(--ink-muted);
    }
  }

  /* ── Changelog ────────────────────────────────────────────────────────── */

  .log {
    max-inline-size: calc(var(--shell) + var(--gutter) * 2);
    padding: clamp(40px, 6vw, 72px) var(--gutter) var(--section-y);
  }

  /* The shell stays centred; the measure is constrained on the entry itself,
     so a release note lines up with the page heading above it rather than
     drifting into the middle of the page. */
  .log__entry {
    max-inline-size: 800px;
  }

  .log__entry + .log__entry {
    margin-block-start: clamp(44px, 6vw, 72px);
    padding-block-start: clamp(44px, 6vw, 72px);
    border-block-start: 1px solid var(--line);
  }

  .log__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-block-end: 16px;
  }

  .log__tag {
    padding: 3px 9px;
    border: 1px solid var(--accent);
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
  }

  .log__date {
    font-size: 14px;
    color: var(--ink-faint);
  }

  .log__entry {
    & h2 {
      font-size: clamp(24px, 3.2vw, 32px);
      line-height: 1.15;
      letter-spacing: -0.03em;
      font-weight: 700;
    }

    & h3 {
      margin-block-start: 36px;
      font-size: 18px;
      font-weight: 700;
      letter-spacing: -0.02em;
    }

    & :is(p, ul) {
      font-size: 16.5px;
      line-height: 1.65;
      color: var(--ink-muted);
    }

    & :is(h2, h3) + :is(p, ul) {
      margin-block-start: 16px;
    }

    /* Both directions: the entries close a list with a summarising line as
       often as they open one with an intro. */
    & :is(p, ul) + :is(p, ul) {
      margin-block-start: 16px;
    }

    & ul {
      display: grid;
      gap: 12px;
      padding-inline-start: 20px;
      list-style: disc;
    }

    & strong {
      font-weight: 600;
      color: var(--ink);
    }
  }
}
