/* ────────────────────────────────────────────────────────────────────
   msg — landing site
   palette: studio ghibli — paper cream, sky blue, forest, terracotta
   type:    Newsreader (display) · Schibsted Grotesk (body) · IBM Plex Mono
   ──────────────────────────────────────────────────────────────────── */

:root {
  /* paper + ink */
  --paper:        #f7f1e3;
  --paper-warm:   #fbf6e8;
  --paper-deep:   #ece3cc;
  --ink:          #2d2a24;
  --ink-soft:     #524c3f;
  --ink-faint:    #8a826f;

  /* sky */
  --sky:          #c8dde9;
  --sky-deep:     #88b1cd;
  --sky-haze:     #e6eef3;

  /* forest */
  --forest:       #6e8b5b;
  --forest-deep:  #4d6a3e;
  --moss:         #b8c79a;

  /* sun + lantern */
  --terracotta:   #c87b5d;
  --sunset:       #e3a47a;
  --gold:         #e6c073;

  /* surface */
  --line:         rgba(45, 42, 36, 0.10);
  --line-soft:    rgba(45, 42, 36, 0.06);
  --shadow:       0 1px 2px rgba(45, 42, 36, 0.04),
                  0 8px 24px rgba(45, 42, 36, 0.06);
  --shadow-deep:  0 4px 12px rgba(45, 42, 36, 0.08),
                  0 24px 48px rgba(45, 42, 36, 0.10);

  --radius:       14px;
  --radius-lg:    22px;

  --measure: 64rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(1200px 600px at 80% -10%, var(--sky-haze), transparent 60%),
    radial-gradient(900px 500px at 0% 30%, rgba(184, 199, 154, 0.18), transparent 60%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* paper grain — subtle, only on large surfaces */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.16  0 0 0 0 0.14  0 0 0 0.045 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.55;
  mix-blend-mode: multiply;
  z-index: 0;
}

main, header, footer { position: relative; z-index: 1; }

a { color: var(--forest-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--terracotta); }

code, pre {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.92em;
}
p code, li code {
  background: var(--paper-deep);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  font-size: 0.86em;
}

em { font-style: italic; color: var(--forest-deep); }

/* ─── decorative sky / clouds ──────────────────────────────────────── */
.sky {
  position: absolute;
  inset: 0 0 auto 0;
  height: 720px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 100px;
  filter: blur(0.4px);
  box-shadow:
    0 12px 30px rgba(136, 177, 205, 0.18),
    inset 0 -8px 24px rgba(136, 177, 205, 0.10);
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 100px;
}
.cloud-a { width: 220px; height: 60px; top: 90px;  right: 8%;  }
.cloud-a::before { width: 110px; height: 90px; top: -36px; left: 36px; }
.cloud-a::after  { width: 80px;  height: 70px; top: -22px; left: 130px; }

.cloud-b { width: 160px; height: 44px; top: 220px; right: 30%; opacity: 0.85; }
.cloud-b::before { width: 80px; height: 64px; top: -26px; left: 24px; }
.cloud-b::after  { width: 60px; height: 50px; top: -18px; left: 92px; }

.cloud-c { width: 280px; height: 70px; top: 380px; left: -40px; opacity: 0.55; }
.cloud-c::before { width: 130px; height: 100px; top: -42px; left: 50px; }
.cloud-c::after  { width: 90px;  height: 80px;  top: -28px; left: 168px; }

/* ─── nav ─────────────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 28px 32px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  color: var(--terracotta);
  font-size: 1.4rem;
  transform: translateY(2px);
}
.brand-name {
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.94rem;
}
.nav-links a:hover { color: var(--terracotta); }

/* ─── hero ────────────────────────────────────────────────────────── */
.hero {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 96px 32px 120px;
  text-align: left;
}
.kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0 0 28px;
}
.hero h1 {
  font-family: 'Newsreader', serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 32px;
  color: var(--ink);
}
.hero h1 em {
  font-style: italic;
  color: var(--forest-deep);
}
.lede {
  max-width: 38em;
  font-size: 1.18rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 40px;
}
.lede em { font-style: italic; color: var(--ink); }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease;
}
.btn-primary {
  background: var(--forest);
  color: var(--paper-warm);
  box-shadow: var(--shadow);
}
.btn-primary:hover {
  background: var(--forest-deep);
  color: var(--paper-warm);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

/* ─── shared section bits ─────────────────────────────────────────── */
.section-h {
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  color: var(--ink);
}
.section-sub {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0 0 48px;
}

/* ─── three-up: how it works ──────────────────────────────────────── */
.three-up {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 80px 32px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.card {
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 28px 28px;
  box-shadow: var(--shadow);
  position: relative;
}
.card-num {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-size: 2.2rem;
  color: var(--terracotta);
  margin-bottom: 8px;
  line-height: 1;
}
.card h3 {
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: 1.4rem;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* ─── quickstart ──────────────────────────────────────────────────── */
.quickstart {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 80px 32px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
  align-items: start;
}
.qs-text { padding-top: 8px; }
.qs-blurb {
  color: var(--ink-soft);
  max-width: 30em;
}
.code {
  margin: 0;
  padding: 28px 28px;
  background: #2d2a24;
  color: #ece3cc;
  border-radius: var(--radius-lg);
  font-size: 0.92rem;
  line-height: 1.7;
  overflow-x: auto;
  box-shadow: var(--shadow-deep);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.code .c { color: #b8c79a; font-style: italic; }

/* ─── features ────────────────────────────────────────────────────── */
.features {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 80px 32px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 40px;
}
.feature {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
  filter: saturate(0.9);
}
.feature h3 {
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.feature p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  max-width: 32em;
}

/* ─── why ─────────────────────────────────────────────────────────── */
.why {
  background: linear-gradient(180deg, transparent, rgba(184, 199, 154, 0.18) 35%, transparent);
  padding: 60px 0 80px;
  margin-top: 40px;
}
.why-inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 32px;
  text-align: left;
}
.why-prose {
  font-family: 'Newsreader', serif;
  font-weight: 400;
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.why-prose em { font-style: italic; color: var(--forest-deep); }
.why-prose.dim {
  color: var(--ink-soft);
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
}

/* ─── spec links ──────────────────────────────────────────────────── */
.spec {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 80px 32px 40px;
}
.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.link-list li {
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 0;
}
.link-list a {
  font-family: 'Newsreader', serif;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}
.link-list a:hover {
  color: var(--terracotta);
}
.link-list li::after { content: ""; }

/* ─── footer ──────────────────────────────────────────────────────── */
.foot {
  max-width: var(--measure);
  margin: 80px auto 60px;
  padding: 32px 32px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.foot p { margin: 0; }
.foot-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
}

/* ─── spec page ───────────────────────────────────────────────────── */
/*
   Layout: prose centered, TOC pinned to the right as a real sidebar.
   Wide screens: [ flex spacer | prose 38rem | gap | TOC 240px | flex spacer ]
   Narrow:        prose stacks above a horizontal TOC strip.
*/
.spec-page {
  background-image:
    radial-gradient(1000px 480px at 90% -10%, var(--sky-haze), transparent 60%),
    radial-gradient(700px 400px at -10% 20%, rgba(184, 199, 154, 0.15), transparent 60%);
}

.spec-shell {
  max-width: 76rem;
  margin: 24px auto 0;
  padding: 0 32px 48px;
  display: grid;
  grid-template-columns: minmax(0, 38rem) 16rem;
  justify-content: center;
  column-gap: 64px;
  position: relative;
  z-index: 1;
}

/* ─── TOC sidebar ─────────────────────────────────────────────────── */
.toc {
  position: sticky;
  top: 32px;
  align-self: start;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 20px 18px 20px 22px;
  border-left: 1px solid var(--line);
  font-size: 0.88rem;
}
.toc-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 16px;
}
.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc li { padding: 0; }
.toc a {
  display: block;
  padding: 5px 0;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.35;
  border-left: 2px solid transparent;
  padding-left: 12px;
  margin-left: -14px;
  transition: color 120ms ease, border-color 120ms ease;
}
.toc a:hover { color: var(--terracotta); }
.toc a.active {
  color: var(--ink);
  border-left-color: var(--terracotta);
  font-weight: 500;
}
.toc .toc-sub a {
  padding-left: 28px;
  margin-left: -14px;
  font-size: 0.83rem;
  color: var(--ink-faint);
}
.toc .toc-sub a.active {
  color: var(--ink-soft);
  font-weight: 400;
}

/* ─── prose typography ────────────────────────────────────────────── */
.prose {
  max-width: 38rem;             /* ~62 chars at 17px Schibsted Grotesk */
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  padding-bottom: 96px;
  /* hyphenation for wider browser support */
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 8 4 4;
}
.prose-loading {
  color: var(--ink-faint);
  font-style: italic;
}

.prose h1 {
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: clamp(2.1rem, 3.4vw, 2.8rem);
  letter-spacing: -0.02em;
  margin: 16px 0 36px;
  line-height: 1.08;
  color: var(--ink);
}
.prose h2 {
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: 1.65rem;
  letter-spacing: -0.012em;
  line-height: 1.2;
  margin: 72px 0 14px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.prose h2:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 32px;
}
.prose h3 {
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.005em;
  margin: 40px 0 10px;
  color: var(--ink);
}
.prose h4 {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 30px 0 8px;
}

.prose p {
  margin: 0 0 18px;
  text-wrap: pretty;
}

.prose a {
  color: var(--forest-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(77, 106, 62, 0.35);
}
.prose a:hover {
  color: var(--terracotta);
  text-decoration-color: currentColor;
}

/* §N.M.K cross-references — small terracotta-tinted pill. */
.prose a.section-ref {
  color: var(--terracotta);
  background: rgba(200, 123, 93, 0.09);
  text-decoration: none;
  font-size: 0.86em;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: 5px;
  white-space: nowrap;
  transition: background 120ms ease;
}
.prose a.section-ref:hover {
  background: rgba(200, 123, 93, 0.20);
  color: var(--terracotta);
}

.prose .anchor {
  float: left;
  margin-left: -1.3em;
  padding-right: 0.4em;
  color: var(--ink-faint);
  opacity: 0;
  text-decoration: none;
  font-weight: 400;
  transition: opacity 120ms ease;
}
.prose h1:hover .anchor,
.prose h2:hover .anchor,
.prose h3:hover .anchor,
.prose h4:hover .anchor { opacity: 0.6; }
.prose .anchor:hover { color: var(--terracotta); opacity: 1 !important; }

.prose ul, .prose ol {
  padding-left: 1.4em;
  margin: 0 0 20px;
}
.prose ul li::marker { color: var(--terracotta); }
.prose ol li::marker { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.prose li { margin: 6px 0; padding-left: 4px; }
.prose li > p { margin: 4px 0; }
.prose li > ul, .prose li > ol { margin: 6px 0; }

.prose blockquote {
  border-left: 3px solid var(--moss);
  background: rgba(184, 199, 154, 0.16);
  margin: 22px 0;
  padding: 14px 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-soft);
  font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote em { font-style: normal; }

.prose code {
  background: rgba(45, 42, 36, 0.06);
  padding: 0.14em 0.4em;
  border-radius: 5px;
  font-size: 0.86em;
  color: var(--ink);
  border: 1px solid rgba(45, 42, 36, 0.06);
}
.prose pre {
  margin: 20px 0 24px;
  padding: 18px 22px;
  background: #2a2722;
  color: #ece3cc;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.7;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border: 0;
}

/* chroma — palette mapped to our cream/forest tokens. Classes are emitted
   server-side by goldmark + chroma with the "ch-" prefix. */
.ch-chroma { color: #ece3cc; background: transparent; }
.ch-chroma .ch-line { display: block; }
.ch-chroma .ch-cl { display: inline; }

/* comments */
.ch-chroma .ch-c, .ch-chroma .ch-cm, .ch-chroma .ch-c1, .ch-chroma .ch-cs,
.ch-chroma .ch-cp, .ch-chroma .ch-cpf, .ch-chroma .ch-ch {
  color: #b8c79a; font-style: italic;
}

/* keywords */
.ch-chroma .ch-k, .ch-chroma .ch-kc, .ch-chroma .ch-kd, .ch-chroma .ch-kn,
.ch-chroma .ch-kp, .ch-chroma .ch-kr, .ch-chroma .ch-kt {
  color: #e3a47a;
}

/* strings */
.ch-chroma .ch-s,  .ch-chroma .ch-sa, .ch-chroma .ch-sb, .ch-chroma .ch-sc,
.ch-chroma .ch-dl, .ch-chroma .ch-sd, .ch-chroma .ch-s2, .ch-chroma .ch-se,
.ch-chroma .ch-sh, .ch-chroma .ch-si, .ch-chroma .ch-sx, .ch-chroma .ch-sr,
.ch-chroma .ch-s1, .ch-chroma .ch-ss {
  color: #b8c79a;
}

/* numbers, literals */
.ch-chroma .ch-m,  .ch-chroma .ch-mb, .ch-chroma .ch-mf, .ch-chroma .ch-mh,
.ch-chroma .ch-mi, .ch-chroma .ch-mo, .ch-chroma .ch-il, .ch-chroma .ch-l,
.ch-chroma .ch-no, .ch-chroma .ch-nb, .ch-chroma .ch-bp {
  color: #e6c073;
}

/* names — function/class/attribute/identifier — soft sky */
.ch-chroma .ch-na, .ch-chroma .ch-nt,
.ch-chroma .ch-nf, .ch-chroma .ch-nc, .ch-chroma .ch-nd,
.ch-chroma .ch-nv, .ch-chroma .ch-vc, .ch-chroma .ch-vg, .ch-chroma .ch-vi {
  color: #c8dde9;
}

/* operators, punctuation — kept unobtrusive */
.ch-chroma .ch-o, .ch-chroma .ch-ow { color: #ece3cc; opacity: 0.78; }
.ch-chroma .ch-p { color: #ece3cc; opacity: 0.65; }

/* generic / diff markers */
.ch-chroma .ch-gd  { color: #c87b5d; }
.ch-chroma .ch-gi  { color: #b8c79a; }
.ch-chroma .ch-ge  { font-style: italic; }
.ch-chroma .ch-gs  { font-weight: 600; }
.ch-chroma .ch-err { color: #c87b5d; }

.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0 26px;
  font-size: 0.94rem;
}
.prose th, .prose td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.prose th {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper-deep);
}
.prose tr:last-child td { border-bottom: 0; }

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

.prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-style: italic; color: var(--forest-deep); }
.prose p code, .prose li code { white-space: nowrap; }

/* hide the floating clouds on the spec page so they don't fight the prose */
.spec-page .sky { height: 320px; opacity: 0.6; }
.spec-page .cloud-c { display: none; }

/* current-page nav indication */
.nav-links a[aria-current="page"] {
  color: var(--terracotta);
  font-weight: 500;
}

/* ─── responsive ──────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .spec-shell {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 0 24px 32px;
    max-width: 38rem;
  }
  .prose { max-width: none; }
  .toc {
    position: static;
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
    order: -1; /* TOC above prose on small screens */
  }
  .toc ol { display: flex; flex-wrap: wrap; gap: 4px 16px; }
  .toc li { padding: 0; }
  .toc a {
    padding: 2px 0;
    border-left: 0;
    margin-left: 0;
    padding-left: 0;
  }
  .toc a.active { border-left: 0; padding-left: 0; }
  .toc .toc-sub { display: none; }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .cards { grid-template-columns: 1fr; }
  .quickstart { grid-template-columns: 1fr; gap: 32px; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero { padding: 64px 24px 80px; }
  .three-up, .quickstart, .features, .spec { padding-left: 24px; padding-right: 24px; }
  .nav { padding: 20px 24px; }
  .prose .anchor { display: none; }
}

/* ─── design system page ──────────────────────────────────────────── */
.design {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 32px 96px;
  position: relative;
  z-index: 1;
}
.design-page .sky { height: 360px; opacity: 0.6; }
.design-page .cloud-c { display: none; }

.design-hero {
  padding: 80px 0 48px;
}
.design-hero h1 {
  font-family: 'Newsreader', serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 24px;
}
.design-hero h1 em { font-style: italic; color: var(--forest-deep); }
.design-hero .lede {
  margin: 0;
  max-width: 38em;
}

.ds-section {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}
.ds-section:first-of-type { border-top: 0; }
.ds-h {
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: 2rem;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.ds-sub {
  color: var(--ink-soft);
  margin: 0 0 36px;
  max-width: 44em;
}
.ds-group {
  margin-bottom: 36px;
}
.ds-group-h {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

/* swatch grid */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.swatch {
  aspect-ratio: 5 / 3;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: 'Schibsted Grotesk', sans-serif;
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: var(--shadow);
}
.swatch span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.swatch code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  background: transparent;
  padding: 0;
  align-self: flex-end;
  opacity: 0.85;
}

/* type rows */
.ds-type-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 36px;
  align-items: start;
  padding: 24px 0;
  border-top: 1px dashed var(--line);
}
.ds-type-row:first-of-type { border-top: 0; padding-top: 8px; }
.ds-type-meta { padding-top: 6px; }
.ds-type-meta .ds-meta {
  margin: 6px 0 12px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.ds-code {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  background: var(--paper-deep);
  padding: 4px 10px;
  border-radius: 6px;
}

/* type scale ladder */
.ds-scale {
  display: grid;
  gap: 0;
}
.ds-scale-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 36px;
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px dashed var(--line);
}
.ds-scale-row:first-child { border-top: 0; }
.ds-scale-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* component blocks */
.ds-block { margin-bottom: 40px; }
.ds-btn-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .ds-type-row,
  .ds-scale-row { grid-template-columns: 1fr; gap: 8px; }
  .ds-type-meta { padding-top: 0; }
}
