/* The Monday After: shared styles. Colours and type follow screens/README.md. */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #0E1621;
  --panel: #17212F;
  --panel2: #1E2B3C;
  --line: #2A3647;
  --text: #E8EDF3;
  --muted: #9AA7B8;
  --muted2: #B7C2D0;
  --soft: #C5CEDA;
  --amber: #FFB020;
  --teal: #5CE0C0;
  --coral: #FF7A6B;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.4; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; } /* headings we move focus to for screen readers */
[hidden] { display: none !important; } /* "hidden" must win over card and flex layouts */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Page frame: a phone-width column, centred on larger screens */
.screen { max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px 0; font-family: var(--mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.top .dots { letter-spacing: 0; }
.bar { margin: 12px 24px 0; height: 3px; background: var(--line); border-radius: 2px; }
.bar > span { display: block; height: 3px; background: var(--amber); border-radius: 2px; }
.bar.teal > span { background: var(--teal); }
.body { flex: 1; padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }

/* Type */
h1 { margin: 0; font-size: 1.75rem; line-height: 1.15; font-weight: 600; }
h1.big { font-size: 2rem; }
h1.mid { font-size: 1.3125rem; line-height: 1.3; }
h1.mirror { font-size: 1.375rem; line-height: 1.35; }
.intro { margin: 0 0 4px; font-size: 0.875rem; line-height: 1.4; color: var(--muted); }
.kicker { font-family: var(--mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.kicker.amber { color: var(--amber); }
.kicker.teal { color: var(--teal); }
.kicker.coral { color: var(--coral); }
.time { font-family: var(--mono); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.08em; color: var(--amber); text-transform: uppercase; }
.small { font-size: 0.78rem; line-height: 1.4; color: var(--muted); }
.note-line { font-size: 0.9rem; line-height: 1.4; }
.tagline { font-size: 0.94rem; font-style: italic; color: var(--amber); margin: 0; }
.center { text-align: center; }

/* Cards */
.card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.card.tight { padding: 10px 14px; gap: 4px; border-radius: 12px; }
.card.outline-amber { border-color: var(--amber); background: var(--bg); }
.card.dashed-amber { border: 1px dashed var(--amber); background: var(--bg); }
.card.dashed-coral { border: 1px dashed var(--coral); background: var(--bg); }
.card p, .card ul { margin: 0; }
.card ul { padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.lead { font-size: 1rem; line-height: 1.4; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 0.8125rem; }
.route { font-size: 0.875rem; color: var(--soft); }
.route strong { color: var(--text); }

/* Option cards (single and multiple choice) */
.options { display: flex; flex-direction: column; gap: 8px; }
.option { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 10px 12px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.option[aria-pressed="true"], .option[aria-checked="true"] { border: 2px solid var(--amber); background: var(--panel2); padding: 9px 11px; }
.option .key { flex: none; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; background: var(--line); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 0.8125rem; font-weight: 500; }
.option[aria-pressed="true"] .key, .option[aria-checked="true"] .key { background: var(--amber); color: var(--bg); }
.option .t { display: block; font-size: 0.94rem; font-weight: 600; line-height: 1.3; }
.option .d { display: block; font-size: 0.78rem; line-height: 1.35; color: var(--muted2); }
.option.plain { padding: 14px 16px; }
.option.plain[aria-checked="true"] { padding: 13px 15px; }
.option.radio .dot { flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 999px; border: 2px solid var(--line); }
.option.radio[aria-checked="true"] .dot { border-color: var(--amber); background: radial-gradient(circle, var(--amber) 0 4px, transparent 5px); }
.option .from { display: block; margin-top: 2px; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.counter { text-align: center; font-family: var(--mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.segments { display: flex; gap: 8px; }
.segments .option { justify-content: center; text-align: center; padding: 10px 6px; }
.segments .option[aria-checked="true"] { padding: 9px 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.875rem; color: var(--soft); }
.check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--amber); }

/* Thread chips */
.thread { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; text-align: left; border: 1px dashed var(--teal); border-radius: 12px; background: transparent; }
.thread .k { display: block; font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal); }
.thread .t { display: block; margin-top: 2px; font-size: 0.875rem; font-weight: 500; line-height: 1.3; }
.thread .d { display: block; margin-top: 2px; font-size: 0.78rem; line-height: 1.35; color: var(--muted2); }
.thread .arrow { flex: none; color: var(--teal); font-size: 1rem; }
.thread.pulled { border-style: solid; }

/* Flags and ledger pills */
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row-tools { display: flex; align-items: center; gap: 8px; }
.flag { flex: none; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); }
.flag[aria-pressed="true"] { border-color: var(--amber); background: var(--panel2); color: var(--amber); }
.lens { font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.06em; color: var(--amber); text-transform: uppercase; text-align: right; }
.who { font-size: 0.78rem; font-weight: 600; color: var(--soft); }
.pill { padding: 2px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 0.6875rem; font-weight: 600; white-space: nowrap; }
.pill.drain { color: var(--coral); }
.pill.deposit { color: var(--teal); }
.pill.big { font-size: 0.875rem; padding: 3px 10px; }
.ledger-row { cursor: pointer; }
.ledger-row .dim { font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; background: none; border: 0; padding: 0; text-align: left; }
.ledger-row p { font-size: 0.8125rem; line-height: 1.35; color: var(--soft); }

/* Story blocks */
.bubble { align-self: flex-start; max-width: 88%; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--line); font-size: 0.94rem; line-height: 1.4; }
.alert { font-size: 0.9rem; line-height: 1.4; color: var(--coral); font-weight: 500; }
.chain { display: flex; align-items: stretch; gap: 6px; }
.chain .node { flex: 1; min-width: 0; padding: 10px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: center; }
.chain .node.good { border-color: var(--teal); }
.chain .node.bad { border: 1px dashed var(--coral); }
.chain .node b { display: block; font-size: 0.8125rem; font-weight: 600; }
.chain .node span { display: block; margin-top: 4px; font-size: 0.72rem; line-height: 1.3; color: var(--muted); }
.chain .node.good span { color: var(--teal); }
.chain .node.bad span { color: var(--coral); }
.chain .sep { display: flex; align-items: center; color: var(--muted); }

/* Reveal box inside threads */
.gain b { color: var(--teal); font-weight: 500; }
.cost b { color: var(--coral); font-weight: 500; }
.gain, .cost { font-size: 0.875rem; line-height: 1.4; }

/* Flight recorder */
label.field { display: flex; flex-direction: column; gap: 8px; }
textarea { width: 100%; min-height: 76px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); resize: vertical; font-size: 0.94rem; line-height: 1.4; }
.lockline { display: flex; gap: 10px; align-items: flex-start; font-size: 0.78rem; line-height: 1.4; color: var(--muted2); }
.lockline svg { flex: none; margin-top: 2px; }
.error { color: var(--coral); font-size: 0.8125rem; margin: 0; }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 8px 16px; border: 0; border-radius: 12px; background: var(--amber); color: var(--bg); font-size: 1rem; font-weight: 600; text-decoration: none; text-align: center; }
.btn.secondary { min-height: 50px; border: 1px solid var(--amber); background: transparent; color: var(--amber); }
.btn.small-btn { min-height: 46px; font-size: 0.94rem; }
.btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

/* Placeholder copy the author still needs to write */
.todo { display: inline; padding: 0 4px; border: 1px dashed var(--coral); border-radius: 4px; color: var(--coral); font-style: italic; }
.todo::before { content: "Copy needed: "; font-style: normal; font-weight: 600; }
.row-tools .todo { font-size: 0.7rem; }

/* Saving status, shown only when something didn't save */
.save-notice { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(440px, calc(100% - 32px)); margin: 0; padding: 10px 14px; border: 1px solid var(--coral); border-radius: 12px; background: var(--panel2); color: var(--text); font-size: 0.875rem; }
.save-notice[hidden] { display: none; }

/* Sign-up and account pages */
input[type="email"] { width: 100%; min-height: 52px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-size: 1rem; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.prose { display: flex; flex-direction: column; gap: 12px; font-size: 0.94rem; line-height: 1.5; color: var(--soft); }
.prose h2 { margin: 12px 0 0; font-size: 1rem; color: var(--text); }
.prose p, .prose ul { margin: 0; }
.prose a, .small a { color: var(--amber); }
.draft-banner { padding: 8px 12px; border: 1px dashed var(--coral); border-radius: 10px; color: var(--coral); font-size: 0.8125rem; }

/* Sign-up page: one column on phones, pitch beside the form on larger screens */
.signup { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.signup-grid { display: grid; gap: 22px; padding: 26px 24px 8px; }
.signup-pitch { display: flex; flex-direction: column; gap: 12px; }
.signup-pitch .kicker { margin: 0; }
.signup-pitch h1 { text-wrap: balance; }
.lede { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--muted2); }
.file-teaser { margin: 6px 0 0; padding: 16px; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 14px; background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.file-teaser .time { font-size: 0.72rem; margin: 0; }
.file-teaser-title { margin: 0; font-size: 1.15rem; line-height: 1.3; font-weight: 600; }
.file-teaser figcaption { margin: 0; }
.signup-form-card { padding: 18px; gap: 12px; border-color: var(--amber); }
.signup-form-card form { display: flex; flex-direction: column; gap: 10px; }
.signup-form-card .kicker { margin: 0; }
.signup-form-card .small { margin: 0; }
.field-label { font-size: 0.875rem; font-weight: 500; color: var(--soft); }
.signup-how { display: flex; flex-direction: column; gap: 12px; }
.signup-how .kicker { margin: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 0.94rem; line-height: 1.45; color: var(--muted2); }
.steps b { color: var(--text); font-weight: 600; }
.step-n { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--line); color: var(--text); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 0.8125rem; font-weight: 500; }
.mini-ledger { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.mini-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.mini-row .dim { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); }
.signup-foot { padding: 18px 24px 28px; margin-top: auto; }

@media (min-width: 880px) {
  .signup { max-width: 960px; }
  .signup-grid { grid-template-columns: 1.2fr 1fr; grid-template-areas: "pitch form" "how form"; column-gap: 48px; padding-top: 48px; }
  .signup-pitch { grid-area: pitch; }
  .signup-form-wrap { grid-area: form; align-self: start; position: sticky; top: 24px; }
  .signup-how { grid-area: how; }
}

/* Privacy page */
.prose ul { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.prose b { color: var(--text); font-weight: 600; }
.privacy .prose { max-width: 65ch; }
