/* ═══════════════════════════════════════════════════════════════════════
   NOT HOLLYWOOD - new streaming aesthetic
   Design synthesis: Robinhood precision · Apple TV cinema ·
   Netflix shelves · Hulu editorial confidence.
   ═════════════════════════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;0,9..144,900;1,9..144,600;1,9..144,900&family=Inter+Tight:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");

/* ─── TOKENS ────────────────────────────────────────────────────────── */
:root {
  /* Canvas - near-black through dark silver */
  --bg:            #08090b;
  --bg-elev-1:     #101215;
  --bg-elev-2:     #181b1f;
  --bg-elev-3:     #22262b;
  --bg-overlay:    rgba(8, 9, 11, 0.72);

  /* Hairlines */
  --hair:          rgba(255, 255, 255, 0.09);
  --hair-strong:   rgba(255, 255, 255, 0.22);

  /* Text - crisp white through silver */
  --text:          #ffffff;
  --text-mid:      #c9ced3;
  --text-dim:      #8a9096;
  --text-faint:    #565a5f;

  /* Silver rails */
  --silver:        #a8adb2;
  --silver-dim:    #6f757b;
  --silver-deep:   #3a3e43;

  /* Primary signal - white on dark canvas */
  --signal:        #ffffff;
  --signal-dim:    #e6e8ea;
  --signal-glow:   rgba(255, 255, 255, 0.28);
  --signal-wash:   rgba(255, 255, 255, 0.06);

  /* Accent - dark silver */
  --ember:         #c9ced3;
  --ember-glow:    rgba(201, 206, 211, 0.28);

  --danger:        #ff6b76;

  /* Type */
  --f-display: "Fraunces", "Instrument Serif", ui-serif, Georgia, serif;
  --f-ui:      "Inter Tight", "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Motion */
  --e-fast: 160ms cubic-bezier(.2,.7,.2,1);
  --e-med:  260ms cubic-bezier(.2,.7,.2,1);
  --e-slow: 520ms cubic-bezier(.2,.7,.2,1);

  /* Rhythm */
  --page-pad:   clamp(20px, 4vw, 56px);
  --shelf-gap:  clamp(10px, 1.2vw, 18px);
  --tile-w:     clamp(240px, 22vw, 320px);
  --tile-h:     calc(var(--tile-w) * 9 / 16);
  --radius-lg:  16px;
  --radius-md:  12px;
  --radius-sm:  8px;
}

/* ─── RESET ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* Ambient grain overlay for cinema feel */
body::before {
  content: "";
  pointer-events: none;
  position: fixed; inset: 0;
  z-index: 1;
  opacity: 0.035;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ═══════════════════════════════════════════════════════════════════════
   NAV - glass hairline (Apple TV + Robinhood cross)
   ═════════════════════════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  padding: 14px var(--page-pad);
  background: linear-gradient(180deg, rgba(5,6,7,0.85), rgba(5,6,7,0));
  transition: background var(--e-med), backdrop-filter var(--e-med), border-color var(--e-med);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5,6,7,0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--hair);
}
.nav-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 36px;
}
.wordmark {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wordmark::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 12px var(--signal-glow);
  margin-right: 4px;
}
.wordmark-accent {
  font-style: italic;
  font-weight: 600;
  color: var(--text-mid);
}

.nav-tabs {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-tabs a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  border-radius: 999px;
  transition: color var(--e-fast), background var(--e-fast);
}
.nav-tabs a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-tabs a.active {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-search {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text-mid);
  transition: color var(--e-fast), background var(--e-fast);
}
.nav-search:hover { color: var(--text); background: rgba(255,255,255,0.05); }

/* Primary CTA - signal chip */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--signal);
  color: #08090b;
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform var(--e-fast), box-shadow var(--e-fast), background var(--e-fast);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.20), 0 6px 22px -8px var(--signal-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  background: #f2f4f6;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.35), 0 12px 32px -10px var(--signal-glow);
}
.btn-plus { font-size: 15px; line-height: 1; margin-top: -1px; }

/* ═══════════════════════════════════════════════════════════════════════
   HERO - cinematic, full-bleed (Apple TV language)
   ═════════════════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  height: 92vh;
  min-height: 640px;
  max-height: 900px;
  overflow: hidden;
  background: var(--bg-elev-1);
}

/* ───────────────────────────────────────────────────────────────────
   Minimal landing hero (replaces kitchen-video hero on homepage).
   Kept as a modifier on .hero so scroll snap / nav offsets still work.
   ─────────────────────────────────────────────────────────────────── */
.hero-minimal {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: min(78vh, 720px);
  max-height: none;
  padding: clamp(80px, 12vh, 140px) 24px clamp(60px, 8vh, 100px);
  background:
    radial-gradient(ellipse 900px 500px at 50% 30%, rgba(120, 130, 200, 0.08), transparent 60%),
    var(--bg-elev-1);
}
.hero-minimal .landing-inner {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(28px, 5vh, 44px);
}
.hero-minimal .landing-title {
  font-family: var(--font-display, "Instrument Serif", Georgia, serif);
  font-size: clamp(38px, 6.4vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--text-primary, #f4f4f6);
  margin: 0;
  font-weight: 400;
}
.hero-minimal .landing-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.hero-minimal .landing-input-wrap {
  position: relative;
  width: 100%;
  background: var(--bg-elev-2, #14161c);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 14px 60px 14px 20px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.28);
}
.hero-minimal .landing-input-wrap:focus-within {
  border-color: rgba(140, 155, 255, 0.55);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.28), 0 0 0 3px rgba(140, 155, 255, 0.18);
}
.hero-minimal .landing-input {
  width: 100%;
  min-height: 28px;
  max-height: 260px;
  resize: none;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text-primary, #f4f4f6);
  font: inherit;
  font-size: 17px;
  line-height: 1.5;
  font-family: inherit;
  padding: 0;
}
.hero-minimal .landing-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.hero-minimal .landing-generate {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  background: var(--accent, #6a8cff);
  color: #0a0b10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}
.hero-minimal .landing-generate:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #8ea6ff;
}
.hero-minimal .landing-generate:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.hero-minimal .landing-durations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.hero-minimal .landing-dur {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 120ms ease;
  font-family: inherit;
}
.hero-minimal .landing-dur:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary, #f4f4f6);
}
.hero-minimal .landing-dur.active {
  background: rgba(140, 155, 255, 0.14);
  border-color: rgba(140, 155, 255, 0.5);
  color: #dfe6ff;
}
@media (max-width: 640px) {
  .hero-minimal { padding: 60px 16px 40px; min-height: 60vh; }
  .hero-minimal .landing-input-wrap { padding: 12px 54px 12px 16px; border-radius: 16px; }
  .hero-minimal .landing-input { font-size: 16px; }
  .hero-minimal .landing-generate { width: 36px; height: 36px; }
  .hero-minimal .landing-dur { padding: 6px 12px; font-size: 12px; }
}
.hero-media {
  position: absolute; inset: 0;
  z-index: 1;
}
.hero-video {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.02);
}
/* Cinema vignette + fades */
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 45%, transparent 0%, rgba(5,6,7,0.35) 55%, rgba(5,6,7,0.85) 100%),
    linear-gradient(180deg, rgba(5,6,7,0.35) 0%, rgba(5,6,7,0) 30%, rgba(5,6,7,0) 55%, rgba(5,6,7,0.85) 90%, var(--bg) 100%);
}
.hero-fade-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(5,6,7,0) 0%, rgba(5,6,7,0.85) 60%, var(--bg) 100%);
  z-index: 2;
  pointer-events: none;
}
.hero-fade-left {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 55%;
  background: linear-gradient(90deg, rgba(5,6,7,0.9) 0%, rgba(5,6,7,0.45) 55%, rgba(5,6,7,0) 100%);
  z-index: 2;
  pointer-events: none;
}

.hero-content {
  position: absolute;
  bottom: 12%;
  left: var(--page-pad);
  right: var(--page-pad);
  max-width: 720px;
  z-index: 3;
  animation: heroIn var(--e-slow) both;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-eyebrow {
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hero-eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 8px var(--signal-glow);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.35); }
}
.hero-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(40px, 5.8vw, 84px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0 0 20px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 24px rgba(0,0,0,0.55);
}
.hero-title em {
  font-style: italic;
  font-weight: 600;
  color: var(--silver);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin: 0 0 18px;
}
.hero-meta .chip {
  padding: 4px 10px;
  border: 1px solid var(--hair);
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(6px);
}
.hero-meta .chip.live {
  color: var(--signal);
  border-color: rgba(255,255,255,0.35);
  background: var(--signal-wash);
}
.hero-synopsis {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-mid);
  max-width: 560px;
  margin: 0 0 28px;
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-hero-primary,
.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  transition: transform var(--e-fast), background var(--e-fast), border-color var(--e-fast);
}
.btn-hero-primary {
  background: var(--text);
  color: #050607;
  box-shadow: 0 8px 30px -10px rgba(255,255,255,0.3);
}
.btn-hero-primary:hover { transform: translateY(-1px); background: #fff; }
.btn-hero-secondary {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border: 1px solid var(--hair-strong);
  backdrop-filter: blur(12px);
}
.btn-hero-secondary:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.25); }

/* When hero is showing a rendering job */
.hero.rendering .hero-eyebrow { color: var(--ember); }
.hero.rendering .hero-eyebrow::before { background: var(--ember); box-shadow: 0 0 8px var(--ember-glow); }

/* ═══════════════════════════════════════════════════════════════════════
   CTA BAND - "Make your own show"
   ═════════════════════════════════════════════════════════════════════════ */
.cta-band {
  position: relative;
  z-index: 5;
  margin-top: -60px;
  padding: 0 var(--page-pad) 24px;
}
.cta-band-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 36px 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--hair-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.cta-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--silver);
  margin: 0 0 8px;
}
.cta-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0 0 6px;
}
.cta-sub {
  font-family: var(--f-ui);
  font-size: 15px;
  color: var(--text-mid);
  margin: 0;
}
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 999px;
  background: #ffffff;
  color: #08090b;
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform var(--e-fast), background var(--e-fast), box-shadow var(--e-fast);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.4), 0 10px 28px -10px rgba(255,255,255,0.28);
}
.btn-cta:hover {
  transform: translateY(-1px);
  background: #f2f4f6;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.6), 0 16px 40px -12px rgba(255,255,255,0.4);
}
@media (max-width: 720px) {
  .cta-band {
    /* The -60px overlap looks great on desktop but on mobile it covers
       the hero's own "Create a Show" button. Add breathing room instead. */
    margin-top: 24px;
  }
  .cta-band-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 24px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   SHELVES - Netflix rows in a Robinhood chassis
   ═════════════════════════════════════════════════════════════════════════ */
.shelves {
  position: relative;
  z-index: 4;
  padding: 8px 0 80px;
  margin-top: 0;
}
.shelf {
  padding: 32px 0 12px;
}
.shelf-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 0 var(--page-pad) 14px;
  max-width: 1600px;
  margin: 0 auto;
}
.shelf-head h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}
.shelf-badge {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--ember);
  color: #150500;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.shelf-sub {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.shelf-see-all {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mid);
  transition: color var(--e-fast);
}
.shelf-see-all:hover { color: var(--signal); }

/* Horizontal scroll row */
.shelf-scroll {
  display: flex;
  gap: var(--shelf-gap);
  padding: 6px var(--page-pad) 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  scroll-padding-left: var(--page-pad);
  -webkit-overflow-scrolling: touch;
}
.shelf-scroll::-webkit-scrollbar { display: none; }

/* Empty state */
.empty-shelf {
  padding: 40px 30px;
  border: 1px dashed var(--hair);
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-size: 14px;
  min-width: 60%;
  scroll-snap-align: start;
}
.empty-shelf b { color: var(--signal); font-weight: 600; }

/* ─── TILE (base) ─────────────────────────────────────────────────── */
.tile {
  position: relative;
  flex: 0 0 auto;
  width: var(--tile-w);
  height: var(--tile-h);
  border-radius: var(--radius-md);
  overflow: hidden;
  scroll-snap-align: start;
  cursor: pointer;
  background: var(--bg-elev-2);
  border: 1px solid var(--hair);
  transition: transform var(--e-med), border-color var(--e-med), box-shadow var(--e-med);
  isolation: isolate;
}
.tile:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.45);
  box-shadow:
    0 22px 40px -20px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.20),
    0 0 32px -8px var(--signal-glow);
  z-index: 5;
}
.tile-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}
.tile-gradient {
  position: absolute; inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.85) 100%);
  opacity: 0.9;
  transition: opacity var(--e-med);
}
.tile:hover .tile-gradient { opacity: 1; }

.tile-badge {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 4;
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.7);
  color: var(--text);
  backdrop-filter: blur(6px);
  border: 1px solid var(--hair);
}
.tile-badge.failed {
  background: rgba(255, 85, 99, 0.15);
  color: var(--danger);
  border-color: rgba(255, 85, 99, 0.4);
}

.tile-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 54px; height: 54px;
  z-index: 3;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: grid; place-items: center;
  opacity: 0;
  backdrop-filter: blur(10px);
  transition: opacity var(--e-med), transform var(--e-med);
}
.tile-play svg { width: 22px; height: 22px; margin-left: 2px; }
.tile:hover .tile-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.tile-overlay {
  position: absolute;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 4;
  transform: translateY(4px);
  transition: transform var(--e-med);
}
.tile:hover .tile-overlay { transform: translateY(0); }

.tile-title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.tile-meta {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tile-meta .dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--text-dim);
}

/* ─── ACTIVE TILE (rendering) ─────────────────────────────────────── */
.tile-active {
  background:
    radial-gradient(ellipse at top, rgba(255,255,255,0.14), transparent 60%),
    var(--bg-elev-2);
  border-color: rgba(255,255,255,0.28);
  cursor: default;
}
.tile-active:hover {
  border-color: rgba(255,255,255,0.4);
  box-shadow:
    0 22px 40px -20px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.22),
    0 0 32px -8px var(--ember-glow);
}
.tile-active .tile-badge {
  background: rgba(255,255,255,0.1);
  color: var(--ember);
  border-color: rgba(255,255,255,0.3);
}
.tile-active {
  /* Active tiles with scene lists need to grow; override the shelf's fixed
     aspect ratio by letting the body dictate height. */
  aspect-ratio: auto;
  min-height: 220px;
}
.tile-active-body {
  position: relative;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tile-active-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 22px;
}
.tile-active-prompt {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-active-scene {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
}
.tile-active-eta {
  color: var(--ember);
  font-weight: 600;
}
.tile-active-charbible {
  font-family: var(--f-mono);
  font-size: 10.5px;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
}
.tile-active-scenes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* Fit ~10 scenes without scrolling (a full 60s render). Rows are ~40-52px
     tall depending on viewport; 520px handles all 10 comfortably. On smaller
     jobs the container just collapses to the natural height. */
  max-height: 520px;
  overflow-y: auto;
  /* Extra bottom padding so the last row's border/glow isn't clipped by the
     scroll container edge — previously showed a hard cut through the row. */
  padding: 4px 2px 8px 2px;
  scrollbar-width: thin;
}
.tile-active-scenes::-webkit-scrollbar { width: 4px; }
.tile-active-scenes::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.scene-row {
  display: grid;
  grid-template-columns: 12px 60px 32px 1fr;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-mid);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.scene-row-running {
  background: rgba(229, 50, 47, 0.10);
  border-color: rgba(229, 50, 47, 0.28);
  color: var(--text);
}
.scene-row-succeeded {
  background: rgba(60, 190, 100, 0.06);
  border-color: rgba(60, 190, 100, 0.18);
  color: rgba(255,255,255,0.72);
}
.scene-row-failed {
  background: rgba(229, 50, 47, 0.15);
  border-color: rgba(229, 50, 47, 0.4);
  color: #ffb0ad;
}
.scene-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  justify-self: center;
}
.scene-row-dot-running {
  background: var(--ember);
  box-shadow: 0 0 8px var(--ember-glow);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.scene-row-dot-succeeded {
  background: #3cbe64;
}
.scene-row-dot-failed {
  background: #e5322f;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.scene-row-idx {
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
}
.scene-row-succeeded .scene-row-idx { color: rgba(255,255,255,0.65); }
.scene-row-dur {
  color: var(--text-mid);
  font-size: 10px;
  letter-spacing: 0.06em;
}
.scene-row-label {
  color: inherit;
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Per-scene mini progress bar. Only drawn when Fal gives us a real fraction,
   so it's a live signal (climbs while the model is inferring) rather than a
   fake time-based fill. Sits inline at the far right of the scene row. */
.scene-row-bar {
  display: inline-block;
  width: 56px; height: 3px;
  background: rgba(255,255,255,0.10);
  border-radius: 2px; overflow: hidden;
  margin-left: 6px; flex-shrink: 0;
}
.scene-row-bar-fill {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent-2, #6ad4ff), var(--accent, #6a8cff));
  border-radius: 2px;
  transition: width 400ms ease-out;
}
.tile-active-progress {
  position: relative;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.tile-active-progress-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, var(--ember), #ff9a5e);
  border-radius: 2px;
  transition: width var(--e-slow);
  box-shadow: 0 0 12px var(--ember-glow);
}
.tile-active-progress::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: sweep 1.6s linear infinite;
  opacity: 0.5;
}
@keyframes sweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ─── IDEA TILE ────────────────────────────────────────────────────── */
.tile-idea {
  background: linear-gradient(160deg, var(--idea-a, #1a1f24), var(--idea-b, #0a0d0f));
}
.tile-idea::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06), transparent 50%);
  z-index: 1;
}
.tile-idea:hover {
  border-color: rgba(255,255,255,0.45);
}
.tile-idea-body {
  position: absolute;
  inset: 0;
  padding: 18px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.tile-idea-cat {
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--signal);
  text-transform: uppercase;
}
.tile-idea-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 8px 0;
}
.tile-idea-hint {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-mid);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── TEMPLATE TILE ────────────────────────────────────────────────── */
.tile-template {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.06), transparent 55%),
    var(--bg-elev-2);
}
.tile-template-body {
  position: absolute;
  inset: 0;
  padding: 20px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.tile-template-value {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
}
.tile-template-unit {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
  margin-top: 8px;
}
.tile-template-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-mid);
}

/* ═══════════════════════════════════════════════════════════════════════
   FOOTER
   ═════════════════════════════════════════════════════════════════════════ */
.page-footer {
  padding: 60px var(--page-pad) 40px;
  border-top: 1px solid var(--hair);
  margin-top: 40px;
}
.page-footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}
.page-footer-inner p { margin: 0 0 8px; }
.page-footer-inner b { color: var(--text-mid); font-weight: 600; }
.footer-fine-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.footer-fine-links a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-fine-links a:hover {
  color: rgba(255, 255, 255, 0.95);
}
.footer-fine {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-top: 20px !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   MODAL - Composer + Detail
   ═════════════════════════════════════════════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
}
.modal[aria-hidden="false"] .modal-backdrop { opacity: 1; }
.modal[aria-hidden="false"] .modal-card { transform: none; opacity: 1; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  opacity: 0;
  transition: opacity var(--e-med);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  max-height: min(92vh, 900px);
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 30%),
    var(--bg-elev-1);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 36px 32px 32px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.7);
  transform: translateY(20px);
  opacity: 0;
  transition: transform var(--e-med), opacity var(--e-med);
  scrollbar-width: thin;
  scrollbar-color: var(--hair-strong) transparent;
}
.modal-card::-webkit-scrollbar { width: 6px; }
.modal-card::-webkit-scrollbar-thumb { background: var(--hair-strong); border-radius: 3px; }

.detail-card { max-width: 900px; padding: 0; overflow: hidden; }

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 4;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text-mid);
  background: rgba(0,0,0,0.45);
  transition: color var(--e-fast), background var(--e-fast), transform var(--e-fast);
}
.modal-close:hover {
  color: var(--text);
  background: rgba(255,255,255,0.1);
  transform: rotate(90deg);
}

/* ─── COMPOSER ────────────────────────────────────────────────────── */
.composer-head { margin-bottom: 24px; }
.composer-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 10px;
}
.composer-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(28px, 3.5vw, 38px);
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0 0 10px;
  color: var(--text);
}
.composer-sub {
  color: var(--text-mid);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.composer-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field { display: flex; flex-direction: column; gap: 10px; }
.field-label {
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mid);
}
.field-optional {
  color: var(--text-faint);
  font-weight: 400;
  letter-spacing: 0.12em;
}
.field-hint {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.hint-sep { margin: 0 6px; color: var(--text-faint); }

textarea, input[type="text"] {
  width: 100%;
  background: var(--bg-elev-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color var(--e-fast), background var(--e-fast), box-shadow var(--e-fast);
  font-family: var(--f-ui);
}
textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--signal-dim);
  background: var(--bg-elev-3);
  box-shadow: 0 0 0 3px var(--signal-wash);
}
textarea::placeholder { color: var(--text-faint); }

/* Dropzone */
.drop-zone {
  position: relative;
  min-height: 120px;
  border: 1.5px dashed var(--hair-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  display: grid;
  place-items: center;
  padding: 20px;
  cursor: pointer;
  transition: border-color var(--e-fast), background var(--e-fast);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--signal-dim);
  background: var(--signal-wash);
}
.drop-empty {
  text-align: center;
  color: var(--text-mid);
  font-size: 13px;
}
.drop-empty svg {
  margin: 0 auto 10px;
  display: block;
  color: var(--text-dim);
}
.drop-empty p { margin: 4px 0; }
.drop-sub { color: var(--text-faint); font-size: 11.5px; font-family: var(--f-mono); letter-spacing: 0.05em; }
.link-btn {
  color: var(--signal);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  font: inherit;
}
.link-btn:hover { color: #f2f4f6; }
.drop-preview {
  position: relative;
  width: 100%;
  max-width: 200px;
}
.drop-preview img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--hair);
}
.drop-clear {
  position: absolute;
  top: -10px; right: -10px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-elev-3);
  border: 1px solid var(--hair-strong);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  display: grid; place-items: center;
}
.drop-clear:hover { background: var(--danger); border-color: var(--danger); }

/* Length picker - feels like a chart control */
.field-length { gap: 14px; }
.length-display {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--f-display);
  line-height: 1;
}
.length-value {
  font-size: 68px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.length-unit {
  font-size: 18px;
  font-style: italic;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: -0.01em;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--signal) 0 var(--slider-fill, 0%), var(--hair) var(--slider-fill, 0%) 100%);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--signal);
  box-shadow: 0 0 0 6px rgba(255,255,255,0.10), 0 4px 14px rgba(0,0,0,0.4);
  cursor: grab;
  transition: transform var(--e-fast);
}
.slider::-webkit-slider-thumb:active { transform: scale(1.1); cursor: grabbing; }
.slider::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--signal);
  box-shadow: 0 0 0 6px rgba(255,255,255,0.10);
  cursor: grab;
}
.slider-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-top: -4px;
  padding: 0 2px;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.chip {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--hair);
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-mid);
  transition: color var(--e-fast), background var(--e-fast), border-color var(--e-fast);
}
.chip:hover { color: var(--text); border-color: var(--hair-strong); }
.chip.active {
  color: #08090b;
  background: var(--signal);
  border-color: var(--signal);
  font-weight: 700;
}
.chip.chip-cast {
  color: var(--text);
  border-color: rgba(120, 200, 255, 0.35);
  background: rgba(120, 200, 255, 0.08);
}

.length-hint {
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  margin: 0;
  padding: 8px 12px;
  border-left: 2px solid var(--signal);
  background: var(--signal-wash);
  border-radius: 2px;
}

/* Segmented control */
.field-inline {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 20px;
}
.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-elev-2);
  border: 1px solid var(--hair);
  border-radius: 999px;
  gap: 2px;
}
.segmented label {
  cursor: pointer;
  position: relative;
}
.segmented input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented span {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-mid);
  transition: color var(--e-fast), background var(--e-fast);
}
.segmented label:hover span { color: var(--text); }
.segmented input:checked + span {
  background: var(--bg-elev-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--hair-strong);
}

/* Composer summary - Robinhood cost readout */
.composer-summary {
  background: var(--bg-elev-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.summary-row b {
  color: var(--signal);
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

/* Big render CTA */
.btn-render {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  background: var(--signal);
  color: #08090b;
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: transform var(--e-fast), background var(--e-fast), box-shadow var(--e-fast);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.30), 0 10px 30px -10px var(--signal-glow);
}
.btn-render:hover {
  transform: translateY(-1px);
  background: #f2f4f6;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.45), 0 18px 40px -14px var(--signal-glow);
}
.btn-render:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-arrow {
  display: inline-block;
  transition: transform var(--e-fast);
}
.btn-render:hover .btn-arrow { transform: translateX(3px); }
.submit-note {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
  letter-spacing: 0.02em;
}

/* ─── DETAIL MODAL ────────────────────────────────────────────────── */
.detail-video-wrap {
  aspect-ratio: 16 / 9;
  background: #000;
}
.detail-video {
  width: 100%; height: 100%;
  object-fit: contain;
}
.detail-body { padding: 28px 32px 32px; }
.detail-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 10px;
}
.detail-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 14px;
  color: var(--text);
}
.detail-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 18px;
}
.detail-meta .chip {
  padding: 4px 10px;
  border: 1px solid var(--hair);
  border-radius: 4px;
  background: rgba(255,255,255,0.03);
}

/* Storage warning styles — "we don't store your videos" */
.detail-storage-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--accent-warm, #f5b544);
  letter-spacing: 0.02em;
  opacity: 0.95;
}

/* Storage warning under composer submit */
.submit-note.storage-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  margin-bottom: 6px;
  background: rgba(245, 181, 68, 0.08);
  border: 1px solid rgba(245, 181, 68, 0.28);
  border-radius: 8px;
  color: #f5b544;
  font-size: 12.5px;
  line-height: 1.5;
}
.submit-note.storage-warning svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
.submit-note.storage-warning b { color: #ffc86b; }

/* Subtle warn variant of shelf-sub */
.shelf-sub.shelf-sub-warn {
  color: #f5b544;
  opacity: 0.85;
}

/* Tile download button (top-right corner) */
.tile-download {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 10, 12, 0.62);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 3;
}
.tile-download svg {
  width: 16px;
  height: 16px;
}
.tile:hover .tile-download,
.tile:focus-within .tile-download {
  opacity: 1;
  transform: translateY(0);
}
.tile-download:hover {
  background: rgba(245, 181, 68, 0.95);
  color: #0a0a0c;
}
.tile-download:focus-visible {
  outline: 2px solid #f5b544;
  outline-offset: 2px;
  opacity: 1;
}

/* Touch devices: always show, no hover */
@media (hover: none) {
  .tile-download {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════════════ */
.page-footer {
  padding: 40px var(--page-x) 0;
  color: var(--text-mute);
  font-size: 12px;
  line-height: 1.6;
}
.detail-prompt {
  background: var(--bg-elev-2);
  border-left: 3px solid var(--signal);
  border-radius: 4px;
  padding: 14px 18px;
  color: var(--text-mid);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 24px;
  font-style: italic;
}
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--hair-strong);
  color: var(--text);
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background var(--e-fast), border-color var(--e-fast);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.24); }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root {
    --tile-w: 60vw;
    --page-pad: 20px;
  }
  .nav-tabs { display: none; }
  .hero { height: 80vh; min-height: 540px; }
  .hero-content { bottom: 8%; }
  .hero-title { font-size: 44px; }
  .hero-synopsis { font-size: 14.5px; }
  .btn-hero-primary, .btn-hero-secondary { padding: 12px 20px; font-size: 14px; }
  .btn-primary { padding: 8px 14px; font-size: 11.5px; }
  .composer-title { font-size: 28px; }
  .length-value { font-size: 52px; }
  .field-inline { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 500px) {
  :root {
    --tile-w: 74vw;
    --page-pad: 14px;
  }
  .modal-card { padding: 26px 20px 24px; }
  .detail-body { padding: 22px 20px 24px; }

  /* Nav: always show backdrop on mobile so content doesn't bleed under it,
     tighten spacing, and prevent horizontal overflow of the CTA. */
  .nav {
    padding: 10px var(--page-pad);
    background: rgba(5,6,7,0.72);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom-color: var(--hair);
  }
  .nav-inner {
    gap: 10px;
  }
  .wordmark { font-size: 18px; }
  .nav-right { gap: 6px; }
  .nav-search { width: 32px; height: 32px; }
  .nav-search svg { width: 16px; height: 16px; }

  /* Sign in button: keep it single-line, compact. */
  .nav-right .nav-auth-btn {
    padding: 5px 10px;
    font-size: 10.5px;
    white-space: nowrap;
    letter-spacing: 0.04em;
  }
  /* Signed-out compact: hide search when Sign In is showing so the CTA
     has room. Wordmark accent stays — "Not Hollywood" is the brand. */
  .nav-right:has(.nav-auth-btn:not([hidden])) .nav-search { display: none; }

  /* Create a Show CTA: shrink label to just the plus + "New", or hide the
     label entirely if there's still no room. The pseudo elements ensure
     the visible label swap happens without JS. */
  .nav-right .btn-primary {
    padding: 8px 12px;
    font-size: 11.5px;
    white-space: nowrap;
    letter-spacing: 0.04em;
  }
  .nav-right .btn-primary .btn-plus { margin-right: 2px; }

  /* Signed-in cluster on mobile: aggressively compact.
     - Hide email (too wide).
     - Hide search icon (unwired anyway; the composer is the main entry).
     - Hide the "credits" label; keep just the number as a chip.
     - Hide the wordmark accent "Hollywood" so the credits chip + sign
       out + primary CTA all fit within the viewport. Only in the
       signed-in state because that's the only one that's too tight. */
  .nav-user-email { display: none; }
  .nav-right:has(.nav-user:not([hidden])) .nav-search { display: none; }
  .nav-inner:has(.nav-user:not([hidden])) .wordmark-accent { display: none; }

  .nav-credits {
    padding: 4px 10px;
    font-size: 11px;
    gap: 0;
  }
  .nav-credits-label { display: none; }
  .nav-credits-value {
    font-size: 12px;
    font-weight: 700;
  }
  .nav-right .nav-signout {
    padding: 5px 8px;
    font-size: 10px;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }
  .nav-user { gap: 6px; }
}

/* Ultra-narrow phones (iPhone SE 1st gen at 320px, older Androids):
   swap "Create a Show" for just the + icon so nothing wraps or truncates. */
@media (max-width: 340px) {
  .nav-right .btn-primary {
    padding: 8px 10px;
    font-size: 0;
    line-height: 1;
  }
  .nav-right .btn-primary .btn-plus {
    font-size: 16px;
    margin: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   AUTH (sign in / sign up modal + nav user chip)
   ═════════════════════════════════════════════════════════════════════════ */
.nav-auth-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
}
.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}
.nav-user-email {
  font-size: 12px;
  color: var(--text-mid);
  font-family: var(--f-mono);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-signout {
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 999px;
}
.nav-credits {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(229, 50, 47, 0.14);
  border: 1px solid rgba(229, 50, 47, 0.35);
  color: #ff8a86;
  font-family: var(--f-mono);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-credits:hover {
  background: rgba(229, 50, 47, 0.22);
  border-color: rgba(229, 50, 47, 0.55);
}
.nav-credits-value {
  font-size: 13px;
  font-weight: 700;
  color: #ffb0ad;
}
.nav-credits-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 176, 173, 0.7);
}
.nav-credits.low .nav-credits-value {
  color: #ff5a55;
}

.auth-card {
  max-width: 480px;
}
.auth-head {
  margin-bottom: 20px;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
}
.auth-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-mid);
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--e-fast), color var(--e-fast);
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color var(--e-fast), background var(--e-fast);
}
.auth-form input[type="email"]:focus,
.auth-form input[type="password"]:focus {
  outline: none;
  border-color: var(--signal);
  background: rgba(255, 255, 255, 0.06);
}
.auth-error {
  background: rgba(255, 90, 90, 0.1);
  border: 1px solid rgba(255, 90, 90, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  color: #ff9090;
  font-size: 13px;
}
.auth-form .field { margin-bottom: 16px; }

/* Google SSO button — Material-esque, white pill on any background. */
.auth-google-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.btn-google:hover:not(:disabled) {
  background: #f8f9fa;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.btn-google:active:not(:disabled) { transform: translateY(1px); }
.btn-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.btn-google-label { line-height: 1; }
.auth-terms {
  font-size: 12px;
  color: var(--text-dim, #8a8a8a);
  text-align: center;
  line-height: 1.5;
}
.auth-terms a {
  color: var(--text-dim, #8a8a8a);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Deep-link highlight: when the user opens /#job-<id> from the completion
   email, the target tile gets a brief pulse so it's obvious which one just
   finished. Fades on its own after ~2.4s (see handleDeepLink in app.js). */
.tile.deep-link-highlight {
  animation: deep-link-pulse 2.4s ease-out;
  outline: 2px solid var(--accent, #e5322f);
  outline-offset: 3px;
}
@keyframes deep-link-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(229, 50, 47, 0.6); }
  60%  { box-shadow: 0 0 0 14px rgba(229, 50, 47, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 50, 47, 0); }
}

/* ═══ Preview & approval modal ═══════════════════════════════════════ */
.preview-card { max-width: 900px; }
.preview-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 60px 20px; color: var(--text-dim);
}
.preview-spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--hair); border-top-color: var(--accent);
  animation: preview-spin 0.8s linear infinite;
}
@keyframes preview-spin { to { transform: rotate(360deg); } }
.preview-body { display: flex; flex-direction: column; gap: 32px; }
.preview-section { display: flex; flex-direction: column; gap: 14px; }
.preview-section-head h3 {
  margin: 0 0 4px 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
}
.preview-section-sub { margin: 0; font-size: 13px; color: var(--text-dim); }
.preview-refs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.preview-ref {
  aspect-ratio: 16/9; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; background: var(--surface-2, #111);
  cursor: pointer; position: relative;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.preview-ref:hover { transform: translateY(-2px); }
.preview-ref.selected { border-color: var(--accent, #6a8cff); }
/* Attention pulse when the user tries to continue without picking a ref. */
.preview-refs.needs-pick {
  animation: refPickPulse 0.6s ease 0s 2;
  border-radius: 12px;
}
@keyframes refPickPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 80, 80, 0.55); }
  60%  { box-shadow: 0 0 0 10px rgba(255, 80, 80, 0.0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 80, 80, 0.0); }
}
.preview-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-ref .badge {
  position: absolute; top: 6px; left: 6px;
  background: rgba(0,0,0,0.7); color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.preview-ref .check {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent, #6a8cff); color: #fff;
  display: none; align-items: center; justify-content: center;
  font-size: 14px;
}
.preview-ref.selected .check { display: flex; }
.preview-ref.preview-ref-broken { cursor: default; opacity: 0.55; border-style: dashed; }

/* Per-character skeleton tiles: shown while /api/plan/character_refs is still
   generating a reference frame. Shimmer bar + character-name badge so the
   user sees which character is loading. Clicking is disabled until the real
   image arrives (JS gates on data-url). */
.preview-ref.preview-ref-skeleton {
  cursor: wait;
  background: linear-gradient(90deg, #141a24 0%, #1c2432 50%, #141a24 100%);
  background-size: 200% 100%;
  animation: refSkelPulse 1.8s ease-in-out infinite;
}
.preview-ref-shimmer {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 45%, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 40%),
    radial-gradient(circle at 70% 55%, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0) 40%);
}
@keyframes refSkelPulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.preview-ref .badge.badge-character {
  background: rgba(106, 140, 255, 0.85);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  max-width: calc(100% - 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-ref .badge.badge-loading {
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.75);
  backdrop-filter: blur(6px);
}
.preview-ref.preview-ref-ready {
  animation: refReadyFade 0.35s ease-out;
}
@keyframes refReadyFade {
  from { opacity: 0.35; transform: scale(0.985); }
  to   { opacity: 1;    transform: scale(1); }
}
.preview-ref-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 11px; text-align: center;
  padding: 6px;
}
.preview-refs-note {
  grid-column: 1 / -1;
  padding: 10px; text-align: center;
  color: var(--text-dim); font-size: 12px;
  border: 1px dashed var(--hair); border-radius: 8px;
}
.preview-empty { margin: 0; padding: 20px; text-align: center;
  color: var(--text-dim); border: 1px dashed var(--hair);
  border-radius: 10px; font-size: 13px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; }
.preview-empty p { margin: 0; }
.preview-empty .btn-ghost { display: inline-flex; align-items: center; gap: 8px; }
.preview-empty-selected {
  margin: 0; font-size: 12px; color: var(--text);
  padding: 4px 10px; background: rgba(106, 140, 255, 0.08);
  border-radius: 999px;
}
/* Same attention pulse as .preview-refs.needs-pick, but on the empty box. */
.preview-empty.needs-pick {
  animation: refPickPulse 0.6s ease 0s 2;
}
.preview-scenes { display: flex; flex-direction: column; gap: 12px; }
.preview-scene {
  border: 1px solid var(--hair); border-radius: 10px;
  padding: 12px; background: var(--surface-2, rgba(255,255,255,0.02));
}
.preview-scene-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.preview-scene-label {
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  letter-spacing: 0.02em; text-transform: uppercase;
}
.preview-scene-dur { font-size: 12px; color: var(--text-dim); }
.preview-scene textarea {
  width: 100%; min-height: 68px; resize: vertical;
  border: 1px solid var(--hair); border-radius: 6px;
  background: transparent; padding: 8px 10px; color: inherit;
  font-family: inherit; font-size: 13px; line-height: 1.5;
}
.preview-scene textarea:focus { outline: 2px solid var(--accent, #6a8cff); outline-offset: -1px; }

/* Story outline card (long-form two-pass approval) */
.outline-card { display: flex; flex-direction: column; gap: 20px; }
.outline-hero {
  padding: 16px 18px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(120,200,255,.06), rgba(120,200,255,.02));
  border: 1px solid rgba(120,200,255,.15);
}
.outline-hero-eyebrow {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(120,200,255,.85); margin-bottom: 6px;
}
.outline-hero-title { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.outline-hero-sub { font-size: 13px; color: var(--text-mid); line-height: 1.5; }
.outline-warn {
  padding: 10px 12px; border-radius: 8px;
  background: rgba(255,180,60,.08); border: 1px solid rgba(255,180,60,.25);
  color: var(--text-mid); font-size: 12.5px;
}
.outline-section { display: flex; flex-direction: column; gap: 8px; }
.outline-section.outline-a {
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(120,255,180,.18); background: rgba(120,255,180,.03);
}
.outline-section.outline-b {
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(255,160,220,.18); background: rgba(255,160,220,.03);
}
.outline-label {
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-mid);
  display: flex; align-items: center; gap: 8px;
}
.outline-inline {
  flex: 1; background: transparent; border: none; border-bottom: 1px dashed var(--hair);
  color: inherit; font: inherit; font-size: 13px; padding: 2px 0;
  text-transform: none; letter-spacing: normal;
}
.outline-inline:focus { outline: none; border-bottom-color: var(--accent, #6a8cff); }
.outline-card textarea {
  width: 100%; min-height: 44px; resize: vertical;
  border: 1px solid var(--hair); border-radius: 6px;
  background: transparent; padding: 8px 10px; color: inherit;
  font-family: inherit; font-size: 13px; line-height: 1.5;
}
.outline-card textarea:focus { outline: 2px solid var(--accent, #6a8cff); outline-offset: -1px; }
.outline-beat { display: flex; flex-direction: column; gap: 4px; }
.outline-beat-label {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em;
  color: var(--text-dim);
}
.outline-cast-line {
  font-family: var(--f-mono); font-size: 11.5px; color: var(--text-dim);
  padding-top: 2px;
}
.outline-notes {
  padding: 10px 12px; border-radius: 8px;
  background: var(--bg-elev-2); border: 1px solid var(--hair);
  font-size: 12.5px; color: var(--text-mid); line-height: 1.5;
}
.preview-actions {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding-top: 12px; border-top: 1px solid var(--hair);
}
.btn-secondary {
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--hair);
  background: transparent; color: inherit; cursor: pointer; font-size: 13px;
}
.btn-secondary:hover { background: var(--surface-2, rgba(255,255,255,0.03)); }

.preview-section-head-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 4px;
}
.preview-section-head-row h3 { margin: 0; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 6px; border: 1px solid var(--hair);
  background: transparent; color: var(--text-dim); cursor: pointer;
  font-size: 12px; font-family: inherit;
}
.btn-ghost:hover { background: var(--surface-2, rgba(255,255,255,0.03)); color: inherit; }
.btn-ghost[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-ghost svg { transition: transform 0.4s ease; }
.btn-ghost.spinning svg { animation: preview-spin 0.9s linear infinite; }

/* ── Render Started notice modal ─────────────────────────────────── */
.render-started-card { max-width: 480px; text-align: center; padding: 40px 32px 32px; }
.render-started-body { display: flex; flex-direction: column; align-items: center; }
.render-started-icon {
  width: 88px; height: 88px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(106,140,255,0.16), rgba(106,140,255,0.06));
  color: var(--accent, #6a8cff);
  margin-bottom: 18px;
  border: 1px solid rgba(106,140,255,0.28);
}
.render-started-body .composer-title { margin: 8px 0 10px; font-size: 26px; }
.render-started-lead {
  font-size: 15px; color: var(--text-dim); line-height: 1.55;
  margin: 0 0 20px; max-width: 380px;
}
.render-started-lead b { color: var(--text); font-weight: 600; word-break: break-all; }
.render-started-facts {
  list-style: none; padding: 0; margin: 0 0 22px;
  display: flex; flex-direction: column; gap: 10px;
  text-align: left; width: 100%;
  background: var(--surface-2, rgba(255,255,255,0.03));
  border: 1px solid var(--hair);
  border-radius: 10px;
  padding: 14px 16px;
}
.render-started-facts li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; line-height: 1.55; color: var(--text);
}
.render-started-facts li b { color: var(--accent, #6a8cff); font-weight: 600; }
.fact-dot {
  flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent, #6a8cff); margin-top: 8px;
}
.render-started-actions { width: 100%; }
.render-started-actions .btn-primary { width: 100%; padding: 12px 20px; font-size: 14px; }
