/* Logistics Singularity. Mobile first: base styles target ~390px, then scale up. */
:root {
  --ink: #0d0f0e;
  --ink-2: #161a18;
  --ink-line: rgba(240, 237, 229, 0.14);
  --on-ink: #f0ede5;
  --on-ink-2: #a9ada5;

  --paper: #f0ede5;
  --paper-2: #e6e1d5;
  --line: rgba(20, 22, 21, 0.14);
  --line-strong: rgba(20, 22, 21, 0.28);
  --on-paper: #141615;
  --on-paper-2: #555a55;

  --ember: #e4794c;
  --ember-press: #c9643a;
  --ember-text: #9c4426; /* ember for text on paper, AA contrast */

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: 20px;
  --max: 1200px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (min-width: 768px) { :root { --gutter: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 17px/1.55 var(--sans);
  color: var(--on-paper);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3 { font-weight: 500; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 40px; line-height: 1.04; letter-spacing: -0.035em; }
h2 { font-size: 28px; line-height: 1.12; letter-spacing: -0.025em; }
h3 { font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
@media (min-width: 768px) {
  body { font-size: 18px; }
  h1 { font-size: 64px; }
  h2 { font-size: 40px; }
  h3 { font-size: 19px; }
}
@media (min-width: 1200px) { h1 { font-size: 76px; } }

.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.small { font-size: 14px; line-height: 1.5; color: var(--on-paper-2); }
.dark .small { color: var(--on-ink-2); }

.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ember); color: var(--ink); padding: 10px 14px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.dark { background: var(--ink); color: var(--on-ink); }
section { position: relative; }

/* Header */
.site-header { position: absolute; inset: 0 0 auto; z-index: 20; color: var(--on-ink); }
.site-header.static { position: relative; }
.site-header.on-paper { color: var(--on-paper); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
@media (min-width: 768px) { .site-header .bar { height: 72px; } }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.brand svg { width: 22px; height: 22px; flex: none; }
.nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.nav a { text-decoration: none; color: inherit; opacity: 0.75; }
.nav a:hover { opacity: 1; }
.nav .hide-sm { display: none; }
@media (min-width: 768px) { .nav .hide-sm { display: inline; } }

/* Buttons: one primary, one quiet link */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 22px; border: 0; border-radius: 4px;
  background: var(--ember); color: #170d08;
  font: 500 16px/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, transform 0.05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: #ec8659; }
.btn:active { background: var(--ember-press); transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn.block { width: 100%; }
@media (min-width: 768px) { .btn { min-height: 48px; } .btn.block-sm { width: auto; } }

.link {
  font: inherit; font-weight: 500; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  text-decoration-color: currentColor;
}
.link:hover { text-decoration-thickness: 2px; }
.actions { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.actions .btn { width: 100%; }
@media (min-width: 560px) {
  .actions { flex-direction: row; align-items: center; gap: 28px; }
  .actions .btn { width: auto; }
}

/* ---------- Home ---------- */
.hero { overflow: hidden; padding: 112px 0 40px; min-height: 86svh; display: flex; align-items: flex-end; }
.hero canvas.network, .band canvas.network { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(13,15,14,0) 30%, rgba(13,15,14,0.88) 78%);
}
.hero .wrap { position: relative; z-index: 2; width: 100%; }
.hero h1 { max-width: 13ch; margin-bottom: 18px; }
.hero .intro { color: var(--on-ink-2); max-width: 34em; margin-bottom: 28px; }
.hero .meta { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--ink-line); color: var(--on-ink-2); display: flex; justify-content: space-between; gap: 16px; }
@media (min-width: 768px) {
  .hero { min-height: 92vh; padding-bottom: 48px; }
  .hero::after { background: linear-gradient(90deg, rgba(13,15,14,0.86) 0%, rgba(13,15,14,0.4) 55%, rgba(13,15,14,0) 85%); }
  .hero .intro { font-size: 20px; }
}

.block { padding: 64px 0; }
@media (min-width: 768px) { .block { padding: 112px 0; } }

.idea { display: grid; gap: 20px; }
.idea h2 { max-width: 14ch; }
.idea .body p { color: var(--on-paper); }
.idea .body p.quiet { color: var(--on-paper-2); }
@media (min-width: 900px) {
  .idea { grid-template-columns: 5fr 7fr; gap: 64px; }
  .idea .body { font-size: 20px; max-width: 34em; }
}

.caps-intro { margin-top: 72px; padding-top: 20px; border-top: 1px solid var(--line-strong); display: grid; gap: 10px; }
.caps-intro h2 { max-width: 16ch; }
@media (min-width: 900px) { .caps-intro { margin-top: 120px; grid-template-columns: 5fr 7fr; gap: 64px; align-items: end; } }

.caps { list-style: none; margin: 32px 0 0; padding: 0; }
.cap { display: grid; gap: 10px; padding: 24px 0; border-top: 1px solid var(--line); }
.cap:last-child { border-bottom: 1px solid var(--line); }
.cap .viz { color: var(--on-paper); width: 100%; max-width: 280px; height: 72px; margin-bottom: 4px; }
.cap .viz svg { width: 100%; height: 100%; }
.cap p { color: var(--on-paper-2); margin: 0; max-width: 36em; }
@media (min-width: 900px) {
  .caps { display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; }
  .cap { grid-template-columns: 1fr; padding: 32px 0 36px; }
  .cap:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .cap .viz { height: 96px; max-width: 320px; }
}

.program { display: grid; gap: 28px; }
.program .lede { color: var(--on-ink-2); max-width: 34em; }
.terms { margin: 0; padding: 0; border-top: 1px solid var(--ink-line); }
.terms > div { padding: 18px 0; border-bottom: 1px solid var(--ink-line); display: grid; gap: 4px; }
.terms dt { font-weight: 600; }
.terms dd { margin: 0; color: var(--on-ink-2); }
.program .fine { color: var(--on-ink-2); font-size: 14px; max-width: 36em; }
@media (min-width: 900px) {
  .program { grid-template-columns: 5fr 7fr; gap: 64px; }
  .terms > div { grid-template-columns: 200px 1fr; gap: 24px; padding: 22px 0; }
}

/* Footer */
.site-footer { background: var(--ink); color: var(--on-ink-2); font-size: 14px; padding: 40px 0 32px; border-top: 1px solid var(--ink-line); }
.site-footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--on-ink); }
.site-footer .note { margin-top: 24px; max-width: 46em; }
.site-footer.on-paper { background: var(--paper); color: var(--on-paper-2); border-top: 1px solid var(--line); }
.site-footer.on-paper a:hover { color: var(--on-paper); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Placeholders: plain text for now; values come from config.js */
.ph { }

/* ---------- Join (stepped form) ---------- */
.join-body { min-height: 100svh; display: flex; flex-direction: column; }
.progress { position: sticky; top: 0; z-index: 30; height: 3px; background: var(--line); }
.progress span { display: block; height: 100%; width: 0; background: var(--ember); transition: width 0.35s var(--ease); }
.join-layout { flex: 1; display: grid; gap: 8px; padding-top: 28px; padding-bottom: 140px; }
.join-aside h1 { font-size: 28px; letter-spacing: -0.025em; margin-bottom: 8px; }
.join-aside p { color: var(--on-paper-2); font-size: 15px; }
.join-aside .fine { display: none; }
@media (min-width: 900px) {
  .join-layout { grid-template-columns: 4fr 6fr; gap: 80px; padding-top: 72px; padding-bottom: 96px; align-items: start; }
  .join-aside { position: sticky; top: 72px; }
  .join-aside h1 { font-size: 44px; margin-bottom: 16px; }
  .join-aside p { font-size: 17px; }
  .join-aside .fine { display: block; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
}

.step { border: 0; margin: 0; padding: 0; min-width: 0; }
.paged .step { display: none; }
.paged .step.active { display: block; animation: stepIn 0.28s var(--ease); }
@keyframes stepIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .paged .step.active { animation: none; } }
.step + .step { margin-top: 48px; }
.paged .step + .step { margin-top: 0; }

.step legend, .step .q-title {
  float: left; width: 100%; padding: 0; margin: 20px 0 12px;
  font-size: 24px; line-height: 1.2; font-weight: 500; letter-spacing: -0.02em;
}
.step legend:focus { outline: none; }
.step legend + * { clear: both; }
.step .count { display: block; font-family: var(--mono); font-size: 12px; color: var(--on-paper-2); margin-bottom: 8px; font-weight: 400; letter-spacing: 0; }
.step .hint { color: var(--on-paper-2); font-size: 15px; margin: 0 0 4px; }
@media (min-width: 900px) { .step legend, .step .q-title { font-size: 30px; margin-top: 0; } }

.options { margin-top: 16px; border-top: 1px solid var(--line); }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opt label {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 14px 4px 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 17px; line-height: 1.3; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.12s;
}
.opt label::after {
  content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: transparent no-repeat center / 12px 12px;
  transition: background-color 0.12s, border-color 0.12s;
}
.opt input[type="checkbox"] + label::after { border-radius: 4px; }
.opt label:active { background: var(--paper-2); }
.opt input:checked + label { font-weight: 500; }
.opt input:checked + label::after {
  background-color: var(--on-paper); border-color: var(--on-paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23f0ede5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.opt input:focus-visible + label { outline: 2px solid var(--ember); outline-offset: -2px; }
@media (hover: hover) { .opt label:hover { background: rgba(20, 22, 21, 0.035); } }
@media (min-width: 900px) { .opt label { padding-left: 2px; } }

.other-input { margin-top: 16px; }
.other-input:not(.show) { display: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-top: 20px; }
.field label { font-size: 15px; font-weight: 500; }
.field input {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 4px;
  border: 1px solid var(--line-strong); background: #faf8f3;
  font: 17px/1.3 var(--sans); color: var(--on-paper);
}
.field input:focus { outline: none; border-color: var(--on-paper); box-shadow: 0 0 0 1px var(--on-paper); }

.consent { margin-top: 28px; display: grid; gap: 14px; }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; font-size: 14px; line-height: 1.45; color: var(--on-paper-2); }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--on-paper); }
.check a { color: var(--on-paper); }

.err { display: none; margin: 10px 0 0; font-size: 14px; color: #8f3418; }
.invalid > .err, .invalid .err { display: block; }
.invalid .field input:invalid, .field.invalid input { border-color: #b4553a; }

.form-bar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  background: rgba(240, 237, 229, 0.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
}
.form-bar .inner { display: flex; align-items: center; gap: 20px; max-width: var(--max); margin: 0 auto; }
.form-bar .btn { flex: 1; }
.form-bar .link { flex: none; font-size: 16px; padding: 12px 4px; }
.form-bar .link[hidden] { display: none; }
@media (min-width: 900px) {
  .form-bar { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; padding: 32px 0 0; }
  .form-bar .inner { flex-direction: row-reverse; justify-content: flex-end; }
  .form-bar .btn { flex: none; min-width: 180px; }
}
.form-status { margin-top: 16px; font-size: 14px; color: #8f3418; }
.form-status:empty { display: none; }

.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Result pages ---------- */
.band { position: relative; overflow: hidden; padding: 104px 0 40px; }
.band::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(13,15,14,0.35), rgba(13,15,14,0.9)); }
.band .wrap { position: relative; z-index: 2; }
.band h1 { max-width: 14ch; margin-bottom: 20px; }
.band .say { font-size: 19px; line-height: 1.5; color: var(--on-ink); max-width: 30em; }
.band .say + p { color: var(--on-ink-2); margin-top: 16px; max-width: 32em; }
@media (min-width: 768px) { .band { padding: 160px 0 72px; } .band .say { font-size: 22px; } }

.next { display: grid; gap: 0; }
.next section { padding: 32px 0; border-top: 1px solid var(--line); }
.next section:first-child { border-top: 0; padding-top: 0; }
.next h2 { font-size: 22px; letter-spacing: -0.015em; margin-bottom: 10px; }
.next p { color: var(--on-paper-2); max-width: 36em; }
@media (min-width: 900px) {
  .next section { display: grid; grid-template-columns: 4fr 8fr; gap: 64px; padding: 44px 0; }
  .next section:first-child { padding-top: 0; }
  .next h2 { font-size: 26px; }
}
.sched-slot { margin-top: 16px; min-height: 220px; border: 1px solid var(--line-strong); border-radius: 4px; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--on-paper-2); font-size: 14px; background: #faf8f3; }
.sched-slot iframe { width: 100%; height: 640px; border: 0; }
.sched-slot code { font-family: var(--mono); font-size: 12px; }
.plain-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.plain-list li { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--on-paper-2); }
.plain-list strong { color: var(--on-paper); font-weight: 600; }

/* ---------- Legal ---------- */
.draft-banner { background: #f2d4c4; color: #5a1f0c; font-size: 13px; font-weight: 600; padding: 10px var(--gutter); }
.legal { padding: 40px 0 80px; }
.legal .wrap { max-width: 720px; margin-left: 0; }
@media (min-width: 900px) { .legal .wrap { margin-left: max(var(--gutter), calc((100vw - var(--max)) / 2)); padding-left: 0; } }
.legal h1 { font-size: 32px; margin-bottom: 8px; }
.legal h2 { font-size: 20px; letter-spacing: -0.01em; font-weight: 600; margin: 40px 0 10px; }
.legal p, .legal li { color: #2b2f2d; }
.legal ul { padding-left: 1.1em; margin: 0 0 1em; }
.legal li { margin-bottom: 0.4em; }
.legal .meta { color: var(--on-paper-2); font-size: 14px; margin-bottom: 28px; }
.legal .note { border-left: 2px solid var(--ember); padding: 2px 0 2px 16px; margin: 24px 0; }
.legal a { color: var(--ember-text); }
@media (min-width: 768px) { .legal { padding: 64px 0 120px; } .legal h1 { font-size: 44px; } }
.hide-sm { display: none; }
@media (min-width: 768px) { .hide-sm { display: inline; } }
@media (max-width: 899px) { .past-first .join-aside { display: none; } }
