:root {
  --bg: #081224;
  --bg-soft: #0c1730;
  --panel: #101d37;
  --ink: #eee9dd;
  --muted: #b8c0cf;
  --faint: #8994a8;
  --line: rgba(234, 239, 248, 0.16);
  --accent: #75a7ff;
  --accent-soft: rgba(117, 167, 255, 0.14);
  --paper: #f3efe5;
  --paper-ink: #1b2432;
  --max: 1120px;
  --measure: 72ch;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(76, 117, 189, .18), transparent 34rem),
    linear-gradient(180deg, #09142a 0%, var(--bg) 42%, #07101f 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  overflow-wrap: anywhere;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

img, svg { max-width: 100%; }
a { color: var(--ink); text-decoration-color: rgba(117, 167, 255, .68); text-underline-offset: .22em; }
a:hover { color: #fff; text-decoration-color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}

.shell { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  color: #07101f;
  background: var(--paper);
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(8, 18, 36, .76);
}
.header-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 18px;
}
.site-name { font-weight: 760; text-decoration: none; letter-spacing: -.02em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 18px; font-size: .92rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: #fff; }

.hero { padding-block: clamp(72px, 11vw, 132px) clamp(60px, 8vw, 96px); }
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 760;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.08; letter-spacing: -.035em; }
h1 { max-width: 12ch; margin: 0; font-size: clamp(3rem, 8vw, 6.9rem); font-weight: 760; }
h2 { margin: 0; font-size: clamp(2rem, 4.6vw, 3.7rem); font-weight: 700; }
h3 { font-size: 1.2rem; }
.lede { max-width: 62ch; margin: 30px 0 0; color: #d3d9e4; font-size: clamp(1.08rem, 2vw, 1.35rem); }
.byline { margin-top: 28px; color: var(--muted); }
.hero-note { max-width: 64ch; margin-top: 52px; padding: 20px 22px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: #d9e1ee; }
.hero-note p { margin: 0; }

.section { padding-block: clamp(64px, 9vw, 112px); border-top: 1px solid var(--line); }
.section-heading { max-width: 760px; margin-bottom: 42px; }
.section-heading > p:not(.eyebrow) { color: var(--muted); font-size: 1.05rem; }
.prose-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, .65fr); gap: clamp(32px, 7vw, 84px); align-items: start; }
.prose-grid > div { max-width: var(--measure); }
.prose-grid p { margin-top: 0; }
.margin-note { padding: 18px 0 18px 22px; border-left: 1px solid var(--accent); color: var(--muted); }
.margin-note strong { color: var(--ink); }
.margin-note p { margin: 6px 0 0; }

.steps { list-style: none; margin: 48px 0 0; padding: 0; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 22px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.step-number { color: var(--accent); font: 700 1rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.steps h3 { margin: 0 0 8px; }
.steps p { max-width: 68ch; margin: 0; color: var(--muted); }

.example-section { background: linear-gradient(180deg, rgba(16, 29, 55, .72), rgba(10, 20, 40, .48)); }
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.copy-sample { min-height: 260px; padding: clamp(24px, 4vw, 40px); border: 1px solid var(--line); background: rgba(8, 18, 36, .55); }
.copy-sample-muted { opacity: .72; }
.sample-label { margin: 0 0 28px; color: var(--accent); font: 700 .78rem ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .1em; }
.copy-sample p:last-child { margin: 0; font-size: clamp(1.1rem, 2.2vw, 1.45rem); line-height: 1.45; }
.example-comment { max-width: 74ch; margin: 26px 0 46px; color: var(--muted); }
.record { border-top: 1px solid var(--line); }
.record-row { display: grid; grid-template-columns: .9fr 1.25fr 1.45fr; gap: 24px; padding: 19px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.record-row strong { color: var(--ink); }
.record-head { color: var(--faint); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 30px; }
.two-up article { padding: 26px; border-top: 2px solid var(--accent); background: rgba(16, 29, 55, .54); }
.two-up h3 { margin-top: 0; }
.two-up p { margin-bottom: 0; color: var(--muted); }

.worksheet-callout { display: flex; align-items: end; justify-content: space-between; gap: 36px; }
.worksheet-callout > div:first-child { max-width: 680px; }
.worksheet-callout p:not(.eyebrow) { color: var(--muted); }
.actions { min-width: 220px; display: grid; gap: 14px; justify-items: start; }
.button { display: inline-block; padding: 12px 17px; border: 1px solid var(--accent); background: var(--accent-soft); text-decoration: none; font-weight: 700; }
.text-link { font-size: .92rem; }

.resources-section { background: #070f1e; }
.resource-group { max-width: 900px; margin-top: 48px; }
.resource-group h3 { margin-bottom: 12px; color: #fff; }
.affiliation-note { max-width: 70ch; color: var(--muted); }
.resource-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.resource-list li { padding: 17px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.resource-list a { font-weight: 700; color: var(--ink); }
.resource-list .paper-link { white-space: nowrap; font-size: .9em; color: #c9d8f3; }

.author-section { display: grid; grid-template-columns: 88px minmax(0, 640px); gap: 30px; align-items: start; }
.author-mark { width: 72px; height: 72px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); font-weight: 760; }
.author-section h2 { font-size: clamp(2rem, 4vw, 3rem); }
.author-section p { color: var(--muted); }
.author-links { font-weight: 700; }

.site-footer { border-top: 1px solid var(--line); color: var(--faint); font-size: .88rem; }
.footer-inner { align-items: flex-start; }
.footer-inner p { margin: 0; max-width: 760px; }

/* Worksheet */
.sheet { padding-block: 70px; max-width: 880px; }
.sheet-header { margin-bottom: 48px; }
.sheet-header h1 { max-width: 16ch; font-size: clamp(2.5rem, 6vw, 4.6rem); }
.sheet-header p:last-child { max-width: 68ch; color: var(--muted); }
.worksheet-meta { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 22px; margin-bottom: 38px; }
.worksheet-meta span, .field span { display: block; margin-bottom: 8px; color: var(--faint); font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.blank-line { height: 28px; border-bottom: 1px solid var(--line); }
.worksheet-row { margin: 0 0 36px; padding: 26px; border: 1px solid var(--line); background: rgba(12, 23, 48, .54); break-inside: avoid; }
.worksheet-row h2 { margin-bottom: 24px; font-size: 1.35rem; }
.field { margin-top: 18px; }
.blank-area { min-height: 72px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(234,239,248,.08) 32px); }
.blank-area.short { min-height: 44px; }
.blank-area.tiny { min-height: 34px; }
.blank-area.notes { min-height: 180px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.worksheet-notes { margin-top: 48px; break-inside: avoid; }
.worksheet-notes h2 { font-size: 1.6rem; }
.worksheet-notes p { color: var(--muted); }
.print-attribution { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: .82rem; }

.not-found { min-height: 100vh; display: grid; align-content: center; justify-items: start; padding-block: 80px; }
.not-found h1 { max-width: 13ch; font-size: clamp(2.6rem, 7vw, 5.5rem); }
.not-found p:not(.eyebrow) { color: var(--muted); }

@media (max-width: 760px) {
  .shell { width: min(calc(100% - 28px), var(--max)); }
  .header-inner, .footer-inner { align-items: flex-start; flex-direction: column; }
  .site-nav { gap: 13px 16px; }
  .hero { padding-top: 64px; }
  .prose-grid, .before-after, .two-up, .author-section, .worksheet-meta, .field-grid { grid-template-columns: 1fr; }
  .steps li { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; }
  .record-head { display: none; }
  .record-row { grid-template-columns: 1fr; gap: 8px; }
  .record-row span:nth-child(2)::before { content: "Wording · "; color: var(--faint); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
  .record-row span:nth-child(3)::before { content: "Condition / source · "; color: var(--faint); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
  .worksheet-callout { align-items: flex-start; flex-direction: column; }
  .author-mark { width: 60px; height: 60px; }
}

@media (max-width: 390px) {
  body { font-size: .96rem; }
  .site-nav { font-size: .86rem; }
  h1 { font-size: clamp(2.75rem, 15vw, 4rem); }
  .copy-sample, .worksheet-row { padding: 20px; }
  .record-row { font-size: .93rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  :root { --ink: #111; --muted: #333; --faint: #555; --line: #bbb; }
  body, body::before { background: #fff !important; color: #111; }
  body::before, .no-print, .skip-link { display: none !important; }
  .sheet { width: 100%; max-width: none; padding: 0; }
  .sheet-header { margin-bottom: 24px; }
  .sheet-header h1 { max-width: none; font-size: 28pt; }
  .worksheet-meta { grid-template-columns: 2fr 1fr 1fr; }
  .worksheet-row { padding: 14px; background: #fff; border-color: #aaa; page-break-inside: avoid; }
  .eyebrow { color: #444; }
  .blank-line, .blank-area { border-color: #999; background: none; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .field, .field-grid { break-inside: avoid; }
  .print-attribution { color: #444; }
  a { color: #111; text-decoration: none; }
}
