/* Tokens from docs/design/tokens.json; dark values from apps/mobile/src/theme/tokens.ts. */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --surface: #ffffff;
  --line: #ededed;
  --ink: #121212;
  --ink-muted: #6a6a6a;
  --primary: #ffd23f;
  --primary-edge: #d4a900;
  --politics: #3355ff;
  --politics-edge: #2440cc;
  --weather: #00a89d;
  --weather-edge: #00786f;
  --art: #ff6b3d;
  --art-edge: #d9501f;
  --on-dark: #ffffff;
  --inky-body: #121212;
  --inky-rim: transparent;
  --link: #1d3bcc;
  --phone: #121212;
  --phone-edge: #000000;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #141519;
    --line: #2a2c33;
    --ink: #f2f2f0;
    --ink-muted: #a3a6ae;
    --inky-rim: #81858f;
    --link: #b9c7ff;
    --phone: #2a2c33;
    --phone-edge: #0b0c0e;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font:
    500 17px/1.55 "Archivo",
    system-ui,
    sans-serif;
}

a {
  color: var(--link);
  font-weight: 700;
  text-underline-offset: 3px;
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--politics);
  outline-offset: 3px;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

/* The four text styles, plus the wordmark and button label. */
.wordmark {
  font-size: 52px;
  line-height: 0.82;
  font-weight: 900;
  font-stretch: 125%;
}
.headline {
  font-size: 30px;
  line-height: 1.02;
  font-weight: 900;
}
.title {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
}
.caption {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink-muted);
}

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header and footer */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}
.site-header .wordmark {
  font-size: 28px;
  color: var(--ink);
  text-decoration: none;
}
.site-header nav {
  display: flex;
  gap: 20px;
}
.site-header nav a {
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
}
.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  text-decoration: underline;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  margin-top: 64px;
  padding: 24px 0 40px;
  border-top: 2px solid var(--line);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

/* Button: primary yellow with a solid bottom edge. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 16px;
  background: var(--primary);
  box-shadow: 0 4px 0 var(--primary-edge);
  color: #121212;
  font-size: 17px;
  line-height: 1;
  font-weight: 800;
  text-decoration: none;
}
.button:active {
  transform: translateY(4px);
  box-shadow: none;
}

/* Hero */
.hero {
  display: grid;
  gap: 40px;
  align-items: center;
  padding: 24px 0 16px;
}
.hero-copy {
  display: grid;
  gap: 20px;
  justify-items: start;
}
.hero-copy .headline {
  font-size: clamp(40px, 7vw, 64px);
  font-stretch: 110%;
}
.hero-copy .lead {
  max-width: 30em;
}

@media (min-width: 860px) {
  .hero {
    grid-template-columns: 1fr 380px;
    padding-top: 48px;
  }
}

/* Phone preview of the Today screen */
.phone {
  justify-self: center;
  width: min(100%, 360px);
  padding: 12px;
  border-radius: 48px;
  background: var(--phone);
  box-shadow: 0 6px 0 var(--phone-edge);
}
.screen {
  display: grid;
  gap: 16px;
  padding: 28px 16px 20px;
  border-radius: 38px;
  background: var(--surface);
  overflow: hidden;
}
.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.masthead .wordmark {
  font-size: 40px;
}
.masthead-line {
  display: flex;
  gap: 6px;
  align-items: center;
}
.flame {
  width: 13px;
  height: 13px;
  fill: var(--art);
}

.cover {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 24px;
  background: var(--art);
  box-shadow: 0 5px 0 var(--art-edge);
  color: #121212;
}
.cover .caption {
  color: #121212;
}
.cover .headline {
  font-size: 26px;
}
.cover .button {
  margin-top: 8px;
}

.group {
  border: 2px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 3px 0 var(--line);
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px 14px;
}
.row + .row {
  border-top: 2px solid var(--line);
}
.row .title {
  font-size: 15px;
}
.badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 900;
}
.badge.art {
  background: var(--art);
  box-shadow: 0 3px 0 var(--art-edge);
  color: #121212;
}
.badge.quiz {
  background: var(--primary);
  box-shadow: 0 3px 0 var(--primary-edge);
}
.badge svg {
  width: 30px;
  height: 30px;
}

/* Features: each card shows the section its example belongs to. */
.features {
  display: grid;
  gap: 20px;
  margin-top: 56px;
}
@media (min-width: 700px) {
  .features {
    grid-template-columns: 1fr 1fr;
  }
}
.feature {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 24px;
  border-radius: 24px;
}
.feature.politics {
  background: var(--politics);
  box-shadow: 0 5px 0 var(--politics-edge);
  color: var(--on-dark);
}
.feature.weather {
  background: var(--weather);
  box-shadow: 0 5px 0 var(--weather-edge);
  color: #121212;
}
.feature.art {
  background: var(--art);
  box-shadow: 0 5px 0 var(--art-edge);
  color: #121212;
}
.feature.quiz {
  background: var(--primary);
  box-shadow: 0 5px 0 var(--primary-edge);
  color: #121212;
}
.feature .caption {
  color: inherit;
}

.note {
  display: grid;
  gap: 16px;
  margin-top: 56px;
  padding: 24px;
  border: 2px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 3px 0 var(--line);
}
@media (min-width: 700px) {
  .note {
    grid-template-columns: 104px 1fr;
    align-items: center;
  }
}
.note .title {
  margin-bottom: 8px;
}
.note p + p {
  margin-top: 8px;
}

/* Inky. The rim keeps the black body visible on a dark page. */
.inky {
  overflow: visible;
}
.inky .body {
  fill: var(--inky-body);
}
.inky .arm {
  fill: none;
  stroke: var(--inky-body);
  stroke-width: 9;
  stroke-linecap: round;
}
.inky .rim {
  fill: var(--inky-rim);
  stroke: var(--inky-rim);
  stroke-width: 3;
  stroke-linejoin: round;
}
.inky .rim.arm {
  fill: none;
  stroke-width: 12;
}
.inky .eye {
  fill: #ffffff;
}
.inky .cheek {
  fill: var(--art);
}
.inky .mouth {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.6;
  stroke-linecap: round;
}
.inky .sway {
  transform-box: view-box;
  animation: sway 3.2s ease-in-out infinite alternate;
}
.inky .wave {
  animation: wave 2.4s ease-in-out infinite;
}
.inky .lids {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 5s infinite;
}

@keyframes sway {
  from {
    transform: rotate(-3deg);
  }
  to {
    transform: rotate(3deg);
  }
}
@keyframes wave {
  0%,
  60%,
  100% {
    transform: rotate(0deg);
  }
  70%,
  90% {
    transform: rotate(-14deg);
  }
  80% {
    transform: rotate(6deg);
  }
}
@keyframes blink {
  0%,
  94%,
  100% {
    transform: scaleY(1);
  }
  97% {
    transform: scaleY(0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .inky * {
    animation: none !important;
  }
}

/* Long-form pages: privacy and support */
.doc {
  max-width: 680px;
  padding-top: 24px;
}
.doc > .headline {
  margin-bottom: 8px;
}
.doc h2 {
  margin: 40px 0 12px;
}
.doc p + p,
.doc p + ul,
.doc ul + p {
  margin-top: 12px;
}
.doc ul {
  padding-left: 20px;
}
.doc li + li {
  margin-top: 8px;
}

.missing {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 64px 0;
  text-align: center;
}
