/* ---------------------------------------------------------------
   Shared stylesheet for the newsletter family.
   Each page sets --accent + --accent-ink in an inline <style> block.
   --------------------------------------------------------------- */

:root {
  --paper: #edeff3;
  --surface: #ffffff;
  --ink: #141d2b;
  --ink-soft: #55637a;
  --ink-faint: #8a95a8;
  --rule: #d3d8e2;
  --rule-soft: #e4e8ee;
  --accent: #1f4fd8;
  --accent-ink: #ffffff;

  --sans: "Bricolage Grotesque", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 2rem 0 0;
}

.wordmark {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}

.wordmark .mark {
  width: 0.7rem;
  height: 0.7rem;
  background: var(--accent);
  border-radius: 1px;
  display: inline-block;
}

.cadence {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}

/* ------------------------------ hero ---------------------------- */

.hero {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: 1fr;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

@media (min-width: 62rem) {
  .hero { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
}

.pitch h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 1rem;
  max-width: 16ch;
}

.pitch .lead {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin: 0 0 1.9rem;
  max-width: 40ch;
}

/* ------------------------------ form ---------------------------- */

.signup {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 30rem;
}

.signup input[type="email"] {
  flex: 1 1 14rem;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

.signup input[type="email"]::placeholder { color: var(--ink-faint); }

.signup button {
  flex: 0 0 auto;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.4rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: 3px;
  cursor: pointer;
}

.signup button:hover { filter: saturate(1.15) brightness(0.94); }

.terms {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin: 0.85rem 0 0;
}

.form-note {
  font-size: 0.92rem;
  margin: 0.9rem 0 0;
  color: var(--accent);
  font-weight: 600;
}

.form-note:empty { margin: 0; }

/* ------------------------------ specimen ------------------------ */

.specimen {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

.specimen-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--rule-soft);
  background: #f7f8fa;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.specimen-body { padding: 0.4rem 1.1rem 1.1rem; }

.row { padding: 1rem 0; border-bottom: 1px solid var(--rule-soft); }
.row:last-child { border-bottom: 0; padding-bottom: 0.4rem; }

.row-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  align-items: baseline;
  justify-content: space-between;
}

.row-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.row-head h3 .sub {
  font-weight: 400;
  color: var(--ink-soft);
}

.stat {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.row-desc {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  max-width: 52ch;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.row-meta span {
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.12rem 0.4rem;
}

.sev {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

/* diff specimen (Redline) */
.diff {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.7;
  margin: 0.4rem 0 0;
  overflow-x: auto;
}

.diff div { padding: 0.05rem 0.5rem; white-space: pre-wrap; }
.diff .del { background: #fbe9e7; color: #8c2f22; }
.diff .add { background: #e6f4ec; color: #14603f; }
.diff .ctx { color: var(--ink-faint); }
.diff .hunk { color: var(--ink-soft); font-weight: 600; }

/* ------------------------------ detail -------------------------- */

.detail {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: 1fr;
  padding: clamp(2rem, 5vw, 3rem) 0;
  border-top: 1px solid var(--rule);
}

@media (min-width: 48rem) {
  .detail { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
}

.detail h2 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}

.contents { margin: 0; }
.contents dt { font-weight: 700; font-size: 0.95rem; }
.contents dd {
  margin: 0.15rem 0 1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  max-width: 46ch;
}

.sources {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.sources li {
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--rule);
}

.sources li:last-child { border-bottom: 0; }

/* ------------------------------ siblings ------------------------ */

.siblings { padding: clamp(2rem, 5vw, 3rem) 0; border-top: 1px solid var(--rule); }

.siblings h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 1.2rem;
}

.sib-grid {
  display: grid;
  gap: 0.6rem 1.6rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.sib {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.92rem;
}

.sib:hover { border-bottom-color: var(--ink); }

.sib .dot {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 1px;
}

.sib b { font-weight: 700; }
.sib span.what { color: var(--ink-soft); }

footer.foot {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

/* ------------------------------ index page ---------------------- */

.index-hero { padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3rem); }

.index-hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  margin: 0 0 1rem;
  max-width: 18ch;
}

.index-hero p {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 48ch;
  margin: 0;
}

.titles {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 3rem;
}

@media (min-width: 46rem) {
  .titles { grid-template-columns: repeat(2, 1fr); }
}

.title-card {
  background: var(--surface);
  padding: 1.5rem 1.4rem;
  text-decoration: none;
  display: block;
}

.title-card:hover { background: #f7f8fa; }

.title-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.title-card h2 .dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 1px;
  flex: 0 0 auto;
}

.title-card p {
  margin: 0 0 0.7rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
  max-width: 40ch;
}

.title-card .feed {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
}

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