/* ───── Hero ──────────────────────────────────────────────────────────── */
.hero {
  padding-top: var(--hero-top);
  padding-bottom: var(--space-3xl);
}
.hero-track {
  max-width: var(--max-hero);
  margin: 0 auto;
}

.hero-headline {
  font-family: var(--display-font);
  font-weight: 700;
  font-size: var(--step-6);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
  /* `text-wrap: pretty` is friendlier than `balance` on narrow viewports —
     `balance` aims for equal line widths and on small screens that can
     produce a "winner" line wider than the container. `pretty` only
     touches the last few lines. overflow-wrap is the belt-and-braces
     guarantee that no single long word can push the document past the
     viewport width. */
  text-wrap: pretty;
  overflow-wrap: break-word;
}
.hero-lede {
  font-family: var(--body-font);
  font-weight: 400;
  font-size: var(--step-2);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  margin: var(--space-m) 0 0 0;
  max-width: 36ch;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

/* ───── Accordion ─────────────────────────────────────────────────────── */
.accordion {
  background: var(--accent);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.acc-h2 { margin: 0; }
.acc-item + .acc-item {
  border-top: 1px solid var(--rule);
}
.acc-trigger {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: filter var(--duration-quick) var(--ease-standard);
}
.acc-trigger:hover { filter: brightness(0.97); }
.acc-trigger:focus-visible {
  box-shadow: inset 0 0 0 2px var(--ink);
}
.acc-trigger-row {
  max-width: var(--max-hero);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-m);
  padding-block: var(--space-m);
  min-width: 0;
}
.acc-chevron {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  color: var(--ink);
  transition: transform var(--duration-slow) var(--ease-standard);
}
.acc-trigger[aria-expanded="true"] .acc-chevron {
  transform: rotate(180deg);
}
.acc-num {
  font-family: var(--mono-font);
  font-weight: 700;
  font-size: var(--step-2);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 2.5ch;
}
.acc-title {
  font-family: var(--display-font);
  font-weight: 400;
  font-size: var(--step-2);
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.acc-panel {
  /* Open accordion items reveal their reading area on the page off-white
     layer (--bg), distinct from the accent-blue trigger row above. The
     reveal reads as: "header strip" → "reading panel". When the panel
     is collapsed (max-height: 0) the colour is invisible. */
  background: var(--bg);
  overflow: hidden;
  transition: max-height var(--duration-slow) var(--ease-standard),
              opacity var(--duration-slow) var(--ease-standard);
  max-height: 0;
  opacity: 0;
}
.acc-panel.is-open {
  opacity: 1;
}
.acc-panel-inner {
  max-width: var(--max-hero);
  margin: 0 auto;
  padding-left: calc(24px + var(--space-m));
  padding-right: 0;
  padding-top: var(--space-m);     /* breathing room from the trigger row */
  padding-bottom: var(--space-l);
}
.acc-body {
  font-family: var(--body-font);
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--ink);
  max-width: 60ch;
  margin: 0;
}
.acc-body + .acc-body { margin-top: 0.5em; }
@media (prefers-reduced-motion: reduce) {
  .acc-panel, .acc-chevron { transition: none; }
}

/* ───── Newsletter ────────────────────────────────────────────────────── */
.newsletter {
  background: var(--accent);
  padding-block: var(--space-3xl);
}
.news-track {
  max-width: var(--max-hero);
  margin: 0 auto;
}
.news-title {
  font-family: var(--display-font);
  font-weight: 400;
  font-size: var(--font-news-title);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 var(--space-2xs) 0;
  overflow-wrap: break-word;
}
.news-intro {
  font-family: var(--body-font);
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 var(--space-l) 0;
  max-width: 56ch;
  overflow-wrap: break-word;
}
.news-form {
  display: grid;
  gap: var(--space-s);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

/* News-submit: form-context button matches input metrics so the submit-cell
   reads as the rightmost field cell, not a pill floating above. */
.news-submit {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  font-size: var(--font-form-input);
  line-height: 1.4;
}
.news-submit-cell { align-self: end; }

/* Newsletter success state — the "moment" after a valid submit.
   White card on the accent layer; check rendered confidently at 40 px so
   it carries presence next to the section-heading-scale title. Stroke
   1.5 (vs. the global 1.25) is a deliberate one-off — this check earns
   its weight as a celebration mark, not a UI affordance. */
.news-success {
  display: flex;
  align-items: flex-start;
  gap: var(--space-m);
  padding: var(--space-l);
  background: var(--bg-card);
  border: 1px solid var(--rule);
  color: var(--ink);
}
.news-success-mark {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  color: var(--ok);
  margin-top: 2px;          /* baseline-nudge against title cap-height */
}
.news-success-title {
  font-family: var(--display-font);
  font-weight: 700;
  font-size: var(--step-2);
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 var(--space-2xs) 0;
}
.news-success-body {
  font-family: var(--body-font);
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
  max-width: 60ch;
}
.news-success-body + .news-success-body {
  margin-top: var(--space-2xs);
}
.news-success-body--mute {
  color: var(--ink-mute);
  font-size: var(--step--1);
}
.news-success-link-row {
  margin: var(--space-m) 0 0 0;
}
.news-success-link {
  font-family: var(--body-font);
  font-size: var(--step-0);
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-thickness var(--duration-quick) var(--ease-standard);
}
.news-success-link:hover {
  text-decoration-thickness: 2px;
}

@media (max-width: 720px) {
  .news-track { padding-left: 0; }
  .news-form { grid-template-columns: 1fr; }
  .news-form .news-submit-cell { align-self: stretch; }
}

/* Narrow-viewport typography. The fluid clamps in tokens.css scale well
   from ~480px upward, but at 320–480px the natural minimum is still wide
   enough that long display lines ("Things I'm working on…") can exceed
   the inset-padded viewport. Below 480px we step the hero down to a
   fixed scale and zero out negative tracking, which would otherwise
   shave a few painful pixels at the cost of legibility. */
@media (max-width: 480px) {
  .hero-headline {
    font-size: 2rem;          /* 32px — large but never clips at 320–479px */
    line-height: 1.08;
    letter-spacing: 0;
  }
  .hero-lede {
    font-size: 1.0625rem;     /* 17px */
    letter-spacing: 0;
  }
  .news-title {
    font-size: 1.875rem;      /* 30px */
    letter-spacing: -0.01em;
  }
}
