/* ============================================================
   Solto — the "day in the life" takeover
   A clickable box (in the Home hero) Flip-expands into a full-page
   overlay you step through (intro → SAE → COO; COO flips dark),
   then collapses back to the box via Finish / Esc / close.
   Tabs-pattern a11y; no-JS shows it inline & readable.
   ============================================================ */

/* --- The entry box (lives under the hero headline) --- */
.storm-enter {
  position: relative; overflow: hidden;
  appearance: none; -webkit-appearance: none; text-align: left; cursor: pointer;
  /* translucent glass — recedes so the headline stays the focal point */
  background: color-mix(in oklab, var(--blush) 13%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--cream);
  --display-fg: var(--blush); --faint-fg: var(--cream-faint);
  border: 1px solid color-mix(in oklab, var(--blush) 26%, transparent); border-radius: 12px;
  padding: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  width: 100%; max-width: 27rem;
  margin-top: clamp(4.5rem, 3rem + 6.5vw, 9.5rem);
  display: grid; gap: 0.9rem;
  transition: background-color var(--dur-hover) var(--ease-soft), border-color var(--dur-hover) var(--ease-soft), transform var(--dur-hover) var(--ease-soft);
}
.storm-enter:hover {
  background: color-mix(in oklab, var(--blush) 20%, transparent);
  border-color: color-mix(in oklab, var(--blush) 42%, transparent);
  transform: translateY(-3px);
}
.enter-title { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.2rem); color: var(--cream); line-height: 0.98; }
.begin {
  font-family: var(--font-mono); font-size: var(--type-mono); letter-spacing: var(--tracking-mono);
  text-transform: uppercase; color: var(--blush); display: inline-flex; align-items: center; gap: 0.5rem;
}
.begin .arrow { transition: transform var(--dur-hover) var(--ease-soft); }
.storm-enter:hover .begin .arrow { transform: translateX(5px); }

/* shared counter */
.counter {
  font-family: var(--font-mono); font-size: var(--type-mono); letter-spacing: var(--tracking-mono);
  color: var(--faint-fg); font-variant-numeric: tabular-nums;
}
.counter .cur { color: var(--display-fg); }

/* --- The overlay (full-page takeover) --- */
.storm-overlay {
  position: fixed; inset: 0; z-index: 60;
  overflow-y: auto; overscroll-behavior: contain;
}
.storm-overlay[hidden] { display: none; }
/* Inner wrapper: centers the panel when it fits, and grows so the overlay
   scrolls (top + controls always reachable) when the scene is taller. */
.storm-inner {
  position: relative; z-index: 1;
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(2rem, 6vh, 5rem) clamp(1rem, 3vw, 3rem);
}
.storm-backdrop { position: fixed; inset: 0; background: var(--ground); }
.overlay-close {
  position: fixed; top: clamp(1rem, 2.5vw, 2rem); right: clamp(1rem, 2.5vw, 2rem); z-index: 2;
  width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid var(--hairline-dark);
  background: none; color: var(--cream); cursor: pointer; display: grid; place-items: center; font-size: 1.15rem;
  transition: border-color var(--dur-hover) var(--ease-soft), color var(--dur-hover) var(--ease-soft);
}
.overlay-close:hover { border-color: var(--blush); color: var(--blush); }

/* --- The blush inset panel (steps) --- */
.panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 62rem;
  background: var(--blush); color: var(--ink);
  --page-fg: var(--ink); --display-fg: var(--ground);
  --muted-fg: color-mix(in oklab, var(--ink) 78%, var(--blush));
  --faint-fg: color-mix(in oklab, var(--ink) 62%, var(--blush)); --rule: rgba(26,26,22,0.16);
  border: 1px solid rgba(26,26,22,0.14); border-radius: 14px;
  box-shadow: 0 40px 80px -42px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.25);
  padding: clamp(2.25rem, 1.5rem + 4vw, 4.5rem);
  min-height: clamp(24rem, 56svh, 36rem);
  display: flex; flex-direction: column; gap: var(--space-lg);
  transition: background-color 0.6s var(--ease-soft), border-color 0.6s var(--ease-soft), color 0.6s var(--ease-soft);
}
.panel.is-dark {
  background: var(--ground); color: var(--cream);
  --page-fg: var(--cream); --display-fg: var(--blush);
  --muted-fg: var(--cream-muted);
  --faint-fg: color-mix(in oklab, var(--cream) 58%, var(--ground)); --rule: var(--hairline-dark);
  border-color: var(--hairline-dark);
}

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.panel-title {
  flex: 1 1 auto; text-align: center;
  font-size: 0.95rem; font-weight: 500; color: var(--page-fg);
}
@media (max-width: 719px) { .panel-title { display: none; } }
.ticks { display: flex; gap: 0.5rem; align-items: center; }
/* The button is a transparent ≥24px-tall hit area (WCAG 2.5.8); the visible
   3px bar is drawn by ::before so the visual stays exactly as before. */
.tick {
  display: flex; align-items: center;
  width: 26px; height: 24px; padding: 0; border: none; background: transparent; cursor: pointer;
  transition: width var(--dur-hover) var(--ease-soft);
}
.tick::before {
  content: ""; display: block; width: 100%; height: 3px; border-radius: 2px;
  background: var(--rule);
  transition: background-color var(--dur-hover) var(--ease-soft);
}
.tick[aria-selected="true"] { width: 46px; }
.tick[aria-selected="true"]::before { background: var(--display-fg); }

.steps { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; }
.step { position: relative; }
.step[hidden] { display: none; }

.who { margin-bottom: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem); }
.timestamp {
  display: block; font-family: var(--font-mono); font-size: var(--type-mono);
  letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--faint-fg); margin-bottom: 0.5rem;
}
.role { display: block; font-size: clamp(1.3rem, 1.05rem + 1vw, 1.9rem); color: var(--display-fg); line-height: 1; }

/* --- The scene as timestamped beats down a time rail --- */
.beats {
  list-style: none; margin: 0; padding: 0 0 0 1.4rem;
  position: relative;
  display: grid; gap: clamp(1.15rem, 0.9rem + 1vw, 1.7rem);
}
.beats::before {   /* the rail — first node down to the last */
  content: ''; position: absolute; left: 0.2rem; top: 0.55em; bottom: 1em;
  width: 1px; background: var(--rule);
}
.beat {
  position: relative;
  display: grid; grid-template-columns: 3.4rem minmax(0, 1fr);
  column-gap: clamp(0.9rem, 0.6rem + 1vw, 1.6rem); align-items: start;
}
.beat::before {   /* node on the rail */
  content: ''; position: absolute; left: -1.4rem; top: 0.42em;
  width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--display-fg);
}
.beat-time {
  font-family: var(--font-mono); font-size: var(--type-mono); letter-spacing: 0.08em;
  color: var(--faint-fg); font-variant-numeric: tabular-nums; padding-top: 0.3em;
}
.beat-lead { font-weight: 600; font-size: clamp(1.08rem, 1rem + 0.4vw, 1.28rem); line-height: 1.4; color: var(--page-fg); max-width: 52ch; }
.beat-sub { margin-top: 0.3rem; font-size: clamp(0.98rem, 0.95rem + 0.2vw, 1.08rem); line-height: 1.5; color: var(--muted-fg); max-width: 52ch; }
/* the closing beat — the punchline, set in the display color */
.beat--close .beat-lead { color: var(--display-fg); }

.panel-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.panel-cue {
  font-family: var(--font-mono); font-size: var(--type-mono); letter-spacing: var(--tracking-mono);
  text-transform: uppercase; color: var(--faint-fg);
}
.foot-actions { display: flex; gap: 0.6rem; align-items: center; }
.nav-btn {
  width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid var(--rule);
  background: none; color: var(--page-fg); cursor: pointer; display: grid; place-items: center; font-size: 1.05rem;
  transition: border-color var(--dur-hover) var(--ease-soft), color var(--dur-hover) var(--ease-soft);
}
.nav-btn:hover:not(:disabled) { border-color: var(--display-fg); color: var(--display-fg); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
/* Finish — appears on the last step, collapses the takeover */
.finish-btn {
  font-family: var(--font-body); font-weight: 600; font-size: 1rem; line-height: 1;
  color: var(--ground-deep); background: var(--blush); border: none; border-radius: var(--radius);
  padding: 0.85rem 1.4rem; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem;
  transition: background-color var(--dur-hover) var(--ease-soft);
}
.finish-btn:hover { background: var(--blush-bright); }
.finish-btn[hidden] { display: none; }

/* No-JS: show the panel inline & readable, all steps stacked. */
.no-js .storm-enter { display: none; }
.no-js .storm-overlay, .no-js .storm-overlay[hidden] { position: static; display: block; padding: 0; }
.no-js .storm-inner { display: block; min-height: auto; padding: 0; }
.no-js .storm-backdrop, .no-js .overlay-close, .no-js .panel-foot, .no-js .ticks { display: none; }
.no-js .panel { min-height: auto; max-width: none; }
.no-js .step[hidden] { display: block; margin-top: var(--space-xl); }

@media (max-width: 859px) {
  .panel { padding: clamp(1.75rem, 1.25rem + 4vw, 2.5rem); min-height: auto; }
}
@media (max-width: 479px) {
  .beat { grid-template-columns: 1fr; row-gap: 0.15rem; }
  .beat-time { padding-top: 0; }
}
