/* Told in Data: site chrome.
   The chrome (frame, cards, footer) uses the frame typeface and takes its
   colours from the page: --bg, --ink and --accent are set on <body> from the
   story or series theme. Story interactives style themselves. */

@font-face { font-family: 'Schibsted Grotesk'; font-weight: 500; font-display: swap; src: url('fonts/SchibstedGrotesk-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 700; font-display: swap; src: url('fonts/SchibstedGrotesk-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 800; font-display: swap; src: url('fonts/SchibstedGrotesk-ExtraBold.ttf') format('truetype'); }

:root {
  --frame: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --gutter: 16px;
  --max: 1120px;
  --muted: color-mix(in srgb, var(--ink) 62%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 22%, var(--bg));
  --raise: color-mix(in srgb, var(--ink) 6%, var(--bg));
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 17px/1.5 var(--frame);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.05; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Running header (web version of the video frame) ---------- */
.tf {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px var(--gutter) 32px;
  opacity: .85;
}
/* The rule starts 17px right of the gutter; the mark hangs from that point. */
.tf-line {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  margin-left: 17px;
  padding: 0 0 5px 4px;
  border-bottom: 2px solid var(--ink);
}
.tf-name { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.tf-label { font-size: 14.5px; text-align: right; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.tf-label:hover, .tf-name:hover { color: inherit; text-decoration: underline; }
.tf-mark { position: absolute; left: var(--gutter); bottom: 2px; color: var(--ink); line-height: 0; }
.tf-mark svg { display: block; }
.tf-under {
  position: absolute; right: var(--gutter); bottom: 8px;
  font-size: 14px; text-decoration: none; white-space: nowrap;
}
.tf-under:hover { text-decoration: underline; color: inherit; }

.draft-banner { margin: 0; padding: 8px var(--gutter); background: var(--accent); color: var(--bg); font-weight: 700; font-size: 14px; text-align: center; }

/* ---------- Footer (web version of the end card) ---------- */
.tf-foot {
  max-width: var(--max); margin: 96px auto 0; padding: 56px var(--gutter) 64px;
  display: grid; justify-items: center; gap: 14px; text-align: center;
  border-top: 1px solid var(--line);
}
.lockup { display: block; color: var(--ink); line-height: 0; }
.lockup-svg { width: 220px; height: auto; overflow: visible; }
.tf-follow { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.tf-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; font-size: 15px; }
.tf-links a { color: var(--muted); }

/* ---------- Section heading: an annotation (rule + hanging dot) ---------- */
.annot {
  position: relative;
  font-size: 15px; font-weight: 700; letter-spacing: 0;
  padding: 0 0 6px 18px; margin: 0 0 20px;
  border-bottom: 2px solid var(--ink);
}
.annot::before {
  content: ''; position: absolute; left: 0; bottom: -12px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
}
.annot::after {
  content: ''; position: absolute; left: 3px; bottom: -2px; width: 2px; height: 13px;
  background: var(--ink); transform-origin: bottom; transform: translate(4px, 0) rotate(28deg);
}
.annot a { text-decoration: none; }

/* ---------- Buttons, badges, filter ---------- */
.button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  font: 700 15px var(--frame); color: var(--bg); background: var(--ink);
  border: 2px solid var(--ink); border-radius: 0; cursor: pointer; text-decoration: none;
}
.button:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.button-quiet { background: transparent; color: var(--ink); }
.badge { justify-self: start; font-size: 12px; font-weight: 700; padding: 2px 6px; border: 1.5px solid currentColor; color: var(--muted); }
.badge-draft { color: var(--accent-text, var(--accent)); }

.filter { margin: 0 0 28px; }
.filter label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.filter input {
  width: 100%; min-height: 52px; padding: 0 16px;
  font: 500 18px var(--frame); color: var(--ink); background: var(--raise);
  border: 2px solid var(--line); border-radius: 0;
  -webkit-appearance: none; appearance: none;
}
.filter input::placeholder { color: var(--muted); }
.filter input:focus { outline: none; border-color: var(--accent); }
.filter-empty { color: var(--muted); }
.coming-soon { margin: 40px 0 0; max-width: 560px; padding-top: 12px; border-top: 2px solid var(--ink); font-size: 18px; line-height: 1.45; color: var(--muted); }
.coming-soon strong { display: block; color: var(--ink); font-size: clamp(24px, 4vw, 32px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 6px; }
.coming-soon a { color: inherit; }

/* ---------- Cards ---------- */
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card a { display: grid; gap: 10px; text-decoration: none; }
.card a:hover { color: inherit; }
.card a:hover .thumb { transform: translateY(-3px); }
.card[hidden] { display: none; }
.thumb {
  width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; background: var(--raise);
  transition: transform .2s ease;
}
.thumb-empty {
  display: grid; place-items: end start; padding: 14px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  font-weight: 800; font-size: 22px; line-height: 1.05; letter-spacing: -0.01em;
}
.thumb-empty span { border-bottom: 3px solid var(--accent); }
.card-text { display: grid; gap: 2px; }
.card-format { font-size: 13px; color: var(--muted); }
.card-title { font-weight: 700; font-size: 16px; line-height: 1.2; }
.card-link { font-size: 13px; color: var(--accent-text, var(--accent)); }
@media (prefers-reduced-motion: reduce) { .thumb { transition: none; } }

/* ---------- told.bio ---------- */
.bio { padding-top: 40px; }
.bio-title { font-size: clamp(30px, 8vw, 52px); font-weight: 800; letter-spacing: -0.025em; max-width: 14ch; margin-bottom: 32px; }
.bio-title span { display: block; color: var(--accent-text, var(--accent)); }

/* ---------- toldindata.com home: a data page, no reel thumbnails ---------- */
.home .hero { padding: 48px 0 8px; display: grid; gap: 56px; }
@media (min-width: 960px) { .home .hero { grid-template-columns: minmax(0, 1fr) 380px; align-items: end; gap: 64px; } }
.featured { display: grid; gap: 10px; padding: 18px 18px 20px; background: var(--raise); border-top: 2px solid var(--ink); text-decoration: none; }
.featured:hover { color: inherit; background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
.featured-kicker { font-size: 13px; font-weight: 700; color: var(--accent); }
.featured-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.featured-chart svg { height: 160px; }
.featured .tile-stat strong { font-size: 28px; }
.featured-go { font-weight: 700; font-size: 15px; color: var(--accent); }
.hero-h { font-size: clamp(40px, 10vw, 104px); font-weight: 800; letter-spacing: -0.045em; line-height: .92; max-width: 13ch; }
@media (min-width: 960px) { .hero-h { font-size: clamp(64px, 6.6vw, 92px); max-width: 11ch; } }
.hero-h span { color: var(--accent-text, var(--accent)); }
.hero-text { max-width: 46ch; margin: 28px 0 0; font-size: clamp(18px, 2.6vw, 22px); line-height: 1.4; color: var(--muted); }
.hero-stats { display: flex; gap: 0; margin: 40px 0 0; border-top: 2px solid var(--ink); max-width: 560px; }
.hero-stats div { flex: 1; padding: 10px 12px 0 0; }
.hero-stats div + div { border-left: 1px solid var(--line); padding-left: 14px; }
.hero-stats dt { font-size: 13px; color: var(--muted); }
.hero-stats dd { margin: 0; font-size: clamp(36px, 7vw, 56px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }

.all-series { margin-top: 88px; display: grid; gap: 96px; }
.series-head { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: baseline; margin-bottom: 24px; }
.series-n { font-size: 15px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.series-title { font-size: clamp(36px, 8.5vw, 80px); font-weight: 800; letter-spacing: -0.04em; line-height: .95; }
.series-title a { text-decoration: none; }
.series-title a:hover { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 5px; text-underline-offset: 6px; }
.series-tagline { grid-column: 2; margin: 12px 0 0; max-width: 48ch; color: var(--muted); font-size: 18px; }
.series-more { display: inline-block; margin-top: 22px; font-weight: 700; color: var(--accent); text-decoration: none; }
.series-more:hover { color: var(--accent); text-decoration: underline; }

/* Data tiles: one small chart per story */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1040px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile[hidden] { display: none; }
.tile a {
  display: grid; gap: 8px; height: 100%; padding: 14px 14px 16px;
  text-decoration: none; background: var(--raise); border-top: 2px solid var(--ink);
  transition: background .15s ease;
}
.tile a:hover { color: inherit; background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
.tile-format { font-size: 13px; color: var(--muted); }
.tile-label { font-size: clamp(20px, 4.4vw, 26px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.tile-chart { display: block; color: var(--ink); }
.tile-chart svg { display: block; width: 100%; height: 84px; overflow: visible; }
.tile-chart-empty { height: 84px; border-bottom: 1px solid var(--line); }
.tile-axis { display: flex; justify-content: space-between; margin-top: -4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile-stat { font-size: 13px; color: var(--muted); line-height: 1.3; }
.tile-stat strong { display: block; font-size: 20px; color: var(--ink); letter-spacing: -0.01em; }
.tile .badge { margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .tile a { transition: none; } }

.recent { margin-top: 112px; }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list a {
  display: grid; grid-template-columns: 7.5em 1fr; gap: 2px 16px; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.recent-list a:hover .recent-title { text-decoration: underline; text-decoration-color: var(--accent); }
.recent-list time { grid-row: span 2; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.recent-series { font-size: 13px; color: var(--accent); font-weight: 700; }
.recent-title { font-size: 18px; font-weight: 700; line-height: 1.25; }
.recent-list .badge { grid-column: 2; }
@media (min-width: 720px) { .recent-list a { grid-template-columns: 8em 11em 1fr auto; } .recent-list time { grid-row: auto; } .recent-list .badge { grid-column: auto; } }

/* ---------- Series page ---------- */
.format-hero { padding: 40px 0 8px; }
.format-hero h1 { font-size: clamp(42px, 11vw, 104px); font-weight: 800; letter-spacing: -0.04em; line-height: .92; max-width: 12ch; }
.lede { max-width: 40ch; font-size: clamp(19px, 3vw, 24px); line-height: 1.35; margin: 24px 0 0; }
.method { max-width: 62ch; color: var(--muted); font-size: 15px; }
.picker { margin-top: 56px; }

/* ---------- Story page ---------- */
.placeholder-note { margin: 24px 0 0; padding: 12px 14px; border: 2px dashed var(--accent); font-size: 15px; }
.story-hero { padding: 36px 0 28px; }
.story-label { margin: 0 0 10px; color: var(--accent-text, var(--accent)); font-weight: 700; font-size: 17px; }
.story-hero h1 { font-size: clamp(32px, 7.4vw, 68px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; max-width: 18ch; }
.story-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 18px 0 0; color: var(--muted); font-size: 15px; }
.dot-sep { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.story-short { color: var(--ink); font-weight: 700; }

.interactive { margin: 0 calc(var(--gutter) * -1); }
@media (min-width: 720px) { .interactive { margin: 0; } }
.interactive-mount { min-height: 360px; }
.interactive-mount[data-loading]::after { content: 'Loading the chart…'; display: block; padding: 40px var(--gutter); color: var(--muted); }
.interactive-error { padding: 24px var(--gutter); color: var(--muted); }

.story-cols { display: grid; gap: 56px; margin-top: 64px; }
@media (min-width: 880px) { .story-cols { grid-template-columns: minmax(0, 1fr) 320px; gap: 64px; align-items: start; } .story-reel { position: sticky; top: 24px; } }
.story-text > section + section { margin-top: 56px; }
.what p { max-width: 62ch; margin: 0 0 14px; font-size: 18px; }
.sources ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.sources li { display: grid; gap: 2px; }
.src-name { font-weight: 700; }
.src-pub, .src-meta, .src-note { color: var(--muted); font-size: 15px; }
.downloads { margin-top: 22px; font-size: 15px; }
.downloads .size { color: var(--muted); }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; }
.share-status { min-height: 1.5em; color: var(--muted); font-size: 14px; }

.reel { margin: 0; max-width: 320px; }
.reel figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.reel-poster { width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; }
.reel-play { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; }
.reel-btn {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--bg); font-size: 26px; padding-left: 4px;
}
.reel iframe { width: 100%; aspect-ratio: 9 / 16; border: 0; display: block; }

.more { margin-top: 88px; }
.more-solo { margin-top: 64px; font-weight: 700; }

/* ---------- 404 ---------- */
.notfound { padding-top: 64px; }
.notfound h1 { font-size: clamp(34px, 8vw, 64px); font-weight: 800; letter-spacing: -0.03em; }
.notfound p { color: var(--muted); }
