/* IR Lens landing page — extends the digest email aesthetic:
   paper #f6f5f2, Georgia serif, ink #1a1a1a, hairlines #e4e1da. */

:root {
  --paper: #f6f5f2;
  --ink: #1a1a1a;
  --muted: #6b665c;
  --hairline: #e4e1da;
  --accent: #7d2b20; /* oxblood — interactive states only */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--paper); }

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- masthead ---------------------------------------------------------- */

.masthead { padding-top: 3rem; text-align: center; }

/* Newspaper double rule: thick over thin. */
.masthead-rule {
  border-top: 3px solid var(--ink);
  padding-top: 3px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 2.25rem;
}

.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.masthead h1 {
  font-size: clamp(3.25rem, 10vw, 4.5rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0 0 0.5rem;
  line-height: 1.05;
}

.identity {
  font-style: italic;
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.lede {
  text-align: left;
  margin: 0 auto 2rem;
  max-width: 36rem;
}

.toc {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 0.7rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.6rem;
}

.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---- signup ------------------------------------------------------------ */

.subscribe { padding: 2.5rem 0 2.75rem; text-align: center; }

.subscribe .kicker { margin-bottom: 1.1rem; }

.signup-row {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

#email {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--hairline);
  padding: 0.65em 0.9em;
  width: min(20rem, 100%);
}

#email:focus {
  outline: none;
  border-color: var(--ink);
}

#email::placeholder { color: var(--muted); font-style: italic; }

button[type="submit"] {
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  padding: 0.65em 1.6em;
  cursor: pointer;
}

button[type="submit"]:hover { background: var(--accent); border-color: var(--accent); }
button[type="submit"]:disabled { opacity: 0.5; cursor: default; }

#storyline-picker {
  border: 1px solid var(--hairline);
  background: #fff;
  margin: 1.1rem auto 0;
  padding: 1rem 1.4rem 1.2rem;
  max-width: 28rem;
  text-align: left;
}

#storyline-picker legend {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.6em;
}

.pick {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  padding: 0.35em 0;
  cursor: pointer;
}

.pick input {
  accent-color: var(--accent);
  width: 1em;
  height: 1em;
  flex: none;
  position: relative;
  top: 0.1em;
}

#form-status { min-height: 1.4em; margin: 0.9rem 0 0; font-style: italic; color: var(--accent); }

.signup-done { font-style: italic; margin: 0.5rem 0; }

.fine-print { font-size: 0.85rem; color: var(--muted); margin: 0.35rem 0 0; }

/* Honeypot: off-screen, never display:none (some bots skip hidden inputs). */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---- sections ---------------------------------------------------------- */

section { border-top: 1px solid var(--hairline); padding: 2.75rem 0 1rem; }

.subscribe { border-top: 1px solid var(--hairline); }

.section-no {
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  color: var(--muted);
  text-align: center;
  margin: 0 0 0.4rem;
}

.section-head h2 {
  font-size: 1.9rem;
  font-weight: 400;
  text-align: center;
  margin: 0 0 1.25rem;
}

.section-intro {
  font-style: italic;
  color: var(--muted);
  max-width: 34rem;
  margin: 0 auto 2.25rem;
  text-align: center;
}

/* storylines */

.storyline { margin: 0 0 2.25rem; }

.storyline h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.storyline .index {
  display: inline-block;
  min-width: 1.4em;
  color: var(--muted);
  font-weight: 400;
  font-style: italic;
}

.storyline p { margin: 0 0 0.5rem; }

.meta {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* storyline temperature gauges (see storyline-temperature-spec.md) */

.gauge { margin: 0.35rem 0 1rem; max-width: 30rem; }

/* Flat, quiet track; the level is a solid oxblood fill — no gradient. */
.gauge-track {
  position: relative;
  height: 9px;
  background: var(--hairline);
}

.gauge-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--accent);
}

/* The week's movement, in the same axis as the value:
   heating → the newly gained segment burns darker than the rest;
   cooling → the lost segment lingers as a pale remnant past the fill. */
.gauge-delta { position: absolute; top: 0; bottom: 0; }
.gauge-delta.heating { background: #4f1712; }
.gauge-delta.cooling { background: var(--accent); opacity: 0.22; }

.gauge-tick {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--ink);
  transform: translateX(-1px);
}

.gauge-bands {
  display: flex;
  margin: 0.35rem 0 0;
  font-size: 0.6rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.gauge-bands span { flex: 1; text-align: center; }

/* Trend word beside the storyline title: italic serif, newspaper-style. */
.gauge-trend {
  font-style: italic;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--muted);
  margin-left: 0.2em;
}

/* sources */

.source-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 2.5rem;
  max-width: 30rem;
  margin: 0 auto 1.5rem;
}

.source-list li {
  padding: 0.3em 0;
  border-bottom: 1px solid var(--hairline);
  break-inside: avoid;
}

@media (min-width: 560px) {
  .source-list { columns: 3; max-width: none; }
}

/* frameworks */

.framework { margin: 0 0 2rem; }

.framework h3 { font-size: 1.2rem; font-weight: 700; margin: 0 0 0.4rem; }

.framework p { margin: 0; }

/* how it works */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3.4rem;
  margin: 0 0 1.75rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.35rem;
  font-size: 2.4rem;
  font-style: italic;
  color: var(--hairline);
  -webkit-text-stroke: 1px var(--muted);
}

.steps h3 { font-size: 1.15rem; font-weight: 700; margin: 0 0 0.25rem; }

.steps p { margin: 0; }

/* colophon */

.colophon { margin-top: 2rem; }

.colophon .masthead-rule { margin-bottom: 1rem; }

.colophon p {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: center;
}

.powered-by {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.powered-by a { text-decoration: none; color: inherit; }
.powered-by a:hover { color: var(--accent); text-decoration: underline; }

/* ---- wide screens ------------------------------------------------------ */

/* On desktop the page opens up to ~1060px: section numeral + heading move
   into a sticky left margin column (journal marginalia), while the prose
   keeps a readable measure on the right. Mobile keeps the single column. */
@media (min-width: 960px) {
  body { font-size: 18px; }

  .page { max-width: 1060px; }

  .masthead { padding-top: 4rem; }

  .masthead h1 { font-size: 5.25rem; }

  .lede { max-width: 40rem; }

  section {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    column-gap: 4rem;
    padding: 3.5rem 0 1.5rem;
  }

  /* The signup CTA stays a centered band under the masthead. */
  .subscribe { display: block; }

  .section-head {
    position: sticky;
    top: 2.5rem;
    align-self: start;
  }

  .section-no,
  .section-head h2 {
    text-align: left;
  }

  .section-body { max-width: 44rem; }

  .section-intro {
    text-align: left;
    margin-left: 0;
    max-width: none;
  }
}

/* ---- motion ------------------------------------------------------------ */

@media (prefers-reduced-motion: no-preference) {
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
  }

  .masthead > * { animation: rise 0.6s ease both; }
  .masthead > *:nth-child(2) { animation-delay: 0.06s; }
  .masthead > *:nth-child(3) { animation-delay: 0.12s; }
  .masthead > *:nth-child(4) { animation-delay: 0.18s; }
  .masthead > *:nth-child(5) { animation-delay: 0.24s; }
  .masthead > *:nth-child(6) { animation-delay: 0.3s; }

  #storyline-picker:not([hidden]) { animation: rise 0.35s ease both; }
}
