/*
  The site's design system. Every page links this file, and pages add only what is theirs alone.

  Layers, lowest priority first. A page's own <style> is unlayered, so it wins over all of them.
  - reset: box sizing and the few element defaults the site changes.
  - tokens: the design tokens, in three tiers.
      1. Primitives: the palette in OKLCH, named by lightness (--gray-21 is 21% light), plus hues.
      2. Semantic roles: what a color is for (--text, --surface, --border…), each a light-dark() pair.
      3. Scales: type, space, radius, elevation and motion.
  - base: elements styled with the tokens (body, links, headings, kbd, focus, selection).
  - layout: page structure (the gutter, the content width, stacks).
  - components: the header and footer, buttons, tiles, the Sizewise window, long-form pages.
  - utilities: single-purpose helpers.

  Theme: :root sets color-scheme: light dark, so light-dark() follows the visitor's setting and the browser's own
  controls match. data-theme="light" or "dark" on <html> forces one theme; map.js and explorer.js read it too.
  Browsers without light-dark() (before Safari 17.5) get the same values from prefers-color-scheme at the end of
  the tokens layer.
*/
@layer reset, tokens, base, layout, components, utilities;

@layer reset {
  *, ::before, ::after { box-sizing: border-box; }
  body, h1, h2, h3, p, figure, blockquote, dl, dd { margin: 0; }
  img, video { display: block; max-inline-size: 100%; }
  img, video { block-size: auto; }
  button, input, select, textarea { font: inherit; color: inherit; }
  [hidden] { display: none !important; }
}

@layer tokens {
  :root {
    color-scheme: light dark;

    /* Tier 1: primitives. Neutrals lean slightly blue (hue 275), like macOS. */
    --gray-100: oklch(100% 0 0);
    --gray-97: oklch(96.8% 0.003 286);
    --gray-94: oklch(94% 0.007 269);
    --gray-93: oklch(92.8% 0.004 271);
    --gray-87: oklch(87.4% 0.008 279);
    --gray-84: oklch(84.4% 0.008 261);
    --gray-83: oklch(82.9% 0.01 267);
    --gray-72: oklch(72.2% 0.012 270);
    --gray-48: oklch(48% 0.015 276);
    --gray-42: oklch(41.8% 0.015 276);
    --gray-24: oklch(24.4% 0.008 275);
    --gray-23: oklch(22.7% 0.008 275);
    --gray-21: oklch(21% 0.008 275);
    --gray-18: oklch(18.2% 0.006 271);
    --black: oklch(0% 0 0);
    --white: oklch(100% 0 0);
    --blue-52: oklch(52.2% 0.177 256);
    --blue-56: oklch(56.3% 0.193 256);
    --blue-62: oklch(62.4% 0.206 255);
    --blue-70: oklch(70.1% 0.16 253);
    /* Hues for the home page's tiles, one per subject. */
    --hue-blue: 235; --hue-green: 150; --hue-purple: 305; --hue-amber: 75; --hue-red: 25; --hue-teal: 190; --hue-lime: 110; --hue-indigo: 270;

    /* Tier 2: semantic roles. */
    --surface: light-dark(var(--gray-100), var(--gray-18));
    --surface-window: light-dark(var(--gray-97), var(--gray-24));
    --surface-sunken: light-dark(var(--gray-93), var(--gray-23));
    --text: light-dark(var(--gray-21), var(--gray-94));
    --text-secondary: light-dark(var(--gray-42), var(--gray-83));
    --text-muted: light-dark(var(--gray-48), var(--gray-72));
    --text-disabled: light-dark(oklch(21% 0.008 275 / 28%), oklch(94% 0.007 269 / 28%));
    --separator: light-dark(oklch(0% 0 0 / 10%), oklch(100% 0 0 / 10%));
    --border: light-dark(var(--gray-87), oklch(100% 0 0 / 24%));
    --border-control: light-dark(oklch(0% 0 0 / 12%), oklch(100% 0 0 / 14%));
    --fill-field: light-dark(oklch(100% 0 0 / 85%), oklch(100% 0 0 / 8%));
    --fill-control: light-dark(oklch(100% 0 0 / 75%), oklch(100% 0 0 / 6%));
    --fill-pressed: light-dark(oklch(0% 0 0 / 7%), oklch(100% 0 0 / 10%));
    --fill-track: light-dark(oklch(21% 0.008 275 / 14%), oklch(100% 0 0 / 16%));
    --accent: light-dark(var(--blue-56), var(--blue-62));
    --link: light-dark(var(--blue-52), var(--blue-70));
    --button: light-dark(var(--gray-21), var(--gray-94));
    --button-text: light-dark(var(--white), var(--gray-18));
    --map: light-dark(var(--gray-84), oklch(17.8% 0 0));

    /* Tier 3: scales. Text sizes are in rem, so they follow the visitor's text size. */
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
    --text-2xs: 0.75rem;     /* 12px: tile labels, the map's legend */
    --text-xs: 0.8125rem;    /* 13px: the window's controls */
    --text-sm: 0.875rem;     /* 14px: notes and captions */
    --text-md: 0.9375rem;    /* 15px: secondary lines */
    --text-base: 1rem;
    --text-lead: 1.0625rem;  /* 17px */
    --text-lg: 1.25rem;      /* 20px: the hero's line, section heads */
    --text-xl: 1.375rem;     /* 22px */
    --text-2xl: 2rem;        /* 32px */
    --text-3xl: 2.5rem;      /* 40px */
    /* Display sizes grow with the viewport, but never past 2.5 times their smallest size. */
    --display-s: clamp(1.75rem, 1.2rem + 2vw, 2.625rem);
    --display-m: clamp(1.875rem, 1.3rem + 2.2vw, 3rem);
    --display-l: clamp(2.5rem, 1.25rem + 5vw, 4.75rem);
    --display-xl: clamp(3.5rem, 2rem + 5vw, 6rem);
    --leading-tight: 1.05;
    --leading-snug: 1.25;
    --leading-normal: 1.5;
    --tracking-display: -0.03em;
    --tracking-title: -0.02em;

    /* Space: a 4px grid in rem, and the two sizes that grow with the viewport. */
    --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem; --space-5: 1.25rem;
    --space-6: 1.5rem; --space-7: 1.75rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem; --space-14: 3.5rem; --space-18: 4.5rem;
    --gutter: clamp(1rem, 4vw, 1.5rem);
    --space-section: clamp(3.5rem, 2rem + 5vw, 6rem);
    --content-width: 75rem;
    --measure: 43rem;

    --radius-xs: 3px; --radius-s: 5px; --radius-m: 8px; --radius-l: 12px; --radius-pill: 999px;
    --shadow-window: 0 0 0 0.5px var(--border-control), 0 24px 60px -18px oklch(0% 0 0 / 28%), 0 4px 14px oklch(0% 0 0 / 10%);
    --target-min: 2.75rem;   /* 44px: the main buttons */

    --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
    --duration-fast: 120ms;
    --duration-base: 200ms;
    --duration-slow: 320ms;
  }

  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"] { color-scheme: dark; }

  @media (prefers-reduced-motion: reduce) {
    :root { --duration-fast: 0s; --duration-base: 0s; --duration-slow: 0s; }
  }

  /* More contrast: secondary text and hairlines move closer to the main text. */
  @media (prefers-contrast: more) {
    :root {
      --text-muted: var(--text-secondary);
      --separator: light-dark(oklch(0% 0 0 / 30%), oklch(100% 0 0 / 35%));
      --border-control: light-dark(oklch(0% 0 0 / 45%), oklch(100% 0 0 / 50%));
      --border: var(--text-muted);
    }
  }

  /* Fallback for browsers without light-dark(): the same pairs, chosen by the system setting. */
  @supports not (color: light-dark(white, black)) {
    :root {
      --surface: var(--gray-100); --surface-window: var(--gray-97); --surface-sunken: var(--gray-93);
      --text: var(--gray-21); --text-secondary: var(--gray-42); --text-muted: var(--gray-48); --text-disabled: oklch(21% 0.008 275 / 28%);
      --separator: oklch(0% 0 0 / 10%); --border: var(--gray-87); --border-control: oklch(0% 0 0 / 12%);
      --fill-field: oklch(100% 0 0 / 85%); --fill-control: oklch(100% 0 0 / 75%); --fill-pressed: oklch(0% 0 0 / 7%); --fill-track: oklch(21% 0.008 275 / 14%);
      --accent: var(--blue-56); --link: var(--blue-52); --button: var(--gray-21); --button-text: var(--white); --map: var(--gray-84);
      --tile-l: 93%;
    }
    @media (prefers-color-scheme: dark) {
      :root {
        --surface: var(--gray-18); --surface-window: var(--gray-24); --surface-sunken: var(--gray-23);
        --text: var(--gray-94); --text-secondary: var(--gray-83); --text-muted: var(--gray-72); --text-disabled: oklch(94% 0.007 269 / 28%);
        --separator: oklch(100% 0 0 / 10%); --border: oklch(100% 0 0 / 24%); --border-control: oklch(100% 0 0 / 14%);
        --fill-field: oklch(100% 0 0 / 8%); --fill-control: oklch(100% 0 0 / 6%); --fill-pressed: oklch(100% 0 0 / 10%); --fill-track: oklch(100% 0 0 / 16%);
        --accent: var(--blue-62); --link: var(--blue-70); --button: var(--gray-94); --button-text: var(--gray-18); --map: oklch(17.8% 0 0);
        --tile-l: 30%;
      }
    }
  }
}

@layer base {
  :root {
    accent-color: var(--accent);
    interpolate-size: allow-keywords;
  }
  body {
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3 { text-wrap: balance; }
  p, li, dd { text-wrap: pretty; }
  a {
    color: var(--link);
    text-decoration-thickness: from-font;
    text-underline-offset: 0.15em;
  }
  strong { font-weight: 600; color: var(--text); }
  kbd {
    font: 0.78125rem var(--font-mono);
    color: var(--text);
    background: var(--fill-field);
    border: 1px solid var(--border-control);
    border-radius: var(--radius-s);
    padding: 1px 6px;
    white-space: nowrap;
  }
  code { font-family: var(--font-mono); font-size: 0.875em; overflow-wrap: anywhere; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  ::selection { background: color-mix(in oklab, var(--accent) 28%, transparent); }
  summary { cursor: pointer; }

  /* Page to page, the header stays put and the rest cross-fades, where the browser can (Safari 18.2, Chrome 126). */
  @view-transition { navigation: auto; }
  @media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
  }
}

@layer layout {
  /* The column every page's content sits in. */
  .wrap {
    inline-size: min(100% - 2 * var(--gutter), var(--content-width));
    margin-inline: auto;
  }
  .stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--space-4)); }
  .stack.tight { --stack-gap: var(--space-2); }
  .section { margin-block-start: var(--space-section); }
}

@layer components {
  /* The header and footer every page shares. scripts/site-pages.test.ts keeps their markup the same on every page. */
  .site-nav, .site-footer { inline-size: min(100% - 2 * var(--gutter), var(--content-width)); margin-inline: auto; }
  .site-nav {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4);
    min-block-size: 4rem; padding-block: var(--space-3);
    border-block-end: 1px solid var(--separator);
    view-transition-name: site-nav;
  }
  .brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-size: 1.0625rem; font-weight: 600; }
  .site-nav nav { display: flex; align-items: center; gap: 18px; }
  .site-nav nav a:not(.get) { display: inline-flex; align-items: center; min-block-size: 34px; color: var(--text); text-decoration: none; font-size: var(--text-sm); font-weight: 500; }
  .get {
    display: inline-flex; align-items: center; min-block-size: 34px; padding-inline: 14px;
    border-radius: var(--radius-m); background: var(--button); color: var(--button-text);
    font-size: var(--text-sm); font-weight: 600; text-decoration: none;
  }
  .site-footer { border-block-start: 1px solid var(--separator); padding-block: var(--space-5) var(--space-10); }
  .site-footer nav { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); }
  .site-footer p { margin-block-start: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
  .site-footer a { display: inline-flex; align-items: center; min-block-size: 32px; color: var(--text-muted); text-decoration: none; font-size: var(--text-sm); }
  @media (hover: hover) {
    .site-nav nav a:not(.get):hover { color: var(--link); }
    .site-footer a:hover { color: var(--link); text-decoration: underline; }
  }

  /* Buttons. A transparent border becomes visible in forced colors, where backgrounds disappear. */
  .button {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-block-size: var(--target-min); padding-inline: 18px;
    border: 1px solid transparent; border-radius: var(--radius-m);
    background: var(--button); color: var(--button-text);
    font-size: var(--text-base); font-weight: 600; text-align: center; text-decoration: none; cursor: pointer;
    transition: background-color var(--duration-fast) var(--ease-out), scale var(--duration-fast) var(--ease-out);
  }
  .button.secondary { background: transparent; border-color: var(--border); color: var(--text); }
  @media (hover: hover) {
    .button:hover { background: color-mix(in oklab, var(--button), var(--surface) 14%); }
    .button.secondary:hover { background: var(--fill-pressed); }
  }
  .button:active { scale: 0.98; }
  /* A text button that reads as a link. */
  .link-button {
    min-block-size: 24px; padding: 0; border: 0; background: none;
    color: var(--link); text-decoration: underline; text-decoration-thickness: from-font; text-underline-offset: 0.15em;
    font-size: var(--text-sm); cursor: pointer; align-self: flex-start;
  }
  .small-target { display: inline-flex; align-items: center; min-block-size: 24px; }

  /* Disclosure chevron, turned when its <details> opens. */
  .chev { display: inline-block; vertical-align: -1px; transition: rotate var(--duration-base) var(--ease-out); }
  details[open] > summary .chev { rotate: 90deg; }
  summary:is(.tile-header, .small-target) { list-style: none; }
  summary:is(.tile-header, .small-target)::-webkit-details-marker { display: none; }
  /* Open and close smoothly where the browser can animate to auto (Chrome 131); elsewhere they snap, as before. */
  details.animated::details-content {
    block-size: 0;
    overflow: clip;
    transition: block-size var(--duration-slow) var(--ease-out), content-visibility var(--duration-slow) allow-discrete;
  }
  details.animated[open]::details-content { block-size: auto; }

  /* The home page's hero. */
  .hero { padding-block-start: var(--space-18); --stack-gap: 18px; }
  .hero h1 { font-size: var(--display-l); line-height: 1.02; font-weight: 700; letter-spacing: var(--tracking-display); max-inline-size: 13em; }
  .hero .lede { font-size: var(--text-lg); line-height: 1.45; color: var(--text-muted); max-inline-size: 32em; }
  .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px var(--space-4); margin-block-start: 6px; }
  .actions > p { flex-basis: 100%; font-size: var(--text-base); line-height: 1.45; }
  .actions > .link-button { align-self: center; font-size: var(--text-base); }
  /* Short facts about the offer, each led by an icon from the page's sprite: two columns, then one on phones. */
  .facts {
    flex-basis: 100%; margin: 0; padding: 0; list-style: none;
    display: grid; grid-template-columns: repeat(2, max-content); gap: var(--space-2) var(--space-8);
    font-size: var(--text-sm); line-height: var(--leading-snug); color: var(--text-secondary);
  }
  .actions > .facts { margin-block-start: var(--space-2); }
  .facts li { display: flex; align-items: center; gap: var(--space-2); }
  .facts svg { flex: none; inline-size: 1rem; block-size: 1rem; fill: none; stroke: var(--text-muted); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
  .facts a { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 0.2em; }
  @media (hover: hover) { .facts a:hover { text-decoration-color: currentColor; } }
  @media (width < 40em) { .facts { grid-template-columns: minmax(0, 1fr); } }
  .status-line { flex-basis: 100%; font-size: var(--text-sm); color: var(--text-muted); }
  /* The email forms: the address and its button share a row, which stacks on a narrow phone. A field
     turns red only once someone leaves it or sends it with a wrong address. The field named website is
     a trap for bots, out of sight and out of the tab order. */
  .email-form { flex-basis: 100%; display: flex; flex-direction: column; gap: var(--space-2); max-inline-size: 34rem; }
  .email-form > label:first-of-type { font-size: var(--text-sm); color: var(--text-secondary); }
  .email-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .email-row input {
    flex: 1 1 14rem; min-inline-size: 0; min-block-size: var(--target-min); padding-inline: 14px;
    border: 1px solid var(--border-control); border-radius: var(--radius-m); background: var(--fill-field);
    font-size: max(16px, var(--text-base));
  }
  .email-row input:user-invalid { border-color: light-dark(oklch(55% 0.2 25), oklch(70% 0.17 25)); }
  .email-row .button { flex: 0 0 auto; }
  .email-form .check { display: flex; align-items: center; gap: var(--space-2); min-block-size: 24px; font-size: var(--text-sm); color: var(--text-secondary); }
  .email-form .check input { inline-size: 1rem; block-size: 1rem; margin: 0; }
  .email-form .feed { font-size: var(--text-sm); color: var(--text-muted); }
  .email-form .trap { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .closing .later { flex: 1 1 100%; max-inline-size: 46rem; }
  .caption { font-size: var(--text-sm); line-height: 1.7; color: var(--text-muted); }
  /* A command wraps only between its halves, so a narrow window never splits a word or an option. */
  .command code span { white-space: nowrap; }

  /* What to do once the disk image downloads, shown under the Download button that started it. */
  .next-steps {
    flex-basis: 100%; max-inline-size: 40rem;
    display: grid; gap: var(--space-3); padding: var(--space-5) var(--space-6);
    background: var(--surface-sunken); border: 1px solid transparent; border-radius: var(--radius-l);
    font-size: var(--text-base); line-height: 1.5; color: var(--text-secondary);
    opacity: 1; translate: 0;
    transition: opacity var(--duration-slow) var(--ease-out), translate var(--duration-slow) var(--ease-out);
  }
  @starting-style { .next-steps { opacity: 0; translate: 0 -6px; } }
  .next-steps h2, .closing .next-steps h2 { letter-spacing: normal; font-size: var(--text-lg); line-height: 1.3; font-weight: 700; color: var(--text); }
  .next-steps h3 { font-size: var(--text-base); font-weight: 600; color: var(--text); }
  .next-steps ol { display: grid; gap: var(--space-2); padding: 0; list-style: none; counter-reset: step; }
  .next-steps li { position: relative; padding-inline-start: 2.25rem; counter-increment: step; }
  .next-steps li::before {
    content: counter(step); position: absolute; inset-inline-start: 0; inset-block-start: 0;
    display: grid; place-items: center; inline-size: 1.5rem; block-size: 1.5rem; border-radius: var(--radius-pill);
    background: var(--fill-track); color: var(--text); font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums;
  }
  .next-steps p { font-size: var(--text-sm); color: var(--text-muted); }
  .closing .next-steps p { font-size: var(--text-sm); }

  /* The proof tiles: a 12-column treemap of facts, like the app's own map. */
  .tiles {
    container: tiles / inline-size;
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; padding: 4px;
    background: var(--surface-sunken); border-radius: var(--radius-m);
  }
  .tile {
    --hue: var(--hue-blue);
    container-type: inline-size;
    display: flex; flex-direction: column; min-inline-size: 0;
    background: oklch(var(--tile-l, 93%) 0.04 var(--hue));
    border-radius: 4px;
    grid-column: span var(--span, 12);
  }
  @supports (color: light-dark(white, black)) {
    .tile { background: light-dark(oklch(93% 0.04 var(--hue)), oklch(30% 0.04 var(--hue))); }
  }
  .tile[data-hue="green"] { --hue: var(--hue-green); }
  .tile[data-hue="purple"] { --hue: var(--hue-purple); }
  .tile[data-hue="amber"] { --hue: var(--hue-amber); }
  .tile[data-hue="red"] { --hue: var(--hue-red); }
  .tile[data-hue="teal"] { --hue: var(--hue-teal); }
  .tile[data-hue="lime"] { --hue: var(--hue-lime); }
  .tile[data-hue="indigo"] { --hue: var(--hue-indigo); }
  .tile[data-span="4"] { --span: 4; } .tile[data-span="5"] { --span: 5; } .tile[data-span="6"] { --span: 6; } .tile[data-span="7"] { --span: 7; } .tile[data-span="8"] { --span: 8; }
  .tile[data-rows="2"] { grid-row: span 2; }
  @container tiles (inline-size < 48rem) {
    .tile[data-span] { --span: 12; }
    .tile[data-rows="2"] { grid-row: auto; }
  }
  .tile-header {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-block-end: 1px solid var(--separator);
    font-size: var(--text-2xs); font-weight: 600; color: var(--text-muted);
  }
  .tile-header :is(h2, h3) { font: inherit; }
  .tile-header > :last-child { font-variant-numeric: tabular-nums; text-align: end; }
  details.tile > .tile-header { border-block-end: 0; }
  details.tile > .tile-body { border-block-start: 1px solid var(--separator); }
  .tile-body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-6); flex: 1; color: var(--text-secondary); }
  .tile-body.split { flex-direction: row; flex-wrap: wrap; gap: var(--space-5) var(--space-8); align-items: flex-start; }
  .tile-body.split > * { flex: 1 1 16rem; }
  .tile-body.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 14px 36px; font-size: var(--text-sm); }
  .tile .note { margin-block-start: auto; font-size: var(--text-sm); line-height: var(--leading-normal); color: var(--text-secondary); }
  /* Big numbers. Each size is a step on the display scale, capped by the tile's width (cqi) so a long word
     still fits when the visitor's text is very large. */
  .stat { color: var(--text); font-weight: 700; line-height: 1; letter-spacing: var(--tracking-display); font-variant-numeric: tabular-nums; }
  .stat.xl { font-size: min(var(--display-xl), 30cqi); line-height: 0.9; letter-spacing: -0.04em; }
  .stat.l { font-size: min(var(--text-3xl), 16cqi); }
  .stat.m { font-size: min(var(--text-2xl), 12cqi); line-height: 1.1; letter-spacing: var(--tracking-title); }
  .stat.s { font-size: min(var(--text-xl), 9cqi); line-height: 1.2; letter-spacing: -0.01em; }

  /* Tiles rise into place once as they scroll in, where the browser ties animation to scrolling. */
  @media (prefers-reduced-motion: no-preference) {
    @supports ((animation-timeline: view()) and (animation-range: entry)) {
      .tile {
        animation: tile-in linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 60%;
      }
    }
  }
  @keyframes tile-in {
    from { opacity: 0; translate: 0 1rem; }
  }

  .media { inline-size: 100%; block-size: auto; border-radius: var(--radius-l); background: var(--surface-window); }
  /* The clip's poster, which becomes the video when played. The circle is the play button. */
  .media.play { position: relative; display: block; overflow: hidden; }
  .media.play img { inline-size: 100%; block-size: auto; }
  .media.play::after {
    content: ""; position: absolute; inset: 50% auto auto 50%; translate: -50% -50%;
    inline-size: 4.5rem; block-size: 4.5rem; border-radius: var(--radius-pill);
    background: oklch(0% 0 0 / 55%) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M8 5.5v13l10.5-6.5z'/%3E%3C/svg%3E") center / 2rem no-repeat;
    backdrop-filter: blur(8px);
    transition: scale var(--duration-fast) var(--ease-out);
  }
  @media (hover: hover) { .media.play:hover::after { scale: 1.06; } }
  .closing { padding-block-end: var(--space-18); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-6); }
  .closing h2 { font-size: var(--display-s); line-height: 1.1; font-weight: 700; letter-spacing: var(--tracking-title); }
  .closing p, .closing details { font-size: var(--text-md); color: var(--text-muted); }
  .closing details p { margin-block-start: 6px; }
  .closing .facts { grid-template-columns: minmax(0, 1fr); font-size: var(--text-md); margin-block: var(--space-2); }
  .closing .stack > .button { align-self: flex-start; margin-block-start: var(--space-2); }
  .actions.wide { flex: 1 1 100%; margin-block-start: 0; gap: var(--space-5) var(--space-7); }
  .demo-section { margin-block-start: var(--space-14); }

  /* Long-form pages: privacy, terms, release notes and press. */
  .doc { overflow-wrap: anywhere; --stack-gap: var(--space-4); max-inline-size: calc(var(--measure) + 2 * var(--gutter)); margin-inline: auto; padding: var(--space-14) var(--gutter) var(--space-18); }
  .doc h1 { font-size: clamp(1.875rem, 1.3rem + 2vw, 2.5rem); line-height: 1.1; font-weight: 700; letter-spacing: var(--tracking-title); }
  .doc h2 { margin-block-start: var(--space-4); font-size: var(--text-lg); line-height: 1.3; font-weight: 600; }
  .doc :is(p, li, dd, dt) { font-size: var(--text-base); line-height: var(--leading-normal); }
  .doc :is(ol, ul) { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
  .doc .note { font-size: var(--text-md); color: var(--text-muted); }
  .doc blockquote { padding-inline-start: var(--space-4); border-inline-start: 3px solid var(--separator); color: var(--text-secondary); }
  .doc dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-5); }
  .doc dt { color: var(--text-muted); }
  .doc dd { min-inline-size: 0; }
  .doc dd .note { display: block; }
  @media (width < 30em) {
    .doc dl { grid-template-columns: 1fr; gap: 2px; }
    .doc dd { margin-block-end: var(--space-2); }
  }

  /* Pages built around a full-size window: /try and /macos. The window and the zoomed folder's
     items, largest first, sit side by side, and stack on narrow screens. */
  .explorer { inline-size: min(100% - 2 * var(--gutter), 76rem); margin-inline: auto; padding-block-end: var(--space-14); }
  .explorer .intro { padding-block: 2.25rem 1.375rem; }
  .explorer h1 { margin-block-end: var(--space-2); font-size: var(--display-m); line-height: var(--leading-tight); letter-spacing: -0.025em; }
  .explorer .lede { font-size: var(--text-lead); color: var(--text-muted); max-inline-size: 44em; }
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 18.75rem; gap: var(--space-5); align-items: start; }
  .layout { --map-block: clamp(380px, calc(100svh - 400px), 760px); }
  .layout .map { block-size: var(--map-block); }
  .items { line-height: var(--leading-snug); }
  .items h2 { margin-block: 2px var(--space-2); font-size: var(--text-xs); color: var(--text-muted); font-weight: 600; }
  .items ol { list-style: none; margin: 0; padding: 0; }
  .items button { inline-size: 100%; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); border: 0; background: none; padding: 6px var(--space-2); border-radius: 7px; font-size: var(--text-xs); text-align: start; cursor: pointer; }
  .items button[aria-current="true"] { background: var(--fill-pressed); }
  @media (hover: hover) { .items button:hover { background: var(--fill-pressed); } }
  .items i { inline-size: 10px; block-size: 10px; border-radius: 2.5px; box-shadow: inset 0 0 0 0.5px var(--border-control); }
  .items .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .items .size { font-variant-numeric: tabular-nums; color: var(--text-muted); }
  .items .rest { padding: 6px var(--space-2) 6px 26px; font-size: var(--text-xs); color: var(--text-muted); }
  .more { margin-block-start: var(--space-12); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.25rem), 1fr)); gap: var(--space-7) var(--space-10); }
  .more h2 { margin-block-end: var(--space-2); font-size: var(--text-lg); letter-spacing: -0.01em; }
  .more p { margin-block-end: 10px; color: var(--text-muted); }
  @media (width < 67.5em) { .layout { grid-template-columns: minmax(0, 1fr); } }
  @media (width < 40em) {
    .explorer .intro { padding-block: var(--space-6) 1.125rem; }
    .explorer .lede { font-size: var(--text-md); }
    /* Scrolled past the intro, the whole window fits the screen, so the status shows what a tap selected. */
    .layout { --map-block: clamp(300px, calc(100svh - 236px), 640px); }
  }

  /* The Sizewise window that explorer.js builds: a toolbar, the map, the legend and the status bar.
     Its controls keep the app's pixel metrics; the text inside them is in rem. */
  .window {
    --toolbar-block: 52px; --status-block: 34px; --legend-block: 35px;
    container: window / inline-size;
    border-radius: var(--radius-l); overflow: hidden;
    background: var(--surface-window); color: var(--text);
    box-shadow: var(--shadow-window);
    line-height: var(--leading-snug);
  }
  .toolbar { display: flex; align-items: center; gap: 10px; min-block-size: var(--toolbar-block); padding: 8px 10px 8px 14px; }
  .crumbs { display: flex; align-items: center; flex: 1 1 auto; min-inline-size: 0; overflow-x: auto; scrollbar-width: none; font-size: var(--text-xs); }
  .crumbs::-webkit-scrollbar { display: none; }
  .crumbs button { flex: none; border: 0; background: none; color: var(--link); min-block-size: 28px; padding: 4px 6px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
  .crumbs button[aria-current] { color: var(--text); font-weight: 700; font-size: var(--text-md); cursor: default; }
  .crumbs span { flex: none; color: var(--text-muted); padding-inline: 1px; }
  .window input[type="search"] { flex: 0 1 170px; min-inline-size: 0; block-size: 30px; border-radius: 15px; border: 0; box-shadow: inset 0 0 0 0.5px var(--border-control); background: var(--fill-field); padding-inline: 12px; font-size: var(--text-xs); color: var(--text); }
  .capsule { display: flex; gap: 2px; padding: 3px 6px; border-radius: 22px; flex: none; background: var(--fill-control); box-shadow: inset 0 0 0 0.5px var(--border-control); }
  .capsule button { inline-size: 34px; block-size: 30px; border: 0; background: transparent; border-radius: var(--radius-m); display: grid; place-items: center; padding: 0; color: var(--text); cursor: pointer; }
  .capsule button:disabled { color: var(--text-disabled); cursor: default; }
  /* Hover lightly fills a control, and pressing it fills it deeper, as macOS's toolbar buttons do. */
  @media (hover: hover) {
    :is(.crumbs button:not([aria-current]), .capsule button:not(:disabled), .legend button):hover { background: var(--fill-pressed); }
  }
  :is(.crumbs button:not([aria-current]), .capsule button:not(:disabled), .legend button):active { background: color-mix(in oklab, var(--fill-pressed), var(--text) 10%); }
  /* A toolbar button's name and shortcut, under it (explorer.js adds these where interest invokers exist). */
  .tip {
    inset: auto; top: anchor(bottom); left: anchor(center); translate: -50% 0; margin: 6px 0 0;
    position-try-fallbacks: flip-block;
    padding: 4px 8px; border: 0.5px solid var(--border); border-radius: var(--radius-s);
    background: var(--surface-window); color: var(--text); box-shadow: var(--shadow-window);
    font-size: var(--text-2xs); line-height: var(--leading-snug); white-space: nowrap;
  }
  .tip kbd { margin-inline-start: 4px; padding: 0 4px; font-size: inherit; }
  .map { background: var(--map); touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; cursor: default; }
  .map:focus-visible { outline-offset: -3px; }
  .legend { display: flex; flex-wrap: wrap; gap: 2px 4px; padding: 5px 10px; border-block-start: 0.5px solid var(--separator); }
  .legend button { display: inline-flex; align-items: center; gap: 5px; min-block-size: 24px; border: 0; background: transparent; padding: 3px 6px; border-radius: var(--radius-s); font-size: var(--text-2xs); color: var(--text); cursor: pointer; }
  .legend button[aria-pressed="true"] { background: var(--fill-pressed); }
  .legend.picking button[aria-pressed="false"] { opacity: 0.5; }
  .legend i { inline-size: 10px; block-size: 10px; border-radius: 2.5px; flex: none; }
  .legend .step { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; font-size: var(--text-2xs); white-space: nowrap; }
  .legend .step i { box-shadow: inset 0 0 0 0.5px var(--border-control); }
  .legend em { font-style: normal; opacity: 0.72; font-variant-numeric: tabular-nums; }
  .status { display: flex; align-items: baseline; gap: 8px; min-block-size: var(--status-block); padding: 8px 14px; border-block-start: 0.5px solid var(--separator); font-size: 0.78125rem; }
  .status b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-inline-size: 0; flex: 0 1 auto; }
  .status .details { flex: none; font-variant-numeric: tabular-nums; }
  .status .where { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-inline-size: 0; flex: 1 1 0; }
  .status .hint { color: var(--text-muted); }
  /* Until explorer.js fills it, a window holds the space it will take, so the page under it doesn't
     jump: the map's size from --map-ratio or --map-block, which the page sets, plus the toolbar, the
     legend and the status bar. A page whose legend wraps sets --legend-block to its height. */
  .window:empty::before {
    content: ""; display: block; box-sizing: content-box;
    aspect-ratio: var(--map-ratio, auto); block-size: var(--map-block, auto);
    padding-block-end: calc(var(--toolbar-block) + var(--legend-block) + var(--status-block));
  }
  @media (scripting: none) { .window:empty { display: none; } }
  /* A narrow window, wherever it sits, stacks its toolbar and scrolls its legend. */
  @container window (inline-size < 40rem) {
    .toolbar, .status, .window:empty::before { --toolbar-block: 90px; --status-block: 48.5px; }
    .toolbar { flex-wrap: wrap; padding: 8px; }
    .crumbs { flex-basis: 100%; order: -1; }
    .window input[type="search"] { flex: 1 1 0; min-inline-size: 80px; }
    .legend { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .legend::-webkit-scrollbar { display: none; }
    .legend button { flex: none; }
    .status { flex-wrap: wrap; row-gap: 0; }
    .status .where { flex-basis: 100%; }
    .status .details { flex: 0 1 auto; }
  }

  /* Where the browser draws smoother corners, they match macOS's continuous ones. */
  @supports (corner-shape: squircle) {
    .window, .media { corner-shape: squircle; border-radius: calc(var(--radius-l) * 1.8); }
    .button { corner-shape: squircle; border-radius: calc(var(--radius-m) * 1.8); }
  }

  /* Forced colors (High Contrast): borders stand in for the backgrounds the system removes. */
  @media (forced-colors: active) {
    .tile, .window { border: 1px solid CanvasText; }
  }
}

@layer utilities {
  .touch-only { display: none; }
  @media (hover: none) { .touch-only { display: inline; } .pointer-only { display: none; } }
  .visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
