/* One theme: light. No dark mode by design (spec section 3). */
:root {
  --paper: #F6F5F1;
  --paper-2: #F3F1EA;
  --field: #FFFEFA;
  --ink: #111111;
  --ink-2: #8A8780;
  --ink-2-text: #68655E;
  --accent: #4B9CD3;
  --accent-dark: #3A7AA5;
  --highlight: #D1FE17;
  --error: #C81E0C;

  --font-body: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-stamp: Anton, Impact, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 500 17px/25px var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
strong, b { font-weight: 700; }
svg { display: block; }

/* ---------- Root and texture ---------- */
.root {
  position: relative; min-height: 100vh; overflow-x: hidden;
  background: var(--paper); color: var(--ink);
}
.grain {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: url(/assets/grain.png);
  opacity: .02; pointer-events: none;
}
.ht-hero {
  position: absolute; top: 0; left: 0; right: 0;
  height: 330px; pointer-events: none;
  background-image: radial-gradient(circle, rgba(17,17,17,.38) 1.05px, transparent 1.25px);
  background-size: 6px 6px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
          mask-image: linear-gradient(to bottom, #000, transparent);
}
.ht-hero.is-short { height: 240px; }
.ht-accent {
  background:
    radial-gradient(circle, #4B9CD3 1.05px, transparent 1.25px) 0 0 / 5px 5px,
    radial-gradient(circle, #4B9CD3 1.05px, transparent 1.25px) 2.5px 2.5px / 5px 5px;
}
.ht-stamp {
  background-image: radial-gradient(circle, #111111 1px, transparent 1.2px);
  background-size: 4px 4px;
}
.ht-ink {
  background-image: radial-gradient(circle, #111111 1.2px, transparent 1.4px);
  background-size: 4px 4px;
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Type helpers ---------- */
.label { font: 400 13px/18px var(--font-mono); color: var(--ink-2-text); }
.em {
  font-family: var(--font-serif); font-size: 1.16em; font-style: italic;
  font-weight: 400; letter-spacing: 0; color: var(--accent-dark);
}
.tag {
  display: inline-block; align-self: flex-start;
  padding: 1px 7px; border: 1px dashed var(--ink);
  font: 400 12px/17px var(--font-mono); color: var(--ink);
}
.mark { white-space: nowrap; padding: 0 3px; background: var(--highlight); font-weight: 700; }
.section-h { font-size: 26px; line-height: 32px; font-weight: 700; letter-spacing: -.02em; }
.small { font-size: 15px; line-height: 22px; }
.muted { color: var(--ink-2-text); }

/* ---------- Links ---------- */
a { color: var(--ink); text-underline-offset: 3px; }
.link {
  display: flex; align-items: center; align-self: flex-start;
  min-height: 44px; color: var(--ink); text-underline-offset: 3px;
}
.link-strong { font-weight: 700; }
p .link { display: inline; min-height: 0; }   /* links inside running text (article sources) stay in the sentence */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 2px;
}
[tabindex="-1"]:focus { outline: none; }
.linkbtn {
  /* inline so it sits in the sentence; vertical padding gives a 44px tap area without changing line height */
  display: inline; padding: 11px 0; margin: 0; border: 0; background: none;
  color: var(--ink); font: inherit; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer;
}

/* ---------- Wordmark ---------- */
.wordmark {
  display: flex; align-self: flex-start; align-items: center; gap: 8px;
  min-height: 32px; margin-left: -6px; padding: 3px 10px 3px 6px;
  background: var(--paper); border-radius: 6px;
  color: var(--ink); text-decoration: none;
  font-weight: 700; letter-spacing: -.02em;
  font-size: 24px; line-height: 30px;
}
.wordmark svg { flex: none; }
a.wordmark { min-height: 44px; padding: 0 10px 0 6px; }
.wordmark.is-plain { margin-left: 0; padding: 0; background: none; }

/* ---------- Icons ---------- */
.icon { flex: none; }
.icon-40 { width: 40px; height: 40px; }
.icon-32 { width: 32px; height: 32px; }
.icon-72 { width: 72px; height: 72px; }
.icon-14 { width: 14px; height: 14px; }

/* ---------- Cards ---------- */
.clip { position: relative; margin: 0 4px 4px 0; transform: rotate(-1deg); }
.clip > .ht-accent, .rcard > .ht-accent {
  position: absolute; top: 4px; right: -4px; bottom: -4px; left: 4px;
}
.clip > article {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 20px; background: var(--paper-2); border: 2px solid var(--ink);
}
.rcard { position: relative; margin: 0 4px 4px 0; }
.rcard > .ht-accent { border-radius: 12px; }
.rcard-body {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 20px; background: var(--paper-2);
  border: 2px solid var(--ink); border-radius: 12px;
}
.card-h { font-size: 26px; line-height: 32px; font-weight: 700; letter-spacing: -.02em; }
.card-row { display: flex; align-items: center; gap: 10px; }

/* ---------- Signup form ---------- */
.signup { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.field {
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 0 14px;
  background: var(--field); border: 2px solid var(--ink); border-radius: 12px;
}
.field:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }
.field.is-invalid { border-color: var(--error); }
.field label { font: 400 14px/20px var(--font-mono); color: var(--ink-2-text); }
.field input {
  flex: 1 1 auto; min-width: 0; height: 50px; margin: 0; padding: 0; border: 0;
  border-radius: 0; background: transparent; color: var(--ink);
  font: 500 17px/24px var(--font-body);
  -webkit-appearance: none; appearance: none;
}
.field input:focus { outline: none; }
.field input::placeholder { color: var(--ink-2-text); opacity: 1; }

.press-wrap { position: relative; margin: 0 4px 4px 0; }
.btn {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; margin: 0; padding: 0 16px;
  border: 2px solid var(--ink); border-radius: 12px;
  background: var(--accent); color: var(--ink);
  font: 700 17px/24px var(--font-body);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .08s linear;
}
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.btn:active { transform: translate(2px, 2px); }
.btn:disabled { opacity: 1; cursor: progress; }
.press-shadow {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 12px; pointer-events: none;
  transform: translate(4px, 4px);
  transition: transform .08s linear;
  background-image: radial-gradient(circle, #111111 1px, transparent 1.2px);
  background-size: 4px 4px;
}
.btn:active + .press-shadow { transform: translate(2px, 2px); }
.trust {
  margin: 0; text-align: center; color: var(--ink-2-text);
  font: 400 13px/18px var(--font-mono);
}
.form-error {
  display: flex; align-items: flex-start; gap: 8px;
  color: var(--error); font-size: 15px; line-height: 22px;
}
.form-error svg { flex: none; margin-top: 1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: block; width: 18px; height: 18px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .btn, .press-shadow { transition: none; } }

/* ---------- Landing ---------- */
.container {
  position: relative; display: flex; flex-direction: column; gap: 56px;
  max-width: 560px; margin: 0 auto; padding: 20px 20px 28px;
}
.hero { position: relative; display: flex; flex-direction: column; }
.kicker { margin-top: 14px; }
.kicker .hl { padding: 0 5px; color: var(--ink); font-weight: 500; }   /* highlighter so the tagline reads over the halftone */
.stamp-wrap {
  position: absolute; top: -6px; right: 0; width: 92px; height: 92px;
  pointer-events: none;
}
.stamp {
  position: relative; width: 100%; height: 100%;
  transform: rotate(-7deg);
  animation: kick .3s ease-out .3s both;
}
.stamp > .ht-stamp { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 50%; }
.stamp-in {
  position: absolute; top: 7px; right: 7px; bottom: 7px; left: 7px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 50%;
  font-family: var(--font-stamp); font-weight: 400; text-transform: uppercase;
}
.stamp-1 { font-size: 25px; line-height: 27px; }
.stamp-2 { font-size: 15px; line-height: 17px; letter-spacing: .06em; }
.arrival { margin-top: 22px; font-size: 15px; line-height: 22px; }
.hero h1 {
  margin-top: 20px; font-size: 38px; line-height: 41px;
  font-weight: 700; letter-spacing: -.02em;
}
.subline { margin-top: 14px; }
/* Not in the design: 6px extra clearance so the headline's first line never meets the stamp when there is no arrival line */
@media (max-width: 959px) { .hero .stamp-wrap + h1 { margin-top: 26px; } }
.hero .form-slot { margin-top: 22px; }

/* Headline variants: picked before first paint, never swapped after load */
.hv { display: none; }
html:not([data-hv]) .hv1, [data-hv="1"] .hv1, [data-hv="2"] .hv2, [data-hv="3"] .hv3 { display: inline; }

/* Load motion */
.em-anim { display: inline-block; animation: wobble .4s ease-out .15s both; }
.hl {
  display: inline-block;
  background-image: linear-gradient(#D1FE17, #D1FE17);
  background-repeat: no-repeat;
  background-position: 0 70%;
  background-size: 100% 78%;
  animation: swipe .3s ease-out .55s both;
}
@keyframes wobble { 0% { transform: scale(.92); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes kick {
  0% { transform: rotate(-10deg) scale(1.08); opacity: 0; }
  60% { transform: rotate(-6deg) scale(.98); opacity: 1; }
  100% { transform: rotate(-7deg) scale(1); }
}
@keyframes swipe { from { background-size: 0 78%; } to { background-size: 100% 78%; } }
@media (prefers-reduced-motion: reduce) { .em-anim, .stamp, .hl { animation: none; } }

/* What you'll get */
.get { display: flex; flex-direction: column; gap: 20px; }
.get-row { display: flex; gap: 14px; align-items: flex-start; }

/* Read today's memo */
.preview { display: flex; flex-direction: column; gap: 22px; }
.issue-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.issue-meta { display: flex; flex-direction: column; gap: 8px; }
.issue-num { font: 400 40px/44px var(--font-stamp); }
.issue-h { font-size: 23px; line-height: 27px; font-weight: 700; letter-spacing: -.02em; }
.d-only { display: none; }

/* Recent memos */
.recent { display: flex; flex-direction: column; gap: 12px; }
.recent-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.recent-list { border-bottom: 1px solid var(--ink); }
.recent-list li {
  display: grid; grid-template-columns: 62px minmax(0, 1fr); column-gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--ink);
}
.recent-date { font: 400 18px/24px var(--font-stamp); text-transform: uppercase; }
.recent-title { font-size: 17px; line-height: 24px; }

/* Second signup */
.repeat { display: flex; flex-direction: column; gap: 16px; }
.repeat-h { font-size: 30px; line-height: 35px; font-weight: 700; letter-spacing: -.02em; }

/* Footer */
.foot { display: flex; flex-direction: column; gap: 14px; }
.video { color: var(--ink-2-text); font-size: 15px; line-height: 22px; }
.video-links { display: flex; flex-wrap: wrap; column-gap: 14px; }
.video-links a {
  display: flex; align-items: center; gap: 5px; min-height: 44px;
  color: var(--ink-2-text); text-underline-offset: 3px;
}
.legal {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px;
  padding-top: 8px; border-top: 1px solid var(--ink);
  font-size: 13px; line-height: 18px; color: var(--ink-2-text);
}
.legal a { display: flex; align-items: center; min-height: 44px; color: var(--ink-2-text); text-underline-offset: 3px; }

/* Narrow phones: keep the stamp clear of the wordmark */
@media (max-width: 359px) {
  .wordmark span { font-size: 21px; }
  .stamp-wrap { width: 72px; height: 72px; }
  .stamp-in { top: 6px; right: 6px; bottom: 6px; left: 6px; }
  .stamp-1 { font-size: 20px; line-height: 22px; }
  .stamp-2 { font-size: 12px; line-height: 14px; }
}

/* ---------- Desktop landing (from 960px) ---------- */
@media (min-width: 960px) {
  .ht-hero { height: 420px; }
  .ht-hero.is-short { height: 240px; }
  .landing {
    display: grid; max-width: 1160px; padding: 28px 20px;
    grid-template-columns: minmax(0, 560px) minmax(0, 480px);
    justify-content: center; column-gap: 72px; row-gap: 64px;
  }
  .landing > .hero { grid-column: 1; grid-row: 1; align-self: center; }
  .landing > .preview { grid-column: 2; grid-row: 1; align-self: center; }
  .landing > .get, .landing > .recent, .landing > .repeat, .landing > .foot {
    grid-column: 1 / -1; justify-self: center; width: 100%; max-width: 560px;
  }
  .landing > .get { margin-top: 24px; } /* 64 + 24 = 88px below the top section */

  .landing .wordmark { font-size: 26px; line-height: 32px; }
  .landing .kicker { font-size: 14px; line-height: 20px; }
  .stamp-wrap { width: 104px; height: 104px; }
  .stamp-in { top: 8px; right: 8px; bottom: 8px; left: 8px; }
  .stamp-1 { font-size: 28px; line-height: 30px; }
  .stamp-2 { font-size: 17px; line-height: 19px; }
  .hero h1 { margin-top: 44px; font-size: 56px; line-height: 60px; }
  .arrival { max-width: calc(100% - 116px); } /* keep clear of the 104px stamp */
  .hero .subline { margin-top: 18px; font-size: 19px; line-height: 27px; }
  .hero .form-slot { margin-top: 28px; }

  .landing .section-h { font-size: 30px; line-height: 36px; }
  .repeat-h { font-size: 36px; line-height: 41px; }

  .preview .m-only { display: none; }
  .preview .d-only { display: block; }
  .preview .clip > article { padding: 28px; gap: 14px; }
  .preview .issue-top { display: block; }
  .preview .issue-meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .preview .issue-num { display: none; }
  .preview-h2 { font-size: 17px; line-height: 24px; font-weight: 700; }
  .preview .issue-h { font-size: 28px; line-height: 32px; }

  .foot .video { display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; }
}

/* ---------- Sample issue (/today) ---------- */
.article {
  position: relative; display: flex; flex-direction: column; gap: 18px;
  max-width: 620px; margin: 0 auto; padding: 20px 20px 28px;
}
.issue-header {
  display: flex; flex-direction: column; gap: 14px; padding: 16px 0 18px;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
}
.issue-header .issue-num { font-size: 44px; line-height: 48px; }
.issue-header h1 { font-size: 36px; line-height: 40px; font-weight: 700; letter-spacing: -.02em; }
.issue-body { display: flex; flex-direction: column; gap: 16px; font-size: 18px; line-height: 27px; }
.chart {
  display: flex; flex-direction: column; gap: 12px; margin: 4px 0; padding: 16px;
  background: var(--paper-2); border: 1px dashed var(--ink);
}
.chart figcaption { display: flex; flex-direction: column; gap: 2px; }
.chart-title { font-size: 17px; line-height: 24px; font-weight: 700; }
.bars { display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 20px; }
.bar-label { display: flex; justify-content: space-between; gap: 4px; }
.bar-track { height: 14px; margin-top: 4px; border: 2px solid var(--ink); background: var(--field); }
.bar-fill { height: 10px; }
.takeaway .rcard-body { gap: 6px; padding: 18px 20px; }
.takeaway h2 { font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -.02em; }
.takeaway p { font-size: 18px; line-height: 27px; }
.issue-signup { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.issue-signup .lede { margin-top: -6px; }

/* ---------- Full-page success ---------- */
.page {
  position: relative; display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto; padding: 20px;
}
.done-icon { margin-top: 72px; }
.done-h { margin-top: 20px; font-size: 42px; line-height: 46px; font-weight: 700; letter-spacing: -.02em; }
.done-p { margin-top: 16px; font-size: 19px; line-height: 27px; }
.done-resend { margin-top: 24px; }
.done-sent { margin-top: 4px; }
.done-next { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--ink); }

/* ---------- Privacy placeholder ---------- */
.prose { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }
.prose h1 { font-size: 38px; line-height: 41px; font-weight: 700; letter-spacing: -.02em; }
.prose h2 { margin-top: 12px; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.02em; }

/* ---------- Sponsor form (/sponsor) ---------- */
.sform { display: flex; flex-direction: column; gap: 16px; margin: 8px 0 0; }
.sfield { display: flex; flex-direction: column; gap: 6px; }
.sfield label { font: 400 14px/20px var(--font-mono); color: var(--ink-2-text); }
.sfield input, .sfield select, .sfield textarea {
  width: 100%; min-height: 52px; margin: 0; padding: 12px 14px;
  background: var(--field); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 12px;
  font: 500 17px/24px var(--font-body);
  -webkit-appearance: none; appearance: none;
}
.sfield textarea { min-height: 132px; resize: vertical; }
.sfield select {
  padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat;
}
.sfield input:focus, .sfield select:focus, .sfield textarea:focus { outline: 3px solid var(--ink); outline-offset: 2px; }
.sfield .is-invalid { border-color: var(--error); }
.sfield .small { margin-top: -2px; }
[hidden] { display: none !important; }
