/* Storylines landing v2 — a living, touchable canvas.
   Palette mirrors the product: near-black green, emerald → lime accent. */

:root {
  --bg: #0b1312;
  --glass: rgba(16, 21, 20, 0.66);
  --glass-strong: rgba(13, 17, 17, 0.85);
  --border: rgba(255, 255, 255, 0.09);
  --border-hi: rgba(255, 255, 255, 0.16);
  --text: #eaf1ee;
  --text-dim: #9db0aa;
  --text-faint: #647672;
  --green: #079a7c;
  --lime: #c6f135;
  --teal: #38ae96;
  --accent-grad: linear-gradient(92deg, #0ab08d 0%, #c6f135 100%);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
/* the visitor becomes a cursor on the canvas */
@media (pointer: fine) {
  .stage.own-cursor, .stage.own-cursor * { cursor: none !important; }
}

/* ── atmosphere ────────────────────────────────────────────────────────── */
.aurora {
  position: absolute;
  width: 68vw;
  height: 68vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}
.aurora-a {
  top: -34vw;
  left: -14vw;
  background: radial-gradient(circle, rgba(7, 154, 124, 0.34) 0%, transparent 62%);
  animation: auroraA 26s ease-in-out infinite alternate;
}
.aurora-b {
  bottom: -38vw;
  right: -16vw;
  background: radial-gradient(circle, rgba(198, 241, 53, 0.13) 0%, transparent 60%);
  animation: auroraB 32s ease-in-out infinite alternate;
}
@keyframes auroraA { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vw, 4vh) scale(1.12); } }
@keyframes auroraB { from { transform: translate(0, 0) scale(1.08); } to { transform: translate(-5vw, -4vh) scale(0.95); } }

.grid-layer {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(157, 176, 170, 0.14) 1px, transparent 1.4px);
  background-size: 28px 28px;
  mask-image: radial-gradient(120% 120% at 50% 45%, #000 55%, transparent 100%);
  pointer-events: none;
}
.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 130% at 50% 40%, transparent 55%, rgba(4, 8, 8, 0.7) 100%);
  pointer-events: none;
}

/* ── chrome ────────────────────────────────────────────────────────────── */
.brand {
  position: absolute;
  top: 26px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17.5px;
  letter-spacing: -0.01em;
  z-index: 40;
}
.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent-grad);
  box-shadow: 0 0 14px rgba(10, 176, 141, 0.9);
}

.presence {
  position: absolute;
  top: 26px;
  right: 32px;
  display: flex;
  align-items: center;
  z-index: 40;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.pdot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--c);
  border: 2px solid #0c1413;
  margin-left: -4px;
}
.pdot:first-child { margin-left: 0; }
.plabel { margin-left: 8px; font-size: 11px; color: var(--text-dim); font-weight: 500; }

/* ── headline ──────────────────────────────────────────────────────────── */
.hero {
  position: absolute;
  left: 32px;
  top: 43%;
  transform: translateY(-50%);
  z-index: 30;
  max-width: min(640px, 44vw);
  pointer-events: none;
}
.kicker {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9fe8d5;
  background: rgba(7, 154, 124, 0.14);
  border: 1px solid rgba(56, 174, 150, 0.35);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(34px, 4.6vw, 72px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-shadow: 0 2px 40px rgba(4, 10, 9, 0.9);
}
.hero .grad {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .sub {
  margin-top: 20px;
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 46ch;
  font-weight: 450;
}

/* ── shared card chrome ────────────────────────────────────────────────── */
.card, .tray {
  position: absolute;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  overflow: hidden;
  z-index: 10;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.dragging { border-color: var(--border-hi); z-index: 26 !important; }
.badge {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2.5px 7px;
  border-radius: 4px;
  color: #06130f;
}
.badge.graded { position: absolute; top: 10px; right: 10px; background: #f2c040; z-index: 3; }
.badge.gen { background: var(--teal); }

/* ── video monitor ─────────────────────────────────────────────────────── */
.video-card { right: 4.5vw; top: 8vh; width: clamp(320px, 28vw, 460px); }
.screen { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.scene-a, .scene-b { position: absolute; inset: 0; transition: opacity 0.45s ease; }
.scene-a { background: radial-gradient(95% 125% at 68% 28%, #f7b267 0%, #c5533f 36%, #5c2a3d 64%, #14172b 100%); }
.scene-a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(180deg, transparent, rgba(8, 10, 24, 0.9)); }
.scene-b { opacity: 0; background: radial-gradient(120% 140% at 25% 70%, #0f3b39 0%, #10555a 36%, #0a2740 72%, #050c17 100%); }
.scene-b::after {
  content: "";
  position: absolute;
  left: 12%; top: 24%; width: 32%; height: 3px; border-radius: 3px;
  background: rgba(198, 241, 53, 0.5);
  box-shadow: 0 20px 0 rgba(198, 241, 53, 0.28), 0 40px 0 rgba(198, 241, 53, 0.14);
}
.grain {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.playhead {
  position: absolute;
  top: 0; bottom: 0; left: 30%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.85);
  z-index: 2;
}
.ph-grip {
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  width: 11px; height: 11px;
  border-radius: 3px;
  background: #fff;
}
.transport {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--glass-strong);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
}
.tbtn {
  width: 25px; height: 25px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 10px;
  flex-shrink: 0;
}
.tc { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; color: #d9e5e0; flex-shrink: 0; }
.tstrip { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.tstrip-fill { height: 100%; width: 30%; background: var(--accent-grad); border-radius: 2px; }
.tname { color: var(--text-faint); font-size: 10px; flex-shrink: 0; }

/* ── generation card ───────────────────────────────────────────────────── */
.gen-card { right: 8vw; bottom: 24vh; width: clamp(220px, 18vw, 300px); }
.gen-screen { position: relative; aspect-ratio: 16 / 9; background: #0c1110; overflow: hidden; }
.gen-blob { position: absolute; border-radius: 50%; filter: blur(22px); opacity: 0.8; }
.b1 { width: 55%; height: 80%; left: 8%; top: 12%; background: rgba(56, 174, 150, 0.4); animation: blob1 5s ease-in-out infinite alternate; }
.b2 { width: 45%; height: 70%; right: 6%; bottom: 8%; background: rgba(242, 192, 64, 0.25); animation: blob2 6s ease-in-out infinite alternate; }
@keyframes blob1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(14%, 10%) scale(1.25); } }
@keyframes blob2 { from { transform: translate(0, 0) scale(1.15); } to { transform: translate(-12%, -8%) scale(0.9); } }
.gen-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 32%, rgba(198, 241, 53, 0.12) 50%, transparent 68%);
  background-size: 230% 100%;
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.gen-pct {
  position: absolute;
  right: 8px; bottom: 6px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10px;
  color: rgba(234, 241, 238, 0.85);
  z-index: 2;
}
.gen-done {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: radial-gradient(125% 165% at 30% 20%, #ffd97a 0%, #ea8a4b 32%, #7c3d63 64%, #170f38 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 3;
}
.gen-done span {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(6, 19, 15, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 13px;
  padding-left: 3px;
}
.gen-meta { display: flex; align-items: center; gap: 8px; padding: 8px 10px 6px; }
.gen-prompt { font-size: 10px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gen-bar { height: 3px; margin: 0 10px 10px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.gen-fill { height: 100%; width: 0%; border-radius: 2px; background: var(--accent-grad); }

/* ── source tray ───────────────────────────────────────────────────────── */
.tray { left: 32px; bottom: 19vh; padding: 10px 12px 12px; z-index: 12; }
.tray-head { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.tray-row { display: flex; gap: 8px; }
.chip {
  position: relative;
  border-radius: 7px;
  border: 1px solid var(--border-hi);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  font-size: 9px;
  font-weight: 600;
  color: #eaf1ee;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 140ms ease, opacity 200ms ease;
}
.chip span { position: relative; z-index: 2; }
.chip.clip { width: 74px; height: 44px; display: flex; align-items: flex-end; padding: 4px 6px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.chip.clip::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.55)); }
.c1 { background: radial-gradient(120% 130% at 30% 25%, #e9c46a 0%, #b0673c 45%, #3f2233 100%); }
.c2 { background: radial-gradient(120% 130% at 65% 30%, #74c69d 0%, #2d6a4f 55%, #12241d 100%); }
.c3 { background: radial-gradient(130% 140% at 40% 20%, #90e0ef 0%, #0077b6 55%, #03134a 100%); }
.chip.music {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  background: linear-gradient(140deg, rgba(56, 174, 150, 0.32), rgba(56, 174, 150, 0.12));
  color: #bfeee2;
}
.chip.ghosted { opacity: 0.25; }

/* ── timeline ──────────────────────────────────────────────────────────── */
.timeline-card {
  left: 53%;
  bottom: 6.5vh;
  transform: translateX(-50%);
  width: clamp(360px, 46vw, 760px);
  padding: 11px 14px 13px;
  z-index: 11;
}
.tl-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.tl-name { font-weight: 600; color: #cfe0da; }
.tl-track {
  position: relative;
  height: 42px;
  background: rgba(5, 10, 9, 0.75);
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}
.seg {
  position: absolute;
  top: 5px; bottom: 5px;
  border-radius: 5px;
  font-size: 9px;
  padding: 3px 7px;
  color: #06130f;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  transition: left 380ms cubic-bezier(0.3, 1.2, 0.4, 1), width 380ms cubic-bezier(0.3, 1.2, 0.4, 1), opacity 300ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.seg.new { box-shadow: 0 0 0 2px rgba(198, 241, 53, 0.8), 0 6px 16px rgba(0, 0, 0, 0.5); }
.tl-tailpad {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 10%;
  border-left: 1px dashed rgba(255, 255, 255, 0.14);
  display: grid; place-items: center;
  color: var(--text-faint);
  font-size: 13px;
}
.tl-playhead {
  position: absolute;
  top: 0; bottom: 0; left: 12%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
  z-index: 4;
}
.tl-audio {
  position: relative;
  height: 17px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(56, 174, 150, 0.3), rgba(56, 174, 150, 0.14));
  overflow: hidden;
  transition: box-shadow 250ms ease;
}
.tl-audio.flash { box-shadow: 0 0 0 2px rgba(198, 241, 53, 0.7); }
.tl-audio::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0 1px, transparent 1px 36px);
}
.tl-audio-label { position: relative; font-size: 8.5px; color: #d8f2ea; padding-left: 7px; line-height: 17px; font-weight: 600; }

/* ── cursors ───────────────────────────────────────────────────────────── */
.cursor { position: absolute; left: 0; top: 0; z-index: 50; pointer-events: none; will-change: transform; }
.cursor svg { display: block; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65)); }
.cursor .tag {
  position: absolute;
  left: 14px;
  top: 17px;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  color: #06130f;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}
.cursor .tag { display: inline-flex; align-items: center; gap: 5px; }
.cursor .tag-logo { display: inline-flex; align-items: center; }
.cursor .tag-logo svg { display: block; }
.cursor .say {
  position: absolute;
  left: 16px;
  top: -30px;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 9px 9px 9px 2px;
  background: var(--glass-strong);
  border: 1px solid var(--border-hi);
  color: var(--text);
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  transition: opacity 200ms ease, transform 200ms ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.cursor .say.show { opacity: 1; transform: translateY(0) scale(1); }
.cursor.me { z-index: 60; }
.cursor.me .tag { background: var(--accent-grad); }

/* ghost = an asset in an agent's (or your) hand */
.ghost {
  position: absolute;
  left: 0; top: 0;
  z-index: 45;
  pointer-events: none;
  border-radius: 7px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 0 1.5px rgba(198, 241, 53, 0.55);
  will-change: transform;
  opacity: 0.95;
}

/* ── footer ────────────────────────────────────────────────────────────── */
.foot { position: absolute; left: 32px; bottom: 20px; font-size: 11px; color: var(--text-faint); z-index: 40; }

/* ── small screens ─────────────────────────────────────────────────────── */
@media (max-width: 780px) {
  .hero { max-width: 90vw; top: 34%; }
  .video-card { right: -14vw; top: 7vh; transform: scale(0.72); transform-origin: top right; }
  .gen-card { display: none; }
  .tray { display: none; }
  .presence { top: auto; bottom: 20px; right: 20px; }
  .timeline-card { width: 94vw; bottom: 9vh; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora, .gen-shimmer, .gen-blob { animation: none !important; }
}
