/* Token contract: ~/Projects/applications/research_notes/Atlas website/00 Plan.md section 2.6 (Rung system, Harbor blue accent) */
:root {
  color-scheme: light;
  --font-display: "Zodiak", Georgia, "Times New Roman", serif;
  --font-body: "Switzer", "Helvetica Neue", Arial, sans-serif;
  --ground: #f1f3ef;
  --surface: #f8f9f6;
  --ink: #111a1f;
  --muted: color-mix(in srgb, var(--ink) 64%, transparent);
  --hair: color-mix(in srgb, var(--ink) 10%, transparent);
  --control: color-mix(in srgb, var(--ink) 20%, transparent);
  --tint: color-mix(in srgb, var(--ink) 5%, transparent);
  --accent: #0b5394;
  --accent-hover: #0c4d88;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --on-accent: #f1f3ef;
  --radius: 8px;
  --radius-card: 16px;
  --shell: 1200px;
  --measure: 700px;
  --section: 112px;
  --nav-h: 60px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-padding-top: calc(var(--nav-h) + 24px); }
@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: 16px; line-height: 24px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.shell { width: min(var(--shell), 100% - 48px); margin-inline: auto; }
.num, table { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--ground); padding: 8px 12px; border-radius: var(--radius); z-index: 20; }
.skip:focus { left: 16px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; text-wrap: balance; color: var(--ink); }
h1 { font-size: clamp(40px, 4.5vw, 64px); line-height: 1.04; letter-spacing: -0.025em; }
h2 { font-size: clamp(30px, 2.9vw, 42px); line-height: 1.1; letter-spacing: -0.02em; }
h3 { font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0 0 16px; }
.lead { font-size: 20px; line-height: 30px; color: var(--muted); margin: 0; max-width: var(--measure); text-wrap: pretty; }
.muted { color: var(--muted); }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; height: var(--nav-h); background: color-mix(in srgb, var(--ground) 82%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--hair); }
.nav .shell { height: 100%; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 21px; letter-spacing: -0.01em; text-decoration: none; }
.brand img { width: 24px; height: 24px; }
.nav .links { display: flex; gap: 28px; margin-left: auto; font-size: 14px; }
.nav .links a { color: var(--muted); text-decoration: none; }
.nav .links a:hover { color: var(--ink); }

/* Buttons: one radius, one height */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 22px; border-radius: var(--radius); font: 500 15px/1 var(--font-body); border: 1px solid transparent; text-decoration: none; cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease); white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: var(--ground); color: var(--ink); border-color: var(--control); }
@media (any-hover: hover) {
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-secondary:hover { border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
}
.nav .btn { height: 40px; padding: 0 18px; font-size: 14px; }

/* Hero: centered stack, asset below */
.hero { padding: 104px 0 0; text-align: center; }
.hero .stack { max-width: 784px; margin-inline: auto; display: grid; justify-items: center; gap: 24px; }
.hero .actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }
.hero .asset { width: min(920px, 100%); margin: 104px auto 0; }
.frame { border-radius: var(--radius-card); overflow: hidden; border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); background: var(--surface); box-shadow: 0 1px 2px rgb(17 26 31 / .05), 0 28px 56px -28px rgb(17 26 31 / .28); }
.frame img { width: 100%; }
.player { position: relative; aspect-ratio: 1840 / 1264; background: #fff; }
.player video { width: 100%; height: 100%; object-fit: cover; }
.playpause { position: absolute; right: 16px; bottom: 16px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--control); background: color-mix(in srgb, var(--ground) 92%, transparent); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .15s var(--ease); }
.playpause svg { width: 16px; height: 16px; fill: currentColor; }
.playpause[data-state="playing"] .i-play, .playpause[data-state="paused"] .i-pause { display: none; }
@media (any-hover: hover) { .playpause:hover { background: var(--ground); } }

/* Sections */
.section { padding: var(--section) 0; }
.section-head { display: grid; gap: 16px; margin-bottom: 56px; justify-items: center; text-align: center; }
.section-head.left { justify-items: start; text-align: left; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }

/* The traced amount (signature element) */
.traced { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius-card); padding: 32px; }
.panel h3 { margin-bottom: 6px; }
.panel .meta { font-size: 14px; color: var(--muted); margin: 0 0 24px; }
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); margin-bottom: 28px; }
.figures div { padding: 18px 16px 16px; }
.figures div + div { padding-left: 16px; border-left: 1px solid var(--hair); }
.figures dt { font-size: 13px; line-height: 18px; color: var(--muted); margin-bottom: 6px; }
.figures dd { margin: 0; font-size: 22px; line-height: 28px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.figures .delta dd { color: var(--accent); }
.mark { font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; vertical-align: super; line-height: 0; margin-left: 2px; padding: 0 2px; border-radius: 4px; }
.mark:hover, .mark:focus-visible { background: var(--accent-soft); }
table.months { width: 100%; border-collapse: collapse; font-size: 15px; }
table.months th { font-weight: 500; font-size: 13px; color: var(--muted); text-align: right; padding: 0 0 10px; }
table.months th:first-child, table.months td:first-child { text-align: left; }
table.months td { text-align: right; padding: 11px 0; }
table.months tbody tr { border-top: 1px solid var(--hair); }
table.months td:last-child { color: var(--accent); font-weight: 500; }
.panel .note { margin: 20px 0 0; font-size: 15px; color: var(--muted); }
.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sources li { padding: 10px 14px; border-radius: var(--radius); transition: background .2s var(--ease); scroll-margin-top: calc(var(--nav-h) + 24px); }
.sources li:target { background: var(--accent-soft); }
.sources .where { display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.sources .where b { color: var(--accent); font-weight: 600; }
.sources q { quotes: none; font-size: 15px; }
.page-shot { margin-top: 24px; }
.page-shot figcaption { font-size: 14px; color: var(--muted); margin-top: 12px; }

/* Missing support */
.states { display: grid; gap: 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 8px 0; }
.states div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; padding: 16px 0; }
.states dt { font-weight: 500; }
.states dd { margin: 0; color: var(--muted); }
.states .result dd { color: var(--ink); }

/* Workbook anatomy */
.tabs { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius-card); overflow: hidden; }
.tab { padding: 24px 28px; }
.tab + .tab { padding-top: 0; }
.tab h3 { font-family: var(--font-body); font-size: 17px; font-weight: 600; letter-spacing: 0; margin-bottom: 6px; }
.tab p { margin: 0; color: var(--muted); }

/* Engagement list */
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 64px; }
.facts li { padding: 0 0 32px; }
.facts b { display: block; font-weight: 600; margin-bottom: 4px; }
.facts span { color: var(--muted); }

/* Product stills */
.shot { margin: 0; }
.review { align-items: center; }
.review .shot { max-width: 480px; justify-self: end; }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.shots figure { margin: 0; }
.shots .frame { aspect-ratio: 4 / 3; }
.shots img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.shots figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* Evidence statement */
.statement { font-family: var(--font-display); font-size: clamp(24px, 2.2vw, 30px); line-height: 1.3; letter-spacing: -0.01em; margin: 40px 0 0; max-width: 780px; text-wrap: balance; }

/* Closing */
.closing { text-align: center; }
.closing .stack { display: grid; justify-items: center; gap: 24px; max-width: 784px; margin-inline: auto; }

/* Footer */
.footer { border-top: 1px solid var(--hair); padding: 40px 0 48px; font-size: 14px; color: var(--muted); }
.footer .shell { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; }
.footer .brand { color: var(--ink); font-size: 18px; }
.footer .brand img { width: 20px; height: 20px; }
.footer .right { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* Motion budget: one rise on load; everything else is visible at rest. */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .6s var(--ease) both; }
  .hero .stack > .rise:nth-child(2) { animation-delay: .06s; }
  .hero .stack > .rise:nth-child(3) { animation-delay: .12s; }
  .hero .asset.rise { animation-delay: .3s; }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

/* Phone and tablet */
@media (max-width: 900px) {
  :root { --section: 72px; }
  .shell { width: min(var(--shell), 100% - 32px); }
  .nav .links { display: none; }
  .nav .shell { justify-content: space-between; }
  .hero { padding-top: 64px; }
  .hero .asset { margin-top: 56px; }
  .hero .asset { display: none; }
  .split, .traced { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures div:nth-child(3) { border-left: 0; border-top: 1px solid var(--hair); }
  .figures div:nth-child(4) { border-top: 1px solid var(--hair); }
  .panel { padding: 24px 20px; }
  .states div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .shots { grid-template-columns: minmax(0, 1fr); }
  .review .shot { justify-self: stretch; max-width: none; }
  .footer .right { margin-left: 0; }
}
@media (max-width: 480px) {
  .hero .actions { flex-direction: column; width: 100%; }
  .hero .actions .btn { width: 100%; }
  .nav .btn { padding: 0 12px; }
  table.months { font-size: 14px; }
}
.film { aspect-ratio: 16 / 9; border-radius: var(--radius-card); overflow: hidden; }
.film video { width: 100%; height: 100%; display: block; background: var(--surface); }
.playpause { font: inherit; }
.mail { border: 1px solid var(--control); border-radius: var(--radius-card); background: var(--surface); color: var(--ink); padding: 32px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 28px 56px -28px rgb(17 26 31 / .35); }
.mail::backdrop { background: rgb(17 26 31 / .28); }
.mail h2 { font-size: 28px; margin: 0 0 8px; }
.mail p { margin: 0 0 24px; }
.mail .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.mail .close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; background: none; font: inherit; font-size: 24px; color: var(--ink); cursor: pointer; border-radius: var(--radius); }
