/* =============================================================================
   whittled.dev · site.css
   The design system shared by every page: fonts, tokens, type, layout and
   components. Markup for each component is in
   planning/Whittled/docs/page-template.html (pages) and
   planning/Whittled/docs/guide-template.html (guides).

   Themes: light is the default (<html data-theme="light">); the header switch
   sets data-theme="dark". The operating system's colour scheme is ignored on
   purpose, so there are no colour-scheme media queries in this file.

   Contents
     1. Fonts                     8. Header and menu
     2. Tokens                    9. Footer
     3. Themes                   10. App pages: local bar, hero, features,
     4. App accents                  compact grid, keys, split, facts, FAQ
     5. Base                     11. Product visuals (figure frame, macOS tokens)
     6. Type                     12. Panel, app links, 404
     7. Layout, buttons, links   13. Guides: page head, article, steps,
                                     shortcuts, notes, tables, app card, lists
                                 14. Continuous corners, motion, print
   ============================================================================= */


/* 1. Fonts ------------------------------------------------------------------
   Instrument Sans (SIL OFL 1.1, see /assets/fonts/OFL.txt), the typeface the
   logo is drawn from. Variable weight 400–700, self-hosted. The arrows file is
   a tiny subset (← ↑ → ↓ ↗) because the latin file leaves them out. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/instrument-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/instrument-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;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/instrument-sans-arrows.woff2") format("woff2");
  unicode-range: U+2190-2193, U+2197;
}

/* Arial resized to Instrument Sans' width and vertical metrics, so the swap
   from fallback to webfont doesn't move the layout. */
@font-face {
  font-family: "Instrument Sans Fallback";
  src: local("Arial"), local("ArialMT");
  size-adjust: 103.64%;
  ascent-override: 93.59%;
  descent-override: 24.12%;
  line-gap-override: 0%;
}


/* 2. Tokens ----------------------------------------------------------------- */

:root {
  --font-sans: "Instrument Sans", "Instrument Sans Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --font-mac: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; /* keycaps and product visuals */

  /* Type scale. Fluid between a 375 px and a 1280 px viewport. */
  --fs-display: clamp(2.75rem, 1.817rem + 3.978vw, 5rem);       /* 44 → 80  home h1 */
  --fs-h1:      clamp(2.5rem, 1.878rem + 2.652vw, 4rem);        /* 40 → 64  an app's name */
  --fs-h2:      clamp(2rem, 1.586rem + 1.768vw, 3rem);          /* 32 → 48  section titles */
  --fs-title:   clamp(2rem, 1.793rem + 0.884vw, 2.5rem);        /* 32 → 40  app names on cards */
  --fs-h3:      clamp(1.625rem, 1.47rem + 0.663vw, 2rem);       /* 26 → 32  feature titles */
  --fs-lead:    clamp(1.125rem, 1.047rem + 0.331vw, 1.3125rem); /* 18 → 21 */
  --fs-item:    clamp(1.0625rem, 1.037rem + 0.11vw, 1.125rem);  /* 17 → 18  small titles, questions */
  --fs-body:    clamp(1rem, 0.974rem + 0.11vw, 1.0625rem);      /* 16 → 17 */
  --fs-ui:      0.9375rem;                                      /* 15  nav, kickers, footer */
  --fs-small:   0.875rem;                                       /* 14  meta and fine print */

  /* Headings sit at 500 so the logo (580) stays the heaviest mark on the page;
     calm comes from size and the secondary colour, not from a light weight. */
  --fw-head: 500;
  --fw-strong: 600;
  --tr-display: -0.028em;
  --tr-h1: -0.025em;
  --tr-h2: -0.022em;
  --tr-h3: -0.016em;
  --tr-lead: -0.008em;
  --lh-display: 1.02;
  --lh-h1: 1.04;
  --lh-h2: 1.08;
  --lh-h3: 1.16;
  --lh-lead: 1.45;
  --lh-body: 1.6;

  /* Spacing: an 8 px base. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --section: clamp(4.5rem, 3.05rem + 6.19vw, 8rem);    /* 72 → 128 between sections */
  --row-gap: clamp(3.5rem, 2.46rem + 4.42vw, 6rem);    /* 56 → 96 between feature rows */

  /* Layout */
  --container: 1120px;
  --gutter: 16px;
  --grid-gap: 32px;
  --measure: 62ch;
  --header-h: 64px;
  --appbar-h: 48px;

  /* Radii. Section 13 swaps in continuous (squircle) corners where the browser
     draws them, the shape of the logo's tile and the app icons. */
  --r-xs: 6px;    /* inline code, small tags */
  --r-ctl: 10px;  /* icon buttons, keycaps */
  --r-btn: 12px;  /* buttons */
  --r-card: 16px; /* app links, list cards */
  --r-shot: 18px; /* product visuals */
  --r-panel: 28px;/* full-width panels */
  --r-code: 12px; /* code blocks */

  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 120ms;
}

@media (min-width: 600px) { :root { --gutter: 32px; } }
@media (min-width: 1024px) { :root { --gutter: 48px; } }


/* 3. Themes ------------------------------------------------------------------
   Monochrome. Ink and paper come from the logo's usage notes; the secondary
   grey leans toward the Whittled icon's graphite. Every pair passes WCAG AA:
   text-2 is 5.3:1 on --bg and 4.8:1 on --surface in light, 7.7:1 and 7.0:1
   in dark. */

:root,
html[data-theme="light"] {
  --success: #248a3d; /* done, built, verified: a deep green that keeps a white tick above 4:1 */
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #F4F5F7;
  --surface-2: #EBECEF;
  --text: #1D1D1F;
  --text-2: #686C74;
  --line: rgba(29, 31, 36, .11);
  --line-strong: rgba(29, 31, 36, .22);
  --focus: #1D1D1F;
  --shadow-sheet: 0 18px 40px -18px rgba(20, 22, 28, .28);
  --shot-line: rgba(0, 0, 0, .08);
  --inverse-bg: #1D1D1F;
  --inverse-surface: #2A2A2E;

  /* The accent is ink until an app page sets its own (section 4). */
  --accent: #1D1D1F;
  --accent-text: #1D1D1F;
  --on-accent: #FFFFFF;
}

html[data-theme="dark"] {
  --success: #248a3d; /* done, built, verified: a deep green that keeps a white tick above 4:1 */
  color-scheme: dark;
  --bg: #121214;
  --surface: #1C1C1F;
  --surface-2: #26262A;
  --text: #F5F5F7;
  --text-2: #A3A6AD;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .20);
  --focus: #F5F5F7;
  --shadow-sheet: 0 18px 40px -12px rgba(0, 0, 0, .7);
  --shot-line: rgba(255, 255, 255, .08);
  --inverse-bg: #1C1C1F;
  --inverse-surface: #26262A;

  --accent: #F5F5F7;
  --accent-text: #F5F5F7;
  --on-accent: #121214;
}


/* 4. App accents -------------------------------------------------------------
   <body data-app="clearshot"> or <body data-app="mantel">. The accent appears
   only on its own app's page, where it means something: the download button,
   the status pill, kickers. White on either fill is 5.1:1. */

[data-app="clearshot"] {
  --accent: #2564EA;
  --accent-text: #2564EA;
  --on-accent: #FFFFFF;
}
html[data-theme="dark"] [data-app="clearshot"] { --accent-text: #5B9BF8; }

[data-app="mantel"] {
  --accent: #C3420C;
  --accent-text: #C3420C;
  --on-accent: #FFFFFF;
}
html[data-theme="dark"] [data-app="mantel"] { --accent-text: #E8743A; }


/* 5. Base ------------------------------------------------------------------- */

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--s-5);
}
html:has(.app-bar) { scroll-padding-top: calc(var(--appbar-h) + var(--s-5)); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-kerning: normal;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; display: block; }

:where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote, pre) { margin: 0; }
:where(h1, h2, h3, h4, h5, h6) { font-weight: var(--fw-head); text-wrap: balance; }
:where(p, li, dd) { text-wrap: pretty; }
:where(ul, ol)[class] { list-style: none; padding: 0; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent-text) 22%, transparent); }

/* Default heading sizes; the type classes below override them. */
h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: var(--tr-h1); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--tr-h2); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--tr-h3); }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .24em;
  text-decoration-color: color-mix(in srgb, currentColor 38%, transparent);
  transition: text-decoration-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
a:hover { text-decoration-color: currentColor; }

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

.skip-link {
  position: absolute;
  z-index: 100;
  top: var(--s-3);
  left: var(--s-3);
  padding: 10px 16px;
  border-radius: var(--r-btn);
  background: var(--text);
  color: var(--bg);
  font-weight: var(--fw-strong);
  text-decoration: none;
  transform: translateY(calc(-100% - 24px));
}
.skip-link:focus-visible { transform: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Show one of two elements per theme (for example a light and a dark
   screenshot of the same shot). */
html[data-theme="dark"] .only-light,
html:not([data-theme="dark"]) .only-dark { display: none !important; }


/* 6. Type ------------------------------------------------------------------- */

.t-display {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-display);
  font-weight: var(--fw-head);
}
.t-h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: var(--tr-h1); font-weight: var(--fw-head); }
.t-h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--tr-h2); font-weight: var(--fw-head); }
.t-title { font-size: var(--fs-title); line-height: 1.1; letter-spacing: var(--tr-h2); font-weight: var(--fw-head); }
.t-h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--tr-h3); font-weight: var(--fw-head); }
.t-item { font-size: var(--fs-item); line-height: 1.35; letter-spacing: 0; font-weight: var(--fw-strong); }
.t-lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
  letter-spacing: var(--tr-lead);
  color: var(--text-2);
  max-width: 34em;
}
.t-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.t-small { font-size: var(--fs-small); line-height: 1.5; }
.t-meta {
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.t-2 { color: var(--text-2); }

/* Facts joined by middle dots ("Free and open source · macOS 27 or later ·
   Apple Silicon"). Every item carries its dot in front; the list is shifted
   left by one dot and clipped, so a line never starts or ends with a dot when
   it wraps. Centred lists stack instead, one fact a line, under 600 px. */
.meta-list { --dot: .8em; display: flex; flex-wrap: wrap; margin-inline-start: calc(var(--dot) * -1); clip-path: inset(-.5em -.5em -.5em var(--dot)); }
.meta-list > li { white-space: nowrap; }
.meta-list > li::before { content: "\00B7"; content: "\00B7" / ""; display: inline-block; width: var(--dot); text-align: center; }
.meta-list--center { justify-content: center; margin-inline: calc(var(--dot) * -1) 0; }
@media (max-width: 599.98px) {
  .meta-list--center { flex-direction: column; align-items: center; margin-inline: 0; clip-path: none; }
  .meta-list--center > li::before { content: none; }
}

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

:where(code):not(pre code) {
  font-size: .86em;
  padding: .08em .3em;
  border-radius: var(--r-xs);
  background: var(--surface);
  overflow-wrap: anywhere;
}
:where(.panel) :where(code):not(pre code) { background: var(--surface-2); }

/* Inline keys, for example a shortcut inside a sentence or a kicker. */
kbd {
  font-family: var(--font-mac);
  font-size: .9em;
  font-weight: 500;
  padding: .06em .4em .1em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  white-space: nowrap;
}

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose > :where(h3, h4) { margin-top: 2.2em; font-size: var(--fs-item); line-height: 1.35; letter-spacing: 0; font-weight: var(--fw-strong); }
.prose > :where(h3, h4) + * { margin-top: .5em; }
.prose > :where(ul, ol):not([class]) { padding-left: 1.15em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--text-2); }
.prose > .code { margin-block: 1.4em; }


/* 7. Layout, buttons, links ------------------------------------------------- */

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.section { padding-block-start: var(--section); }
main > .section:last-child { padding-block-end: var(--section); }

.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 2rem + 2.2vw, 4rem); }
.section-head > * + * { margin-top: var(--s-4); }

.stack > * + * { margin-top: var(--stack, var(--s-4)); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }

/* A 12-column grid from 1024 px; one column below. */
.grid-12 { display: grid; gap: var(--grid-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) {
  .grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .grid-12 > .span-4 { grid-column: span 4; }
  .grid-12 > .span-5 { grid-column: span 5; }
  .grid-12 > .span-6 { grid-column: span 6; }
  .grid-12 > .span-7 { grid-column: span 7; }
  .grid-12 > .span-8 { grid-column: span 8; }
  .grid-12 > .span-12 { grid-column: 1 / -1; }
}

/* Buttons. At most two side by side; each section has at most one. */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: var(--fw-strong);
  line-height: 1;
  letter-spacing: -.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn__icon { width: 18px; height: 18px; flex: none; margin-inline-start: -2px; }

.btn--primary { background: var(--text); color: var(--bg); }
.btn--primary:hover { background: color-mix(in srgb, var(--text) 84%, var(--bg)); }

.btn--secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--secondary:hover { background: var(--surface); border-color: color-mix(in srgb, var(--text) 30%, transparent); }

/* The download button follows release.js: data-state is loading, ready or soon.
   Loading and ready look the same (the link already works while the version
   loads). Soon without data-soon-label means "no release yet": neutral. Soon
   with data-soon-label means GitHub could not be reached for an app that has
   releases: the button stays the app's download. */
.btn--download { background: var(--accent); color: var(--on-accent); }
.btn--download:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn--download[data-state="loading"] { cursor: progress; }
.btn--download[data-state="soon"]:not([data-soon-label]) {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}
[data-release-version] { transition: opacity var(--t-fast) var(--ease); }
[data-release-version][data-state="loading"] { opacity: .55; }

.btn--sm { min-height: 36px; padding: 0 14px; font-size: .875rem; border-radius: calc(var(--r-btn) - 2px); }
.btn--sm::after { content: ""; position: absolute; inset: -4px 0; } /* 44 px hit area */

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
@media (max-width: 599.98px) {
  .actions { flex-direction: column; align-items: stretch; }
  .actions > .btn { width: 100%; }
}

/* Status pill (not a link): "In development". */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--accent-text);
  font-size: var(--fs-small);
  font-weight: var(--fw-strong);
  line-height: 1;
  white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
html[data-theme="dark"] .pill { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.pill--lg { min-height: 48px; padding: 0 20px; font-size: 1rem; }

/* Text links for every secondary action. */
.link {
  font-weight: 500;
  color: var(--text);
  text-decoration-color: var(--line-strong);
}
.link:hover { text-decoration-color: currentColor; }
.link--more::after,
.link--ext::after {
  display: inline-block;
  margin-inline-start: .28em;
  text-decoration: none;
  transition: transform var(--t-fast) var(--ease);
}
.link--more::after { content: "\2192"; content: "\2192" / ""; }
.link--ext::after { content: "\2197"; content: "\2197" / ""; color: var(--text-2); font-size: .9em; }
.link--more:hover::after { transform: translateX(2px); }
.links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }


/* 8. Header and menu ----------------------------------------------------------
   64 px, static. The lockup is inlined (fill: currentColor) so it follows the
   theme. The theme switch sits at the far right at every width; below 768 px
   the links fold into a menu button just left of it. */

.site-header { position: relative; z-index: 30; background: var(--bg); }
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: var(--header-h);
}
.site-header__home {
  display: inline-flex;
  align-items: center;
  margin-inline-end: auto;
  padding-block: 11px;
  color: var(--text);
  border-radius: var(--r-xs);
}
.site-header__home svg { width: auto; height: 22px; }

.site-nav { display: flex; align-items: center; }
.site-nav__list { display: flex; align-items: center; gap: 28px; }
.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--fs-ui);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}
.site-nav__link:hover { color: var(--text-2); }
.site-nav__link[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--line-strong); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--r-ctl);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  position: relative;
  transition: background-color var(--t-fast) var(--ease);
}
.icon-btn::after { content: ""; position: absolute; inset: -2px; } /* 44 px hit area */
.icon-btn:hover { background: var(--surface); }
.icon-btn svg { width: 20px; height: 20px; }

.theme-toggle { margin-inline-start: 8px; }
.theme-toggle .moon { fill: transparent; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; transition: fill var(--t-fast) var(--ease); }
html[data-theme="dark"] .theme-toggle .moon { fill: currentColor; }

.site-nav__toggle { display: none; }
.site-nav__toggle .bar { transform-origin: center; transform-box: fill-box; transition: transform 160ms var(--ease); }
.site-nav__toggle[aria-expanded="true"] .bar-1 { transform: translateY(3px) rotate(45deg); }
.site-nav__toggle[aria-expanded="true"] .bar-2 { transform: translateY(-3px) rotate(-45deg); }

/* Without JavaScript the switch can't work, so it isn't shown. */
html:not(.js) .theme-toggle { display: none; }

@media (max-width: 767.98px) {
  .site-header__home svg { height: 20px; }
  .theme-toggle { margin-inline-start: 0; }

  /* With JavaScript: a menu button and a sheet under the header. */
  .js .site-nav__toggle { display: inline-grid; }
  .js .site-nav__list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 var(--gutter) var(--s-4);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sheet);
  }
  .js .site-header[data-menu-open] .site-nav__list { display: flex; }
  .js .site-nav__list > li { border-top: 1px solid var(--line); }
  .js .site-nav__link { display: flex; min-height: 52px; font-size: 1.25rem; letter-spacing: -.01em; }

  /* Without JavaScript: the links wrap onto a second row. */
  html:not(.js) .site-header__inner { flex-wrap: wrap; padding-block: var(--s-2); row-gap: 0; }
  html:not(.js) .site-nav { order: 3; width: 100%; }
  html:not(.js) .site-nav__list { flex-wrap: wrap; gap: 0 var(--s-5); }
}


/* 9. Footer -------------------------------------------------------------------
   On the page background with a hairline on top. Four link columns (Apps,
   Guides, Open source, Whittled; two by two on phones), then the lockup as the
   sign-off, then the legal line. */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-block: clamp(3rem, 2.5rem + 2.2vw, 4.5rem) clamp(2rem, 1.8rem + 1vw, 3rem);
  font-size: var(--fs-ui);
}
.site-footer__nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-6) var(--grid-gap);
}
@media (min-width: 768px) {
  .site-footer__nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.site-footer__heading {
  font-size: var(--fs-ui);
  line-height: 1.4;
  letter-spacing: 0;
  font-weight: var(--fw-strong);
  color: var(--text);
  margin-bottom: var(--s-2);
}
.site-footer__list > li + li { margin-top: 2px; }
.site-footer__list a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--text-2);
  text-decoration: none;
}
.site-footer__list a:hover { color: var(--text); }
.site-footer__signoff {
  display: inline-flex;
  margin-top: clamp(3.5rem, 2.8rem + 3vw, 6rem);
  color: var(--text);
  border-radius: var(--r-xs);
}
.site-footer__signoff svg { width: auto; height: clamp(36px, 30px + 1.6vw, 48px); max-width: 100%; }
.site-footer__legal {
  margin-top: var(--s-5);
  font-size: var(--fs-small);
  color: var(--text-2);
}


/* 10. App pages -------------------------------------------------------------- */

/* App icons carry macOS's transparent margin (about 8% a side). .app-icon pulls
   the image out by that margin so the visible tile lines up with the text. */
.app-icon {
  --icon: 80px;
  display: block;
  flex: none;
  width: var(--icon);
  height: var(--icon);
  margin-inline-start: calc(var(--icon) * -.079);
  margin-block: calc(var(--icon) * -.089) calc(var(--icon) * -.07);
}

/* Local bar: sticky once the header scrolls away. */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(18px);
  backdrop-filter: saturate(1.8) blur(18px);
  border-bottom: 1px solid var(--line);
}
.app-bar__inner { display: flex; align-items: center; gap: var(--s-5); min-height: var(--appbar-h); }
.app-bar__name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-inline-end: auto;
  font-size: var(--fs-ui);
  font-weight: var(--fw-strong);
  color: var(--text);
  text-decoration: none;
}
.app-bar__name .app-icon { --icon: 30px; margin-block: 0; }
.app-bar__links { display: flex; gap: var(--s-5); }
.app-bar__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
}
.app-bar__links a:hover { color: var(--text); }
@media (max-width: 767.98px) { .app-bar__links { display: none; } }

/* App hero: text on 5 columns, the product on 7. */
.app-hero { padding-block: clamp(2.5rem, 1.6rem + 3.8vw, 5rem) 0; }
.app-hero__grid { display: grid; gap: var(--s-7); align-items: center; }
@media (min-width: 960px) {
  .app-hero__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--s-8); }
}
.app-hero .app-icon { --icon: 64px; }
@media (min-width: 960px) { .app-hero .app-icon { --icon: 80px; } }
.app-hero__title { margin-top: var(--s-5); }
.app-hero__lead { margin-top: var(--s-4); max-width: 24em; }
.app-hero__actions { margin-top: var(--s-6); }
.app-hero__meta { margin-top: var(--s-5); }

/* Feature rows: a visual on 7 columns beside text on 4, sides alternating and
   starting with the visual on the left. On narrow screens the visual comes
   first. */
.features { display: grid; row-gap: var(--row-gap); }
.feature { display: grid; gap: var(--s-6); align-items: center; }
.feature__visual { order: -1; min-width: 0; }
.feature__text { min-width: 0; max-width: 34rem; }
.feature__kicker {
  margin-bottom: var(--s-3);
  font-size: var(--fs-ui);
  font-weight: var(--fw-strong);
  line-height: 1.4;
  color: var(--accent-text);
}
.feature__kicker kbd { padding: 0; border: 0; font-size: 1em; font-weight: 500; color: var(--text-2); letter-spacing: .04em; }
.feature__title { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--tr-h3); }
.feature__body { margin-top: var(--s-4); color: var(--text-2); }
.feature__body > * + * { margin-top: .75em; }
.feature__detail {
  margin-top: var(--s-5);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-size: var(--fs-small);
  color: var(--text-2);
}
@media (min-width: 960px) {
  .feature { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); column-gap: clamp(3rem, 6vw, 6rem); }
  .feature__visual { order: 0; grid-column: 1; grid-row: 1; }
  .feature__text { grid-column: 2; grid-row: 1; }
  /* :not(.feature--wide) keeps a wide row in an even position full width. */
  .feature:nth-child(even of .feature):not(.feature--wide) { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
  .feature:nth-child(even of .feature):not(.feature--wide) .feature__visual { grid-column: 2; }
  .feature:nth-child(even of .feature):not(.feature--wide) .feature__text { grid-column: 1; }

  /* The one allowed break: a full-width visual, title and text side by side above it. */
  .feature.feature--wide { grid-template-columns: minmax(0, 1fr); row-gap: var(--s-7); }
  .feature.feature--wide .feature__text {
    grid-column: 1; grid-row: 1; max-width: none;
    display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); column-gap: clamp(3rem, 6vw, 6rem); align-items: start;
  }
  .feature.feature--wide .feature__visual { grid-column: 1; grid-row: 2; }
  .feature.feature--wide .feature__kicker,
  .feature.feature--wide .feature__title { grid-column: 1; }
  .feature.feature--wide .feature__body { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
  /* A wide row's .feature__detail sits under the body, in the right-hand column. */
  .feature.feature--wide .feature__detail { grid-column: 2; }
}

/* Compact grid for "everything else": no icons, a hairline on each item.
   Items holding a visual span two text items' width on desktop. */
.compact { display: grid; gap: var(--s-7) var(--grid-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .compact { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .compact__item { grid-column: span 2; }
  .compact__item--visual { grid-column: span 3; }
}
.features + .compact { margin-top: var(--section); }
.compact__item { min-width: 0; padding-top: var(--s-5); border-top: 1px solid var(--line); }
.compact__item--visual { padding-top: 0; border-top: 0; }
.compact__item--visual > .shot { margin-bottom: var(--s-5); }
.compact__title { font-size: var(--fs-item); line-height: 1.35; letter-spacing: 0; font-weight: var(--fw-strong); }
.compact__text { margin-top: var(--s-2); color: var(--text-2); max-width: 40ch; }
.compact__item--visual .compact__text { max-width: 52ch; }

/* Keyboard shortcuts as keycaps. */
.keys { display: grid; gap: var(--s-6) var(--grid-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .keys { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.keys__item { display: grid; gap: var(--s-4); justify-items: start; }
.keys__label { font-weight: 500; }
.keycaps { display: inline-flex; gap: 6px; }
.keycaps kbd {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  height: 52px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: var(--r-ctl);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mac);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1;
}
html[data-theme="dark"] .keycaps kbd { background: var(--surface); }

/* Label-left split for short, text-heavy sections (privacy, open source,
   requirements, FAQ): the title on 4 columns, the content on 8. */
.split { display: grid; gap: var(--s-5) var(--grid-gap); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.split__title { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--tr-h3); }
.split__body { min-width: 0; max-width: var(--measure); }
.split__body > * + * { margin-top: var(--s-4); }
.split__body > .code, .split__body > .facts, .split__body > .faq { margin-top: var(--s-5); }
/* A list that opens a split drops its top rule: the split's own hairline is above it. */
.split__body > .facts:first-child { margin-top: -10px; border-top: 0; }
.split__body > .faq:first-child { margin-top: -18px; border-top: 0; }
.split__body > :where(h3) { margin-top: var(--s-7); font-size: var(--fs-item); line-height: 1.35; letter-spacing: 0; font-weight: var(--fw-strong); }
.split__body > :where(h3) + * { margin-top: var(--s-2); }
@media (min-width: 960px) {
  .split { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .split__head { grid-column: 1 / span 4; }
  .split__body { grid-column: 5 / span 8; }
}
.splits { display: grid; row-gap: var(--s-9); }

/* Facts and specs: a definition list with hairlines. */
.facts { border-top: 1px solid var(--line); }
.facts__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px var(--s-5);
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 600px) { .facts__row { grid-template-columns: minmax(9rem, 1fr) minmax(0, 2.4fr); } }
.facts dt { color: var(--text-2); }
.facts dd { color: var(--text); }

/* FAQ: details and summary, so every answer is in the HTML and opens without
   JavaScript. */
.faq { border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  min-height: 64px;
  padding-block: var(--s-4);
  font-size: var(--fs-item);
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
  border-radius: var(--r-xs);
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(currentColor 0 0) center / 14px 1.5px no-repeat,
    linear-gradient(currentColor 0 0) center / 1.5px 14px no-repeat;
  color: var(--text-2);
  transition: background-size 160ms var(--ease);
}
.faq__q:hover::after { color: var(--text); }
.faq__item[open] > .faq__q::after { background-size: 14px 1.5px, 1.5px 0; }
.faq__a { padding-bottom: var(--s-5); max-width: var(--measure); color: var(--text-2); }
.faq__a > * + * { margin-top: .75em; }

/* Terminal commands. The block scrolls sideways itself, never the page. */
.code {
  max-width: 100%;
  padding: 18px 22px;
  overflow-x: auto;
  border-radius: var(--r-code);
  background: var(--surface);
  color: var(--text);
  font-size: .875rem;
  line-height: 1.75;
  tab-size: 2;
  white-space: pre;
  scrollbar-width: thin;
}
.code code { font: inherit; background: none; padding: 0; border-radius: 0; }
.code .c { color: var(--text-2); } /* optional: a comment line */


/* 11. Product visuals -----------------------------------------------------------
   <figure class="shot" data-shot="name"> at a fixed aspect ratio, so a real
   capture can replace the rendering one for one. The figure is a size
   container; inside, --pt is one macOS point of the stage being shown.

   Custom properties on the figure (pt are macOS points):
     --ar        aspect ratio of the view (default 16 / 10)
     --stage-w   --stage-h      the whole drawing, in pt (default 1280 × 800)
     --view-w    --view-x  --view-y   the visible part: its width and offset
     --ar-n, --view-w-n, --view-x-n, --view-y-n   the narrow crop, under 600 px

   .shot          a crop of a screen: rounded, a hairline at its edge
   .shot--bare    no frame, nothing clipped, for a lone window or panel
   .shot--float   a lifted window shadow, for a crop that sits on --surface */

.shot {
  position: relative;
  margin: 0;
  aspect-ratio: var(--ar, 16 / 10);
  container-type: inline-size;
  border-radius: var(--r-shot);
  overflow: hidden;
  isolation: isolate;
  background: var(--surface);
}
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--shot-line);
  pointer-events: none;
}
.shot__art {
  --pt: calc(100cqw / var(--view-w, var(--stage-w, 1280)));
  /* Shadows measured in pt live here, beside --pt: a custom property resolves
     var() where it is declared, so on .shot they would have no --pt to use.
     Under 600 px they follow the narrow crop's --pt automatically. */
  --shadow-window: 0 0 0 calc(.5 * var(--pt)) rgba(0, 0, 0, .25), 0 calc(10 * var(--pt)) calc(30 * var(--pt)) rgba(0, 0, 0, .20), 0 calc(24 * var(--pt)) calc(60 * var(--pt)) rgba(0, 0, 0, .16);
  --shadow-panel: 0 0 0 calc(.5 * var(--pt)) rgba(0, 0, 0, .20), 0 calc(6 * var(--pt)) calc(18 * var(--pt)) rgba(0, 0, 0, .24);
  position: absolute;
  inset: 0;
  overflow: hidden;
  font-family: var(--font-mac);
  color: var(--mac-label);
  line-height: 1.2;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
.shot__stage {
  position: absolute;
  left: calc(var(--view-x, 0) * var(--pt) * -1);
  top: calc(var(--view-y, 0) * var(--pt) * -1);
  width: calc(var(--stage-w, 1280) * var(--pt));
  height: calc(var(--stage-h, 800) * var(--pt));
}
.shot > img, .shot__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 599.98px) {
  .shot { aspect-ratio: var(--ar-n, var(--ar, 16 / 10)); border-radius: calc(var(--r-shot) * .75); }
  .shot__art { --pt: calc(100cqw / var(--view-w-n, var(--view-w, var(--stage-w, 1280)))); }
  .shot__stage {
    left: calc(var(--view-x-n, var(--view-x, 0)) * var(--pt) * -1);
    top: calc(var(--view-y-n, var(--view-y, 0)) * var(--pt) * -1);
  }
}
.shot--bare { background: none; overflow: visible; border-radius: 0; }
.shot--bare::after { content: none; }
.shot--float { box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 24px 48px -24px rgba(0, 0, 0, .28); }
html[data-theme="dark"] .shot--float { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 24px 48px -20px rgba(0, 0, 0, .7); }

/* macOS tokens for the renderings (ui-spec.md §2). They follow the site's
   theme: light pages show macOS in its light appearance, dark pages its dark
   one. Overlay colours that are dark in both appearances don't change. */
.shot {
  --mac-accent: #007AFF;
  --mac-label: rgba(0, 0, 0, .85);
  --mac-label-2: rgba(0, 0, 0, .50);
  --mac-label-3: rgba(0, 0, 0, .26);
  --mac-separator: rgba(0, 0, 0, .10);
  --mac-window: #ECECEC;
  --mac-content: #FFFFFF;
  --mac-canvas: #DCDCDC;
  --mac-fill-4: rgba(0, 0, 0, .05);
  --mac-red: #FF3B30;
  --mac-orange: #FF9500;
  --mac-yellow: #FFCC00;
  --mac-green: #34C759;
  --mac-material: rgba(246, 246, 246, .80);
  --mac-menubar: rgba(246, 246, 246, .55);
  --mac-inactive-light: #CDCDCD;
  --wood: #F3E6D3;
  --wall: #3A3A3C;
  --wall-tide:
    radial-gradient(45% 45% at 22% 18%, rgba(255, 255, 255, .35), transparent),
    linear-gradient(160deg, #A8DCEB 0%, #4F9BE0 45%, #2550B8 100%);
  --wall-hearth: linear-gradient(160deg, #FDE3B5 0%, #F4A55A 50%, #C8551E 100%);

  /* Theme-independent (ClearShot's overlay) */
  --dim: rgba(0, 0, 0, .40);
  --hud-material: rgba(28, 28, 30, .80);
  --hud-hover: rgba(255, 255, 255, .12);
  --hud-on: rgba(255, 255, 255, .20);
  --hud-pressed: rgba(255, 255, 255, .25);
  --hud-accent: #0A84FF;
  --tag: rgba(0, 0, 0, .75);
  --qa-control: rgba(0, 0, 0, .60);
  --qa-dim: rgba(0, 0, 0, .35);
}
html[data-theme="dark"] .shot {
  --mac-accent: #0A84FF;
  --mac-label: rgba(255, 255, 255, .88);
  --mac-label-2: rgba(255, 255, 255, .55);
  --mac-label-3: rgba(255, 255, 255, .25);
  --mac-separator: rgba(255, 255, 255, .10);
  --mac-window: #323232;
  --mac-content: #1E1E1E;
  --mac-canvas: #262626;
  --mac-fill-4: rgba(255, 255, 255, .06);
  --mac-red: #FF453A;
  --mac-orange: #FF9F0A;
  --mac-yellow: #FFD60A;
  --mac-green: #30D158;
  --mac-material: rgba(44, 44, 46, .80);
  --mac-menubar: rgba(28, 28, 30, .45);
  --mac-inactive-light: #5A5A5A;
  --wood: #3A3128;
  --wall: #D6D6D6;
  --wall-tide:
    radial-gradient(45% 45% at 22% 18%, rgba(120, 190, 255, .18), transparent),
    linear-gradient(160deg, #1F4A66 0%, #173A73 50%, #0D1A3A 100%);
  --wall-hearth: linear-gradient(160deg, #5C3517 0%, #3E200E 55%, #1E0F07 100%);
}


/* 12. Panel, app links, 404 ----------------------------------------------------- */

.panel {
  padding: clamp(2.5rem, 1.6rem + 3.8vw, 5rem) clamp(1.25rem, .3rem + 4vw, 4.5rem);
  border-radius: var(--r-panel);
  background: var(--surface);
}
@media (max-width: 599.98px) { .panel { border-radius: calc(var(--r-panel) * .72); } }
.panel--center { text-align: center; }
.panel--center > * { margin-inline: auto; }
.panel--center > * + * { margin-top: var(--s-5); }
.panel--center > .actions { margin-top: var(--s-6); }
.panel--center .actions { justify-content: center; }

/* The page's one strong panel. Light: ink with white type. Dark: never a
   light panel on the dark page; the surface plus a hairline instead.
   Tokens are re-declared so every component inside follows. */
.panel--inverse {
  --bg: #1D1D1F;
  --surface: #2A2A2E;
  --surface-2: #34343A;
  --text: #F5F5F7;
  --text-2: #A3A6AD;
  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .24);
  --focus: #F5F5F7;
  color-scheme: dark;
  background: var(--bg);
  color: var(--text);
}
html[data-theme="dark"] .panel--inverse {
  --bg: #1C1C1F;
  --surface: #26262A;
  --surface-2: #303036;
  box-shadow: inset 0 0 0 1px var(--line);
}

/* An app as a link: icon, name and one line. */
.app-link {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5) var(--s-4) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  color: var(--text);
  text-decoration: none;
  text-align: start;
}
.app-link:hover { background: var(--surface); border-color: transparent; }
.app-link .app-icon { --icon: 52px; margin: -4px 0 -4px -2px; }
.app-link__name { display: block; font-weight: var(--fw-strong); line-height: 1.3; }
.app-link__text { display: block; font-size: var(--fs-small); line-height: 1.45; color: var(--text-2); }

.notfound {
  display: grid;
  justify-items: center;
  padding-block: clamp(5rem, 3.4rem + 6.8vw, 9rem) clamp(4rem, 3rem + 4.4vw, 7rem);
  text-align: center;
}
.notfound__title { font-size: clamp(2.25rem, 2.08rem + .74vw, 2.75rem); line-height: var(--lh-h1); letter-spacing: var(--tr-h1); }
.notfound__text { margin-top: var(--s-4); max-width: 30em; }
.notfound .actions { margin-top: var(--s-6); justify-content: center; }
.notfound__apps {
  display: grid;
  gap: var(--s-3);
  width: min(100%, 42rem);
  margin-top: var(--s-8);
}
@media (min-width: 600px) { .notfound__apps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.notfound__apps > li { display: flex; }
.notfound__apps .app-link { flex: 1; }
.notfound__label { margin-top: var(--s-8); font-size: var(--fs-small); color: var(--text-2); }
.notfound__label + .notfound__apps { margin-top: var(--s-4); }
@media (max-width: 599.98px) { .notfound .actions { width: 100%; } }


/* 13. Guides ----------------------------------------------------------------------
   How-to articles under /guides/ and the hub that lists them. Markup for every
   piece is in planning/Whittled/docs/guide-template.html. A guide hangs from
   the same left edge as every page: the page head on the container edge, a
   hairline, then "In this guide" on the left and the body on 8 columns from
   960 px, the label-left split's grid, so "Related guides" (a .split) lines up
   under it. The body is set for reading: 62ch, body text in --text. */

/* Page head (the hub and every guide): breadcrumb, h1, lead, meta. */
.page-head { padding-block-start: clamp(2.5rem, 1.6rem + 3.8vw, 5rem); }
.page-head__title {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  letter-spacing: var(--tr-h2);
  max-width: 18em;
}
.page-head__lead { margin-top: var(--s-4); }
.page-head__meta { margin-top: var(--s-5); }

/* Breadcrumb: Guides › Screenshots. The current page is the h1, not repeated. */
.breadcrumb { margin-bottom: var(--s-3); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; font-size: var(--fs-ui); line-height: 1.4; color: var(--text-2); }
.breadcrumb li + li::before { content: "\203A"; content: "\203A" / ""; margin-inline: .5em; }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 32px; color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }

/* Article layout: contents beside the body from 960 px, stacked above it below. */
.article__layout {
  display: grid;
  gap: var(--s-6) var(--grid-gap);
  margin-top: clamp(2.5rem, 2rem + 2.2vw, 4rem);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}
.article__aside { min-width: 0; padding-bottom: var(--s-5); border-bottom: 1px solid var(--line); }
.article__body { min-width: 0; max-width: var(--measure); }
@media (min-width: 960px) {
  .article__layout { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
  .article__aside {
    grid-column: 1 / span 3;
    position: sticky;
    top: var(--s-5);
    max-height: calc(100vh - 2 * var(--s-5));
    overflow-y: auto;
    padding-bottom: 0;
    border-bottom: 0;
  }
  .article__body { grid-column: 5 / span 8; }
}

/* "In this guide": the body's h2s, in order. */
.toc__title { font-size: var(--fs-small); line-height: 1.5; font-weight: var(--fw-strong); color: var(--text-2); }
.toc__list { margin-top: var(--s-2); }
.toc__list a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding-block: 6px;
  font-size: var(--fs-ui);
  line-height: 1.4;
  color: var(--text-2);
  text-decoration: none;
}
.toc__list a:hover { color: var(--text); }

/* The body: headings, paragraphs and lists in reading rhythm. */
.article__body > * + * { margin-top: 1em; }
.article__body > :where(h2) {
  margin-top: var(--s-8);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  letter-spacing: var(--tr-h3);
}
.article__body > :where(h3) {
  margin-top: var(--s-6);
  font-size: var(--fs-item);
  line-height: 1.35;
  letter-spacing: 0;
  font-weight: var(--fw-strong);
}
.article__body > :where(h2) + * { margin-top: var(--s-4); }
.article__body > :where(h3) + * { margin-top: var(--s-2); }
.article__body > :first-child { margin-top: 0; }
.article__body > :where(.steps, .note, .code, .table-wrap, .app-card, .shot) { margin-top: var(--s-5); }
.article__body > :where(.steps, .note, .code, .table-wrap, .app-card, .shot) + :where(p, ul, ol) { margin-top: var(--s-5); }
.article__body :where(ul, ol):not([class]) { padding-left: 1.2em; }
.article__body :where(ul, ol):not([class]) > li + li { margin-top: .45em; }
.article__body li::marker { color: var(--text-2); }
.article__body strong { font-weight: var(--fw-strong); }

/* Numbered steps: a sequence the reader follows in order. */
.steps { counter-reset: step; display: grid; gap: var(--s-4); }
.steps > li { counter-increment: step; position: relative; min-height: 28px; padding-inline-start: 44px; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  font-size: var(--fs-small);
  font-weight: var(--fw-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text);
}
.steps > li > * + * { margin-top: .5em; }

/* A shortcut inside a sentence: one keycap per key, the spoken name for
   screen readers (and the Markdown mirror) beside them. */
.shortcut { white-space: nowrap; }
.shortcut__keys { display: inline-flex; gap: 3px; }
.shortcut__keys kbd {
  display: inline-block;
  min-width: 1.75em;
  padding: .02em .35em .08em;
  line-height: 1.35;
  text-align: center;
  background: var(--bg);
}
html[data-theme="dark"] .shortcut__keys kbd { background: var(--surface); }

/* Note or tip: a short aside on --surface, its label in the first line. */
.note { padding: 18px 22px; border-radius: var(--r-card); background: var(--surface); }
.note > * + * { margin-top: .5em; }
.note__title { font-weight: var(--fw-strong); }
.note :where(code):not(pre code) { background: var(--surface-2); }
.note .shortcut__keys kbd { background: var(--bg); }
html[data-theme="dark"] .note .shortcut__keys kbd { background: var(--surface-2); }

/* Table (shortcuts, settings). It scrolls sideways itself, never the page. */
.table-wrap { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table :where(th, td) { padding: 12px var(--s-5) 12px 0; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.table :where(th, td):last-child { padding-inline-end: 0; }
.table thead th { padding-block-start: 0; font-size: var(--fs-small); font-weight: var(--fw-strong); color: var(--text-2); border-bottom-color: var(--line-strong); }
.table tbody th { font-weight: 500; }
.table td { color: var(--text-2); }

/* App card: points from a guide to ClearShot or Mantel. Monochrome, like the
   home page: an app's accent belongs to its own page. The name's link covers
   the card. */
.app-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.app-card:hover { background: var(--surface); border-color: transparent; }
.app-card:has(.app-card__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.app-card .app-icon { --icon: 56px; margin: -4px 0 -4px -2px; }
.app-card__body { min-width: 0; }
.app-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); }
.app-card__name { font-size: var(--fs-item); line-height: 1.35; font-weight: var(--fw-strong); }
.app-card__link { color: var(--text); text-decoration: none; }
.app-card__link::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.app-card__link:focus-visible { outline: none; }
.app-card__text { margin-top: var(--s-1); color: var(--text-2); }
.app-card .meta-list { margin-top: var(--s-2); }

/* Sources: Apple's own documentation for what macOS does. */
.sources { margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.sources__title { font-size: var(--fs-small); line-height: 1.5; letter-spacing: 0; font-weight: var(--fw-strong); color: var(--text-2); }
.sources__list { margin-top: var(--s-2); font-size: var(--fs-small); line-height: 1.5; color: var(--text-2); }
.sources__list > li + li { margin-top: var(--s-2); }
.sources__list .link { font-weight: 500; }

/* Guide list: the hub's lists and "Related guides". Hairline rows, a title
   that leads on (→) and one line about the guide. */
.guide-list { border-top: 1px solid var(--line); }
.guide-list > li { border-bottom: 1px solid var(--line); }
.guide-link { display: block; padding-block: 18px; color: var(--text); text-decoration: none; }
.guide-link__title { display: block; font-size: var(--fs-item); line-height: 1.35; font-weight: var(--fw-strong); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: .24em; transition: text-decoration-color var(--t-fast) var(--ease); }
.guide-link__title::after { content: "\2192"; content: "\2192" / ""; display: inline-block; margin-inline-start: .28em; transition: transform var(--t-fast) var(--ease); }
.guide-link__text { display: block; margin-top: var(--s-1); color: var(--text-2); }
.guide-link:hover .guide-link__title { text-decoration-color: var(--line-strong); }
.guide-link:hover .guide-link__title::after { transform: translateX(2px); }
.split__body > .guide-list:first-child { margin-top: -18px; border-top: 0; }
.split__body > p + .guide-list { margin-top: var(--s-5); }


/* 14. Continuous corners, motion, print ------------------------------------------
   Where the browser can draw continuous (squircle) corners, buttons, panels and
   visuals take the same curve as the logo's tile and the app icons. The radii
   grow to keep the same visual size. A new rounded surface that uses one of
   the --r-* tokens adds class "squircle" to get the same curve. */

@supports (corner-shape: squircle) {
  :root {
    --r-ctl: 15px;
    --r-btn: 18px;
    --r-card: 26px;
    --r-shot: 30px;
    --r-panel: 48px;
    --r-code: 20px;
  }
  .btn, .icon-btn, .app-link, .app-card, .note, .shot, .shot::after, .panel, .code, .keycaps kbd, .skip-link, .squircle {
    corner-shape: squircle;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-nav, .theme-toggle, .app-bar, .skip-link, .article__aside { display: none !important; }
  .site-header, .site-footer { border: 0; }
  a { text-decoration: none; }
}
