/* ============================================================
   home.css — homepage sections
   Hero cover, What I Do ledger, Work catalog plates, Writing
   spread + index, Now logbook, Contact envelope.
   ============================================================ */

/* ---------- Hero — the magazine cover ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: calc(var(--masthead-h) + 40px) var(--space-2xl);
  position: relative;
}

.cover-strip {
  position: relative;
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: var(--space-m);
  font-family: var(--font-mono);
  font-size: var(--text-folio);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cover-strip::before,
.cover-strip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  background: var(--rule-ink);
  transform-origin: left center;
}

.cover-strip::before { top: 0; height: 3px; }
.cover-strip::after { top: 7px; height: 1px; }

.js .cover-strip::before,
.js .cover-strip::after {
  transform: scaleX(0);
  animation: rule-draw 900ms var(--ease-out) 150ms forwards;
}

.js .cover-strip::after { animation-delay: 300ms; }

@keyframes rule-draw {
  to { transform: scaleX(1); }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  margin-top: clamp(40px, 7vh, 80px);
}

/* masked line-rise entrance */
.hero-line { display: block; overflow: hidden; }
.hero-line > span { display: block; }

.js .hero-line > span {
  transform: translateY(112%);
  animation: line-rise 950ms var(--ease-out) forwards;
  animation-delay: calc(250ms + var(--line-i, 0) * 90ms);
}

@keyframes line-rise {
  to { transform: translateY(0); }
}

.hero-eyebrow { margin-bottom: var(--space-m); }

.hero-eyebrow a {
  color: inherit;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: left calc(100% - 0.02em);
}

.hero-eyebrow a:hover { color: var(--copper); }

.hero-name {
  font-size: var(--text-display);
  font-weight: 340;
  line-height: 0.88;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.hero-name em {
  font-style: italic;
  font-weight: 300;
}

.hero-lede {
  margin-top: var(--space-l);
  font-size: var(--text-lede);
  line-height: 1.6;
  color: var(--ink);
  max-width: 44ch;
}

.hero-deck {
  margin-top: var(--space-s);
  font-size: var(--text-body);
  line-height: 1.7;
  color: var(--ink-3);
  max-width: 52ch;
}

.hero-actions {
  margin-top: var(--space-l);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m) var(--space-l);
}

/* contents card — "in this issue" */
.hero-contents {
  background: var(--surface-1);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 28px 28px;
}

.js .hero-contents {
  opacity: 0;
  transform: translateY(10px);
  animation: card-in 800ms var(--ease-out) 900ms forwards;
}

@keyframes card-in {
  to { opacity: 1; transform: none; }
}

.hero-contents-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-ink);
  font-family: var(--font-mono);
  font-size: var(--text-folio);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}

.hero-contents-head span:last-child { color: var(--copper-text); }

.hero-contents-list li + li { border-top: 1px solid var(--rule-soft); }

.hero-contents-list a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 2px;
  transition: padding-left 250ms var(--ease-out);
}

.hero-contents-list a:hover,
.hero-contents-list a:focus-visible { padding-left: 8px; }

.hero-contents-list .toc-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--copper-text);
}

.hero-contents-list .toc-label {
  font-size: 16px;
  color: var(--ink);
}

.hero-contents-list .toc-arrow {
  margin-left: auto;
  color: var(--ink-4);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--dur-fast) ease, transform 250ms var(--ease-out);
}

.hero-contents-list a:hover .toc-arrow,
.hero-contents-list a:focus-visible .toc-arrow {
  opacity: 1;
  transform: none;
  color: var(--copper-text);
}

.hero-contents-stats {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-m);
}

.hero-contents-stats .stat-num {
  display: block;
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--copper);
  font-variant-numeric: tabular-nums;
}

.hero-contents-stats .stat-cap {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.6;
}

/* scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-4);
  writing-mode: vertical-rl;
}

.scroll-cue-line {
  width: 1px;
  height: 44px;
  background: var(--rule);
  position: relative;
  overflow: hidden;
}

.scroll-cue-line::after {
  content: "";
  position: absolute;
  left: 0;
  top: -100%;
  width: 100%;
  height: 100%;
  background: var(--copper);
  animation: cue-drop 2.4s var(--ease-out) infinite;
}

@keyframes cue-drop {
  0% { top: -100%; }
  55%, 100% { top: 100%; }
}

/* ---------- 01 · What I Do — ruled ledger ---------- */

.ledger {
  margin-top: var(--space-xl);
  border-top: 1px solid var(--rule);
}

.ledger-row {
  position: relative;
  display: grid;
  grid-template-columns: 110px 170px minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: var(--space-m) var(--space-l);
  align-items: start;
  padding: 34px 18px 34px 12px;
  border-bottom: 1px solid var(--rule);
  transition: background var(--dur-fast) ease;
}

.ledger-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--copper);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 350ms var(--ease-out);
}

.ledger-row:hover { background: var(--surface-1); }
.ledger-row:hover::before { transform: scaleY(1); }

.ledger-num {
  font-family: var(--font-serif);
  font-size: 88px;
  font-weight: 300;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px var(--rule);
  transition: color 350ms ease, -webkit-text-stroke-color 350ms ease;
}

.ledger-row:hover .ledger-num {
  color: var(--copper);
  -webkit-text-stroke: 1px var(--copper);
}

.ledger-label {
  font-family: var(--font-mono);
  font-size: var(--text-folio);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 10px;
}

.ledger-title {
  font-size: var(--text-h3);
  font-weight: 380;
  font-style: italic;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
}

.ledger-copy {
  color: var(--ink-2);
  line-height: 1.7;
  max-width: 46ch;
}

/* stat strip */
.stat-strip {
  margin-top: var(--space-xl);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-l);
  border-top: 1px solid var(--rule-ink);
}

.stat {
  padding-top: 18px;
}

.stat-value {
  font-size: var(--text-numeral);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--copper);
  font-variant-numeric: tabular-nums;
}

.stat-caption {
  margin-top: 12px;
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  max-width: 24ch;
}

.stat-note {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-folio);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- 02 · Work — catalog plates ---------- */

.plates {
  margin-top: var(--space-xl);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-m);
}

.plate {
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 28px 24px;
  transition: border-color var(--dur-fast) ease, transform 300ms var(--ease-out);
}

.plate:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.plate-folio {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--font-mono);
  font-size: var(--text-folio);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.plate-marker {
  width: 6px;
  height: 6px;
  background: var(--copper);
}

.plate-impact {
  margin-top: 20px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.plate-impact-num {
  font-size: 54px;
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--copper);
  font-variant-numeric: tabular-nums;
  background-image: linear-gradient(var(--copper), var(--copper));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 400ms var(--ease-out);
  padding-bottom: 6px;
}

.plate:hover .plate-impact-num { background-size: 100% 2px; }

.plate-impact-num .unit {
  font-size: 24px;
  letter-spacing: -0.01em;
}

.plate-impact-cap {
  font-family: var(--font-mono);
  font-size: var(--text-folio);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.plate-stamp-row { margin-top: 20px; padding-bottom: 6px; }

.plate-title {
  margin-top: 16px;
  font-size: var(--text-h3);
  font-weight: 380;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
}

.plate-sub {
  margin-top: 6px;
  font-style: italic;
  font-size: 16px;
  color: var(--ink-3);
}

.plate-summary {
  margin-top: 14px;
  color: var(--ink-2);
  line-height: 1.7;
}

.plate-metrics {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--rule-soft);
}

.plate-metrics > div {
  padding: 12px 14px;
}

.plate-metrics > div + div { border-left: 1px solid var(--rule-soft); }

.plate-metrics dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.plate-metrics dd {
  margin-top: 6px;
  font-size: 19px;
  font-weight: 400;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.plate-tools {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plate-tools li {
  font-family: var(--font-mono);
  font-size: var(--text-folio);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 4px 9px;
}

.plate.is-dev .plate-tools li { border-color: var(--verdigris); color: var(--verdigris-text); }

.plate-toggle {
  margin-top: auto;
  padding-top: 20px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--text-folio);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper-text);
}

.plate-toggle .icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1;
  transition: transform 300ms var(--ease-out);
}

.plate.is-open .plate-toggle .icon { transform: rotate(45deg); }

.plate-story {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 420ms var(--ease-out);
}

.plate.is-open .plate-story { grid-template-rows: 1fr; }

.plate-story-inner { overflow: hidden; }

.plate-story-inner p {
  margin-top: 16px;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--copper);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
}

.plate-story-inner sup {
  color: var(--copper-text);
  font-family: var(--font-mono);
  font-size: 10px;
  margin-right: 6px;
}

/* ---------- 03 · Writing — spread + index ---------- */

.spread {
  margin-top: var(--space-xl);
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--space-l);
  background: var(--surface-1);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: clamp(24px, 3.4vw, 44px);
  transition: border-color var(--dur-fast) ease, transform 300ms var(--ease-out);
}

.spread:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.spread-rail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding-right: var(--space-m);
  border-right: 1px solid var(--rule-soft);
}

.spread-date {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list li {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 3px 8px;
}

.spread-title {
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 320;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 20ch;
}

.spread-title .draw-target {
  background-image: linear-gradient(var(--copper), var(--copper));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: left calc(100% - 0.04em);
  transition: background-size 400ms var(--ease-out);
}

.spread:hover .draw-target,
.spread:focus-visible .draw-target { background-size: 100% 2px; }

.spread-excerpt {
  margin-top: 18px;
  font-size: var(--text-lede);
  line-height: 1.65;
  color: var(--ink-3);
  max-width: 54ch;
}

.spread-cta {
  margin-top: 24px;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper-text);
}

.spread-cta .arrow { transition: transform 250ms var(--ease-out); }
.spread:hover .spread-cta .arrow { transform: translateX(6px); }

.post-index {
  margin-top: var(--space-m);
  border-top: 1px solid var(--rule);
}

.post-index li { border-bottom: 1px solid var(--rule); }

.post-index a {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: var(--space-m);
  padding: 22px 6px;
  transition: background var(--dur-fast) ease;
}

.post-index a:hover,
.post-index a:focus-visible { background: var(--surface-1); }

.post-index-date {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.post-index-title {
  font-size: 22px;
  font-weight: 380;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--ink);
  background-image: linear-gradient(var(--copper), var(--copper));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: left calc(100% - 0.08em);
  transition: background-size 350ms var(--ease-out);
  padding-bottom: 2px;
}

.post-index a:hover .post-index-title { background-size: 100% 1px; }

.post-index-tags {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  white-space: nowrap;
}

.post-index-arrow {
  color: var(--ink-4);
  transition: transform 250ms var(--ease-out), color var(--dur-fast) ease;
}

.post-index a:hover .post-index-arrow {
  transform: translateX(6px);
  color: var(--copper-text);
}

/* ---------- 04 · Now — the logbook ---------- */

.section-head-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-l);
  align-items: end;
}

.clock {
  text-align: right;
  font-family: var(--font-mono);
  color: var(--ink-3);
}

.clock-place {
  display: block;
  font-size: var(--text-folio);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.clock-time {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  letter-spacing: 0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-height: 1.2em;
}

.clock-date {
  display: block;
  margin-top: 2px;
  font-size: var(--text-folio);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.log {
  margin-top: var(--space-xl);
  border-top: 1px solid var(--rule-ink);
}

.log-row {
  display: grid;
  grid-template-columns: 150px 220px minmax(0, 1fr) auto;
  gap: var(--space-m) var(--space-l);
  align-items: start;
  padding: 28px 6px;
  border-bottom: 1px solid var(--rule);
  transition: background var(--dur-fast) ease;
}

.log-row:hover { background: var(--surface-1); }

.log-label {
  font-size: 20px;
  font-weight: 380;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
}

.log-text {
  color: var(--ink-2);
  line-height: 1.7;
  max-width: 52ch;
}

.log-date {
  font-family: var(--font-mono);
  font-size: var(--text-folio);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 6px;
}

/* toolkit */
.toolkit { margin-top: var(--space-xl); }

.toolkit-cols {
  margin-top: var(--space-m);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-l);
}

.toolkit-col-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-ink);
  font-family: var(--font-mono);
  font-size: var(--text-folio);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper-text);
}

.toolkit-col li {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 17px;
  color: var(--ink-2);
  position: relative;
  padding-left: 0;
  transition: padding-left 250ms var(--ease-out), color var(--dur-fast) ease;
}

.toolkit-col li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--copper);
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
}

.toolkit-col li:hover {
  padding-left: 18px;
  color: var(--ink);
}

.toolkit-col li:hover::before { opacity: 1; }

/* ---------- 05 · Contact — the envelope ---------- */

.contact-inner {
  position: relative;
  text-align: center;
  padding: clamp(40px, 6vw, 72px) var(--space-m);
}

.contact-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--rule);
  pointer-events: none;
}

.envelope-wrap {
  width: min(440px, 100%);
  margin: 28px auto 0;
}

.envelope-wrap svg {
  width: 100%;
  height: auto;
  overflow: visible;
  margin-inline: auto;
}

.contact-title {
  margin-top: 16px;
  font-size: var(--text-h2);
  font-weight: 320;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.contact-title em { font-style: italic; color: var(--copper); }

.contact-dek {
  max-width: 46ch;
  margin: 20px auto 36px;
  font-style: italic;
  font-size: var(--text-lede);
  line-height: 1.65;
  color: var(--ink-3);
}

.contact-email {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: clamp(14px, 2vw, 17px);
  letter-spacing: 0.1em;
  color: var(--copper-text);
  border-bottom: 1px solid var(--copper);
  padding-bottom: 5px;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.contact-email:hover,
.contact-email:focus-visible { color: var(--copper); }

.contact-meta {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 32px;
  font-family: var(--font-mono);
  font-size: var(--text-folio);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.contact-meta a { color: var(--ink-2); }
.contact-meta a:hover, .contact-meta a:focus-visible { color: var(--copper-text); }

/* envelope animation — rest state is "delivered": letter away, badge on.
   transform-box: view-box makes the px transform-origins mean viewBox
   coordinates in every browser (Safari/Firefox included). The badge sits
   inside a positioning <g translate(324 124)> and animates around its own
   center so the keyframe transform can't erase its placement. */
.letter-card,
.envelope,
.front-pocket,
.receive-halo,
.spark,
.env-shadow { transform-box: view-box; }

.letter-card { opacity: 0; transform-origin: 250px 120px; }
.letter-line { stroke-dasharray: 88; stroke-dashoffset: 0; opacity: 0; }
.envelope { transform-origin: 250px 218px; }
.front-pocket { transform-origin: 250px 222px; }
.receive-halo { opacity: 0; transform-origin: 250px 212px; }
.received-badge { opacity: 1; transform-box: fill-box; transform-origin: center; }
.spark { opacity: 0; }
.env-shadow { transform-origin: 250px 282px; opacity: 0.16; }

.is-playing .letter-card { animation: letter-slide 4.8s var(--ease-out) infinite; }
.is-playing .letter-line { animation: write-line 4.8s ease-in-out infinite; }
.is-playing .letter-line.two { animation-delay: 0.08s; }
.is-playing .letter-line.three { animation-delay: 0.16s; }
.is-playing .envelope { animation: envelope-settle 4.8s ease-in-out infinite; }
.is-playing .front-pocket { animation: pocket-breathe 4.8s ease-in-out infinite; }
.is-playing .receive-halo { animation: receive-halo 4.8s ease-out infinite; }
.is-playing .received-badge { animation: badge-pop 4.8s var(--ease-out) infinite; }
.is-playing .spark { animation: spark 4.8s ease-out infinite; }
.is-playing .spark.two { animation-delay: 0.1s; }
.is-playing .spark.three { animation-delay: 0.2s; }
.is-playing .env-shadow { animation: shadow-breathe 4.8s ease-in-out infinite; }

@keyframes letter-slide {
  0%, 10% { opacity: 0; transform: translateY(-64px) rotate(-3deg) scale(0.96); }
  18%, 48% { opacity: 1; transform: translateY(-8px) rotate(0deg) scale(1); }
  64%, 76% { opacity: 1; transform: translateY(74px) rotate(0deg) scale(0.96); }
  82%, 100% { opacity: 0; transform: translateY(92px) rotate(0deg) scale(0.92); }
}

@keyframes write-line {
  0%, 18% { stroke-dashoffset: 88; opacity: 0; }
  27%, 50% { stroke-dashoffset: 0; opacity: 1; }
  66%, 100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes envelope-settle {
  0%, 48%, 100% { transform: translateY(0); }
  63%, 78% { transform: translateY(-4px); }
}

@keyframes pocket-breathe {
  0%, 48%, 100% { transform: translateY(0); }
  64%, 74% { transform: translateY(2px); }
}

@keyframes receive-halo {
  0%, 62% { opacity: 0; transform: scale(0.72); }
  70% { opacity: 0.22; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.32); }
}

@keyframes badge-pop {
  0%, 66% { opacity: 0; transform: scale(0.64) translateY(7px); }
  74%, 88% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(0.95) translateY(-4px); }
}

@keyframes spark {
  0%, 66% { opacity: 0; transform: translateY(8px) scale(0.7); }
  74%, 84% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-10px) scale(0.8); }
}

@keyframes shadow-breathe {
  0%, 48%, 100% { transform: scaleX(1); opacity: 0.16; }
  63%, 78% { transform: scaleX(0.9); opacity: 0.1; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-contents { max-width: 480px; }
}

@media (max-width: 900px) {
  .ledger-row {
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas:
      "num label"
      "num title"
      "num copy";
    padding-inline: 8px;
  }
  .ledger-num { grid-area: num; font-size: 56px; }
  .ledger-label { grid-area: label; padding-top: 4px; }
  .ledger-title { grid-area: title; }
  .ledger-copy { grid-area: copy; }

  .stat-strip { grid-template-columns: 1fr; gap: var(--space-m); }
  .stat { border-top: 1px solid var(--rule); padding-top: 16px; }
  .stat:first-child { border-top: none; }

  .plates { grid-template-columns: 1fr; }

  .spread { grid-template-columns: 1fr; gap: var(--space-m); }
  .spread-rail {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--rule-soft);
    padding: 0 0 16px;
  }

  .post-index a {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "date arrow"
      "title arrow"
      "tags arrow";
    gap: 8px var(--space-m);
  }
  .post-index-date { grid-area: date; }
  .post-index-title { grid-area: title; }
  .post-index-tags { grid-area: tags; white-space: normal; }
  .post-index-arrow { grid-area: arrow; align-self: center; }

  .section-head-split { grid-template-columns: 1fr; align-items: start; }
  .clock { text-align: left; }

  .log-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .log-date { padding-top: 0; }

  .toolkit-cols { grid-template-columns: 1fr; gap: var(--space-m); }

  .scroll-cue { display: none; }

  .ghost-num { font-size: clamp(110px, 26vw, 180px); top: 0.1em; }
}
