/* Briefed Today. One accent (warm red-orange), ink and neutral everywhere else. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --ink: #1b1b1b;
  --ink2: #6b6b6b;
  --line: #e6e6e6;
  --track: #eeeeee;
  --fill: #8a8a8a;
  --accent: #b8400f;
  --on-accent: #ffffff;
  --accent-soft: #eba98b;
  --sheet: #ffffff;
  --handle: #d4d4d4;
  --sel: #f9ddd0;
  --w: 720px;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131313;
    --ink: #e8e8e8;
    --ink2: #9d9d9d;
    --line: #2c2c2c;
    --track: #2c2c2c;
    --fill: #8a8a8a;
    --accent: #f27a4b;
    --on-accent: #131313;
    --accent-soft: #8c4b2e;
    --sheet: #1e1e1e;
    --handle: #4a4a4a;
    --sel: #5a3020;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
::selection { background: var(--sel); color: var(--ink); }
a, button { -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08); }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.skip { position: absolute; left: 16px; top: -48px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--ink); border-radius: 8px; }
.skip:focus { top: 12px; z-index: 10; }
.wrap { width: 100%; max-width: var(--w); margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
.dot { color: var(--ink2); }
.meta { font-size: 14px; color: var(--ink2); }
.ext { font-size: 0.85em; }

/* header */
.top .wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; min-height: 44px; }
.brand:hover { text-decoration: none; }
.mark { color: var(--ink); flex: none; }
.mark-b { fill: var(--bg); }
.top nav { display: flex; gap: 4px; margin-right: -10px; }
.navlink { display: inline-flex; align-items: center; font: inherit; font-size: 15px; color: var(--ink2); background: none; border: 0; padding: 0 10px; min-height: 44px; cursor: pointer; border-radius: 8px; }
.navlink { transition: color 150ms ease; }
.navlink:hover, .navlink.current { color: var(--ink); text-decoration: none; }

main.wrap { flex: 1; padding-top: 28px; padding-bottom: 72px; }

/* home */
.date { font-size: 14px; color: var(--ink2); }
h1 { font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.sub { font-size: 14px; color: var(--ink2); margin-top: 8px; }
.stories { margin-top: 28px; }
.story { position: relative; display: flex; align-items: baseline; gap: 14px; padding: 22px 0; border-top: 1px solid var(--line); }
.story .text { transition: opacity 120ms ease; }
.story:active .text { opacity: 0.6; }
.stories li:first-child .story { border-top: 0; padding-top: 12px; }
.story h2 { font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.story.lead h2 { font-size: 23px; line-height: 1.2; letter-spacing: -0.02em; }
.story .summary { margin-top: 8px; color: var(--ink); }
.story .meta { margin-top: 10px; }
.story-link::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }
.story:hover h2 a { text-decoration: underline; text-underline-offset: 3px; }
.story-link:focus-visible { outline: none; }
.story-link:focus-visible::after { outline: 2px solid var(--ink); outline-offset: 6px; }

/* score */
.score { flex: none; width: 46px; display: grid; grid-template-columns: max-content 1fr; align-items: baseline; align-content: start; column-gap: 2px; }
.score .num { font-size: 22px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.score .den { font-size: 12px; color: var(--ink2); }
.score .bar { grid-column: 1 / -1; display: block; height: 4px; width: 40px; margin-top: 8px; border-radius: 2px; background: var(--track); position: relative; overflow: hidden; }
.score .bar::after { content: ""; position: absolute; inset: 0; width: var(--v); background: var(--fill); border-radius: 2px; }
.lead .score .num { font-size: 28px; }
.lead .score .bar::after, .score.big .bar::after { background: var(--accent); }
.score.big { display: flex; align-items: baseline; gap: 10px; width: auto; margin-top: 16px; }
.score.big .num { font-size: 36px; }
.score.big .den { font-size: 14px; margin-left: -8px; }
.score.big .bar { width: 120px; height: 6px; border-radius: 3px; margin: 0; align-self: center; }
.score.big .label { font-size: 14px; color: var(--ink2); }

/* story page */
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink2); min-height: 44px; }
.back:hover { color: var(--ink); }
.story-head { margin-top: 8px; }
.story-head h1 { margin-top: 6px; }
.lede { font-size: 19px; line-height: 1.45; margin-top: 20px; }
.qa, .sources, .why { margin-top: 32px; }
.story-head + .qa { margin-top: 40px; }
.qa h2, .sources h2, .why h2, .block h2 { font-size: 14px; font-weight: 600; color: var(--ink2); text-transform: none; letter-spacing: 0; margin-bottom: 4px; }
.sources li { display: grid; padding: 6px 0 2px; }
.sources li + li { border-top: 1px solid var(--line); }
.pub { font-size: 14px; color: var(--ink2); }
.source-link { display: block; font-weight: 500; padding: 9px 0 10px; margin-top: -7px; }
.dims { margin-top: 16px; display: grid; grid-template-columns: 1fr; row-gap: 10px; column-gap: 40px; }
.dims li { display: grid; grid-template-columns: 130px 1fr 28px; align-items: center; gap: 12px; font-size: 14px; }
.dim-bar { display: block; height: 6px; border-radius: 3px; background: var(--track); position: relative; overflow: hidden; }
.dim-bar::after { content: ""; position: absolute; inset: 0; width: var(--v); background: var(--accent-soft); border-radius: 3px; }
.dim-val { text-align: right; font-variant-numeric: tabular-nums; }

/* about and policy */
.person { display: flex; align-items: center; gap: 20px; }
.person img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
@media (prefers-color-scheme: dark) { .person img { filter: brightness(0.88); } }
.person h1 { font-size: 28px; }
.statement { font-size: 26px; line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; margin-top: 32px; max-width: 22ch; }
.block { margin-top: 36px; }
.block p + p, .block ul + p { margin-top: 10px; }
.points li { padding: 6px 0 6px 18px; position: relative; }
.points li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink2); }
.questions { counter-reset: q; display: grid; gap: 8px; margin-top: 4px; }
.questions li { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.questions + .meta { margin-top: 12px; }
.goal { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.principles { display: grid; gap: 6px; margin-top: 4px; }
.principles li { display: flex; gap: 8px; align-items: baseline; }
.principles span { color: var(--ink2); }
.sign { margin-top: 28px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.actions { display: flex; align-items: center; gap: 20px; margin-top: 36px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 16px; }
.btn { transition: filter 150ms ease; }
.btn:hover { text-decoration: none; filter: brightness(0.94); }
.link { font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.policy .lede { font-size: 18px; margin-top: 12px; }
.policy > .meta { margin-top: 36px; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; margin-top: 28px; }
.facts li { display: grid; }
.facts b { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.facts span { font-size: 14px; color: var(--ink2); }
.policy a, .block a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink2); }

/* footer */
.foot { padding: 20px 0 calc(20px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--ink2); }
.foot a { display: inline-block; padding: 13px 2px; }
.foot a:hover { color: var(--ink); }

/* how we rank: dialog, bottom sheet on phones */
.sheet { border: 0; padding: 20px var(--gutter) calc(24px + env(safe-area-inset-bottom)); margin: auto 0 0; width: 100%; max-width: 100%; background: var(--sheet); color: var(--ink); border-radius: 20px 20px 0 0; max-height: 88dvh; overflow: auto; }
.sheet::backdrop { background: rgba(0, 0, 0, 0.45); }
body:has(dialog[open]) { overflow: hidden; }
.sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--handle); margin: 0 auto 16px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.close { width: 44px; height: 44px; margin-right: -12px; border: 0; background: none; color: var(--ink2); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.close:hover { color: var(--ink); background: var(--track); }
.sheet-lede { margin-top: 8px; }
.steps { counter-reset: s; margin-top: 20px; display: grid; gap: 16px; }
.steps > li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 12px; }
.steps > li::before { content: counter(s); grid-row: 1 / span 3; width: 28px; height: 28px; border-radius: 50%; background: var(--track); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; margin-top: 2px; }
.steps b { font-weight: 600; }
.steps span { grid-column: 2; color: var(--ink2); font-size: 15px; }
.chips { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips li { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--track); display: block; }
.sheet-note { margin-top: 20px; font-size: 14px; color: var(--ink2); }
.sheet[open] { animation: rise 220ms cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }

@media (min-width: 700px) {
  :root { --gutter: 24px; }
  main.wrap { padding-top: 40px; }
  h1 { font-size: 36px; }
  .story h2 { font-size: 20px; }
  .story.lead h2 { font-size: 28px; }
  .story { gap: 20px; padding: 24px 0; }
  .score { width: 56px; }
  .score .num { font-size: 24px; }
  .score .bar { width: 48px; }
  .lead .score .num { font-size: 32px; }
  .dims { grid-template-columns: 1fr 1fr; }
  .person img { width: 96px; height: 96px; }
  .statement { font-size: 30px; }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .principles { grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 8px; }
  .principles li { display: grid; gap: 2px; }
  .sheet { margin: auto; width: 480px; border-radius: 16px; padding: 24px 28px 28px; max-height: 80vh; }
  .sheet-handle { display: none; }
  .sheet[open] { animation: fade 180ms ease-out; }
  @keyframes fade { from { transform: translateY(8px); opacity: 0; } }
}

@media (prefers-reduced-motion: reduce) {
  .sheet[open] { animation: none; }
  * { transition: none !important; }
}
