/* Day's TED Talk — mobile-first explainer */
:root {
  --bg: #0c0d10;
  --bg-elev: #15171c;
  --bg-figure: #101216;
  --ink: #eceae4;
  --ink-dim: #b4b1a8;
  --ink-mute: #8a867c;
  --rule: #2a2c32;
  --accent: #c45a3c;
  --accent-soft: rgba(196, 90, 60, 0.16);
  --card-border: #2d3038;
  --link: #d7c4a3;
  --radius: 12px;
  --measure: 42rem;
  --pad: 1.15rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.125rem; /* 18px */
  line-height: 1.7;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

.page {
  width: min(var(--measure), 100%);
  margin: 0 auto;
  padding: 1.5rem var(--pad) 3.25rem;
}

.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 1.15rem;
}

.kicker .dot {
  width: 0.4rem;
  height: 0.4rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
}

h1 {
  font-family: Newsreader, "Iowan Old Style", Palatino, Georgia, serif;
  font-weight: 500;
  font-size: clamp(2rem, 9vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  max-width: 100%;
}

.lede {
  font-family: Newsreader, Georgia, serif;
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-dim);
  margin: 0 0 1.5rem;
}

hr.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0 0 1.5rem;
}

p { margin: 0 0 1.2rem; }

.source-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 0.9rem;
  align-items: center;
  margin: 1.5rem 0;
  padding: 0.95rem 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  max-width: 100%;
}

.source-card:hover,
.source-card:focus-visible {
  border-color: #4a3b32;
  background: #1a1715;
  outline: none;
}

.source-card .mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: Newsreader, Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1;
}

.source-card .meta { min-width: 0; }

.source-card .outlet {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 0.2rem;
}

.source-card h2 {
  font-family: Newsreader, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 0.25rem;
  color: var(--ink);
}

.source-card .url {
  font-size: 0.8rem;
  color: var(--ink-mute);
  overflow-wrap: anywhere;
  word-break: break-word;
  margin: 0;
}

.figure {
  margin: 1.5rem 0;
  max-width: 100%;
}

.figure-frame {
  position: relative;
  background: var(--bg-figure);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.figure-frame img,
.figure-frame video {
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #000;
}

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 12rem;
  padding: 1.75rem 1rem;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(196, 90, 60, 0.05), transparent 42%),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 10px,
      rgba(255, 255, 255, 0.015) 10px,
      rgba(255, 255, 255, 0.015) 11px
    );
}

.placeholder-label {
  font-family: Newsreader, Georgia, serif;
  font-size: 1.1rem;
  color: var(--ink);
}

.placeholder-hint {
  font-size: 0.8rem;
  color: var(--ink-mute);
  overflow-wrap: anywhere;
}

.hidden { display: none !important; }

figcaption {
  margin: 0.55rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-mute);
}

.moral {
  margin: 1.6rem 0;
  padding: 0 0 0 0.95rem;
  border-left: 2px solid var(--accent);
}

.moral p {
  font-family: Newsreader, Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.45;
  margin: 0;
}

.sources {
  margin-top: 2.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--rule);
}

.sources h2 {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-mute);
  margin: 0 0 0.85rem;
}

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

.sources li {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink-dim);
}

.sources a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

.sources a:hover { color: var(--ink); }

.foot {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--ink-mute);
}

@media (min-width: 640px) {
  :root { --pad: 1.5rem; }
  .page { padding-top: 2.25rem; padding-bottom: 4.5rem; }
  .lede { font-size: 1.2rem; }
  .moral p { font-size: 1.28rem; }
  .source-card h2 { font-size: 1.15rem; }
}

.extra { margin: 2.5rem 0; padding: 1.25rem 1.25rem 0.5rem; border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; background: rgba(255,255,255,0.03); }
.extra h2 { margin-top: 0; }
.extra ul { padding-left: 1.2rem; }
.extra li { margin-bottom: 0.6rem; }
.extra a { color: inherit; text-decoration: underline; }
.signoff { margin: 3rem 0 2rem; font-size: 1.15rem; line-height: 1.6; }
