/* ================================================================
   EmailSigner — "The last line of the letter"
   The whole site is set as a piece of correspondence:
   a letterhead, a red margin rule, marginalia, dot-leader contents,
   ruled paper forms, and a colophon that signs off.
   Ink discipline: red is reserved for things you sign or act on;
   blue is reserved for links. Everything else is ink on paper.
   No frameworks, no webfonts, no cards, no gradients-as-decoration.
   ================================================================ */

:root {
  --paper: #f5f1e8;
  --paper-deep: #ece7d9;
  --sheet: #fdfcf7;
  --ink: #1a1c21;
  --ink-soft: #585b63;
  --ink-faint: #8e9097;
  --wax: #b03a2a;
  --wax-deep: #8e2b1e;
  --post: #29497e;
  --line: #d8d1bf;
  --line-soft: #e6e0cf;
  --ok: #33684a;
  --warn: #96691c;
  --bad: #b03a2a;

  --serif: Georgia, 'Times New Roman', 'Palatino Linotype', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'SF Mono', Menlo, monospace;

  /* left-anchored letter geometry */
  --mL: clamp(22px, 8vw, 128px);   /* text margin (the writing starts here) */
  --mR: clamp(22px, 5vw, 96px);
  --rule-x: calc(var(--mL) - 30px); /* the red margin rule */
  --measure: 1180px;

  --sh-sheet: 0 1px 2px rgba(26,28,33,.06), 0 14px 40px rgba(26,28,33,.10);
}

html[data-theme="dark"] {
  --paper: #16171b;
  --paper-deep: #1c1e23;
  --sheet: #1f2126;
  --ink: #e9e4d6;
  --ink-soft: #a6a396;
  --ink-faint: #767469;
  --wax: #d96a52;
  --wax-deep: #e88b76;
  --post: #8fa9d9;
  --line: #33353c;
  --line-soft: #26282e;
  --ok: #74b58e;
  --warn: #cfa14e;
  --bad: #d96a52;
  --sh-sheet: 0 1px 2px rgba(0,0,0,.4), 0 14px 44px rgba(0,0,0,.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

html, body { overflow-x: clip; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}

/* paper tooth — procedural grain, no request */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-theme="dark"] body::after { opacity: .07; }

/* the red margin rule — runs the whole letter */
body::before {
  content: ""; position: fixed; top: 0; bottom: 0; z-index: 0;
  left: var(--rule-x); width: 1px;
  background: var(--wax); opacity: .38;
}
@media (max-width: 900px) { body::before { display: none; } }

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

::selection { background: var(--wax); color: #fdfcf7; }

img { max-width: 100%; height: auto; }
a { color: var(--post); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--wax); }

/* ---------------- letter geometry ---------------- */
.sheet { padding-left: var(--mL); padding-right: var(--mR); max-width: var(--measure); }
.wrap, .wrap-wide { padding-left: var(--mL); padding-right: var(--mR); max-width: var(--measure); }
.measure { max-width: 74ch; }

/* marginalia — rotated notes hanging on the rule */
.marg {
  position: absolute; left: calc(var(--rule-x) - 9px); top: 0;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--wax); background: var(--paper); padding: 10px 0;
  white-space: nowrap;
}
@media (max-width: 900px) { .marg { display: none; } }

/* ---------------- skip link ---------------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  background: var(--ink); color: var(--paper);
  padding: 10px 18px; font-family: var(--mono); font-size: 13px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------------- letterhead ---------------- */
.lh-top {
  display: flex; align-items: center; gap: 18px;
  padding: 22px var(--mR) 14px var(--mL);
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
  font-family: var(--serif); font-size: 22px; letter-spacing: -.01em;
}
.brand:hover { color: var(--ink); }
.brand .postmark { width: 32px; height: 32px; display: block; flex-shrink: 0; }
.brand > span { line-height: 1; transform: translateY(1px); }
.brand b { font-weight: 700; }
.brand .brand-tail { color: var(--wax); }
.lh-ref {
  margin-left: auto;
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint);
}
@media (max-width: 720px) { .lh-ref { display: none; } }

.lh-rule { margin: 0 var(--mR) 0 var(--mL); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); height: 5px; }

/* index strip — the sticky nav */
.lh-nav {
  position: sticky; top: 0; z-index: 120;
  background: var(--paper);
  display: flex; align-items: center; gap: 4px;
  padding: 0 var(--mR) 0 var(--mL);
  border-bottom: 1px solid var(--line);
  min-height: 46px;
}
.site-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.site-nav a {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; padding: 14px 12px 12px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--wax); border-bottom-color: var(--wax); }
.site-nav .nav-cta { margin-left: auto; color: var(--wax); font-weight: 600; }
.site-nav .nav-cta::after { content: " →"; }
.site-nav .nav-cta:hover { color: var(--wax-deep); }

.theme-toggle {
  border: none; background: none; color: var(--ink-soft); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 12px 0 12px 16px;
  border-left: 1px solid var(--line); margin-left: 8px;
}
.theme-toggle:hover { color: var(--wax); }

.menu-btn {
  display: none; background: none; border: none; color: var(--ink);
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  padding: 14px 0 12px; cursor: pointer;
}

@media (max-width: 880px) {
  .menu-btn { display: block; }
  .site-nav {
    display: none;
    position: absolute; top: 46px; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 6px 22px 16px;
    box-shadow: var(--sh-sheet);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 13px 4px; font-size: 12px; border-bottom: none; }
  .site-nav a[aria-current="page"] { border-bottom: none; }
  .site-nav .nav-cta { margin-left: 0; }
  .lh-nav { justify-content: space-between; }
}

/* ---------------- type ---------------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -.014em; }
h1 { font-style: italic; font-size: clamp(33px, 5.5vw + 12px, 76px); line-height: 1.04; overflow-wrap: break-word; }
h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.14; }
h3 { font-size: 19px; line-height: 1.3; }

.salutation {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--wax);
}
.eyebrow { /* legacy alias used across pages */
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--wax); display: block;
}

.lede { font-size: clamp(16.5px, 1.9vw, 19px); color: var(--ink-soft); max-width: 60ch; }

/* ---------------- the sign-here CTA ---------------- */
.sign {
  display: inline-block; position: relative;
  padding: 10px 6px 12px 30px;
  font-family: var(--mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
  border-bottom: 1.5px solid var(--ink);
  cursor: pointer; background: none;
}
.sign::before {
  content: "×"; position: absolute; left: 6px; bottom: 8px;
  font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--wax);
}
.sign::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1.5px; height: 2px;
  background: var(--wax); transform: scaleX(0); transform-origin: left;
  transition: transform .38s cubic-bezier(.6,0,.2,1);
}
.sign:hover { color: var(--wax); }
.sign:hover::after, .sign:focus-visible::after { transform: scaleX(1); }
.sign-quiet { border-bottom-color: var(--line); color: var(--ink-soft); }
.sign-lg { font-size: 14px; padding-right: 10px; }

/* plate buttons — tool chrome in the studio */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 12px 18px; cursor: pointer; text-decoration: none; line-height: 1.2;
  color: var(--ink); background: transparent;
  border: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--ink);
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--ink); color: var(--paper); border-top-color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--paper); border-top-color: var(--ink); }
.btn-primary:hover { background: var(--wax); border-color: var(--wax); color: #fdfcf7; }
.btn-ghost { color: var(--ink-soft); }
.btn-sm { padding: 9px 12px; font-size: 10.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

:focus-visible { outline: 2px solid var(--post); outline-offset: 2px; }

/* ---------------- chapters ---------------- */
.section { position: relative; padding-top: 64px; padding-bottom: 72px; }
.chapter { position: relative; border-top: 1px solid var(--line); }
.section-head { margin-bottom: 36px; max-width: 70ch; }
.section-head .eyebrow { margin-bottom: 14px; }
.section-head p { margin-top: 12px; }

/* ---------------- hero: the letter opens ---------------- */
.opening { padding-top: clamp(48px, 8vh, 96px); padding-bottom: 30px; position: relative; }
.opening .salutation { display: block; margin-bottom: 26px; }
.opening h1 { max-width: 21ch; }
.opening .lede { margin: 26px 0 34px; }
.open-actions { display: flex; gap: 34px; align-items: baseline; flex-wrap: wrap; }
.attest {
  margin-top: 30px; display: flex; flex-wrap: wrap; gap: 6px 26px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
}
.attest span::before { content: "✓ "; color: var(--ok); }

/* the flourish — draws itself in */
.flourish { display: block; overflow: visible; }
.flourish path { stroke: var(--wax); stroke-width: 2.2; fill: none; stroke-linecap: round; }
.flourish.draw path {
  stroke-dasharray: var(--flen, 900); stroke-dashoffset: var(--flen, 900);
  animation: flourish-draw 1.4s cubic-bezier(.5,0,.3,1) .2s forwards;
}
@keyframes flourish-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .flourish.draw path { stroke-dashoffset: 0; animation: none; } }

/* the specimen — a real letter, on the desk */
.specimen-zone { position: relative; padding-top: 26px; padding-bottom: 84px; }
.specimen {
  background: var(--sheet);
  max-width: 640px;
  box-shadow: var(--sh-sheet);
  border: 1px solid var(--line-soft);
  transform: rotate(-.4deg);
  margin-left: clamp(0px, 14vw, 300px);
  position: relative;
}
@media (max-width: 900px) { .specimen { transform: none; margin-left: 0; } }
.specimen .fold {
  position: absolute; left: 0; right: 0; height: 1px; background: var(--ink); opacity: .05; pointer-events: none;
}
.specimen .fold-1 { top: 33%; } .specimen .fold-2 { top: 66%; }
/* the specimen is a printed letter — it stays paper in both themes */
html[data-theme="dark"] .specimen { background: #fdfcf7; border-color: #e2dccb; }
html[data-theme="dark"] .spec-head { color: #8e9097; border-bottom-color: #eee8d9; }
html[data-theme="dark"] .spec-body { color: #585b63; }
html[data-theme="dark"] .spec-note { background: #fdfcf7; }
.spec-head {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 22px 30px 14px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
}
.spec-body { padding: 24px 30px 8px; font-size: 14.5px; color: var(--ink-soft); }
.spec-body p { margin-bottom: 12px; }
.spec-sig { padding: 8px 30px 30px; }
.spec-note {
  position: absolute; right: -12px; top: -14px;
}
@media (max-width: 700px) {
  .spec-note { right: 6px; }
  .spec-head { flex-direction: column; gap: 3px; }
}
.spec-note {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--wax); border: 1.5px solid var(--wax); padding: 6px 10px;
  transform: rotate(2.5deg); background: var(--paper); border-radius: 2px; opacity: .9;
}

/* ---------------- contents (features as an index) ---------------- */
.contents-list { list-style: none; max-width: 860px; }
.contents-list li { border-bottom: 1px solid var(--line-soft); }
.contents-list .c-row {
  display: flex; align-items: baseline; gap: 14px; padding: 22px 0 8px;
}
.contents-list .c-num {
  font-family: var(--mono); font-size: 11px; color: var(--wax); letter-spacing: .1em;
  flex-shrink: 0; width: 34px;
}
.contents-list h3 { font-family: var(--serif); font-style: italic; font-size: 21px; font-weight: 700; }
.contents-list .c-dots { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-5px); min-width: 30px; }
.contents-list .c-ref { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); letter-spacing: .12em; text-transform: uppercase; flex-shrink: 0; }
.contents-list p { margin: 0 0 22px 48px; max-width: 62ch; color: var(--ink-soft); font-size: 14.5px; }
@media (max-width: 640px) {
  .contents-list p { margin-left: 0; }
  .contents-list .c-ref { display: none; }
}

/* ---------------- the method — a ruled ledger ---------------- */
.method { list-style: none; max-width: 860px; counter-reset: step; }
.method li {
  display: grid; grid-template-columns: 110px 1fr; gap: 8px 26px;
  padding: 26px 0; border-top: 1px solid var(--line);
}
.method li:first-child { border-top: 2px solid var(--ink); }
.method .m-step {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--wax);
  padding-top: 5px;
}
.method h3 { font-style: italic; font-size: 21px; margin-bottom: 6px; }
.method p { color: var(--ink-soft); font-size: 14.5px; max-width: 60ch; }
@media (max-width: 600px) { .method li { grid-template-columns: 1fr; } }

/* ---------------- tariff (comparison) ---------------- */
.tariff-wrap { position: relative; max-width: 980px; }
.compare-scroll { overflow-x: auto; }
table.compare { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; border-top: 2px solid var(--ink); }
table.compare th, table.compare td { padding: 14px 16px 14px 0; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.compare thead th {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 600; border-bottom: 1px solid var(--ink);
}
table.compare td.yes { color: var(--ok); font-weight: 600; }
table.compare td.no { color: var(--bad); }
table.compare td:first-child { font-weight: 600; }
table.compare .self { color: var(--ink); }
thead th.self { color: var(--wax) !important; }

.stamp {
  position: absolute; right: 6px; top: -26px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--wax); border: 2px solid var(--wax); border-radius: 3px;
  padding: 9px 14px; transform: rotate(-5deg); opacity: .85; background: var(--paper);
  pointer-events: none;
}
@media (max-width: 700px) { .stamp { position: static; display: inline-block; margin-bottom: 18px; } }

/* ---------------- Q & A (faq as correspondence) ---------------- */
.faq { max-width: 800px; border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq summary {
  cursor: pointer; list-style: none; position: relative;
  padding: 20px 40px 20px 44px;
  font-family: var(--serif); font-style: italic; font-size: 19px; font-weight: 700; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "Q."; position: absolute; left: 2px; top: 21px;
  font-family: var(--mono); font-style: normal; font-weight: 400; font-size: 12px; letter-spacing: .06em;
  color: var(--wax);
}
.faq summary::after {
  content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); color: var(--ink-faint); font-size: 19px; font-weight: 400;
}
.faq details[open] summary::after { content: "–"; color: var(--wax); }
.faq .faq-a { position: relative; padding: 0 8px 24px 44px; color: var(--ink-soft); max-width: 66ch; }
.faq .faq-a::before {
  content: "A."; position: absolute; left: 2px; top: 2px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--ink-faint);
}

/* ---------------- closing ("yours faithfully") ---------------- */
.closing {
  border-top: 1px solid var(--line);
  padding-top: 76px; padding-bottom: 84px; position: relative;
}
.cta-band {
  border-top: 1px solid var(--line);
  padding: 76px var(--mR) 84px var(--mL); position: relative; max-width: var(--measure);
}
.closing .salutation, .cta-band .eyebrow { margin-bottom: 20px; }
.closing h2, .cta-band h2 { font-style: italic; max-width: 22ch; margin-bottom: 14px; }
.closing p, .cta-band p { color: var(--ink-soft); margin-bottom: 30px; max-width: 56ch; }

/* ---------------- colophon ---------------- */
.colophon { margin-top: 40px; }
.colophon .col-rule { margin: 0 var(--mR) 0 var(--mL); border-top: 1px solid var(--ink); border-bottom: 2px solid var(--ink); height: 5px; }
.col-body { padding: 44px var(--mR) 20px var(--mL); max-width: var(--measure); }
.col-close { font-family: var(--serif); font-style: italic; font-size: 21px; }
.col-brand { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; font-family: var(--serif); font-size: 19px; }
.col-brand .postmark { width: 26px; height: 26px; }
.col-note { color: var(--ink-soft); font-size: 13.5px; max-width: 46ch; }
.col-index {
  display: flex; flex-wrap: wrap; gap: 4px 0; margin: 30px 0 0;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
}
.col-index a { color: var(--ink-soft); text-decoration: none; padding: 6px 0; }
.col-index a:hover { color: var(--wax); }
.col-index .sep { color: var(--line); padding: 6px 12px; }
.f-coffee {
  display: inline-block; margin-top: 26px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink) !important; text-decoration: none;
  border-bottom: 1.5px solid var(--wax); padding: 4px 2px 6px;
}
.f-coffee:hover { color: var(--wax) !important; }
.col-legal {
  padding: 26px var(--mR) 40px var(--mL);
  display: flex; flex-wrap: wrap; gap: 6px 28px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
}

/* ---------------- prose (guides, legal, about) ---------------- */
.prose { max-width: 74ch; }
.prose h2 { margin: 52px 0 14px; position: relative; }
.prose h2::before { content: ""; display: block; width: 44px; border-top: 2px solid var(--wax); margin-bottom: 16px; }
.prose h3 { margin: 30px 0 10px; font-style: italic; }
.prose p { margin-bottom: 14px; }
.prose p.muted, .prose li.muted { color: var(--ink-soft); }
.prose ul, .prose ol { margin: 0 0 16px 22px; }
.prose li { margin-bottom: 7px; }
.prose li::marker { color: var(--wax); font-family: var(--mono); font-size: .9em; }
.prose .updated { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: .12em; text-transform: uppercase; }
.prose blockquote { border-left: 2px solid var(--wax); padding: 4px 0 4px 18px; margin: 18px 0; color: var(--ink-soft); font-style: italic; }
.prose code {
  font-family: var(--mono); font-size: .86em; background: var(--paper-deep);
  border-radius: 3px; padding: 1px 5px;
}
.prose hr { border: none; border-top: 1px solid var(--line); margin: 40px 0; }

/* right rail — figures and running TOCs live in the letter's margin */
.rail { margin: 30px 0; }
@media (min-width: 1180px) {
  .prose { position: relative; }
  .rail {
    position: absolute; margin: 0;
    left: calc(100% + 60px); top: 0;
    width: min(520px, calc(100vw - var(--mL) - var(--mR) - 100% - 60px));
  }
  .rail-sticky { bottom: 0; }
  .rail-sticky .rail-inner { position: sticky; top: 80px; }
  .rail .fig { margin: 6px 0 0; }
  .rail .toc { margin: 6px 0 0; max-width: 420px; }
}

.fig { margin: 40px 0 10px; }
.fig img { display: block; border: 1px solid var(--line-soft); box-shadow: var(--sh-sheet); }
.fig figcaption {
  margin-top: 12px; font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint);
}

.callout {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 16px 2px 14px; margin: 22px 0; font-size: 14.5px;
}
.callout b:first-child {
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  display: block; margin-bottom: 6px; color: var(--wax);
}
.callout.warn b:first-child { color: var(--warn); }

/* TOC — dot leaders, like a real contents page */
.toc { margin: 30px 0 8px; max-width: 620px; }
.toc h2 { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 14px; border-top: 2px solid var(--ink); padding-top: 12px; }
.toc ol { list-style: none; margin: 0; }
.toc li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; font-size: 14px; }
.toc li .t-num { font-family: var(--mono); font-size: 10.5px; color: var(--wax); width: 22px; flex-shrink: 0; }
.toc li a { text-decoration: none; color: var(--ink); }
.toc li a:hover { color: var(--wax); }
.toc li .t-dots { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-4px); min-width: 24px; }

/* ---------------- templates gallery ---------------- */
.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 34px; max-width: 1100px; }
@media (max-width: 860px) { .tpl-grid { grid-template-columns: minmax(0, 1fr); } }
.tpl-card { position: relative; min-width: 0; }
.tpl-card .tpl-preview {
  padding: 30px 28px; background: #fdfcf7;
  border: 1px solid var(--line-soft); box-shadow: var(--sh-sheet);
  overflow-x: auto; min-height: 170px; display: flex; align-items: center;
}
.tpl-card:nth-child(odd) .tpl-preview { transform: rotate(-.35deg); }
.tpl-card:nth-child(even) .tpl-preview { transform: rotate(.3deg); }
@media (max-width: 640px) { .tpl-card .tpl-preview { transform: none !important; } }
.tpl-card .tpl-meta { padding: 18px 4px 0; }
.tpl-card .tpl-name {
  font-family: var(--serif); font-style: italic; font-size: 21px; font-weight: 700;
  display: flex; align-items: baseline; gap: 12px;
}
.tpl-card .tpl-code { font-family: var(--mono); font-style: normal; font-size: 9.5px; letter-spacing: .2em; color: var(--wax); }
.tpl-card .tpl-desc { font-size: 14px; color: var(--ink-soft); margin: 6px 0 12px; max-width: 52ch; }

/* ================================================================
   THE STUDIO
   ================================================================ */
.studio { padding: 30px var(--mR) 70px var(--mL); max-width: 1440px; position: relative; }
.studio-head { margin: 6px 0 30px; }
.studio-head h1 { font-size: clamp(30px, 3.6vw, 44px); }
.studio-head .salutation { display: block; margin-bottom: 12px; }
.studio-head .lede { font-size: 15px; margin-top: 10px; }

.studio-grid { display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 56px; align-items: start; }
@media (max-width: 1020px) { .studio-grid { grid-template-columns: 1fr; gap: 40px; } }

/* the form ledger */
.panel { border-top: 1px solid var(--line); }
.controls > .panel:first-of-type { border-top: 2px solid var(--ink); }
.panel > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: baseline; gap: 12px; padding: 17px 0 15px;
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary .p-num { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--wax); flex-shrink: 0; }
.panel > summary .p-title { font-family: var(--serif); font-style: italic; font-size: 19px; font-weight: 700; }
.panel > summary .p-lead { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-5px); min-width: 20px; }
.panel > summary .p-hint { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.panel > summary::after { content: "+"; font-family: var(--mono); color: var(--ink-faint); font-size: 17px; }
.panel[open] > summary::after { content: "–"; color: var(--wax); }
.panel .p-body { padding: 6px 0 30px; }

/* paper-form fields: ruled lines, not boxes */
.field { margin-bottom: 18px; }
.field label, .field .lab {
  display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 2px;
}
.field input[type="text"], .field input[type="email"], .field input[type="url"], .field input[type="tel"],
.field textarea, .field select {
  width: 100%; padding: 8px 2px; font-size: 16px; font-family: var(--sans);
  border: none; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-bottom: 2px solid var(--wax); margin-bottom: -1px;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); opacity: .8; font-style: italic; }
.field textarea { min-height: 72px; resize: vertical; line-height: 1.5; }
.field select { cursor: pointer; }
.field .hint { font-size: 12px; color: var(--ink-faint); margin-top: 6px; font-family: var(--sans); text-transform: none; letter-spacing: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
@media (max-width: 460px) { .field-row { grid-template-columns: 1fr; } }

/* template picker */
.tpl-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.tpl-choice {
  border: none; border-bottom: 2px solid transparent; background: transparent;
  padding: 10px 6px 8px; cursor: pointer; text-align: center;
}
.tpl-choice:hover { background: var(--paper-deep); }
.tpl-choice[aria-pressed="true"] { border-bottom-color: var(--wax); background: var(--paper-deep); }
.tpl-choice .t-thumb { height: 30px; display: flex; align-items: center; justify-content: center; margin-bottom: 7px; color: var(--ink); }
.tpl-choice .t-name { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.tpl-choice[aria-pressed="true"] .t-name { color: var(--wax); }
.tpl-choice svg { width: 100%; height: 100%; }

/* swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 8px; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(0,0,0,.15); position: relative; flex-shrink: 0;
}
.swatch[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: -6px; border: 1.5px solid var(--ink); border-radius: 50%;
}
input[type="color"].swatch-input {
  width: 26px; height: 26px; border: 1px dashed var(--ink-faint); border-radius: 50%;
  overflow: hidden; padding: 0; cursor: pointer; background: none;
}

/* segmented → underline tabs */
.seg { display: inline-flex; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg button {
  border: none; background: none; color: var(--ink-faint); cursor: pointer;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  padding: 8px 11px 7px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.seg button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--wax); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--ink-soft); }

/* social rows */
.social-row { display: grid; grid-template-columns: 106px 1fr; gap: 14px; margin-bottom: 4px; align-items: baseline; }
.social-row .s-name { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.social-row input {
  width: 100%; padding: 8px 2px; font-size: 16px; border: none; border-bottom: 1px solid var(--line-soft);
  background: transparent; color: var(--ink); border-radius: 0;
}
.social-row input:focus { outline: none; border-bottom: 2px solid var(--wax); margin-bottom: -1px; }
.social-row input::placeholder { color: var(--ink-faint); opacity: .7; font-style: italic; }

/* upload zone */
.upload-zone {
  display: block; border: 1px dashed var(--line); padding: 18px; text-align: center;
  color: var(--ink-soft); font-size: 13.5px; cursor: pointer; background: transparent;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--wax); color: var(--ink); }
.upload-zone input { display: none; }
.logo-status { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 12.5px; }
.logo-status img { width: 42px; height: 42px; object-fit: contain; border: 1px solid var(--line); background: #fdfcf7; }
.logo-status button {
  background: none; border: none; color: var(--bad); cursor: pointer;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 1px solid var(--bad); padding: 2px 0;
}

/* range rows */
.range-row { display: grid; grid-template-columns: 1fr 52px; gap: 12px; align-items: center; padding-top: 10px; }
.range-row output { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); text-align: right; }
input[type="range"] { width: 100%; accent-color: var(--wax); }

/* checklines */
.checkline { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; font-size: 14px; color: var(--ink); }
.checkline input { margin-top: 3px; accent-color: var(--wax); }
.checkline span small { display: block; color: var(--ink-faint); font-size: 12px; }

/* ---------------- proof desk (preview) ---------------- */
.preview-col { position: sticky; top: 66px; }
@media (max-width: 1020px) { .preview-col { position: static; } }

.preview-card { position: relative; }
.preview-toolbar {
  display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  padding: 0 0 12px; border-bottom: 2px solid var(--ink);
}
.preview-toolbar .pt-label {
  font-family: var(--serif); font-style: italic; font-size: 18px; font-weight: 700; color: var(--ink); margin-right: 4px;
}
.preview-stage { padding: 34px 8px 26px; transition: background .25s; }
.preview-stage.pv-dark { background: #17181b; margin: 0 -14px; padding: 34px 22px 26px; }
.preview-frame {
  margin: 0 auto; background: #ffffff; border: 1px solid var(--line-soft);
  box-shadow: var(--sh-sheet); padding: 30px 34px; position: relative; transition: max-width .3s;
}
.pv-dark .preview-frame { background: #202124; border-color: #34363c; }
.preview-frame.pv-desktop { max-width: 660px; }
.preview-frame.pv-mobile { max-width: 348px; padding: 22px 18px; }
.preview-frame::before, .preview-frame::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px; background: #000; opacity: .045; pointer-events: none;
}
.preview-frame::before { top: 33%; } .preview-frame::after { top: 66%; }
.pv-dark .preview-frame::before, .pv-dark .preview-frame::after { background: #fff; opacity: .05; }
.pv-meta {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid rgba(128,128,128,.25); line-height: 1.9;
}
.pv-light .pv-meta { color: #6b6e76; }
.pv-dark .pv-meta { color: #9aa0a6; }
.pv-body { font-size: 14px; margin-bottom: 20px; font-family: var(--sans); }
.pv-light .pv-body { color: #202124; }
.pv-dark .pv-body { color: #e8eaed; }
.pv-note {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); padding: 12px 2px 0; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}

/* export bar — the dispatch row */
.export-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.export-bar .btn { flex: 1 1 auto; min-width: 136px; }
@media (max-width: 560px) { .export-bar .btn { min-width: calc(50% - 4px); } }

/* inspection slip */
.check-card { margin-top: 34px; border-top: 2px solid var(--ink); position: relative; }
.check-head { display: flex; align-items: baseline; gap: 14px; padding: 14px 0 8px; }
.check-head h2 { font-family: var(--serif); font-style: italic; font-size: 19px; }
.check-score { margin-left: auto; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.check-score b { color: var(--ok); }
.check-list { list-style: none; padding: 4px 0 10px; }
.check-list li { display: flex; gap: 12px; padding: 7px 0; font-size: 13.5px; color: var(--ink-soft); align-items: baseline; border-bottom: 1px dotted var(--line-soft); }
.check-list li:last-child { border-bottom: none; }
.check-list li .ic { font-family: var(--mono); flex-shrink: 0; width: 14px; }
.check-list li.ok .ic { color: var(--ok); }
.check-list li.warn .ic { color: var(--warn); }
.check-list li.bad .ic { color: var(--bad); }
.check-list li.warn, .check-list li.bad { color: var(--ink); }
.check-stamp {
  position: absolute; right: 0; top: 8px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ok); border: 1.5px solid var(--ok); border-radius: 3px;
  padding: 5px 9px; transform: rotate(-4deg); opacity: 0; transition: opacity .3s, transform .3s;
  pointer-events: none; background: var(--paper);
}
.check-stamp.on { opacity: .9; transform: rotate(-4deg) scale(1); }

/* install desk */
.install-card { margin-top: 34px; border-top: 2px solid var(--ink); }
.install-card > .ic-head { padding: 14px 0 10px; font-family: var(--serif); font-style: italic; font-size: 19px; font-weight: 700; }
.install-tabs { display: flex; flex-wrap: wrap; gap: 0 4px; border-bottom: 1px solid var(--line); }
.install-tabs button {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  border: none; background: none; color: var(--ink-faint); cursor: pointer;
  padding: 8px 10px 9px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.install-tabs button[aria-selected="true"] { color: var(--wax); border-bottom-color: var(--wax); }
.install-tabs button:hover:not([aria-selected="true"]) { color: var(--ink-soft); }
.install-body { padding: 16px 2px 8px; font-size: 14px; color: var(--ink-soft); }
.install-body ol { margin: 6px 0 10px 20px; }
.install-body li { margin-bottom: 7px; }
.install-body li::marker { color: var(--wax); font-family: var(--mono); font-size: .85em; }
.install-body b { color: var(--ink); }

/* touch targets: comfortable thumbs on phones */
@media (max-width: 900px) {
  .btn { padding: 17px 18px; }
  .btn-sm { padding: 15px 14px; }
  .seg button { padding: 12px 13px 11px; }
  .swatch, input[type="color"].swatch-input { width: 32px; height: 32px; }
  .theme-toggle, .menu-btn { padding-top: 15px; padding-bottom: 15px; }
  .install-tabs button { padding: 11px 12px 12px; }
}

/* studio proof strip (header right) */
.studio-attest { display: flex; gap: 20px; flex-wrap: wrap; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-top: 18px; }
.studio-attest span::before { content: "✓ "; color: var(--ok); }

/* ---------------- toast — a rubber stamp ---------------- */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) rotate(-1.5deg) scale(.92);
  background: var(--paper); color: var(--wax);
  border: 2px solid var(--wax); border-radius: 3px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  padding: 13px 22px; opacity: 0; pointer-events: none; z-index: 400;
  max-width: min(92vw, 520px); text-align: center;
  transition: opacity .18s, transform .18s cubic-bezier(.2,1.4,.4,1);
}
.toast.show { opacity: 1; transform: translateX(-50%) rotate(-1.5deg) scale(1); }

/* ---------------- modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,20,24,.5); z-index: 350;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--paper); border-top: 3px double var(--ink);
  width: min(860px, 100%); max-height: 86vh; display: flex; flex-direction: column;
  box-shadow: var(--sh-sheet);
}
.modal .m-head { display: flex; align-items: baseline; padding: 18px 24px 12px; border-bottom: 1px solid var(--line); }
.modal .m-head h2 { font-size: 19px; font-family: var(--serif); font-style: italic; }
.modal .m-close { margin-left: auto; background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ink-soft); padding: 4px 8px; }
.modal .m-close:hover { color: var(--bad); }
.modal .m-body { padding: 16px 24px; overflow: auto; }
.modal textarea {
  width: 100%; min-height: 300px; font-family: var(--mono); font-size: 12px; line-height: 1.55;
  background: var(--sheet); color: var(--ink); border: 1px solid var(--line); padding: 14px;
  white-space: pre-wrap; word-break: break-all;
}
.modal .m-foot { padding: 12px 24px 20px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* ---------------- 404 ---------------- */
.dead-letter { padding-top: clamp(70px, 14vh, 150px); padding-bottom: 90px; position: relative; }
.dead-letter h1 { max-width: 14ch; }
.dead-letter .stamp { position: static; display: inline-block; margin-bottom: 26px; }

/* ---------------- utility ---------------- */
.muted { color: var(--ink-soft); }
.mono { font-family: var(--mono); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; } .mt-4 { margin-top: 44px; }
.mb-2 { margin-bottom: 16px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media print {
  .lh-nav, .colophon, .airmail, .theme-toggle, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
}
