/* ============================================================
   The Robin Cam — foundation styles
   Design direction: plan §3 (warm living storybook).
   This is the FOUNDATION: tokens locked, structure + motion in place.
   The Phase 5 showpiece pass polishes on top of this — see PHASE5-PLAN.md.
   ============================================================ */

:root {
  /* Palette — derived from the robin (plan §3) */
  --robin-egg:     #7FD4C1;   /* hero color, the literal egg */
  --morning-cream: #FBF6EC;   /* background, dawn light */
  --robin-breast:  #E8743B;   /* terracotta accent, the joy color, CTAs */
  --nest-brown:    #3D2E26;   /* primary text (warm, never cold black) */
  --dawn-gold:     #F4C95D;   /* highlights, live pulse, egg glow */
  --soft-sky:      #BFE6DD;   /* subtle fills, card tints */

  /* Derived tints */
  --cream-deep:   #F3EAD7;
  --ink-soft:     #6B574B;
  --card-bg:      #FFFFFF;
  --hairline:     #ECE0CC;
  --terracotta-ink: #A8481C;  /* AA-safe terracotta for SMALL text on cream/white (≥5.4:1); --robin-breast stays for decorative/large */

  /* Type */
  --display: "Lora", Georgia, "Times New Roman", serif;
  --body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Rhythm */
  --maxw: 940px;
  --radius: 22px;
  --radius-lg: 34px;
  --shadow: 0 18px 50px -24px rgba(61, 46, 38, 0.35);
  --shadow-soft: 0 10px 30px -18px rgba(61, 46, 38, 0.28);
  --gap: clamp(1.25rem, 4vw, 2.5rem);

  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);

  --day: 0.5;   /* 0 = night, 1 = midday; set from the viewer's local clock (app.js) */
}

/* ---- reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* must win over component display rules */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--nest-brown);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--soft-sky) 0%, transparent 60%),
    var(--morning-cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
h1, h2, p { margin: 0; }

/* ---- accessibility ---- */
.skip-link {
  position: absolute; left: 50%; top: -3rem; transform: translateX(-50%);
  background: var(--nest-brown); color: var(--morning-cream);
  padding: 0.6rem 1rem; border-radius: 0 0 12px 12px; z-index: 100;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }
:focus-visible {
  outline: 3px solid var(--robin-breast);
  outline-offset: 3px;
  border-radius: 6px;
}
.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Privacy-first: with JS on, keep the live page hidden until site.json confirms
   "live" — so content never flashes before the kill switch can apply, and a stale/
   unreachable control doc fails CLOSED to the veil. With JS off, .js is absent so the
   static page shows (see the <noscript> in the video frame). */
html.js body[data-site="pending"] .page,
html.js body[data-site="private"] .page { visibility: hidden; }

/* ---- layout ---- */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(0.5rem, 2vw, 1.1rem) clamp(1rem, 4vw, 2rem) 4rem;
}

/* ---- masthead ---- */
.masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.35rem 0 0.5rem;
}
.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  color: var(--nest-brown);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.masthead__brand { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; }
.masthead__greeting {
  font-family: var(--display); font-style: italic; font-weight: 500;
  font-size: 0.82rem; color: var(--ink-soft); letter-spacing: 0.005em;
}
.masthead__right { display: flex; align-items: center; gap: 0.75rem; }

.live-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: rgba(232, 116, 59, 0.12);
  color: var(--nest-brown);            /* AA on the pale fill; the breathing dot carries the terracotta */
  font-weight: 700; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.4rem 0.7rem 0.4rem 0.6rem; border-radius: 999px;
}
.live-pill[data-live="false"] { background: rgba(107, 87, 75, 0.1); color: var(--ink-soft); }
.live-pill__dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--robin-breast);
  box-shadow: 0 0 0 0 rgba(232, 116, 59, 0.55);
  animation: breathe 2.4s ease-in-out infinite;
}
.live-pill[data-live="false"] .live-pill__dot { background: var(--ink-soft); animation: none; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 116, 59, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(232, 116, 59, 0); }
}

/* ---- hero ---- */
.hero { text-align: center; padding: 0; }
.hero__eyebrow {
  font-family: var(--body); font-weight: 700;
  font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--terracotta-ink);
  margin: 0 0 0.45rem;
}
.hero__narration {
  font-family: var(--display);
  font-weight: 500;                 /* variable Lora, a medium cut for a touch more presence at display size */
  font-optical-sizing: auto;        /* (inert for Lora: no opsz axis, kept as harmless future-proofing) */
  font-size: clamp(1.5rem, 8vw, 3.5rem);   /* ramps smoothly 320px→desktop, no binary step */
  line-height: 1.06;
  letter-spacing: -0.022em;
  color: var(--nest-brown);
  max-width: 15ch;                  /* a deliberately narrow measure — reads like a line of verse */
  margin: 0 auto clamp(0.7rem, 2.2vw, 1.15rem);
  padding-inline: 0.5rem;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);   /* faint lift off the cream */
  transition: opacity 0.3s ease, transform 0.45s var(--ease-spring), filter 0.3s ease;
}
.hero__narration.is-swapping { opacity: 0; transform: translateY(8px); filter: blur(2px); }
/* the fresh sentence "sets" like ink — a brief terracotta bloom that resolves */
@keyframes inkSettle {
  from { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 7px rgba(168, 72, 28, 0.28); }
  to   { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 0 rgba(168, 72, 28, 0); }
}
@media (prefers-reduced-motion: no-preference) {
  .hero__narration.is-fresh { animation: inkSettle 0.6s ease; }
}

/* ---- THE CLUTCH — a CSS nest cup cradling the eggs (the showpiece) ---- */
.clutch {
  width: min(86%, 340px);
  margin: 0.1rem auto clamp(0.6rem, 2vw, 1rem);
}
.clutch__cup {
  position: relative;
  aspect-ratio: 5 / 1.55;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: clamp(8px, 2.4vw, 16px);
  border-radius: 46% 46% 48% 48% / 24% 24% 78% 78%;
  background:
    radial-gradient(110% 70% at 50% 0%, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0) 55%),
    /* woven layers: concentric rings curving around a centre below the bowl */
    repeating-radial-gradient(58% 82% at 50% 130%,
      rgba(43, 32, 24, 0) 0 7px, rgba(43, 32, 24, 0.30) 7px 9px, rgba(134, 98, 67, 0.10) 9px 15px),
    radial-gradient(120% 135% at 50% -12%, #7a5c43 0%, #573f2e 48%, #38291f 100%);
  box-shadow:
    inset 0 16px 24px -12px rgba(0, 0, 0, 0.6),
    inset 0 -10px 16px -10px rgba(255, 232, 190, 0.16),
    0 16px 26px -16px rgba(61, 46, 38, 0.55);
  overflow: hidden;
  isolation: isolate;
}
/* warm light pooling under the eggs — strength driven by --glow (time-aware later) */
.clutch__glow {
  position: absolute; left: 50%; bottom: -8%;
  width: 72%; height: 78%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--dawn-gold), rgba(244, 201, 93, 0) 62%);
  /* warm at night, faded at noon — solves the "empty nest = dead page" problem */
  opacity: calc(0.5 * (1 - var(--day)) + 0.06);
  z-index: 0; pointer-events: none;
  transition: opacity 1.2s ease;
}
.clutch__eggs {
  position: relative; z-index: 1;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: clamp(2px, 1vw, 6px);
}
.clutch__slot { display: block; line-height: 0; }
.clutch__slot + .clutch__slot { margin-left: clamp(-10px, -1.8vw, -4px); }   /* nestle / overlap */
.clutch__slot:nth-child(1) { transform: rotate(-9deg) translateY(1px); }
.clutch__slot:nth-child(2) { transform: rotate(4deg)  translateY(3px); }
.clutch__slot:nth-child(3) { transform: rotate(-3deg) translateY(3px); }
.clutch__slot:nth-child(4) { transform: rotate(8deg)  translateY(1px); }
.clutch__slot:nth-child(5) { transform: rotate(-6deg) translateY(0); }
.clutch__egg {
  width: clamp(30px, 8.5vw, 46px); height: auto; display: block;
  filter: drop-shadow(0 3px 3px rgba(43, 32, 24, 0.4));
}
/* a hatched egg becomes a little hatchling in the cup (its slot opens the hatch photo);
   drawn in the robin-egg palette, a touch larger than an egg so the chick reads. */
.clutch__hatchling { width: clamp(34px, 9.5vw, 52px); }
/* the signature beat: a fresh egg drops in, the cup glows once and takes a deeper breath */
@keyframes eggSettle {
  0%   { transform: translateY(-46px) scale(0.86); opacity: 0; }
  55%  { transform: translateY(4px)  scale(1.05); opacity: 1; }
  78%  { transform: translateY(-2px) scale(0.99); }
  100% { transform: translateY(0)    scale(1); }
}
.clutch__egg.settle { animation: eggSettle 0.62s var(--ease-spring) both; }
@keyframes cupBreath { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.035); } }
@keyframes glowPulse {
  0%, 100% { opacity: calc(0.5 * (1 - var(--day)) + 0.06); }
  35%      { opacity: calc(0.5 * (1 - var(--day)) + 0.56); }
}
@keyframes cupIdleBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012); } }
@media (prefers-reduced-motion: no-preference) {
  .clutch__cup { animation: cupIdleBreath 6s ease-in-out infinite; }
  .clutch__cup.is-arriving { animation: cupBreath 0.7s var(--ease-spring); }   /* arrival overrides idle */
  .clutch__cup.is-arriving .clutch__glow { animation: glowPulse 0.7s ease; }
}

/* The first eggs are real photos — their slot becomes a <button>. Strip native chrome so it
   sits identically to the plain <span> slot (rotation/nestle rules are tag-agnostic). */
.clutch__slot--photo {
  -webkit-appearance: none; appearance: none;
  margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.clutch__slot--photo:focus-visible { outline: 2px solid var(--robin-egg); outline-offset: 3px; border-radius: 9px; }
@media (hover: hover) {
  .clutch__slot--photo .clutch__egg { transition: transform 0.22s var(--ease-spring), filter 0.22s ease; }
  .clutch__slot--photo:hover .clutch__egg { transform: translateY(-3px) scale(1.06); filter: drop-shadow(0 6px 7px rgba(43, 32, 24, 0.45)); }
}
.clutch__slot--photo:active .clutch__egg { transform: scale(0.94); }
/* ---- egg photo peek: a small card that floats above a hovered/tapped egg.
   position:fixed + measured off the egg's rect → never shifts the page. ---- */
.egg-peek {
  position: fixed; z-index: 60;
  width: 248px; max-width: calc(100vw - 16px);
  padding: 10px 10px 8px;
  background: var(--card-bg); border-radius: 18px;
  box-shadow: var(--shadow), 0 2px 6px rgba(61, 46, 38, 0.12);
  pointer-events: none; opacity: 0;
  transform: translateY(4px) scale(0.96); transform-origin: bottom center;
  transition: opacity 0.18s ease, transform 0.18s var(--ease-spring);
}
.egg-peek[data-place="below"] { transform-origin: top center; transform: translateY(-4px) scale(0.96); }
.egg-peek.is-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.egg-peek__frame {
  position: relative;
  display: block; overflow: hidden; border-radius: 11px;
  aspect-ratio: 1000 / 620; background: var(--soft-sky);
}
.egg-peek__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.egg-peek.is-open { cursor: zoom-in; }      /* the whole card is clickable to enlarge */
.egg-peek__zoom {
  position: absolute; right: 7px; bottom: 7px;
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-content: center; color: #fff;
  background: rgba(28, 20, 14, 0.5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.egg-peek__cap {
  margin: 8px 4px 1px; text-align: center;
  font-family: var(--display); font-style: italic; font-size: 0.95rem; color: var(--ink-soft);
}

/* ---- full-size egg photo lightbox ---- */
body.has-modal { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: clamp(16px, 4vw, 40px);
  background: rgba(28, 20, 14, 0.85); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.22s ease;
}
.lightbox.is-open { opacity: 1; }
.lightbox__fig {
  margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: min(100%, 1100px); min-width: 0;     /* fit the padded cell; centering stays symmetric */
  transform: scale(0.96); transition: transform 0.26s var(--ease-spring);
}
.lightbox.is-open .lightbox__fig { transform: scale(1); }
.lightbox__img {
  /* size relative to the padded container (NOT vw) so the scrollbar gutter can't offset centering */
  display: block; max-width: 100%; max-height: 80vh; width: auto; height: auto;
  border-radius: 16px; background: var(--soft-sky); box-shadow: 0 40px 90px -24px rgba(0, 0, 0, 0.65);
}
.lightbox__cap {
  margin: 0; text-align: center; color: #f6efe2;
  font-family: var(--display); font-style: italic; font-size: clamp(1.05rem, 3.5vw, 1.3rem);
}
.lightbox__close {
  position: absolute; top: clamp(12px, 3vw, 22px); right: clamp(12px, 3vw, 22px);
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  display: grid; place-content: center; color: #fff;
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background 0.2s ease, transform 0.2s var(--ease-spring);
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.28); transform: scale(1.06); }
.lightbox__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* prev/next arrows (swipe also works) */
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  display: grid; place-content: center; color: #fff;
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background 0.2s ease, transform 0.2s var(--ease-spring);
}
.lightbox__nav--prev { left: clamp(8px, 3vw, 26px); }
.lightbox__nav--next { right: clamp(8px, 3vw, 26px); }
.lightbox__nav:hover { background: rgba(255, 255, 255, 0.28); }
.lightbox__nav:active { transform: translateY(-50%) scale(0.93); }
.lightbox__nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lightbox__dots { display: flex; gap: 8px; justify-content: center; }
.lightbox__dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); transition: background 0.2s ease, transform 0.2s ease; }
.lightbox__dot.is-active { background: #fff; transform: scale(1.15); }
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox__fig, .lightbox.is-open .lightbox__fig { transition: opacity 0.12s linear; transform: none; }
}
.egg-peek::after {
  content: ""; position: absolute; left: var(--arrow-x, 50%);
  width: 14px; height: 14px; background: var(--card-bg);
  transform: translateX(-50%) rotate(45deg);
}
.egg-peek[data-place="above"]::after { bottom: -6px; box-shadow: 3px 3px 6px rgba(61, 46, 38, 0.07); }
.egg-peek[data-place="below"]::after { top: -6px; box-shadow: -3px -3px 6px rgba(61, 46, 38, 0.05); }
@media (prefers-reduced-motion: reduce) {
  .egg-peek, .egg-peek[data-place="below"], .egg-peek.is-open { transition: opacity 0.12s linear; transform: none; }
}

/* ---- the organic video frame ---- */
.stage-frame {
  position: relative; margin: 0 auto; max-width: 820px;
  border-radius: var(--radius-lg);
  padding: clamp(8px, 1.5vw, 14px);
  background: linear-gradient(160deg, #fff 0%, var(--cream-deep) 100%);
  box-shadow: var(--shadow);
}
.stage-frame::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; padding: 1.5px;
  background: linear-gradient(160deg, var(--robin-egg), var(--dawn-gold));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.5; pointer-events: none;
}
.stage-frame__media {
  position: relative; aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius-lg) - 10px);
  overflow: hidden; background: #2a2018;
}
.stage-frame__media iframe { width: 100%; height: 100%; border: 0; display: block; }
/* transparent cover over the iframe so YouTube's chrome can't be hovered back into view */
.stage-frame__cover { position: absolute; inset: 0; z-index: 1; background: transparent; }
/* our own fullscreen toggle — subtle but always visible so it works on touch too */
.stage-frame__fs {
  position: absolute; z-index: 2;
  bottom: clamp(12px, 2.2vw, 18px); right: clamp(12px, 2.2vw, 18px);
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(20, 14, 10, 0.5); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  cursor: pointer; opacity: 0.78;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s var(--ease-spring);
}
.stage-frame__fs:hover { opacity: 1; background: rgba(20, 14, 10, 0.72); transform: scale(1.06); }
.stage-frame__media:fullscreen,
.stage-frame__media:-webkit-full-screen {
  width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; background: #000;
}
.stage-frame__poster {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 0.5rem;
  color: var(--cream-deep); text-align: center;
  background: radial-gradient(circle at 50% 40%, #4a3b30, #2a2018);
}
.stage-frame__poster-bird { font-size: clamp(2.5rem, 8vw, 4rem); }
.stage-frame__live {
  position: absolute; top: clamp(14px, 2.5vw, 22px); right: clamp(14px, 2.5vw, 22px);
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(20, 14, 10, 0.6); color: #fff; backdrop-filter: blur(6px);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.35rem 0.6rem; border-radius: 999px;
}
.stage-frame__live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--robin-breast);
  animation: breathe 2.4s ease-in-out infinite;
}

/* presence as a book-plate caption under the video (Lora italic, centred) */
.presence {
  display: inline-flex; align-items: center; gap: 0.45rem;
  margin: clamp(0.9rem, 2.5vw, 1.4rem) auto 0;
  font-family: var(--display); font-style: italic; font-weight: 500;
  font-size: clamp(0.95rem, 2.4vw, 1.1rem); color: var(--ink-soft);
}
.presence__icon { font-style: normal; transition: transform 0.4s var(--ease-spring); }
.presence[data-present="true"] .presence__icon { transform: translateY(-1px) rotate(-6deg); }

/* ---- cards / sections ---- */
section { margin-top: clamp(2rem, 6vw, 3.5rem); }
.card {
  background: var(--card-bg); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: clamp(1.25rem, 3.5vw, 2rem);
  box-shadow: var(--shadow-soft);
}
.section-title {
  font-family: var(--body); font-weight: 700;
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--terracotta-ink); margin-bottom: 0.85rem;
}

/* ---- stage + journey ---- */
.stage__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.stage__label {
  font-family: var(--display); font-size: clamp(1.25rem, 3.5vw, 1.7rem);
  font-weight: 500; color: var(--nest-brown);
}
.journey {
  list-style: none; margin: 1.25rem 0 0; padding: 0;
  display: flex; gap: 0.3rem;
}
.journey__step {
  flex: 1 1 0; min-width: 0;          /* all six share the width and shrink to fit — never scroll/clip */
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  text-align: center; color: var(--ink-soft);
  font-size: clamp(0.6rem, 2.3vw, 0.74rem); font-weight: 600;
  line-height: 1.15; overflow-wrap: break-word; hyphens: auto;
}
.journey__dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--cream-deep); border: 2px solid var(--hairline);
  position: relative;
}
.journey__step[data-done="true"] .journey__dot { background: var(--soft-sky); border-color: var(--robin-egg); }
.journey__step[data-current="true"] { color: var(--nest-brown); }
.journey__step[data-current="true"] .journey__dot {
  background: var(--robin-breast); border-color: var(--robin-breast);
  box-shadow: 0 0 0 5px rgba(232, 116, 59, 0.18);
}
/* connecting path between the steps; the completed stretch tints to robin-egg */
.journey__step { position: relative; }
.journey__dot { z-index: 1; }
.journey__step::after {
  content: ""; position: absolute; top: 7px; left: 50%; z-index: 0;
  width: calc(100% + 0.3rem); height: 2px; background: var(--hairline);
}
.journey__step:last-child::after { display: none; }
.journey__step[data-done="true"]::after { background: var(--robin-egg); }
@keyframes dotGlow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(232, 116, 59, 0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(232, 116, 59, 0.06); }
}
@media (prefers-reduced-motion: no-preference) {
  .journey__step[data-current="true"] .journey__dot { animation: dotGlow 2.6s ease-in-out infinite; }
}

/* ---- scoreboard ---- */
.scoreboard {
  display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(0.6rem, 2vw, 1rem);
}
.tile {
  flex: 1 1 140px;
  background: var(--card-bg); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: clamp(1rem, 2.5vw, 1.5rem) 0.75rem;
  text-align: center; box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.tile__emoji { font-size: 1.5rem; }
.tile__value {
  font-family: var(--display); font-weight: 600; line-height: 1.05;
  font-size: clamp(1.5rem, 5vw, 2.4rem); color: var(--nest-brown);
  text-wrap: balance; overflow-wrap: break-word;
}
.tile__label { font-size: 0.76rem; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.01em; }

/* ---- explainer ---- */
.explainer__body { font-size: clamp(1rem, 2.5vw, 1.15rem); color: var(--ink-soft); max-width: 60ch; }

/* ---- sparkline ---- */
.sparkline { display: flex; align-items: flex-end; gap: 4px; height: 72px; }
.sparkline__bar {
  flex: 1; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(var(--robin-egg), var(--dawn-gold));   /* sky → golden horizon */
  min-height: 4px; transition: height 0.6s var(--ease-spring);
}
.rhythm__axis {
  display: flex; justify-content: space-between;
  margin-top: 0.5rem; font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.04em; color: var(--ink-soft);
}

/* ---- THE LAST 24 HOURS strip (the rolling-24h rhythm; ported from v2 /new, namespaced
   .rstrip so it doesn't collide with v1's old .rhythm/.sparkline). Bouts are shaded by length
   so a flurry of quick comes-and-gos reads FADED while a long settled sit reads solid + deep. ---- */
.rstrip__note { margin: 0 0 0.95rem; font-size: 0.86rem; line-height: 1.45; color: var(--ink-soft); }
.rstrip { position: relative; height: 74px; }
.rstrip__track { position: absolute; left: 0; right: 0; top: 24px; height: 26px; background: #F1EAD9; border-radius: 8px; }
.rstrip__seg {
  position: absolute; top: 0; bottom: 0; background: #1D9E75;   /* a visit (default) */
  cursor: pointer; transition: background 0.15s ease;
  border: 0; padding: 0; min-width: 6px; border-radius: 3px;
}
.rstrip__seg--quick { background: #9ED9C8; }   /* a quick come-and-go: faded */
.rstrip__seg--sit { background: #0F6E56; }      /* a longer, settled sit: solid + deep */
/* 44px-tall finger target without changing the visual band height. */
.rstrip__seg::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; bottom: -9px; }
.rstrip__seg:hover, .rstrip__seg.is-active { background: #094636; }
.rstrip__seg:focus-visible { outline: none; background: #094636; box-shadow: inset 0 0 0 2px var(--morning-cream); }
.rstrip__now { position: absolute; top: 18px; bottom: 14px; width: 2px; background: var(--robin-breast); }
.rstrip__now-label { position: absolute; top: 0; transform: translateX(-50%); font-size: 0.7rem; color: var(--terracotta-ink); font-weight: 600; }
.rstrip__divider { position: absolute; top: 22px; height: 30px; width: 1px; background: rgba(61, 46, 38, 0.18); }
.rstrip__divider-label { position: absolute; top: 2px; transform: translateX(3px); font-size: 0.62rem; color: var(--ink-soft); white-space: nowrap; }
.rstrip__tip {
  position: absolute; top: 54px; transform: translateX(-50%);
  background: var(--nest-brown); color: var(--morning-cream);
  padding: 5px 9px; border-radius: 8px; font-size: 0.72rem; white-space: nowrap;
  pointer-events: none; z-index: 5; opacity: 0; transition: opacity 0.15s ease;
}
.rstrip__tip.is-on { opacity: 1; }
.rstrip__axis { position: relative; height: 16px; margin-top: 2px; font-size: 0.68rem; color: var(--ink-soft); }
.rstrip__axis span { position: absolute; }
.rstrip__foot { margin: 0.75rem 0 0; font-size: 0.72rem; line-height: 1.4; color: var(--ink-soft); }
.rstrip-empty { margin: 0; padding: 1.4rem 0; text-align: center; font-family: var(--display); font-style: italic; color: var(--ink-soft); font-size: 0.95rem; }
@media (max-width: 480px) {
  .rstrip { height: 80px; }
  .rstrip__track { top: 26px; height: 32px; }
  .rstrip__seg { min-width: 7px; }
  .rstrip__now { top: 22px; bottom: 14px; }
  .rstrip__divider { top: 24px; height: 36px; }
  .rstrip__tip { top: 62px; }
}

/* ---- timeline (a vertical rail of milestones) ---- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 1.15rem; }
.timeline::before {
  content: ""; position: absolute; left: 15px; top: 12px; bottom: 12px;
  width: 2px; background: var(--hairline);
}
.timeline__item { position: relative; padding-left: 2.6rem; }
.timeline__icon {
  position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; display: grid; place-content: center;
  font-size: 1.4rem; line-height: 1;
  background: var(--card-bg); border: 1px solid var(--hairline); border-radius: 50%;
}
/* Egg milestones wear the same robin-egg glyph as the nest cup. Ones we have a photo for
   become a button: hover shows the glance card, click/tap opens the full-size lightbox. */
.timeline__egg { width: 18px; height: auto; display: block; filter: drop-shadow(0 1.5px 1.5px rgba(43, 32, 24, 0.26)); }
.timeline__icon--photo {
  padding: 0; cursor: pointer; background: var(--card-bg);
  -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease, border-color 0.2s ease;
}
.timeline__icon--photo .timeline__egg { transition: transform 0.2s var(--ease-spring); }
@media (hover: hover) {
  .timeline__icon--photo:hover { transform: scale(1.12); box-shadow: 0 5px 14px -5px rgba(61, 46, 38, 0.4); border-color: var(--robin-egg); }
  .timeline__icon--photo:hover .timeline__egg { transform: scale(1.08); }
}
.timeline__icon--photo:active { transform: scale(0.96); }
.timeline__icon--photo:focus-visible { outline: 2px solid var(--robin-egg); outline-offset: 2px; }
/* A gentle one-time "pop" (scale bounce + soft robin-egg ring) as each photo medallion scrolls
   into view, inviting a hover/tap. JS adds .is-noticed once per icon; no fill-mode so the resting
   state and :hover stay intact afterward. Skipped under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .timeline__icon--photo.is-noticed { animation: timelinePhotoPop 0.85s var(--ease-spring); animation-delay: var(--pop-delay, 0s); }
}
@keyframes timelinePhotoPop {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(127, 212, 193, 0); }
  30%  { transform: scale(1.15); box-shadow: 0 5px 14px -5px rgba(61, 46, 38, 0.4), 0 0 0 5px rgba(127, 212, 193, 0.4); border-color: var(--robin-egg); }
  55%  { transform: scale(0.98); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(127, 212, 193, 0); }
}

.timeline__date {
  display: block;
  font-variant-numeric: tabular-nums; font-weight: 700; color: var(--terracotta-ink);
  font-size: 0.78rem; letter-spacing: 0.02em;
}
.timeline__label { display: block; color: var(--nest-brown); margin-top: 0.05rem; }

/* ---- fact ---- */
.fact {
  text-align: center; background: linear-gradient(160deg, var(--soft-sky), var(--morning-cream));
  border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--hairline);
}
.fact__title { color: var(--nest-brown); }
.fact__body { font-family: var(--display); font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 500; max-width: 40ch; margin: 0 auto; }
/* rotating facts: grid-stack every fact in ONE cell so the card height = the tallest
   fact and never reflows when the active one swaps; the rest cross-fade underneath. */
.fact__rotator { display: grid; align-items: center; justify-items: center; }
.fact__rotator > .fact__body { grid-area: 1 / 1; opacity: 0; transition: opacity 0.35s ease; }
.fact__rotator > .fact__body.is-active { opacity: 1; transition: opacity 0.35s ease 0.3s; }
@media (prefers-reduced-motion: reduce) {
  .fact__rotator > .fact__body, .fact__rotator > .fact__body.is-active { transition: none; }
}

/* ---- footer ---- */
.footer { margin-top: clamp(2.5rem, 7vw, 4rem); text-align: center; color: var(--ink-soft); }
.footer__line { font-family: var(--display); font-style: italic; font-size: 1.15rem; }
.footer__sub { font-size: 0.85rem; margin-top: 0.4rem; }
.footer__note { color: var(--terracotta-ink); font-weight: 600; }

/* ---- private veil (kill switch) ---- */
.private-veil { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center;
  background: var(--morning-cream); padding: 2rem; text-align: center; }
.private-veil__card { max-width: 30ch; }
.private-veil__bird { font-size: 3rem; display: block; margin-bottom: 1rem; }
.private-veil p { font-family: var(--display); font-size: clamp(1.2rem, 4vw, 1.6rem); }

/* ---- count-up helper ---- */
[data-countup] { font-variant-numeric: tabular-nums; }

/* ---- entrances ---- */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s var(--ease-spring); }

/* First-paint hero reveal: held until JS sets data-first="ready" (real data in), so the
   loading placeholder never visibly swaps. Opacity applies to everyone; motion users also
   get the rise + stagger (reduced-motion just appears, via the global override below). */
body[data-first="loading"] .hero__eyebrow,
body[data-first="loading"] #narration,
body[data-first="loading"] .clutch,
body[data-first="loading"] .stage-frame,
body[data-first="loading"] .presence { opacity: 0; }
body[data-first="ready"] .hero__eyebrow,
body[data-first="ready"] #narration,
body[data-first="ready"] .clutch,
body[data-first="ready"] .stage-frame,
body[data-first="ready"] .presence { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  /* rise on the text + frame; the clutch only fades (its eggs do their own drop-in settle) */
  body[data-first="loading"] .hero__eyebrow,
  body[data-first="loading"] #narration,
  body[data-first="loading"] .stage-frame,
  body[data-first="loading"] .presence { transform: translateY(14px); }
  body[data-first="ready"] .hero__eyebrow,
  body[data-first="ready"] #narration,
  body[data-first="ready"] .stage-frame,
  body[data-first="ready"] .presence { transform: none; }
  body[data-first="ready"] .hero__eyebrow,
  body[data-first="ready"] #narration,
  body[data-first="ready"] .clutch,
  body[data-first="ready"] .stage-frame,
  body[data-first="ready"] .presence { transition: opacity 0.7s ease, transform 0.8s var(--ease-spring); }
  body[data-first="ready"] #narration  { transition-delay: 0.04s; }
  body[data-first="ready"] .clutch      { transition-delay: 0.12s; }
  body[data-first="ready"] .stage-frame { transition-delay: 0.20s; }
  body[data-first="ready"] .presence    { transition-delay: 0.28s; }
}

/* ---- responsive ---- */
@media (max-width: 620px) {
  .share-btn { padding: 0.4rem 0.85rem; }
}
@media (max-width: 400px) {
  /* keep the whole masthead row on one line at 320px */
  .masthead { gap: 0.5rem; }
  .wordmark { font-size: clamp(1.2rem, 5.4vw, 1.6rem); white-space: nowrap; }
  .masthead__greeting { font-size: 0.72rem; }
  .masthead__right { gap: 0.4rem; }
  .live-pill { padding: 0.35rem 0.5rem; font-size: 0.72rem; }
  .share-btn { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
}
@media (pointer: coarse) {
  .share-btn { min-height: 44px; }   /* comfortable touch target on phones/tablets */
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---- Season retrospective surface: the long-term-stats spotlight + frozen "incubation, by the
   numbers" + heatmap. Shown in "season mode" (body.season-mode), where the live scoreboard and the
   last-24h rhythm are hidden because they go noisy once chicks are in the nest. Scoped to
   .season-mode so the current homepage is unaffected until we promote it. ---- */
.season-mode .scoreboard, .season-mode .rhythm.card, .season-mode .presence { display: none; }
/* Livestream OFF (set data-stream="off" on <body>): hide the video frame, both "Live" pills, and
   the skip-to-video link. Flip to "on" / remove the attribute to bring the live nest back. */
body[data-stream="off"] #live,
body[data-stream="off"] #livePill,
body[data-stream="off"] .skip-link { display: none !important; }
.season__grid, .devotion__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem 1rem; margin-top: .35rem; }
.season__stat, .devotion__stat { text-align: center; padding: .5rem .2rem; }
.season__num { display: block; font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 7vw, 2.5rem); color: var(--nest-brown); line-height: 1; }
.season__lab, .devotion__lab { display: block; font-size: .77rem; color: var(--ink-soft); margin-top: .35rem; font-weight: 600; line-height: 1.3; }
.devotion { background: linear-gradient(180deg, #FFFDF8, #F5EDDD); }
.devotion__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .8rem; }
.devotion__tag { font-size: .64rem; text-transform: uppercase; letter-spacing: .07em; color: var(--terracotta-ink); font-weight: 700; }
.devotion__note { color: var(--ink-soft); font-size: .9rem; line-height: 1.5; margin: .5rem 0 1.1rem; max-width: 54ch; }
.devotion__num { display: block; font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 6vw, 2.1rem); color: var(--nest-brown); line-height: 1; }
.devotion__unit { font-size: .55em; font-weight: 600; margin-left: .08em; color: var(--ink-soft); }
.incheat { margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--hairline); }
.incheat__cap { font-size: .82rem; color: var(--ink-soft); line-height: 1.45; margin: 0 0 .9rem; max-width: 60ch; }
/* Plot = [ day labels | cell grid ], with an hour-axis strip beneath the grid (col 2, row 2). */
.incheat__plot { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .5rem; }
.incheat__days { grid-column: 1; grid-row: 1; display: grid; align-self: stretch; font-size: .62rem; color: var(--ink-soft); }
.incheat__days span { display: flex; align-items: center; justify-content: flex-end; white-space: nowrap; line-height: 1; padding-right: .12rem; letter-spacing: .01em; }
.incheat__grid { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.incheat__cell { aspect-ratio: 1 / 1; border-radius: 2px; background: #F1EAD9; }
.incheat__cell.is-hot { position: relative; z-index: 1; box-shadow: 0 0 0 2px var(--nest-brown); }
.incheat__hours { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(24, 1fr); margin-top: .4rem; font-size: .62rem; color: var(--ink-soft); }
.incheat__hours span { white-space: nowrap; line-height: 1; letter-spacing: .01em; }
.incheat__scale { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; font-size: .7rem; color: var(--ink-soft); }
.incheat__ramp { display: inline-flex; gap: 2px; }
.incheat__ramp i { width: 15px; height: 10px; border-radius: 2px; }
.incheat__tip { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; transform: translate(-50%, -100%);
  background: var(--nest-brown); color: #FBF6EC; padding: .42rem .62rem; border-radius: 9px; max-width: 16rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.28); opacity: 0; transition: opacity .12s ease; }
.incheat__tip[data-place="below"] { transform: translate(-50%, 0); }
.incheat__tip.is-open { opacity: 1; }
.incheat__tip strong { display: block; font-family: var(--display); font-weight: 600; font-size: .84rem; }
.incheat__tip .incheat__tipsub { display: block; font-size: .74rem; opacity: .88; }
/* Hatch markers on the grid: a 🐣 on the exact cell each egg broke out, with the times listed
   below and surfaced in the cell's hover tooltip. */
.incheat__cell--hatch { position: relative; z-index: 2; }
.incheat__hatch { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none;
  font-size: clamp(11px, 2.4vw, 15px); line-height: 1;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, .95)) drop-shadow(0 1px 1px rgba(61, 46, 38, .5)); }
.incheat__tiphatch { display: block; margin-top: .18rem; font-size: .76rem; font-weight: 600; color: var(--dawn-gold); }
.incheat__hatchnote { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .8rem 0 0; font-size: .74rem; color: var(--ink-soft); }
.incheat__hatchitem { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.incheat__hatchemoji { font-size: 1em; }
@media (max-width: 520px) { .incheat__days, .incheat__hours { font-size: .56rem; } }
@media (min-width: 560px) { .season__grid, .devotion__grid { grid-template-columns: repeat(4, 1fr); } }

/* "Trips to the nest" — daily-visits bar chart (season demo). Bars share a baseline; the count
   sits on top, the weekday below. Terracotta to set it apart from the green incubation heatmap. */
.visits__head { display: flex; align-items: baseline; gap: .55rem .8rem; flex-wrap: wrap; }
.visits__tag { text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; font-weight: 700; color: var(--terracotta-ink); }
.visits__note { font-size: .82rem; color: var(--ink-soft); line-height: 1.45; margin: .55rem 0 1.4rem; max-width: 60ch; }
.visits__bars { display: flex; align-items: flex-end; gap: clamp(.35rem, 2.2vw, 1.1rem); padding-top: .5rem; }
.visits__col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.visits__val { font-family: var(--display); font-weight: 600; font-size: clamp(.78rem, 2.4vw, .95rem); color: var(--nest-brown); margin-bottom: .3rem; line-height: 1; }
.visits__bar { width: 100%; max-width: 46px; border-radius: 6px 6px 0 0; transform-origin: bottom;
  background: linear-gradient(180deg, var(--robin-breast), var(--terracotta-ink)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
.visits__day { font-size: clamp(.62rem, 2vw, .72rem); color: var(--ink-soft); margin-top: .45rem; white-space: nowrap; }
/* On narrow screens the columns get too tight for "Jul 3"; show just the day number there. */
@media (max-width: 520px) { .visits__mon { display: none; } }
@keyframes visitsGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: no-preference) {
  .visits.is-in .visits__bar { animation: visitsGrow .6s var(--ease-spring) both; }
  .visits__col:nth-child(2) .visits__bar { animation-delay: .06s; }
  .visits__col:nth-child(3) .visits__bar { animation-delay: .12s; }
  .visits__col:nth-child(4) .visits__bar { animation-delay: .18s; }
  .visits__col:nth-child(5) .visits__bar { animation-delay: .24s; }
  .visits__col:nth-child(6) .visits__bar { animation-delay: .30s; }
  .visits__col:nth-child(7) .visits__bar { animation-delay: .36s; }
}
