/* ==========================================================================
   Redesign layer: Home. Loads after r-base.css on index.html only.
   Hero = one founder each side, the cover line centred between them,
   one note on top whose arrow forks out to both heads (drawn in main.js).
   ========================================================================== */

/* 1. Hero. --fork-stem / --fork-drop are read by main.js: stem length, and split → heads.
   Side columns are at least the wider cutout (643 × 1600 → 0.402), so both match and the middle stays centred. */
.rh { --fig-h: clamp(340px, 30vw, 500px); --fork-stem: 40px; --fork-drop: 110px; position: relative; display: grid; grid-template-columns: minmax(calc(var(--fig-h) * 0.402), 1fr) minmax(0, 720px) minmax(calc(var(--fig-h) * 0.402), 1fr); grid-template-areas: "a mid b"; align-items: end; column-gap: var(--s-6); max-width: 1280px; margin-inline: auto; padding: calc(var(--fork-stem) + var(--fork-drop) + 56px) var(--margin) 0; }
.rh .figure { position: relative; z-index: 1; width: auto; }
.rh__fig img { height: var(--fig-h); width: auto; max-width: none; }
.rh__fig--a { grid-area: a; justify-self: start; }
.rh__fig--b { grid-area: b; justify-self: end; }
.rh__mid { grid-area: mid; align-self: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-5); text-align: center; padding-bottom: calc(var(--fig-h) * 0.5); }
.rh__title { line-height: 0.96; text-wrap: balance; }
.rh__title br { display: none; }
.rh .rule { width: 40px; }
.rh .lead { max-width: 32ch; text-wrap: balance; }
.rh .duo-fork { z-index: 2; }

/* Up to 900: no room at the sides, so the cover line comes first and the two stand together under the note */
@media (max-width: 900px) {
  .rh { --fig-h: 440px; --fork-stem: 28px; --fork-drop: 44px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "mid mid" "a b"; column-gap: var(--s-6); row-gap: calc(var(--fork-stem) + var(--fork-drop) + 72px); padding-top: var(--s-8); }
  .rh__fig--a { justify-self: end; }
  .rh__fig--b { justify-self: start; }
  .rh__mid { padding-bottom: 0; }
  .rh .lead { max-width: 34ch; }
}
@media (max-width: 760px) {
  .rh { --fig-h: 330px; column-gap: var(--s-5); padding-top: var(--s-6); }
  .rh__mid { gap: var(--s-4); }
  .rh__title { font-size: min(64px, calc((100vw - 2 * var(--margin)) / 6.2)); white-space: nowrap; }
  .rh .duo-fork__text { font-size: 22px; }
}
@media (max-width: 360px) { .rh { --fig-h: 290px; } }

/* Hero: a text cursor after "source" that blinks (on/off, no fade). Opacity only, so nothing moves. */
.rh__dot { display: inline-block; width: 0.035em; height: 0.86em; margin-left: 0.07em; background: currentColor; vertical-align: -0.1em; animation: rh-blink 1.1s steps(1, end) infinite; }
@keyframes rh-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .rh__dot { animation: none; } }

/* Hero title as an editor line (r-home.js): deleted letters only hide, so the line never reflows.
   The cursor takes no width of its own (negative margin), so moving it doesn't nudge the letters either. */
.rh__title { cursor: text; -webkit-tap-highlight-color: transparent; }
.rh__ch.is-gone { visibility: hidden; }
.rh__dot { margin-right: -0.105em; }
.rh__title.is-editing .rh__dot { animation: none; opacity: 1; }   /* solid while typing, like a real editor */
/* the underline erases from the right while the title is deleted, and draws back once it's retyped */
/* the pen underline erases while the title is being deleted and draws back when it is typed back (r-home.js) */
html.n-anim .rh__mid .n-layer g.is-in.ul-off path { stroke-dashoffset: 1; transition: stroke-dashoffset 450ms cubic-bezier(0.45, 0, 0.25, 1); }

/* Hero v3: one sentence, the last words underlined by hand (r-notes.js draws the .n-ul) */
.rh__mid:has(.rh__big) { container-type: inline-size; }
.rh__big { font-family: var(--text); font-weight: 500; font-size: clamp(26px, 7.4cqi, 60px); line-height: 1.12; letter-spacing: -0.025em; white-space: nowrap; margin: 0; }   /* lines break only at the <br>s; the size follows the column so the longest line always fits */
.rh__big { text-align: center; width: max-content; max-width: 100%; }   /* centred lines; the block is only as wide as its longest line */
.rh__br-d { display: inline; }
@media (min-width: 901px) { .rh__big { margin-top: clamp(32px, 5svh, 64px); } }   /* the sentence sits a little under the heads, not level with them */
@media (min-width: 901px) { .rh:has(.rh__big) { grid-template-columns: minmax(calc(var(--fig-h) * 0.402), 1fr) minmax(0, 820px) minmax(calc(var(--fig-h) * 0.402), 1fr); } }   /* a wider middle for the bigger sentence */
html.n-anim .rh__mid .n-layer g.is-in path { transition: stroke-dashoffset 1.1s cubic-bezier(.4, 0, .2, 1) .5s; }   /* the pen starts a beat after the page shows, slow enough to watch */
.rh__br { display: none; }
@media (max-width: 600px) { .rh__big { font-size: 7.1cqi; margin-top: 16px; text-align: left; align-self: flex-start; } }   /* phone: the same two lines, sized to the width; starts 48px under the bar and on the page margin, like the Stories and Posts headings */
