/* Prototype A · Reference: quiet, typographic, notes in the margin. */
@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=Source+Sans+3:wght@400;600&display=swap");

:root {
  --paper: #fbf9f4;
  --ink: #1f1d1a;
  --muted: #6b655c;
  --rule: #ddd6c8;
  --accent: #8b1e1e;
  --tint: #f3efe6;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.125rem/1.62 var(--serif); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.proto-banner { font: 600 .78rem/1.4 var(--sans); background: #2b2925; color: #f3efe6; padding: .5rem 1rem; text-align: center; }
.proto-banner a { color: #f6d27a; }

.site-header { max-width: 60rem; margin: 0 auto; padding: 1.5rem 1rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem 2rem; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--rule); }
.site-name { font: 600 1.15rem var(--serif); color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.site-name span { color: var(--muted); font-weight: 400; }
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font: 400 .95rem var(--sans); }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.nav-off { color: var(--muted); opacity: .6; }

main { max-width: 60rem; margin: 0 auto; padding: 0 1rem 3rem; }

/* Home */
.hero { max-width: 38rem; padding: 3.5rem 0 1rem; }
.kicker { font: 600 .8rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.hero h1 { font-weight: 400; font-style: italic; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; margin: 0 0 1.25rem; }
.lede { font-size: 1.25rem; color: #3b3732; margin: 0 0 2rem; }
.hero-figure, .diagram { margin: 2rem 0; }
.hero-figure figcaption, .diagram figcaption { font: 400 .85rem/1.45 var(--sans); color: var(--muted); margin-top: .5rem; }
svg { width: 100%; height: auto; display: block; }
svg .ground { fill: #e8e1d2; }
svg .zone { fill: var(--accent); opacity: .12; }
svg .track { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 6 5; }
svg .touch { fill: var(--accent); }
svg .label { font: italic 13px var(--serif); fill: var(--muted); }

section { max-width: 38rem; }
section h2, .body h2 { font-weight: 600; font-size: 1.35rem; margin: 2.5rem 0 .75rem; }
.calculator { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: .5rem 0 1.25rem; margin: 2.5rem 0; }
.calc-sentence { font-size: 1.3rem; line-height: 1.9; }
.calc-sentence input { font: inherit; width: 4.2ch; border: 0; border-bottom: 2px solid var(--accent); background: var(--tint); color: var(--accent); text-align: center; padding: 0 .1rem; -moz-appearance: textfield; }
.calc-sentence input::-webkit-inner-spin-button { -webkit-appearance: none; }
#calc-n { width: 3.4ch; }
.calc-sentence output { font-weight: 600; color: var(--accent); }
.calc-note { font-size: .95rem; color: var(--muted); }

.fw-list { padding-left: 1.4rem; }
.fw-list li { margin: 0 0 1rem; padding-left: .3rem; }
.fw-list li::marker { font-weight: 600; color: var(--accent); }
.fw-list a { color: inherit; }
.fw-more { color: var(--muted); font-size: .95rem; }
.cta { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin: 2.5rem 0; font-family: var(--sans); }
.cta-primary { font-weight: 600; }

/* Articles */
.article { max-width: 60rem; }
.article > *, .body > *:not(.note) { max-width: 38rem; }
.position { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font: 400 .85rem var(--sans); color: var(--muted); padding: 1.5rem 0 0; }
.pos-here { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); order: -1; width: 100%; }
.article h1 { font-weight: 600; font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1.18; margin: 1rem 0 1.5rem; }
.subtitle { display: block; font-weight: 400; font-style: italic; color: #3b3732; }
.key-idea { border-left: 3px solid var(--accent); padding: .25rem 0 .25rem 1.25rem; margin: 0 0 1.5rem; font-size: 1.2rem; }
.key-label { font: 600 .75rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 .25rem; }
.key-idea p:last-child { margin: 0; }
.byline { font: 400 .9rem var(--sans); color: var(--muted); }
.author { color: var(--ink); font-weight: 600; }
.toc { font: 400 .95rem var(--sans); background: var(--tint); padding: .75rem 1.25rem; margin: 1.5rem 0; }
.toc-title { font-weight: 600; margin: 0 0 .25rem; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc a { color: var(--ink); }

.body { position: relative; }
.anchor { font: 400 .9rem var(--sans); color: var(--rule); text-decoration: none; margin-left: .3rem; }
h2:hover .anchor { color: var(--accent); }
q { font-style: italic; }
blockquote.statement { font-size: 1.6rem; font-style: italic; line-height: 1.3; margin: 1.5rem 0; padding: 0; color: var(--accent); }
blockquote.pull { font-style: italic; margin: 1.5rem 0; padding-left: 1.25rem; border-left: 1px solid var(--rule); color: #3b3732; }
.narrative { font-style: italic; font-size: 1.15rem; color: #3b3732; }

.note { display: block; font: 400 .85rem/1.45 var(--sans); color: var(--muted); margin: -.5rem 0 1rem 1.5rem; }
.note-num { font-weight: 600; color: var(--accent); margin-right: .3rem; }

.glance { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); margin: 1.5rem 0; padding: .5rem 0; font: 400 .95rem/1.5 var(--sans); }
.glance h2 { font: 600 .8rem var(--sans); letter-spacing: .12em; text-transform: uppercase; margin: .25rem 0 .5rem; }
.glance dl { display: grid; grid-template-columns: 9rem 1fr; gap: .4rem 1rem; margin: 0; }
.glance dt { font-weight: 600; }
.glance dd { margin: 0; }
.factor-list dt { font-weight: 600; margin-top: 1rem; }
.factor-list dd { margin: .25rem 0 0; }
.draft-flag { font: 600 .8rem var(--sans); color: #8a5a00; background: #fff4d6; display: inline-block; padding: .2rem .5rem; }
.questions li { margin-bottom: .6rem; }

.related, .cite { border-top: 1px solid var(--rule); margin-top: 2.5rem; font-size: 1rem; }
.cite-apa { font-family: var(--sans); font-size: .95rem; }
.cite summary { cursor: pointer; font: 600 .9rem var(--sans); }
.cite pre { font-size: .8rem; background: var(--tint); padding: .75rem; overflow-x: auto; }
.license-line { font: 400 .9rem var(--sans); color: var(--muted); margin-top: 2rem; }

.site-footer { max-width: 60rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; border-top: 1px solid var(--rule); font: 400 .85rem var(--sans); color: var(--muted); }

/* Wide screens: notes move into the margin, Tufte-style. */
@media (min-width: 64rem) {
  .article, main { padding-left: 2rem; }
  .body > .note { float: right; clear: right; width: 15rem; margin: .35rem -18.5rem 1rem 0; }
  .glance { float: right; clear: right; width: 16rem; margin: 0 -19rem 1rem 1rem; border-top-width: 1px; }
  .glance dl { grid-template-columns: 1fr; gap: .1rem; }
  .glance dd { margin-bottom: .5rem; }
  .article > .glance { max-width: none; }
}

@media print {
  .proto-banner, .site-nav, .position, .toc, .anchor { display: none; }
  body { background: #fff; font-size: 11pt; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: var(--muted); }
  .body > .note { float: none; margin: 0 0 .75rem 1.5rem; width: auto; }
}
