/* Shuye (书页) — site styles. Hand-written, no build step.
   Palette from the app's tokens (lib/app/theme/tokens.dart): "Paper & Seal" light, "Night Jade" dark. */

@font-face {
  font-family: "Shuye Serif";
  src: url("/assets/fonts/shuye-latin-serif-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Shuye Serif";
  src: url("/assets/fonts/shuye-latin-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Shuye Serif";
  src: url("/assets/fonts/shuye-latin-serif-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
/* Noto Serif SC, subset to the characters this site uses (tools/subset_han.py). Variable weight. */
@font-face {
  font-family: "Shuye Han";
  src: url("/assets/fonts/noto-serif-sc-subset.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F6F1E7;
  --surface: #FFFDF8;
  --ink: #1E1B16;
  --muted: #6B6253;
  --subtle: #8A7E6A;
  --seal: #B8432F;
  --on-seal: #F6F1E7;
  --tint: #F2D6CC;
  --rule: #E3D9C6;
  --link: #B8432F;
  --focus: #B8432F;
  --plate: #EDE5D6;
  --frame: #CFC3AE;

  --latin: "Shuye Serif", "Shuye Han", "Iowan Old Style", Georgia, serif;
  --han: "Shuye Han", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", serif;

  --measure: 36rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --wide: 78rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E1714;
    --surface: #16241F;
    --ink: #E7EFEA;
    --muted: #9DB3A8;
    --subtle: #7F978B;
    --seal: #C94F39;
    --on-seal: #F6F1E7;
    --tint: #203530;
    --rule: #23372F;
    --link: #4FB59A;
    --focus: #4FB59A;
    --plate: #13201C;
    --frame: #33493F;
  }
}

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

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--latin);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (min-width: 48rem) {
  body { font-size: 1.125rem; }
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

[lang|="zh"] { font-family: var(--han); }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

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

::selection { background: var(--tint); color: var(--ink); }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

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

.wrap {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Labels, rules, small type ---------- */

.label {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.label .num {
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--seal);
  margin-right: 0.55em;
}

/* A book's running head: a label left, a word right, a hairline under both. */
.running-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.running-head .folio {
  font-family: var(--han);
  font-size: 0.9375rem;
  color: var(--subtle);
  letter-spacing: 0.08em;
}

/* ---------- Site header ---------- */

.site-header { padding-top: 1.1rem; }
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}
.brand svg { width: 1.7rem; height: 1.7rem; flex: none; }
.brand .name { font-size: 1.25rem; font-weight: 600; letter-spacing: 0.01em; }
.brand .han { font-family: var(--han); font-size: 0.95rem; color: var(--muted); letter-spacing: 0.06em; }

.mark-page { fill: var(--ink); }
.mark-fold { fill: var(--rule); }
.mark-seal { fill: var(--seal); }
@media (prefers-color-scheme: dark) {
  .mark-page { fill: #E7EFEA; }
  .mark-fold { fill: #9DB3A8; }
}

.site-nav ul {
  display: flex;
  gap: clamp(0.9rem, 2.4vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.6rem;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 40rem) {
  .site-nav .wide-only { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-top: clamp(2.5rem, 7vw, 5.5rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
}

.seal {
  writing-mode: vertical-rl;
  font-family: var(--han);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0.35em;
  color: var(--on-seal);
  background: var(--seal);
  border-radius: 4px;
  padding: 0.7rem 0.45rem 0.35rem;
  margin: 0;
  width: max-content;
  user-select: none;
}

.hero-copy { position: relative; }
.hero .seal { position: absolute; top: 0; right: 0; }

.hero h1 {
  margin: 1.1rem 0 0;
  max-width: 18ch;
  font-weight: 400;
  font-size: clamp(2.5rem, 1.2rem + 4.6vw, 5.1rem);
  line-height: 1.02;
  letter-spacing: -0.018em;
  padding-right: 3.25rem;
}
.hero h1 em { font-style: italic; }

.lede {
  margin: 1.6rem 0 0;
  max-width: 34rem;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  line-height: 1.55;
  color: var(--muted);
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
.store {
  display: inline-flex;
  flex-direction: column;
  min-width: 10.5rem;
  min-height: 3.25rem;
  justify-content: center;
  padding: 0.55rem 1.1rem 0.6rem;
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.25;
}
.store small {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.store span { font-size: 1.0625rem; }
.store.is-soon { border-style: dashed; border-color: var(--frame); }
a.store:hover { background: var(--ink); color: var(--paper); }
a.store:hover small { color: inherit; }
.store-note { margin: 0.8rem 0 0; font-size: 0.9375rem; color: var(--muted); }

.hero-figure { margin: 0; }

@media (min-width: 60rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 18.5rem;
    column-gap: clamp(3rem, 6vw, 6rem);
    row-gap: 3.5rem;
    align-items: start;
  }
  .hero-copy { grid-column: 1; grid-row: 1; }
  .hero-figure { grid-column: 2; grid-row: 1 / span 2; margin-top: 4.5rem; }
  .specimen { grid-column: 1; grid-row: 2; max-width: 42rem; }
}
@media (min-width: 40rem) {
  .hero h1 em { display: block; }
}
@media (min-width: 86rem) {
  .hero .seal { right: auto; left: -4.25rem; top: -0.2rem; }
  .hero h1 { padding-right: 0; }
}

/* ---------- The reading specimen (mirrors the app's reader and docked word panel) ---------- */

.specimen {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.specimen-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--rule);
}

.controls { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }

.seg {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px;
  margin: 0;
}
.seg legend {
  float: left;
  padding: 0 0.5rem 0 0.6rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 2.1rem;
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  min-height: 2.1rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button .zh { font-family: var(--han); font-size: 1rem; }

.specimen-text { padding: 1.4rem 1.1rem 0.6rem; }
@media (min-width: 40rem) { .specimen-text { padding: 1.8rem 1.75rem 0.8rem; } }

.sentence { margin: 0 0 1.25rem; }
.sentence .zh {
  margin: 0;
  font-family: var(--han);
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.75rem);
  line-height: 2.25;
  letter-spacing: 0;
  font-weight: 400;
}
.sentence .en {
  margin: 0.1rem 0 0;
  font-style: italic;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

ruby { ruby-position: over; ruby-align: center; }
rt {
  font-family: var(--latin);
  font-size: 0.4em;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.tok {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0 0.04em;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  border-radius: 3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tok:hover { background: color-mix(in srgb, var(--tint) 60%, transparent); }
.tok[aria-pressed="true"] {
  background: var(--tint);
  box-shadow: inset 0 -2px 0 var(--seal);
}
.tok:focus-visible { outline-offset: 1px; }
.nb { white-space: nowrap; }

.specimen[data-pinyin="off"] .sentence rt,
.specimen[data-pinyin="level"] .tok[data-known] rt { visibility: hidden; }
.specimen[data-translation="off"] .sentence .en { display: none; }

/* The docked panel: always under the text, never over it. */
.panel {
  border-top: 1px solid var(--rule);
  padding: 1.1rem 1.1rem 1.25rem;
  min-height: 11.5rem;
}
@media (min-width: 40rem) { .panel { padding: 1.25rem 1.75rem 1.5rem; } }

.panel-hint { margin: 0; color: var(--muted); max-width: 30rem; }
.panel-hint strong { color: var(--ink); font-weight: 600; }

.panel-entry { display: grid; gap: 0.35rem 1.5rem; }
@media (min-width: 40rem) {
  .panel-entry { grid-template-columns: auto minmax(0, 1fr); }
}
.panel-word { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.35rem 0.8rem; }
.panel-word .w { font-family: var(--han); font-size: 2.25rem; line-height: 1.15; }
.panel-word .r { font-style: italic; font-size: 1.125rem; color: var(--muted); }
.tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--seal);
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 0.05rem 0.4rem;
  line-height: 1.5;
}
.panel-body p { margin: 0 0 0.3rem; }
.panel-body .here { font-size: 1.125rem; }
.panel-body .k {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.5em;
}
.panel-body .note { color: var(--ink); }
.panel-body .also { color: var(--muted); font-size: 0.9375rem; }

.panel-nav {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}
.btn-quiet {
  appearance: none;
  font: inherit;
  font-size: 0.875rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  min-height: 2.5rem;
  padding: 0 0.95rem;
  cursor: pointer;
}
.btn-quiet:hover { border-color: var(--ink); }
.btn-quiet[disabled] { opacity: 0.45; cursor: default; }
.btn-quiet[disabled]:hover { border-color: var(--rule); }
.specimen-foot { margin: 0; padding: 0 1.1rem 1rem; font-size: 0.8125rem; color: var(--subtle); }
@media (min-width: 40rem) { .specimen-foot { padding: 0 1.75rem 1.1rem; } }

/* ---------- Device outline and screenshot plates ---------- */

.device {
  margin: 0;
  width: 100%;
  max-width: 18.5rem;
}
.device .frame {
  border: 1px solid var(--frame);
  border-radius: 2.6rem;
  padding: 0.6rem;
  background: var(--surface);
}
.device .screen {
  position: relative;
  aspect-ratio: 1320 / 2868;
  border-radius: 2.05rem;
  overflow: hidden;
  background: var(--plate);
}
/* Shown until (or unless) the screenshot loads: a quiet paper plate with the screen's name. */
.device .screen::before {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--subtle);
}
.device .screen::after {
  content: "";
  position: absolute;
  left: 18%; right: 18%;
  top: calc(50% + 1.4rem);
  height: 1px;
  background: var(--rule);
}
.device picture, .device img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}
.device img { object-fit: cover; color: transparent; font-size: 0; }
.device .screen.is-missing picture { display: none; }
.device figcaption {
  margin-top: 0.85rem;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--muted);
  text-align: center;
}
.device.small { max-width: 14.5rem; }

/* ---------- Sections ---------- */

.section { padding-block: clamp(3.5rem, 9vw, 7rem); }
.section + .section { padding-top: 0; }

.section h2 {
  margin: 0 0 1.25rem;
  max-width: 18ch;
  font-weight: 400;
  font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.012em;
}
.section .intro { max-width: var(--measure); color: var(--muted); margin: 0; font-size: 1.125rem; }

/* How it works: three steps, staggered like captions down a page. */
.steps {
  display: grid;
  gap: 3.5rem;
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
}
.step .n {
  display: block;
  font-style: italic;
  font-size: 3.25rem;
  line-height: 1;
  color: var(--seal);
  margin-bottom: 0.6rem;
}
.step h3 { margin: 0 0 0.5rem; font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.step p { margin: 0 0 1.5rem; max-width: 26rem; }
@media (min-width: 56rem) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(2rem, 4vw, 4rem); }
  .step:nth-child(2) { margin-top: 4.5rem; }
  .step:nth-child(3) { margin-top: 9rem; }
}

/* Feature rows: text and a plate, alternating sides. */
.feature {
  display: grid;
  gap: 2.25rem;
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
  border-top: 1px solid var(--rule);
  align-items: center;
}
.feature:first-of-type { border-top: 0; padding-top: 0; }
.feature h3 {
  margin: 0.6rem 0 1rem;
  font-weight: 400;
  font-size: clamp(1.65rem, 1.2rem + 1.6vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.008em;
  max-width: 24ch;
}
.feature p { margin: 0 0 1rem; max-width: var(--measure); }
.feature .where {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.feature .where b { font-weight: 600; color: var(--ink); }
.feature .plate { justify-self: center; width: 100%; }
.feature .device { margin-inline: auto; }

@media (min-width: 56rem) {
  .feature { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(3rem, 7vw, 7rem); }
  .feature.flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .feature.flip .text { order: 2; }
  .feature .text { padding-left: clamp(0rem, 4vw, 4.5rem); }
  .feature.flip .text { padding-left: 0; }
}

.facts {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  max-width: var(--measure);
  border-top: 1px solid var(--rule);
}
.facts li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 1rem;
}

/* Typeset plates (no screenshot needed): pinyin modes, Listen. */
.typeset {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.25rem 1.25rem 0.75rem;
  max-width: 30rem;
  margin-inline: auto;
}
.typeset .row { padding: 0.25rem 0 0.9rem; }
.typeset .row + .row { border-top: 1px solid var(--rule); padding-top: 0.9rem; }
.typeset .zh {
  margin: 0.2rem 0 0;
  font-family: var(--han);
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.6rem);
  line-height: 2.2;
  letter-spacing: 0.02em;
}
.typeset rt.off { visibility: hidden; }
.typeset .caption { margin: 0.4rem 0 0.5rem; font-size: 0.8125rem; color: var(--subtle); font-style: italic; }

.listen .zh .s { background: var(--tint); border-radius: 3px; padding: 0.1em 0.15em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.listen .zh .spoken { text-decoration: underline; text-decoration-color: var(--seal); text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.player {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  align-items: center;
  margin-top: 0.75rem;
  padding: 0.7rem 0 0.4rem;
  border-top: 1px solid var(--rule);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.player .on { color: var(--ink); }

/* HSK table */
.hsk {
  border-collapse: collapse;
  width: 100%;
  max-width: 30rem;
  margin-inline: auto;
  font-variant-numeric: tabular-nums lining-nums;
}
.hsk caption { text-align: left; padding-bottom: 0.75rem; }
.hsk th, .hsk td { padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--rule); text-align: left; }
.hsk thead th { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.hsk td:last-child, .hsk th:last-child { text-align: right; }
.hsk tbody th { font-weight: 400; }
.hsk tfoot td { color: var(--muted); font-size: 0.9375rem; border-bottom: 0; text-align: left !important; }

/* Accounts list */
.notes {
  display: grid;
  gap: 0;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}
.notes li { padding: 1.25rem 0; border-bottom: 1px solid var(--rule); }
.notes h3 { margin: 0 0 0.35rem; font-size: 1.1875rem; font-weight: 600; }
.notes p { margin: 0; max-width: var(--measure); }
@media (min-width: 56rem) {
  .notes li { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 2rem; align-items: baseline; }
}

/* ---------- Pricing ---------- */

.pricing-grid { display: grid; gap: 3rem; margin-top: 2.5rem; }
@media (min-width: 60rem) {
  .pricing-grid { grid-template-columns: minmax(0, 1fr) 15rem; column-gap: clamp(3rem, 7vw, 7rem); align-items: start; }
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: lining-nums;
}
.price-table th, .price-table td {
  padding: 0.8rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.price-table thead th {
  border-bottom: 1px solid var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.6rem;
}
.price-table thead th.premium { color: var(--seal); }
.price-table tbody th { font-weight: 400; padding-left: 0; }
.price-table tbody th small { display: block; color: var(--muted); font-size: 0.875rem; }
.price-table td { width: 30%; }
.price-table tr.price td, .price-table tr.price th { padding-block: 1.1rem; }
.price-table .big { font-size: 1.625rem; line-height: 1.15; display: block; }
.price-table .sub { color: var(--muted); font-size: 0.9375rem; }
.price-table sup { font-size: 0.7em; color: var(--seal); }
@media (max-width: 30rem) {
  .price-table th, .price-table td { padding-inline: 0.35rem; font-size: 0.9375rem; }
  .price-table .big { font-size: 1.3rem; }
}

.fine {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  max-width: 40rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.fine li { margin: 0 0 0.6rem; padding-left: 1.4rem; text-indent: -1.4rem; }
.fine li b { color: var(--seal); font-weight: 600; display: inline-block; width: 1.4rem; text-indent: 0; }

/* ---------- FAQ ---------- */

.faq-grid { display: grid; gap: 2rem; }
@media (min-width: 60rem) {
  .faq-grid { grid-template-columns: 17rem minmax(0, 1fr); column-gap: clamp(3rem, 7vw, 7rem); }
  .faq-grid .aside { position: sticky; top: 2rem; align-self: start; }
  .faq-grid .aside h2 { font-size: clamp(2rem, 1.4rem + 1.4vw, 2.6rem); }
}
.faq { border-top: 1px solid var(--ink); max-width: 44rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  font-size: 1.1875rem;
  line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--seal);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 1.25rem; max-width: var(--measure); }
.faq .answer p { margin: 0 0 0.75rem; }

/* ---------- Closing and footer ---------- */

.closing { padding-block: clamp(3rem, 8vw, 6rem); border-top: 1px solid var(--rule); }
.closing p.big {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.site-footer { padding: 2.5rem 0 3rem; border-top: 1px solid var(--ink); font-size: 0.9375rem; }
.site-footer .cols { display: grid; gap: 2rem; }
@media (min-width: 48rem) {
  .site-footer .cols { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
}
.site-footer .colophon p { margin: 0.5rem 0 0; color: var(--muted); max-width: 30rem; }
.site-footer ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-footer ul a { color: var(--ink); text-decoration: none; display: inline-block; padding-block: 0.35rem; }
.site-footer ul a:hover { text-decoration: underline; }
.site-footer .copy { margin: 2rem 0 0; color: var(--subtle); font-size: 0.875rem; }

/* ---------- Document pages (legal, contact, delete account) ---------- */

.doc { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(3.5rem, 8vw, 6rem); }
.doc-grid { display: grid; gap: 2rem; }
@media (min-width: 64rem) {
  .doc-grid { grid-template-columns: 15rem minmax(0, 1fr); column-gap: clamp(3rem, 6vw, 6rem); }
  .doc-grid .toc { position: sticky; top: 2rem; align-self: start; max-height: calc(100vh - 4rem); overflow: auto; }
}
.doc h1 {
  margin: 0.9rem 0 0.75rem;
  font-weight: 400;
  font-size: clamp(2.3rem, 1.5rem + 3.2vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.doc .meta { margin: 0 0 2rem; color: var(--muted); font-size: 0.9375rem; }
.doc .summary {
  max-width: 40rem;
  margin: 0 0 2.5rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--seal);
  border-radius: 4px;
}
.doc .summary p { margin: 0 0 0.6rem; }
.doc .summary ul { margin: 0; padding-left: 1.2rem; }
.doc .summary li { margin-bottom: 0.3rem; }
.prose { max-width: 40rem; }
.prose h2 {
  margin: 3rem 0 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.25;
}
.prose h2 .n { color: var(--seal); font-weight: 400; margin-right: 0.45em; font-variant-numeric: lining-nums; }
.prose h3 { margin: 1.75rem 0 0.5rem; font-size: 1.125rem; font-weight: 600; }
.prose p, .prose li { max-width: 40rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--subtle); }
.prose .path { font-weight: 600; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.9375rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.6rem 0.5rem 0.6rem 0; border-bottom: 1px solid var(--rule); }
.prose thead th { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--ink); }
.table-scroll { overflow-x: auto; }
.prose .aside-note { color: var(--muted); font-size: 0.9375rem; }
.prose address { font-style: normal; }

.toc ol { margin: 0.75rem 0 0; padding: 0; list-style: none; counter-reset: toc; font-size: 0.9375rem; }
.toc li { counter-increment: toc; margin: 0; border-bottom: 1px solid var(--rule); }
.toc a { display: block; padding: 0.45rem 0; color: var(--muted); text-decoration: none; }
.toc a::before { content: counter(toc) ". "; color: var(--subtle); }
.toc a:hover { color: var(--ink); }
@media (max-width: 63.99rem) {
  .toc { border: 1px solid var(--rule); border-radius: 4px; padding: 0.9rem 1rem 0.4rem; max-width: 40rem; }
  .toc ol { columns: 2 12rem; column-gap: 1.5rem; }
  .toc li { break-inside: avoid; }
}

.steps-list { counter-reset: s; list-style: none; padding: 0 !important; }
.steps-list > li {
  counter-increment: s;
  position: relative;
  padding: 0.2rem 0 0.75rem 2.6rem;
  margin: 0;
}
.steps-list > li::before {
  content: counter(s);
  position: absolute;
  left: 0; top: 0.15rem;
  width: 1.75rem; height: 1.75rem;
  border: 1px solid var(--seal);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.9375rem;
  color: var(--seal);
  font-variant-numeric: lining-nums;
}

.callout {
  margin: 1.5rem 0;
  padding: 1rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
}
.callout p:last-child { margin-bottom: 0; }

.email-big { font-size: clamp(1.4rem, 1rem + 2vw, 2rem); word-break: break-word; }

.not-found { padding-block: clamp(4rem, 12vw, 9rem); }
.not-found .big-han { font-family: var(--han); font-size: clamp(4rem, 3rem + 6vw, 7.5rem); line-height: 1; color: var(--seal); margin: 0 0 1rem; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .site-header, .site-footer, .toc, .skip { display: none; }
  body { background: #fff; color: #000; }
}

@media (max-width: 59.99rem) {
  .hero-figure .device, .step .device, .pricing-grid .device { margin-inline: auto; }
}

.not-found h1 {
  margin: 0.6rem 0 1rem;
  font-weight: 400;
  font-size: clamp(2.2rem, 1.5rem + 3vw, 3.5rem);
  line-height: 1.05;
}
