/*
 * Landing cinematic scenes (lps-*) — styles for the four demo components in
 * src/views/landing-scenes.ts. Monochrome like the app itself: white surface,
 * ink text, thin borders, square-ish corners. Accents appear only where they
 * appear in the product — section markers (orbit bodies) and the agent's
 * green spark on a write. All motion is opacity/transform on state classes
 * the scene scripts toggle; the scripts also gate on prefers-reduced-motion,
 * and the block at the bottom kills anything that slips through.
 */

/* ── Shared scene chrome ─────────────────────────────────────────────────── */

.lps-card {
  border: var(--border) solid var(--line-soft);
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-4);
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--ink);
  position: relative;
  overflow: hidden; /* chips slide in from the card's own edge, not the page's */
  width: 100%;
}

/* Local twin of the app's .label — scenes must not depend on components.css. */
.lps-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--mono-tracking-wide);
  color: var(--muted);
}

/* Decorative ghost button: believable chrome, deliberately inert. */
.lps-ghost-btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--mono-tracking);
  color: var(--muted);
  background: none;
  border: var(--border) solid var(--line);
  border-radius: var(--radius);
  padding: 2px 8px;
  cursor: default;
}
.lps-ghost-btn--xs { padding: 0 6px; }

/* Agent identity chip — mono caps + the spark glyph, as in the app's presence UI. */
.lps-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--mono-tracking);
  text-transform: uppercase;
  border: var(--border) solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1px 6px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.lps-chip__dot { width: 5px; height: 5px; background: var(--ink-soft); flex: none; }
.lps-spark--green { color: var(--accent-green); } /* the one green moment: an agent wrote */

/* Typing caret (composer) — a solid block that blinks in steps, like a terminal. */
.lps-caret {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--ink);
  vertical-align: -2px;
  animation: lps-blink 1s steps(1) infinite;
}
.lps-caret.is-off { display: none; }
@keyframes lps-blink { 50% { opacity: 0; } }

/* ── Scene 1: the night shift ────────────────────────────────────────────── */

/* Fixed frame (plus a floor for narrow columns) so the 15s loop never shifts
   the page layout, whatever state it is in. 2/1 hugs the content column — the
   fullest frame (filed rows + briefing) measures ~360px at the hero's width;
   4/3 left a third of the card empty. */
.lps-night { aspect-ratio: 2 / 1; min-height: 400px; display: flex; }
.lps-night__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  transition: opacity 0.45s ease;
}
/* Owner asleep: the whole card steps down one shade. */
.lps-night.is-dim .lps-night__inner { opacity: 0.55; }
/* End of loop: gentle fade to black-on-white nothing before the repaint. */
.lps-night__inner.is-reset { opacity: 0; }

.lps-night__head { display: flex; justify-content: space-between; align-items: baseline; }
.lps-night__clock {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  letter-spacing: var(--mono-tracking);
  transition: opacity 0.22s ease;
}
.lps-night__clock.is-swap { opacity: 0; } /* cross-fade half: out, retext, in */

/* The composer: a quiet input line the note types into. Two lines reserved. */
.lps-night__composer {
  border: var(--border) solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  min-height: 56px;
  overflow-wrap: anywhere;
}

/* Pending capture row (¶). Present-but-transparent until Enter lands it. */
.lps-night__pending { min-height: 42px; }
.lps-night__row {
  position: relative;
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  font-size: var(--text-sm);
  padding-right: 88px; /* the parking spot the CLAUDE chip slides into */
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.lps-night__row.is-in { opacity: 1; transform: none; }
.lps-night__row.is-out { opacity: 0; }
.lps-night__pilcrow { font-family: var(--font-mono); color: var(--muted-2); flex: none; }
.lps-night__pending-text { min-width: 0; overflow-wrap: anywhere; }
.lps-night__filing {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lps-night__filing.is-in { opacity: 1; }
/* The agent chip slides in from the card's right edge and parks on the row. */
.lps-night__row .lps-chip {
  position: absolute;
  right: 0;
  top: -2px;
  opacity: 0;
  transform: translateX(48px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.lps-night__row .lps-chip.is-in { opacity: 1; transform: none; }

/* Filed area: two attributed rows slide in as the capture is split. */
.lps-night__filed { display: flex; flex-direction: column; gap: var(--space-2); min-height: 108px; }
.lps-night__filed-row {
  border: var(--border) solid var(--line-soft);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.lps-night__filed-row.is-in { opacity: 1; transform: none; }
.lps-night__filed-text { font-size: var(--text-sm); }
.lps-night__filed-path { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); }
.lps-night__sig { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); margin-top: 2px; }

/* Morning briefing, pinned to the card's foot; lines appear one at a time. */
.lps-night__brief {
  margin-top: auto;
  border-top: var(--border) solid var(--line-soft);
  padding-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.lps-night__brief-line {
  font-size: var(--text-sm);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.lps-night__brief-line.is-in { opacity: 1; transform: none; }
.lps-night__brief-sig { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); }

/* ── Scene 2: the briefing that writes itself ────────────────────────────── */

.lps-brief { padding: 0; }
.lps-brief__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border) solid var(--line-soft);
}
.lps-brief__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
/* Lines occupy their space from the start (opacity only) — zero layout shift. */
.lps-brief__line {
  font-size: var(--text-sm);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.lps-brief__line.is-in { opacity: 1; transform: none; }
.lps-brief__line--label:not(:first-child) { margin-top: var(--space-2); }
.lps-brief__dash { color: var(--muted-2); }

/* ── Scene 3: attribution cycler ─────────────────────────────────────────── */

.lps-attr__inner { display: flex; flex-direction: column; gap: var(--space-3); }
.lps-attr__chiprow { min-height: 20px; } /* chip space is reserved: no reflow between phases */
.lps-attr .lps-chip { opacity: 0; transition: opacity 0.4s ease; }
.lps-attr.is-a .lps-chip { opacity: 1; }

/* Phase A greys the paragraph (someone else holds the lock); B/C restore ink. */
.lps-attr__para { margin: 0; font-size: var(--text-md); line-height: 1.6; transition: color 0.45s ease; }
.lps-attr.is-a .lps-attr__para { color: var(--muted); }
/* The final word writes itself onto the end a beat into phase A, then stays. */
.lps-attr.is-a .lps-attr__append { animation: lps-append 3.5s linear both; }
@keyframes lps-append {
  0%, 30% { opacity: 0; }
  36%, 100% { opacity: 1; }
}
.lps-attr__cursor {
  display: inline-block;
  width: 6px;
  height: 12px;
  margin-left: 2px;
  vertical-align: -1px;
  background: var(--muted);
  opacity: 0;
}
.lps-attr.is-a .lps-attr__cursor { opacity: 1; animation: lps-blink 1s steps(1) infinite; }

/* Phase B: the margin signature. In flow (transparent when off) — no shift. */
.lps-attr__sig {
  align-self: flex-end;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.lps-attr.is-b .lps-attr__sig,
.lps-attr.is-c .lps-attr__sig { opacity: 1; transform: none; }

/* Phase C: the version strip slides up under a hairline. Space pre-reserved. */
.lps-attr__versions {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  border-top: var(--border) solid var(--line-soft);
  padding-top: var(--space-2);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.lps-attr.is-c .lps-attr__versions { opacity: 1; transform: none; }
.lps-attr__vrow { display: flex; align-items: center; gap: var(--space-2); }
.lps-attr__vver { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink); width: 20px; flex: none; }
.lps-attr__vmeta { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: var(--mono-tracking); color: var(--ink-soft); }
.lps-attr__vrow .lps-ghost-btn { margin-left: auto; }

/* Reduced motion: the composed payoff — signature + history, no lock chip. */
.lps-attr.lps-static .lps-attr__sig,
.lps-attr.lps-static .lps-attr__versions { opacity: 1; transform: none; }

/* ── Scene 4: the mini orbit map ─────────────────────────────────────────── */

.lps-orbit__svg { display: block; width: 100%; height: auto; }
.lps-orbit__ring { fill: none; stroke: var(--line-soft); stroke-width: 1; }
.lps-orbit__hub { fill: var(--ink); }
.lps-orbit__ring-label,
.lps-orbit__agent-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  fill: var(--muted);
}

/* Section bodies wear the app's section-marker accents; entries stay grey. */
.lps-orbit__body--blue { fill: var(--accent-blue); }
.lps-orbit__body--green { fill: var(--accent-green); }
.lps-orbit__body--amber { fill: var(--accent-amber); }
.lps-orbit__body--red { fill: var(--accent-red); }
.lps-orbit__body--purple { fill: var(--accent-purple); }
.lps-orbit__body--teal { fill: var(--accent-teal); }
.lps-orbit__body--pink { fill: var(--accent-pink); }
.lps-orbit__sat { fill: var(--muted-2); }
.lps-orbit__agent-dot { fill: var(--ink); }

/* Time travel: nodes born after the slider's date fade out (and back). */
.lps-orbit__node { transition: opacity 0.2s ease; }
.lps-orbit__node.is-unborn { opacity: 0; pointer-events: none; }

/* The agent drifts between its two anchor sections on the middle ring.
   Endpoints arrive as custom properties from the layout code. */
.lps-orbit__agent {
  transform: translate(var(--lps-ax1), var(--lps-ay1));
  animation: lps-drift 12s ease-in-out infinite alternate;
}
@keyframes lps-drift {
  from { transform: translate(var(--lps-ax1), var(--lps-ay1)); }
  to { transform: translate(var(--lps-ax2), var(--lps-ay2)); }
}

.lps-orbit__controls { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); }
.lps-orbit__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--mono-tracking-wide);
  min-width: 66px; /* widest month string — the label never nudges the slider */
}
.lps-orbit__slider { flex: 1; min-width: 0; accent-color: var(--ink); margin: 0; }
.lps-orbit__play { cursor: pointer; color: var(--ink); }
.lps-orbit__play:hover { background: var(--surface-3); }
.lps-orbit__caption { margin: var(--space-2) 0 0; }

/* ── Reduced motion: no scene may move on its own ────────────────────────────
   The scene scripts already render static compositions; this kills anything
   CSS-driven (caret blink, agent drift, phase fades). The orbit map's node
   fades become instant toggles — the slider itself stays fully usable. */
@media (prefers-reduced-motion: reduce) {
  [class^="lps-"],
  [class*=" lps-"] {
    animation: none !important;
    transition: none !important;
  }
}
