/* Daily Better You — legal set stylesheet.
   Tokens transcribed from ventures/dby/specs/dby-design-system.md §1 (the dawn ramp)
   and §10.1 (the five stage keys). Text-first surface: paper ground, warm ink,
   one accent family (text-safe gold), and the dawn ramp spent once, on the top rule. */

:root {
  /* dawn ramp — §1 */
  --paper: #fbf4ea;
  --paper-2: #fffaf3;
  --cream: #fff4e6;
  --ink: #2c2030;
  --ink-soft: #5b4a5a;
  --ink-faint: #8a7684;
  --line: #e7dccd;
  --line-soft: #f0e7da;

  /* the one accent family: gold, at text-safe value (§10.1 stage-4 --stage-ink) */
  --accent: #9d5a14;
  --accent-hot: #e07b28;
  --accent-wash: rgba(224, 123, 40, 0.08);

  /* the five stage keys — §10.1, used only in the dawn rule */
  --s1: #a789ff;
  --s2: #ff85b0;
  --s3: #ff9a6b;
  --s4: #ffc66b;
  --s5: #ffe89a;

  --display: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --measure: 68ch;
  --gutter: 24px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.68;
  font-weight: 400;
  overflow-wrap: break-word;
}

/* the dawn ramp — the single bold spend on these pages */
.dawn-rule {
  height: 4px;
  background: linear-gradient(90deg, var(--s1) 0%, var(--s2) 26%, var(--s3) 52%, var(--s4) 76%, var(--s5) 100%);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--cream);
  padding: 10px 16px;
  border-radius: 0 0 6px 0;
  z-index: 20;
}
.skip-link:focus { left: 0; }

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

:focus-visible {
  outline: 2px solid var(--accent-hot);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.site-head {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  max-width: 760px; /* same measure as main + .foot-inner: the wordmark sits over the h1 */
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: baseline;
  justify-content: space-between;
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--ink); }
.wordmark em { font-style: normal; color: var(--accent); }

.head-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 0;
  padding: 0;
}
.head-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}
.head-nav a:hover { color: var(--accent); text-decoration: underline; }
.head-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 650;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ---------- page body ---------- */

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 44px var(--gutter) 72px;
}

.page-kicker {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}

h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 14px;
  text-wrap: balance;
}

.standfirst {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 18px;
  max-width: var(--measure);
}

.meta {
  font-size: 14px;
  color: var(--ink-faint);
  margin: 0 0 34px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.toc {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
  margin: 0 0 42px;
}
.toc h2 {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
  border: 0;
  padding: 0;
}
.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 28px;
  font-size: 15px;
}
.toc li { margin: 0 0 6px; break-inside: avoid; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

section { margin: 0 0 40px; scroll-margin-top: 16px; }

h2 {
  font-family: var(--display);
  font-weight: 750;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
h2 .num {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-right: 10px;
}

h3 {
  font-family: var(--body);
  font-weight: 650;
  font-size: 16px;
  color: var(--ink);
  margin: 26px 0 8px;
}

p { margin: 0 0 16px; max-width: var(--measure); }

strong { color: var(--ink); font-weight: 650; }

ul, ol { margin: 0 0 16px; padding-left: 22px; max-width: var(--measure); }
li { margin: 0 0 8px; }

.plain { list-style: none; padding-left: 0; }
.plain li {
  padding-left: 16px;
  border-left: 2px solid var(--line);
}

/* lawful-basis and processor tables.
   The table is the one element allowed to be wider than the page. It scrolls
   inside its own box, never the document — so it is focusable, labelled, and
   on a phone it says so out loud (.table-hint). */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
}

.table-hint {
  display: none;
  font-size: 13px;
  color: var(--ink-faint);
  margin: 0 0 8px;
}
@media (max-width: 640px) {
  .table-hint { display: block; }
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 15px;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
th {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }

/* callouts */
.note {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 18px 20px;
  margin: 0 0 22px;
}
.note p:last-child { margin-bottom: 0; }
.note .note-label {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}

.crisis { background: var(--accent-wash); }

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

.site-foot {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
}
.foot-inner {
  max-width: 760px; /* the gutter lives here, so the footer lines up with main */
  margin: 0 auto;
  padding: 40px var(--gutter) 56px;
  font-size: 14.5px;
  line-height: 1.6;
}

.entity { margin: 0 0 24px; }
.entity-label {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 10px;
}
.entity-line { margin: 0 0 4px; max-width: 60ch; }
.entity-line:last-child { margin-bottom: 0; }

.foot-disclaimer {
  margin: 0 0 22px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  max-width: 62ch;
}

.foot-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 0 0 18px;
  padding: 0;
}
.foot-nav a { color: var(--ink-soft); text-decoration: none; }
.foot-nav a:hover { color: var(--accent); text-decoration: underline; }

.foot-legalese { font-size: 13px; color: var(--ink-faint); margin: 0; }

/* ---------- small screens ---------- */

@media (max-width: 620px) {
  body { font-size: 16.5px; }
  main { padding-top: 32px; }
  .toc ol { columns: 1; }
  .head-inner { padding: 16px var(--gutter); }
}

@media (max-width: 380px) {
  :root { --gutter: 16px; }
  .head-nav ul { gap: 4px 14px; }
}

/* ---------- print ---------- */

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .dawn-rule, .head-nav, .foot-nav, .toc, .skip-link { display: none; }
  .site-head, .site-foot { background: #fff; }
  main { max-width: none; padding: 0; }
  a { color: #000; text-decoration: underline; }
  h2 { break-after: avoid; }
  section { break-inside: auto; }
}
