/* Listening — journal.algernonlabs.com
   Layout and components ported from the Claude Design mockup
   (Landing.dc.html / Support.dc.html).

   The palette is NOT defined here. app/theme/tokens.ts is the single source of
   truth for colour, and the custom property names below mirror its keys exactly
   (ink900 -> --ink-900, accentSoft -> --accent-soft) so one name means one value
   in both the app and the site. `make check-site` fails if they drift.
   Add a colour to tokens.ts first, then mirror it here. */

/* ---------- tokens ---------- */

:root {
  --paper: #FAF9F6; --paper-raised: #FFFFFF; --paper-sunken: #F2F0EB;
  --ink-900: #26241F; --ink-700: #4A463E; --ink-500: #78736A; --ink-300: #A8A399;
  --ink-200: #C9C5BC; --ink-100: #E4E1DA;
  --accent: #8A6F47; --accent-soft: #EFE7DA;

  --serif: ui-serif, Georgia, 'Times New Roman', serif;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171613; --paper-raised: #1E1C18; --paper-sunken: #221F1A;
    --ink-900: #EFECE5; --ink-700: #D2CDC3; --ink-500: #A6A096; --ink-300: #7E786D;
    --ink-200: #3B372F; --ink-100: #2B2822;
    --accent: #C9A874; --accent-soft: #2E2620;
  }
}

:root[data-theme="light"] {
  --paper: #FAF9F6; --paper-raised: #FFFFFF; --paper-sunken: #F2F0EB;
  --ink-900: #26241F; --ink-700: #4A463E; --ink-500: #78736A; --ink-300: #A8A399;
  --ink-200: #C9C5BC; --ink-100: #E4E1DA;
  --accent: #8A6F47; --accent-soft: #EFE7DA;
}

:root[data-theme="dark"] {
  --paper: #171613; --paper-raised: #1E1C18; --paper-sunken: #221F1A;
  --ink-900: #EFECE5; --ink-700: #D2CDC3; --ink-500: #A6A096; --ink-300: #7E786D;
  --ink-200: #3B372F; --ink-100: #2B2822;
  --accent: #C9A874; --accent-soft: #2E2620;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

html:has(.doc-page) { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink-900);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  text-wrap: pretty;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover { color: var(--ink-900); text-decoration-color: var(--ink-900); }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

summary::-webkit-details-marker { display: none; }

/* The UA rule for [hidden] is display:none, which any explicit display value
   on the same element outranks. Restore it so hidden actually hides. */
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

.shell { max-width: var(--shell); margin: 0 auto; padding-inline: 24px; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--ink-100);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .shell {
  padding-block: 14px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  text-decoration: none;
}

.wordmark-note { color: var(--ink-300); font-size: 14px; }

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
}

/* :not(.btn) so the nav colour never wins over the button's own colour —
   .site-nav a would otherwise out-specify .btn and hide the label. */
.site-nav a:not(.btn) { color: var(--ink-700); }

/* Language toggle. A plain link, not a control: these pages run script-src 'none',
   so every page has a hand-written counterpart under /zh and the toggle is an
   ordinary href between them. Quieter than the nav links — it is a way out for the
   people who need it, not a thing to draw the eye. */
.lang {
  text-decoration: none;
  color: var(--ink-300) !important;
  font-size: 14px;
  white-space: nowrap;
}

.lang:hover { color: var(--ink-700) !important; }

.nav-link {
  text-decoration: none;
  border-bottom: 1px solid var(--ink-200);
  padding-bottom: 2px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  color: var(--paper);
  background: var(--ink-900);
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 5px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--ink-900);
  cursor: pointer;
  line-height: 1.2;
}

.btn:hover { color: var(--paper); opacity: 0.88; }

.btn-sm { padding: 8px 14px; font-size: 15px; }

/* ---------- sections ---------- */

.section { border-top: 1px solid var(--ink-100); }
.section-sunk { background: var(--paper-sunken); }
.section > .shell { padding-block: clamp(48px, 6vw, 88px); }

.section-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.015em;
}

.section-lede { margin: 0 0 40px; color: var(--ink-500); max-width: 56ch; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-300);
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(48px, 7vw, 104px) clamp(40px, 5vw, 72px);
  display: flex;
  gap: clamp(32px, 5vw, 64px);
  flex-wrap: wrap;
  align-items: flex-start;
}

.hero-copy { flex: 1 1 420px; min-width: min(100%, 320px); }

.hero h1 {
  margin: 0 0 24px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4.6vw, 50px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

/* Deliberately a class, not `.hero p`: a descendant selector here outranks
   .bubble / .eyebrow / .card-note and resizes every paragraph in the mockup
   card next to it. */
.hero-lede {
  margin: 0 0 18px;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.6;
  color: var(--ink-700);
  max-width: 52ch;
}

.hero-lede-last { margin-bottom: 32px; }

.pills {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.pills li {
  border: 1px solid var(--ink-200);
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 13.5px;
  color: var(--ink-500);
}

.hero-aside { flex: 1 1 360px; min-width: min(100%, 300px); }

/* ---------- hero cta ---------- */

.cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 26px;
}

.cta-note { color: var(--ink-500); font-size: 14px; }

/* ---------- entry card (hero mockup) ---------- */

.card {
  background: var(--paper-raised);
  border: 1px solid var(--ink-100);
  border-radius: 10px;
  padding: 20px;
}

.entry-card { box-shadow: 0 1px 0 var(--ink-100); }

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--ink-100);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.entry-head span { font-size: 13px; color: var(--ink-300); }
.entry-head .entry-day { letter-spacing: 0.08em; text-transform: uppercase; }

.thread { display: flex; flex-direction: column; gap: 14px; }

.bubble {
  margin: 0;
  align-self: flex-end;
  max-width: 88%;
  background: var(--paper-sunken);
  border: 1px solid var(--ink-100);
  border-radius: 10px 10px 2px 10px;
  padding: 11px 14px;
  font-size: 15.5px;
  line-height: 1.5;
}

.clarify {
  margin: 0;
  align-self: flex-start;
  max-width: 88%;
  color: var(--ink-700);
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 12px;
  font-size: 15px;
  line-height: 1.5;
}

.choices { display: flex; gap: 8px; align-self: flex-start; }

.choices span {
  border: 1px solid var(--ink-200);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 13.5px;
  color: var(--ink-700);
}

.extracted {
  border-top: 1px solid var(--ink-100);
  margin-top: 18px;
  padding-top: 14px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  background: var(--accent-soft);
  color: var(--ink-900);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 13.5px;
  font-family: var(--mono);
}

.card-note { margin: 12px 0 0; font-size: 13.5px; color: var(--ink-500); }

/* ---------- how it works ---------- */

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 28px;
}

.steps li { border-top: 1px solid var(--ink-200); padding-top: 18px; }

.step-num {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}

.steps h3 { margin: 0 0 8px; font-size: 19px; font-weight: 600; }
.steps p:not(.step-num) { margin: 0; color: var(--ink-700); font-size: 16px; }

/* ---------- argument (why most tracking apps lie) ---------- */

.argument > .shell { padding-block: clamp(52px, 7vw, 104px); }

.argument-title {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.015em;
  max-width: 26ch;
}

.argument-lede {
  margin: 0 0 48px;
  font-size: clamp(17px, 1.5vw, 19px);
  color: var(--ink-700);
  max-width: 62ch;
}

.claims { display: flex; flex-direction: column; gap: clamp(36px, 4vw, 56px); }

.claim { display: flex; gap: clamp(24px, 4vw, 56px); flex-wrap: wrap; }

.claim-num { flex: 0 0 auto; width: 64px; }

.claim-num span {
  font-family: var(--serif);
  font-size: 38px;
  color: var(--ink-200);
}

.claim-body { flex: 1 1 380px; min-width: min(100%, 280px); }

.claim-body h3 {
  margin: 0 0 14px;
  font-size: clamp(20px, 2.2vw, 25px);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Direct children only — the gap chart nested below has its own .eyebrow
   and .card-note that this rule would otherwise recolour. */
.claim-body > p { margin: 0 0 14px; color: var(--ink-700); }
.claim-body > p:last-child { margin-bottom: 0; }
.claim-body > p.aside { color: var(--ink-500); font-size: 16px; }

/* ---------- gap chart ---------- */

.chart {
  border: 1px solid var(--ink-100);
  background: var(--paper-raised);
  border-radius: 8px;
  padding: 18px;
  max-width: 520px;
}

.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 84px; }

.chart-bars > div { flex: 1; }

.chart-bars .bar {
  background: var(--accent-soft);
  border-top: 2px solid var(--accent);
}

.chart-bars .gap { height: 100%; border-bottom: 1px dashed var(--ink-200); }

/* Bar heights as classes rather than inline styles, so the CSP can refuse
   inline styles outright. */
.bar-44 { height: 44%; }
.bar-52 { height: 52%; }
.bar-62 { height: 62%; }
.bar-70 { height: 70%; }
.bar-78 { height: 78%; }
.bar-84 { height: 84%; }

/* ---------- rungs ---------- */

.rungs {
  margin: 0 0 36px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column-reverse;
  gap: 14px;
}

.rung {
  background: var(--paper-raised);
  border: 1px solid var(--ink-100);
  border-radius: 8px;
  padding: 18px 20px;
}

.rung-2 { margin-left: clamp(0px, 3vw, 32px); }
.rung-3 { margin-left: clamp(0px, 6vw, 64px); border-color: var(--accent); }

.rung-head {
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
}

.rung-label { font-family: var(--mono); font-size: 13px; color: var(--ink-300); }
.rung-3 .rung-label { color: var(--accent); }

.rung-head h3 { margin: 0; font-size: 19px; font-weight: 600; }
.rung-gloss { color: var(--ink-500); font-size: 15px; }
.rung p { margin: 8px 0 0; color: var(--ink-700); font-size: 16px; }

/* ---------- split sections ---------- */

.split > .shell {
  display: flex;
  gap: clamp(28px, 5vw, 64px);
  flex-wrap: wrap;
}

.split-main { flex: 1 1 380px; min-width: min(100%, 300px); }
.split-main p { margin: 0 0 14px; color: var(--ink-700); }
.split-main p:last-child { margin-bottom: 0; }
.split-main .section-title { margin-bottom: 16px; }

.split-aside { flex: 1 1 320px; min-width: min(100%, 280px); }

/* ---------- factors board ---------- */

.factors-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.factors-head p { margin: 0; }
.factors-head .eyebrow { margin: 0; }
.factors-head .from { font-size: 13px; color: var(--ink-300); }

.factors { margin: 0; padding: 0; list-style: none; }

.factors li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-100);
}

.factors li:last-child { border-bottom: 0; }

.factor-name { flex: 1; font-size: 16px; }

.state {
  border: 1px solid var(--ink-200);
  color: var(--ink-700);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 14px;
  font-family: var(--mono);
}

.state-yes { border-color: var(--accent); color: var(--ink-900); }

.state-note { color: var(--ink-300); font-size: 13px; }

.section-title-tight { margin-bottom: 16px; }

/* ---------- privacy ---------- */

.privacy-intro { flex: 1 1 320px; min-width: min(100%, 280px); }
.privacy-intro .section-title { margin-bottom: 16px; }
.privacy-intro p { margin: 0; color: var(--ink-700); max-width: 44ch; }

.privacy-detail { flex: 1 1 400px; min-width: min(100%, 300px); }

.pull {
  margin: 0 0 22px;
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.6;
  color: var(--ink-900);
  border-left: 2px solid var(--accent);
  padding-left: 18px;
}

.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plain-list li {
  color: var(--ink-700);
  font-size: 16px;
  border-bottom: 1px solid var(--ink-100);
  padding-bottom: 12px;
}

.plain-list li:last-child { border-bottom: 0; padding-bottom: 0; }

/* ---------- closing ---------- */

.closing > .shell {
  padding-block: clamp(52px, 7vw, 96px);
  text-align: center;
}

.closing h2 {
  margin: 0 auto 20px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 3.2vw, 36px);
  letter-spacing: -0.015em;
  max-width: 24ch;
}

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--ink-100); background: var(--paper-sunken); }

.site-footer .shell {
  padding-block: 32px 44px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
}

.footer-mark { margin: 0 0 6px; font-family: var(--serif); font-size: 17px; }
.footer-meta { margin: 0; color: var(--ink-500); font-size: 14px; }

.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; font-size: 15px; }
.footer-nav a { color: var(--ink-700); }

/* ================= support / document pages ================= */

.doc-page { font-size: 16px; line-height: 1.6; }
.doc-page h2, .doc-page h3 { scroll-margin-top: 88px; }

.doc-shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) 24px 80px;
  display: flex;
  gap: clamp(28px, 4vw, 56px);
  flex-wrap: wrap;
  align-items: flex-start;
}

.toc {
  flex: 1 1 200px;
  min-width: min(100%, 200px);
  max-width: 240px;
  position: sticky;
  top: 76px;
}

.toc p {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-300);
}

.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 14.5px;
}

.toc a { color: var(--ink-700); text-decoration: none; }
.toc a.accent { color: var(--accent); }

.doc-main { flex: 1 1 520px; min-width: min(100%, 300px); max-width: 70ch; }

.doc-main h1 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: -0.02em;
}

.doc-main section { margin-bottom: 40px; }
.doc-main section:last-child { margin-bottom: 0; }

.doc-main h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(21px, 2.4vw, 26px);
  letter-spacing: -0.015em;
}

.doc-main h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.doc-main p { margin: 0 0 20px; color: var(--ink-700); }
.doc-main p.tight { margin-bottom: 8px; }
.doc-main p:last-child { margin-bottom: 0; }
.doc-main strong { font-weight: 600; }

.callout {
  background: var(--paper-raised);
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 36px;
}

.callout h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  font-family: var(--sans);
  letter-spacing: normal;
}
.callout .contact-email { margin: 0 0 8px; font-size: 19px; }
.callout p:last-child { margin-bottom: 0; }

.callout-accent {
  border-color: var(--accent);
  padding: 20px;
  margin-bottom: 24px;
}

.callout-accent h3 { margin: 0 0 10px; }
.callout-accent p { margin: 0 0 10px; }
.callout-accent p:last-child { margin-bottom: 0; }

.spec-list {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 20px;
  border-top: 1px solid var(--ink-100);
}

.spec-list dt {
  padding: 10px 0;
  color: var(--ink-500);
  font-size: 15px;
  border-bottom: 1px solid var(--ink-100);
}

.spec-list dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--ink-100); }

.rule-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink-100); }

.rule-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--ink-100);
  color: var(--ink-700);
}

