/* PenMorph: one visual language with the app (PenMorph/Design/Manual.swift: Theme, Space, GeoMark).
   Light, dark and auto: html[data-theme] is set by the inline script in <head>; without it the system decides. */

:root {
  color-scheme: light;
  --paper: #FAF6EF;
  --raised: #F1ECE2;
  --desk: #E9E4DA;
  --ink: #171615;
  --secondary: #6F6A62;
  --rule: #DDD6C9;
  --red: #E0431F;       /* brand red: fills only */
  --red-text: #C93A18;  /* red for text on cream (AA) */
  --blue: #375DA8;
  --yellow: #FBBE24;
  --bezel: #171615;
  --paper-sheet: #FDFAF3;
  --rule-blue: #C9D3E3;
  --bezel-line: #171615;
  --screen-edge: #171615;
  /* Space */
  --xs: 4px; --s: 8px; --m: 12px; --l: 16px; --xl: 24px; --xxl: 40px; --xxxl: 80px;
  --wide: 1200px;
  --text: 640px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Dark: the same values twice, for "auto" on a dark system and for the explicit choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #161514; --raised: #211F1D; --desk: #23211E; --ink: #F2EDE4; --secondary: #9D968B; --rule: #35322E;
    --red: #F0603F; --red-text: #F0603F; --blue: #6C8FD6; --yellow: #FBBE24;
    --bezel: #0C0B0A; --bezel-line: #6A645B; --screen-edge: #000; --paper-sheet: #1C1B19; --rule-blue: #2E3646;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #161514; --raised: #211F1D; --desk: #23211E; --ink: #F2EDE4; --secondary: #9D968B; --rule: #35322E;
  --red: #F0603F; --red-text: #F0603F; --blue: #6C8FD6; --yellow: #FBBE24;
  --bezel: #0C0B0A; --bezel-line: #6A645B; --screen-edge: #000; --paper-sheet: #1C1B19; --rule-blue: #2E3646;
}

/* Which screenshot shows: light by default, dark on a dark system (auto) or by choice. */
.pic .dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pic .light { display: none; }
  :root:not([data-theme="light"]) .pic .dark { display: block; }
}
:root[data-theme="dark"] .pic .light { display: none; }
:root[data-theme="dark"] .pic .dark { display: block; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red-text); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: var(--l); top: -100px; background: var(--ink); color: var(--paper); padding: var(--s) var(--m); z-index: 20; }
.skip:focus { top: var(--l); }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--xl); }
@media (max-width: 480px) { .wrap { padding: 0 var(--l); } }

/* The three shapes */
.mark { display: inline-block; vertical-align: middle; flex: none; overflow: visible; }
.mark .r { fill: var(--red); }
.mark .b { fill: var(--blue); }
.mark .y { fill: var(--yellow); }

/* Wide uppercase type */
.brand span, .eyebrow, .section-head h2, .nav a, .button, .label, .theme button, .step-num, .tag {
  font-family: var(--display); font-stretch: 125%; text-transform: uppercase;
}

/* Header */
.top { border-bottom: 1px solid var(--rule); background: var(--paper); }
.top .wrap { display: flex; align-items: center; gap: var(--l) var(--xl); min-height: 64px; flex-wrap: wrap; padding-top: var(--s); padding-bottom: var(--s); }
.brand { display: inline-flex; align-items: center; gap: var(--m); text-decoration: none; margin-right: auto; }
.brand span { font-weight: 800; letter-spacing: 0.14em; font-size: 15px; }
.nav { display: flex; gap: var(--l); flex-wrap: wrap; }
.nav a { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-decoration: none; padding: var(--xs) 0; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: var(--red); }
.theme { display: none; border: 1px solid var(--rule); border-radius: 999px; padding: 2px; gap: 2px; }
.js .theme { display: inline-flex; }
.theme button {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: var(--secondary); background: none; border: 0;
  border-radius: 999px; padding: 6px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 28px;
}
.theme button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.theme svg { width: 10px; height: 10px; }
@media (max-width: 560px) { .theme button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .theme button { padding: 8px; } }

/* Type */
h1, h2, h3 { font-family: var(--display); font-stretch: 125%; line-height: 1.08; margin: 0; overflow-wrap: break-word; }
h1 { font-size: clamp(32px, 7vw, 76px); font-weight: 900; letter-spacing: -0.015em; }
h2 { font-size: clamp(26px, 4vw, 44px); font-weight: 850; letter-spacing: -0.01em; }
h3 { font-size: 18px; font-weight: 750; }
p { margin: 0 0 var(--l); }
.lede { font-size: clamp(18px, 2.1vw, 22px); line-height: 1.5; max-width: 34em; }
.muted, .detail { color: var(--secondary); }
.detail { font-size: 15px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; color: var(--secondary); margin: 0 0 var(--m); }
.cmd { font-family: var(--mono); font-weight: 500; white-space: nowrap; }
code.cmd { font-size: 0.95em; }

/* Numbered section head, like ManualSection: "01  PEN" and a rule under it (drawn in on reveal) */
.section { padding: var(--xxxl) 0 0; }
.section-head { position: relative; display: flex; align-items: baseline; gap: var(--m); padding-bottom: 10px; margin-bottom: var(--xxl); }
.section-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--ink); transform-origin: left; }
.section-head .num { font: 700 13px/1 var(--mono); color: var(--red-text); }
.section-head h2 { font-size: 13px; font-weight: 800; letter-spacing: 0.14em; line-height: 1.3; }

/* Device frames: flat bezels, no product artwork */
.device { position: relative; margin: 0; background: var(--bezel); box-shadow: 0 0 0 1.5px var(--bezel-line); }
.device .pic img { width: 100%; border-radius: inherit; }
.device .pic { border-radius: inherit; overflow: hidden; box-shadow: 0 0 0 1px var(--screen-edge); }
.ipad { padding: clamp(8px, 1.4%, 16px); border-radius: clamp(18px, 3.2%, 36px); }
.ipad .pic { border-radius: clamp(10px, 1.9%, 22px); }
.ipad.portrait { padding: clamp(8px, 2%, 16px); border-radius: clamp(18px, 4.6%, 36px); }
.ipad.portrait .pic { border-radius: clamp(10px, 2.7%, 22px); }
.iphone { padding: clamp(6px, 3.2%, 12px); border-radius: clamp(26px, 15%, 52px); }
.iphone .pic { border-radius: clamp(20px, 12%, 42px); }
figcaption { font-size: 13px; color: var(--secondary); margin-top: var(--m); }

/* Hero */
.hero { padding: var(--xxl) 0 var(--l); }
.hero .grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--xxl) var(--xl); align-items: center; }
.hero .copy { grid-column: 1 / span 5; }
.hero .stage { grid-column: 6 / span 7; position: relative; }
.hero h1 { margin-bottom: var(--xl); }
.hero .mark { margin-bottom: var(--xl); }
@media (max-width: 980px) {
  .hero .copy, .hero .stage { grid-column: 1 / -1; }
}

/* The hero's paper: four scenes written by an invisible pen in the app's own handwriting (src/ink.ts, src/hero.ts).
   Ruled like the app's lined paper. Only stroke-dashoffset and opacity change; the box has a fixed aspect. */
.ink { margin: 0; background: var(--paper-sheet); border: 1.5px solid var(--ink); border-radius: 16px; padding: var(--m) var(--l) var(--m); }
.ink-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s); margin-bottom: var(--s); }
.ink-head .tag { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; color: var(--secondary); }
.ink-count { font: 700 12px var(--mono); color: var(--red-text); white-space: nowrap; }
.ink-stage { position: relative; aspect-ratio: 640 / 400; }
.ink-stage .scene { position: absolute; inset: 0; }
.ink-stage .scene + .scene { display: none; }
.js .ink-stage .scene { display: block; opacity: 0; visibility: hidden; transition: opacity 350ms var(--ease), visibility 0s linear 350ms; }
.js .ink-stage .scene.on { opacity: 1; visibility: visible; transition: opacity 350ms var(--ease); }
.ink svg { width: 100%; height: auto; display: block; overflow: visible; }
.ink .rules line { stroke: var(--rule-blue); stroke-width: 1; }
.ink .w, .margin-ink .w { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.margin-ink .w { stroke-width: 1.8; }
.ink .w.red, .margin-ink .w.red { stroke: var(--red); }
.ink .said { opacity: 0.28; }
.ink .res rect { fill: var(--raised); stroke: var(--rule); stroke-width: 1; }
.ink .res .dot { fill: var(--red); }
.ink .res text { fill: var(--ink); font-family: var(--mono); white-space: pre; }
.ink .res-label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; fill: var(--secondary) !important; }
.ink .res-answer { font-size: 22px; font-weight: 700; }
.ink .res-step { font-size: 14px; }
.ink .dim line, .ink .dim path { stroke: var(--blue); stroke-width: 1.5; fill: var(--blue); }
.ink .dim .tag { fill: var(--paper-sheet); stroke: var(--blue); }
.ink .dim text { fill: var(--blue); font-size: 14px; font-weight: 700; text-anchor: middle; }
.ink-controls { display: none; gap: var(--s); align-items: center; flex-wrap: wrap; margin-top: var(--m); }
.js .ink-controls { display: flex; }
.ink-controls button { font: 600 12px var(--sans); color: var(--ink); background: var(--raised); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 12px; cursor: pointer; min-height: 32px; }
.ink-dots { display: flex; gap: 6px; margin-right: auto; flex-wrap: wrap; }
.ink-dots button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ink-caption { font-size: 14px; color: var(--secondary); margin: var(--s) 0 0; min-height: 2.6em; }
.ink-grid { display: none; }
@media (max-width: 560px) { .ink-dots button span { font-size: 11px; } .ink { padding: var(--s) var(--m); } }

@keyframes pm-ink { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pm-gone { from { opacity: 1; } to { opacity: 0; } }
@keyframes pm-show { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pm-mark-in { from { opacity: 0; transform: translateX(-14px) scale(0.6); } to { opacity: 1; transform: none; } }

/* Handwritten notes beside a few headings */
.margin-ink { margin-left: auto; align-self: flex-end; margin-bottom: -6px; flex: none; max-width: 40%; height: auto; }

.contact-block { border: 1.5px solid var(--ink); border-radius: 14px; padding: var(--xl); margin-top: var(--xxl); }
.contact-mail { font: 800 clamp(18px, 3vw, 24px) var(--display); font-stretch: 125%; margin: var(--s) 0 var(--m); }
.contact-mail a { text-decoration: none; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: var(--m); align-items: center; margin-top: var(--xl); }
.button { display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: 0.14em; padding: 15px var(--xl); border-radius: 10px; text-decoration: none; border: 1.5px solid var(--ink); }
.button.primary { background: var(--ink); color: var(--paper); }
.button.primary:hover { color: var(--paper); background: var(--red-text); border-color: var(--red-text); }
.button.quiet { background: transparent; color: var(--ink); }
.button.quiet:hover { background: var(--raised); color: var(--ink); }
.button.pending { background: var(--ink); color: var(--paper); cursor: default; }

/* How a command works */
.steps { list-style: none; padding: 0; margin: 0 0 var(--xxl); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--xl); counter-reset: step; }
.steps li { border-top: 1px solid var(--rule); padding-top: var(--m); }
.steps li::before { counter-increment: step; content: counter(step, decimal-leading-zero); display: block; font: 700 13px var(--mono); color: var(--red-text); margin-bottom: var(--s); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.examples { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); border-top: 1px solid var(--rule); column-gap: var(--xl); }
.examples li { display: grid; grid-template-columns: 128px 1fr; gap: var(--l); padding: var(--l) 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.examples .cmd { font-size: 20px; }
@media (max-width: 420px) { .examples li { grid-template-columns: 1fr; gap: var(--xs); } }

/* Feature rows: text and a device, alternating */
.feature { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--xxl) var(--xl); align-items: center; }
.feature > .text { grid-column: 1 / span 5; }
.feature > .media { grid-column: 6 / span 7; }
.feature.flip > .text { grid-column: 8 / span 5; grid-row: 1; }
.feature.flip > .media { grid-column: 1 / span 7; grid-row: 1; }
.feature.narrow > .media { grid-column: 7 / span 5; }
.feature.flip.narrow > .media { grid-column: 2 / span 5; }
.feature.text-only > .text { grid-column: 1 / span 7; }
.feature ul { padding: 0; margin: 0 0 var(--l); list-style: none; }
.feature li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.feature li:first-child { border-top: 1px solid var(--rule); }
@media (max-width: 900px) {
  .feature > .text, .feature > .media, .feature.flip > .text, .feature.flip > .media, .feature.narrow > .media, .feature.flip.narrow > .media, .feature.text-only > .text { grid-column: 1 / -1; grid-row: auto; }
  .feature.narrow > .media { max-width: 460px; }
}
.pair { display: flex; gap: var(--xl); align-items: flex-end; }
.pair .ipad { flex: 3; }
.pair .iphone { flex: 1; min-width: 120px; max-width: 220px; }
.note { font-size: 14px; color: var(--secondary); border-left: 3px solid var(--yellow); padding-left: var(--m); }

/* Shapes as section ornaments */
.shapes { display: flex; gap: 10px; margin-bottom: var(--l); }
.shapes i { display: block; width: 14px; height: 14px; }
.shapes .r { background: var(--red); }
.shapes .b { background: var(--blue); border-top-left-radius: 14px; }
.shapes .y { background: var(--yellow); border-radius: 50%; }

/* Tour: a sticky iPad whose picture follows the steps (JS, wide screens); a plain list otherwise */
.tour-stage { display: none; }
.tour-steps { list-style: none; margin: 0; padding: 0; }
.tour-steps > li { padding: var(--xl) 0; border-top: 1px solid var(--rule); }
.tour-steps .step-num { font: 700 13px var(--mono); color: var(--red-text); display: block; margin-bottom: var(--s); text-transform: none; }
.tour-steps h3 { font-size: clamp(20px, 2.4vw, 28px); margin-bottom: var(--m); }
.tour-steps figure { margin: var(--xl) 0 0; }
@media (min-width: 960px) {
  .js .tour { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--xl); }
  /* the stage is centred on the screen (site.js measures --stage-h): the active step, which is the one that
     crosses the middle, then stands beside the device and not below it */
  .js .tour-stage { display: block; grid-column: 1 / span 8; grid-row: 1; position: sticky; top: max(72px, calc(50vh - var(--stage-h, 420px) / 2)); align-self: start; }
  .js .tour-steps { grid-column: 9 / span 4; grid-row: 1; }
  .js .tour-steps > li { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; border-top: 0; padding: 0; opacity: 0.35; transition: opacity 300ms var(--ease); }
  /* first and last step: as tall as the stage, so the section starts and ends with text beside the device */
  .js .tour-steps > li:first-child, .js .tour-steps > li:last-child { min-height: var(--stage-h, 420px); }
  .js .tour-steps > li.active { opacity: 1; }
  .js .tour-steps figure { display: none; }
  .tour-stage .frames { position: relative; }
  .tour-stage .frame { transition: opacity 400ms var(--ease); }
  .tour-stage .frame + .frame { position: absolute; inset: 0; }
  .tour-stage .frame:not(.active) { opacity: 0; }
  .tour-stage .dots { display: flex; gap: 6px; margin-top: var(--l); }
  .tour-stage .dots i { width: 22px; height: 3px; background: var(--rule); transition: background 300ms; }
  .tour-stage .dots i.active { background: var(--red); }
}

/* Templates teaser */
.thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--l); }
@media (max-width: 900px) { .thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.thumbs a { display: block; text-decoration: none; font-size: 13px; }
.thumbs img { aspect-ratio: 800 / 1131; object-fit: contain; width: 100%; border: 1px solid var(--rule); background: #fff; margin-bottom: var(--s); transition: transform 200ms var(--ease), border-color 200ms; }
.thumbs a:hover img, .thumbs a:focus-visible img { border-color: var(--ink); transform: translateY(-3px); }

/* Price */
.price-band { border: 1.5px solid var(--ink); border-radius: 18px; padding: clamp(24px, 5vw, 56px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--xl); align-items: center; position: relative; overflow: hidden; }
.price-band .figure { grid-column: 1 / span 6; }
.price-band .terms { grid-column: 7 / span 6; }
@media (max-width: 820px) { .price-band .figure, .price-band .terms { grid-column: 1 / -1; } }
.amount { font: 900 clamp(56px, 11vw, 120px)/0.95 var(--display); font-stretch: 125%; letter-spacing: -0.02em; display: block; }
.amount sup { font-size: 0.42em; vertical-align: 0.9em; margin-right: 2px; }
.then { font: 700 clamp(18px, 2.4vw, 24px) var(--display); font-stretch: 125%; color: var(--secondary); margin-top: var(--m); display: block; }
.label { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; color: var(--secondary); display: block; margin-bottom: var(--s); }
.price-band ul { list-style: none; margin: 0; padding: 0; }
.price-band li { padding: 10px 0; border-bottom: 1px solid var(--rule); display: flex; gap: var(--m); align-items: baseline; }
.price-band li::before { content: ""; flex: none; width: 8px; height: 8px; background: var(--red); transform: translateY(-1px); }
.price-band li:nth-child(2)::before { background: var(--blue); border-top-left-radius: 8px; }
.price-band li:nth-child(3)::before { background: var(--yellow); border-radius: 50%; }

/* Prose pages */
.prose { max-width: var(--text); }
.prose h2 { font-size: 20px; margin: var(--xxl) 0 var(--m); }
.prose ul { padding-left: 1.2em; margin: 0 0 var(--l); }
.prose li { margin-bottom: var(--s); }
.page-head { padding: var(--xxl) 0 var(--xl); }
.page-head h1 { font-size: clamp(32px, 6vw, 64px); }
.page-head .lede { margin-top: var(--l); }
.draft { font: 700 12px var(--mono); color: var(--red-text); border: 1px solid var(--red-text); display: inline-block; padding: 2px var(--s); border-radius: 4px; margin-bottom: var(--l); }
dl.faq dt { font-weight: 700; margin-top: var(--xl); }
dl.faq dd { margin: var(--s) 0 0; }

/* Command reference */
.cmd-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--xxl); align-items: start; }
.cmd-layout .toc-col { position: sticky; top: 96px; }
@media (max-width: 900px) { .cmd-layout { grid-template-columns: 1fr; } .cmd-layout .toc-col { position: static; } }
.cmd-table { width: 100%; border-collapse: collapse; }
.cmd-table td { padding: 11px var(--m) 11px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.cmd-table td:first-child { width: 34%; }
.cmd-table .cmd { font-size: 17px; }
.cmd-table tr:hover td { background: var(--raised); }
.also { font-size: 13px; color: var(--secondary); }
.also .cmd { font-size: 13px; }
@media (max-width: 560px) {
  .cmd-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .cmd-table td { display: block; border: 0; padding: 0; width: auto !important; }
}
.toc { display: flex; flex-wrap: wrap; gap: var(--s); margin: 0; padding: 0; list-style: none; }
.toc-col .toc { flex-direction: column; gap: 2px; }
.toc-col .toc a { border: 0; background: none; padding: 3px 0; border-radius: 0; font-size: 14px; }
.toc a, .chip { display: inline-block; border: 1px solid var(--rule); border-radius: 999px; padding: 6px var(--m); font-size: 14px; text-decoration: none; background: var(--raised); }
.cmd-section { padding-top: var(--xxl); }
.cmd-section .section-head { margin-bottom: var(--l); }

/* Search and filters: a sticky bar */
.filterbar { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule); padding: var(--m) 0; margin-bottom: var(--xl); }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: var(--m); align-items: end; }
.filters.one { grid-template-columns: 1fr auto; }
@media (max-width: 760px) { .filters, .filters.one { grid-template-columns: 1fr; } }
.filters label { display: block; }
input[type="search"], select {
  width: 100%; font: 16px var(--sans); color: var(--ink); background: var(--raised);
  border: 1px solid var(--rule); border-radius: 10px; padding: 11px var(--m); appearance: none; -webkit-appearance: none;
}
input[type="search"]:focus, select:focus { border-color: var(--ink); }
input[type="search"] { font-family: var(--mono); }
.count { font: 13px var(--mono); color: var(--secondary); margin: 0; padding-bottom: 12px; white-space: nowrap; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--xl) var(--l); }
.cards a { text-decoration: none; display: block; border-radius: 6px; }
.cards img { border: 1px solid var(--rule); background: #fff; aspect-ratio: 800 / 1131; object-fit: contain; width: 100%; transition: transform 200ms var(--ease), border-color 200ms; }
.cards a:hover img, .cards a:focus-visible img { border-color: var(--ink); transform: translateY(-3px); }
.cards .name { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; margin-top: var(--s); }
.cards .meta { display: block; font-size: 13px; color: var(--secondary); text-transform: capitalize; }
.case-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 0 var(--xl); }
.case-list li { border-top: 1px solid var(--rule); padding: var(--l) 0; }
.case-list a { font-weight: 700; text-decoration: none; }
.case-list p { margin: var(--xs) 0 0; font-size: 14px; color: var(--secondary); }
[hidden] { display: none !important; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 440px) 1fr; gap: var(--xxl); align-items: start; }
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-grid figure { margin: 0; }
.detail-grid figure img { border: 1px solid var(--rule); background: #fff; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s) var(--l); margin: 0 0 var(--xl); }
.facts dt { font: 700 11px var(--display); font-stretch: 125%; letter-spacing: 0.14em; text-transform: uppercase; color: var(--secondary); padding-top: 4px; }
.facts dd { margin: 0; }
.crumbs { font-size: 14px; color: var(--secondary); margin-bottom: var(--l); }

/* Footer */
.foot { border-top: 1.5px solid var(--ink); margin-top: var(--xxxl); padding: var(--xxl) 0 var(--xxl); font-size: 14px; }
.foot .wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--xl); }
.foot .about { grid-column: 1 / span 5; }
.foot nav { grid-column: 7 / span 6; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s) var(--xl); }
@media (max-width: 760px) { .foot .about, .foot nav { grid-column: 1 / -1; } }
.foot p { margin: var(--m) 0 0; color: var(--secondary); }

/* Motion: only with JS and only without Reduce Motion */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .js .reveal { opacity: 0; transform: translateY(10px); transition: opacity 400ms var(--ease), transform 400ms var(--ease); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .section-head::after { transform: scaleX(0); transition: transform 600ms var(--ease) 100ms; }
  .js .section-head.in::after { transform: scaleX(1); }
  .hero .mark > * { animation: pm-mark-in 600ms var(--ease) both; transform-box: fill-box; }
  .hero .mark > :nth-child(2) { animation-delay: 140ms; }
  .hero .mark > :nth-child(3) { animation-delay: 280ms; }
  .ink .scene.play .w { animation: pm-ink var(--d) linear var(--t) both; }
  .ink .scene.play .said { animation: pm-gone 400ms var(--ease) var(--fade) both; }
  .ink .scene.play .res { animation: pm-show 450ms var(--ease) var(--show) both; }
  .ink.paused .scene * { animation-play-state: paused !important; }
  .js .margin-ink .w { stroke-dashoffset: 1; }
  .js .in .margin-ink .w { animation: pm-ink var(--d) linear calc(var(--t) + 500ms) both; }
}

/* Reduce Motion: everything still, the hero's four scenes as a still grid */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .ink-stage, .ink-controls, .ink-head .ink-count, .ink-caption { display: none !important; }
  .ink-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--m); }
  .ink-grid .scene { opacity: 1 !important; visibility: visible !important; }
  .ink-grid p { font-size: 13px; color: var(--secondary); margin: var(--xs) 0 0; }
}
