/* WriteGuard storefront, draft of 25 Nov 2026.
   RunCraft palette (owner's ruling 25 Nov). Two families: Newsreader for h1/h2 only, Atkinson Hyperlegible Next for everything else.
   Body scale: 14 / 16 / 18 px only. Fonts are self-hosted because the Worker's CSP allows only 'self'. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #F5F6F1;
  --surface: #FFFFFF;
  --soft: #E3E9DD;
  --line: #C5CEC2;
  --ink: #10231F;
  --muted: #46574F;
  --board-line: #2F4A43;
  --on-board: #F5F6F1;
  --on-board-muted: #C9D3CC;
  --verified: #0B6B53;
  --verified-soft: #E1F0EB;
  --active: #2B4BD8;
  --active-hover: #1E38B0;
  --active-soft: #E8EDFC;
  --amber: #F0A30A;
  --amber-ink: #B45309;
  --warn-ink: #6B4500;
  --warn-soft: #FDF3DB;

  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 160ms;
  --gutter: 16px;
}
@media (min-width: 720px) { :root { --gutter: 24px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
p { margin: 0; }
a { color: var(--active); text-underline-offset: 3px; }
a:hover { color: var(--active-hover); }
:focus-visible { outline: 3px solid var(--active); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }
.tabular { font-variant-numeric: tabular-nums; }
.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--surface); padding: 10px 14px; z-index: 60;
}
.skip-link:focus { left: 8px; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.75rem, 7.4vw, 5rem); line-height: 0.98; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.06; }
h3 { font-family: var(--font-body); font-size: var(--text-lg); line-height: 1.3; font-weight: 700; margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: 6px; border: 1px solid transparent;
  font-family: var(--font-body); font-size: var(--text-base); font-weight: 700;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn-primary { background: var(--active); border-color: var(--active); color: #FFFFFF; }
.btn-primary:hover { background: var(--active-hover); border-color: var(--active-hover); color: #FFFFFF; }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: var(--text-lg); }
.btn-block { width: 100%; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(245, 246, 241, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-inner {
  max-width: 1140px; margin: 0 auto; padding: 10px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; white-space: nowrap; flex-shrink: 0;
  min-height: 44px;
}
.brand img { width: 34px; height: auto; }
.brand-word {
  font-family: var(--font-display); font-weight: 600; font-size: 24px;
  letter-spacing: -0.025em; line-height: 1;
}
.nav { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.nav a.nav-link {
  display: none;
  color: var(--muted); text-decoration: none; font-size: var(--text-base); font-weight: 600;
  padding: 0 12px; min-height: 44px; align-items: center; border-radius: 6px;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.nav a.nav-link:hover { color: var(--ink); background: var(--soft); }
.nav .btn { margin-left: 8px; }
@media (min-width: 900px) { .nav a.nav-link { display: inline-flex; } }

/* The hero pairs notebook paper with the ink used on the classroom board. */
.hero {
  padding: clamp(34px, 3.3vw, 55px) 0 clamp(28px, 4vw, 56px);
  background: var(--ink);
  color: var(--on-board);
  text-align: center;
}
.hero h1 {
  font-size: clamp(2.9rem, 7.65vw, 6.5rem);
  letter-spacing: -0.042em;
  line-height: 0.96;
}
.hero .lead {
  margin: 16px auto 22px;
  max-width: 64ch;
  font-size: var(--text-lg);
  color: var(--on-board-muted);
}
.hero .btn-primary { border-color: var(--on-board); background: var(--on-board); color: var(--ink); }
.hero .btn-primary:hover { border-color: var(--soft); background: var(--soft); }
.hero .btn-primary:focus-visible { outline-color: var(--on-board); }
.site-home .nav .btn-primary { border-color: var(--on-board); background: var(--on-board); color: var(--ink); }
.site-home .nav .btn-primary:hover { border-color: var(--soft); background: var(--soft); color: var(--ink); }
.site-home .nav .btn-primary:focus-visible { outline-color: var(--on-board); }
.hero-note { margin-top: 10px; font-size: var(--text-sm); color: var(--on-board-muted); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.demo {
  display: block;
  width: 100%;
  min-inline-size: 0;
  max-width: 1050px;
  margin: clamp(26px, 3.3vw, 44px) auto 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--ground);
  color: var(--ink);
  text-align: left;
}
.demo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  min-height: 60px;
  padding: 6px clamp(9px, 2vw, 22px);
  border-bottom: 1px solid var(--line);
}
.demo-title { font-size: var(--text-sm); font-weight: 700; }
.demo-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border-radius: 5px;
  background: var(--soft);
}
.demo-controls label {
  display: grid;
  min-height: 44px;
  min-width: 66px;
  place-items: center;
  padding: 0 13px;
  border-radius: 3px;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.demo-controls label:hover { background: var(--surface); }
.demo-controls input:checked + label { background: var(--ink); color: var(--on-board); }
.demo-controls input:focus-visible + label { outline: 3px solid var(--active); outline-offset: 2px; }
.demo-panels {
  display: grid;
  padding: clamp(13px, 2.5vw, 31px);
  background-color: var(--soft);
  background-image: linear-gradient(to bottom, transparent 27px, #d5ded2 27px, #d5ded2 28px);
  background-size: 100% 28px;
}
.demo-panel {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(0, 1fr);
  gap: clamp(16px, 4.1vw, 60px);
  align-items: center;
  visibility: hidden;
}
.demo:has(#show-draft:checked) #sample-draft,
.demo:has(#show-revision:checked) #sample-revision,
.demo:has(#show-record:checked) #sample-record { visibility: visible; }
.sample-page {
  min-width: 0;
  padding: clamp(16px, 2.3vw, 32px);
  border: 1px solid var(--line);
  border-left: 4px solid var(--verified);
  background: var(--surface);
  box-shadow: 0 4px 0 -2px var(--ground), 0 5px 0 -2px var(--line), 0 15px 30px -24px var(--ink);
}
.sample-meta, .sample-detail { font-size: var(--text-sm); color: var(--muted); }
.sample-title {
  margin: 7px 0 12px;
  font-size: clamp(1.75rem, 3.2vw, 2.8rem);
  text-wrap: unset;
}
.sample-excerpt { min-height: 3.1em; }
.sample-excerpt mark { background: var(--verified-soft); color: var(--ink); }
.sample-detail { display: block; margin-top: 12px; }
.record-link { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; margin-top: 2px; color: var(--active); }
.sample-slip {
  position: relative;
  width: 94%;
  justify-self: center;
  padding: clamp(14px, 2vw, 25px);
  border: 1px solid var(--line);
  background: var(--ground);
  box-shadow: 0 7px 0 -3px var(--surface), 0 8px 0 -3px var(--line), 0 20px 28px -26px var(--ink);
  transform: rotate(-2deg);
}
.sample-slip::before {
  position: absolute;
  top: -6px;
  left: 18px;
  width: 32px;
  height: 8px;
  background: var(--amber);
  content: "";
}
.slip-heading {
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
  font-size: var(--text-lg);
}
.slip-lines { margin: 0; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.slip-lines div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.slip-lines dd { margin: 0; font-weight: 700; }
.slip-signature { margin-top: 12px; border-top: 1px solid var(--ink); padding-top: 3px; color: var(--muted); font-size: var(--text-sm); }
.demo-caption { border-top: 1px solid var(--line); padding: 7px 14px; color: var(--muted); font-size: var(--text-sm); }
.record-proof { background: var(--soft); }
.proof-grid { display: grid; align-items: center; gap: clamp(20px, 5vw, 76px); }
.proof-grid .section-head { margin-bottom: 0; }
.proof-grid .section-head p { max-width: 41ch; }
.proof-grid figure { margin: 0; min-width: 0; }
.proof-grid img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 17px 30px -24px var(--ink);
}
.proof-grid figcaption { margin-top: 8px; color: var(--muted); font-size: var(--text-sm); }
.proof-grid figcaption a { display: inline-flex; align-items: center; min-height: 44px; margin-right: 10px; }

@media (min-width: 760px) {
  .proof-grid { grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr); }
}
@media (max-width: 640px) {
  .demo-toolbar { display: grid; }
  .demo-title { padding-left: 4px; }
  .demo-panel { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 16px; }
  .sample-slip { transform: none; width: 100%; }
  .sample-excerpt { min-height: 0; }
}
.site-home .topbar {
  background: var(--ink);
  color: var(--on-board);
}
.site-home .topbar.scrolled { border-bottom-color: var(--board-line); }
.site-home .brand, .site-home .nav a.nav-link { color: var(--on-board); }
.site-home .nav a.nav-link:hover { background: var(--board-line); }
.site-home .topbar :focus-visible { outline-color: var(--on-board); }
.site-home section[id] { scroll-margin-top: 72px; }
@media (max-width: 899px) {
  .site-home .nav a.sign-in { display: inline-flex; padding: 0 8px; }
  .site-home .nav .btn { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
@media (min-width: 720px) { .section { padding: 88px 0; } }
.section-tint { background: var(--surface); border-top: 1px solid var(--soft); border-bottom: 1px solid var(--soft); }
.section-head { display: grid; gap: 14px; margin-bottom: 36px; max-width: 720px; }
.section-head p { font-size: var(--text-lg); color: var(--muted); }

/* How it works */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: step; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }
.steps li {
  counter-increment: step;
  display: grid; gap: 8px; align-content: start;
  padding: 22px 0; border-top: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  font-family: var(--font-display); font-weight: 600; font-size: 2.6rem; line-height: 1;
  color: var(--amber-ink);
}
.steps p { color: var(--muted); }

/* What a teacher sees: ink band */
.board { background: var(--ink); color: var(--on-board); }
.board h2 { color: var(--on-board); }
.board .section-head p { color: var(--on-board-muted); }
.board-rows { display: grid; }
.board-row {
  display: grid; gap: 6px; padding: 20px 0; border-top: 1px solid var(--board-line);
}
.board-row:last-child { border-bottom: 1px solid var(--board-line); }
@media (min-width: 820px) { .board-row { grid-template-columns: 300px minmax(0, 1fr); gap: 32px; } }
.board-row h3 { color: var(--on-board); }
.board-row p { color: var(--on-board-muted); max-width: 62ch; }

/* Pricing */
.plans { display: grid; gap: 18px; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; } }
.plan {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 24px 20px; display: flex; flex-direction: column; gap: 18px;
}
.plan.plan-main { border-color: var(--active); box-shadow: inset 0 3px 0 var(--active); }
.plan-name { font-size: var(--text-lg); font-weight: 700; }
.plan-who { color: var(--muted); font-size: var(--text-base); margin-top: 2px; }
.price { display: grid; gap: 4px; }
.price-figure {
  font-family: var(--font-display); font-weight: 600; font-size: 2.5rem; line-height: 1.05;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.price-figure span { font-family: var(--font-body); font-size: var(--text-base); font-weight: 400; color: var(--muted); letter-spacing: 0; }
.price-founding { font-size: var(--text-sm); color: var(--verified); font-weight: 700; }
.price-standard { font-size: var(--text-sm); color: var(--muted); padding-top: 8px; border-top: 1px solid var(--soft); }
.limits { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.limits li { position: relative; padding-left: 26px; }
.limits li::before {
  content: ""; position: absolute; left: 2px; top: 6px; width: 12px; height: 7px;
  border-left: 2.5px solid var(--verified); border-bottom: 2.5px solid var(--verified);
  transform: rotate(-45deg);
}
.plan .btn { margin-top: auto; }
.pricing-foot { margin-top: 22px; color: var(--muted); font-size: var(--text-sm); max-width: 72ch; }

/* Trial */
.trial-grid { display: grid; gap: 28px; }
@media (min-width: 900px) { .trial-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; } }
.facts { margin: 0; display: grid; }
.facts div { padding: 16px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; color: var(--muted); }

/* Privacy */
.privacy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
@media (min-width: 820px) { .privacy-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; } }
.privacy-list li { padding: 18px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.privacy-list p { color: var(--muted); }
.privacy-more { margin-top: 24px; }

/* FAQ */
.faq { max-width: 780px; display: grid; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; min-height: 56px; padding: 14px 40px 14px 0; position: relative;
  font-weight: 700; font-size: var(--text-lg); display: flex; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  transition: transform var(--dur) var(--ease);
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq .answer { padding: 0 0 18px; color: var(--muted); max-width: 66ch; display: grid; gap: 10px; }

/* Closing call to action */
.closing { text-align: center; }
.closing p { font-size: var(--text-lg); color: var(--muted); margin: 14px auto 26px; max-width: 46ch; }

/* Footer */
.site-footer { background: var(--ink); color: var(--on-board-muted); padding: 40px 0 48px; font-size: var(--text-sm); }
.footer-grid { display: grid; gap: 22px; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1fr auto; align-items: center; } }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--on-board); }
.footer-brand img { width: 30px; height: auto; }
.footer-brand .brand-word { font-size: 22px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-left: -10px; }
.footer-links a {
  color: var(--on-board); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center;
  padding: 0 10px; border-radius: 6px; font-size: var(--text-base);
  transition: background-color var(--dur) var(--ease);
}
.footer-links a:hover { background: var(--board-line); color: var(--on-board); }
.footer-small { margin-top: 18px; }

/* Legal pages */
.legal { max-width: 720px; padding: 48px 0 72px; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 14px; }
.legal h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 34px 0 10px; }
.legal ul { padding-left: 22px; display: grid; gap: 8px; }
.legal p + p { margin-top: 12px; }
.legal .meta { color: var(--muted); font-size: var(--text-sm); }
.draft-note {
  background: var(--warn-soft); color: var(--warn-ink); border-left: 3px solid var(--amber);
  padding: 12px 14px; border-radius: 4px; font-size: var(--text-sm); margin: 18px 0 8px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

.nowrap { white-space: nowrap; }
