/* ============================================================
   FuseTV — vertical micro-drama OTT prototype
   Dark-only design system
   ============================================================ */

:root {
  /* surfaces — deep cool greens, near-black */
  --bg:         #070D0A;
  --bg-2:       #0A120D;
  --surface:    #0F1813;
  --surface-2:  #15221A;
  --surface-3:  #1D2E23;

  /* text */
  --text:       #ECF5EF;
  --text-dim:   rgba(236,245,239,0.60);
  --text-faint: rgba(236,245,239,0.36);
  --text-ghost: rgba(236,245,239,0.18);

  /* hairlines / glass */
  --line:       rgba(140,255,190,0.08);
  --line-2:     rgba(160,255,200,0.15);
  --glass:      rgba(18,34,26,0.55);
  --glass-hi:   rgba(160,255,200,0.16);

  /* electric green system — green is the active fill + glow */
  --green:      #32EC7C;
  --green-2:    #5CF09A;
  --green-dim:  #1CA75C;
  --green-glow: rgba(50,236,124,0.45);
  --grad: #32EC7C;             /* bright/active fill */
  --grad-soft: rgba(50,236,124,0.12);
  --brand-fg: #04160C;         /* text/icons on a bright green fill */
  --accent:     #32EC7C;
  --accent-pink:#FF6B72;       /* love red */
  --accent-amber:#32EC7C;      /* premium accent (now green) */
  --accent-cool:#7FD8B0;       /* soft mint */
  --live:       #FF5C63;

  /* type */
  --display: 'Hanken Grotesk', system-ui, sans-serif;
  --ui:      'Hanken Grotesk', system-ui, sans-serif;
  --mono:    ui-monospace, 'SF Mono', 'Roboto Mono', Menlo, monospace;

  /* radii */
  --r-card: 18px;
  --r-lg:   24px;
  --r-sheet:30px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-2: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: #050908;
  font-family: var(--ui);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

/* center the device on an earthy gradient backdrop */
.stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1100px 760px at 50% 10%, rgba(50,236,124,0.18), transparent 60%),
    radial-gradient(900px 720px at 82% 96%, rgba(28,167,92,0.16), transparent 60%),
    linear-gradient(168deg, #0A1A12 0%, #08120D 54%, #050908 100%);
  overflow: hidden;
}
.stage-inner { transform-origin: center center; }

/* no scrollbars inside the phone */
.noscroll::-webkit-scrollbar { width: 0; height: 0; display: none; }
.noscroll { scrollbar-width: none; -ms-overflow-style: none; }

button { font-family: inherit; color: inherit; border: none; background: none; cursor: pointer; }
img { display: block; }

/* ---- app shell ---- */
.app {
  position: absolute; inset: 0;
  background:
    radial-gradient(130% 46% at 50% -6%, rgba(50,236,124,0.16), transparent 62%),
    linear-gradient(180deg, #0C1A12 0%, #0A140E 38%, #070D0A 74%, #060B09 100%);
  overflow: hidden;
}
/* floating bottom nav fades out while a bottom sheet is open so it never overlaps sheet content */
.bottom-nav { transition: opacity .28s var(--ease), transform .3s var(--ease); }
.app-sheet-open .bottom-nav { opacity: 0; transform: translateY(28px); pointer-events: none; }
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ---- accent helpers (electric green) ---- */
.grad-bg { background: var(--grad); }
.grad-text {
  color: var(--green);
  -webkit-text-fill-color: currentColor;
  background: none;
  text-shadow: 0 0 18px rgba(50,236,124,0.40);
}
.grad-ring { position: relative; }
.grad-ring::before {
  content:''; position:absolute; inset:-2px; border-radius:inherit;
  padding:1.5px; background:var(--green);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events:none;
  box-shadow: 0 0 14px rgba(50,236,124,0.5);
}

/* ---- liquid glass surfaces ---- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 0.5px solid var(--line-2);
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.20);
}

/* ---- pills / tags ---- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  white-space: nowrap; line-height: 1;
}
.tag-glass { background: rgba(255,255,255,0.10); color: var(--text); border: 0.5px solid var(--line-2); }
.tag-genre { background: rgba(255,255,255,0.06); color: var(--text-dim); border: 0.5px solid var(--line); }

/* production tag colors (muted) */
.prod { font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; }
.prod-live  { color: #E79AA2; }
.prod-ai    { color: #9FC6D6; }
.prod-hybrid{ color: #BDB0D6; }
.prod-orig  { color: #DBC18E; }

/* ---- buttons ---- */
.btn-grad {
  background: var(--grad); color: var(--brand-fg); font-weight: 700;
  border-radius: 999px; padding: 15px 24px; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 6px 22px rgba(50,236,124,0.34), 0 0 0 0.5px rgba(50,236,124,0.35);
  transition: transform .14s var(--ease), box-shadow .2s var(--ease), filter .2s;
}
.btn-grad:active { transform: scale(0.96); filter: brightness(0.96); }

.btn-glass {
  background: rgba(255,255,255,0.10); color: var(--text); font-weight: 600;
  border-radius: 999px; padding: 14px 22px; font-size: 14px;
  border: 0.5px solid var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .14s var(--ease), background .2s;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.btn-glass:active { transform: scale(0.96); background: rgba(255,255,255,0.16); }

/* tappable scale */
.tap { transition: transform .16s var(--ease); }
.tap:active { transform: scale(0.95); }

/* ---- titles — sleek, lighter weight ---- */
.display {
  font-family: var(--display); font-weight: 600;
  letter-spacing: -0.022em; line-height: 1.05; text-transform: none;
}

/* active bottom-tab icon: subtle earthy gradient stroke */
.nav-ico-active svg { stroke: url(#navGrad); }

/* ---- refracted liquid-glass circular button ---- */
.glass-fab {
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(16px) saturate(190%);
  -webkit-backdrop-filter: blur(16px) saturate(190%);
  border: 1px solid rgba(255,255,255,0.32);
  box-shadow:
    inset 1.5px 1.5px 1.5px rgba(255,255,255,0.45),
    inset -1px -1.5px 1.5px rgba(255,255,255,0.10),
    0 8px 22px rgba(0,0,0,0.35);
  color: #fff;
}

/* ============================================================
   Motion
   ============================================================ */
@keyframes fadeUp { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform:none; } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes scaleIn { from { opacity:0; transform: scale(0.96); } to { opacity:1; transform:none; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes popHeart {
  0% { transform: scale(0); opacity: 0; }
  40% { transform: scale(1.25); opacity: 1; }
  70% { transform: scale(0.92); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes burstUp {
  0%   { transform: translate(-50%, 0) scale(0.6); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(-50%, -120px) scale(1.1); opacity: 0; }
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dotPulse { 0%,100% { opacity:.35; transform: scale(1);} 50% { opacity:1; transform: scale(1.15);} }
@keyframes floatSticker {
  0%   { transform: translateY(0) scale(0.4) rotate(var(--rot,0deg)); opacity: 0; }
  15%  { opacity: 1; transform: translateY(-10px) scale(1.2) rotate(var(--rot,0deg)); }
  100% { transform: translateY(-260px) scale(0.9) rotate(var(--rot,0deg)); opacity: 0; }
}
@keyframes glowPulse {
  0%,100% { box-shadow: 0 8px 26px rgba(50,236,124,0.30); }
  50%     { box-shadow: 0 8px 36px rgba(92,240,154,0.50); }
}

/* electric-green glow utility */
.glow { box-shadow: 0 0 22px rgba(50,236,124,0.45); }
.text-glow { text-shadow: 0 0 16px rgba(50,236,124,0.5); }

@keyframes slideRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Base = the visible END state. Entrance animations only run when motion is
   allowed, so print / reduced-motion / static captures always show content
   instead of the pre-animation opacity:0 frame. */
.anim-fadeUp, .anim-fadeIn, .anim-scaleIn, .enter-right, .enter-up {
  opacity: 1; transform: none;
}
@media (prefers-reduced-motion: no-preference) {
  .enter-right { animation: slideRight .36s var(--ease) both; }
  .enter-up    { animation: slideUp .4s var(--ease) both; }
  .anim-fadeUp { animation: fadeUp .5s var(--ease) both; }
  .anim-fadeIn { animation: fadeIn .4s var(--ease) both; }
  .anim-scaleIn{ animation: scaleIn .4s var(--ease) both; }
}

/* ---- staggered screen entrances ---- */
.stagger > * { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .stagger > * { animation: fadeUp .6s var(--ease) both; }
  .stagger > *:nth-child(1) { animation-delay: .03s; }
  .stagger > *:nth-child(2) { animation-delay: .09s; }
  .stagger > *:nth-child(3) { animation-delay: .15s; }
  .stagger > *:nth-child(4) { animation-delay: .21s; }
  .stagger > *:nth-child(5) { animation-delay: .27s; }
  .stagger > *:nth-child(6) { animation-delay: .33s; }
  .stagger > *:nth-child(7) { animation-delay: .39s; }
  .stagger > *:nth-child(8) { animation-delay: .45s; }
  .stagger > *:nth-child(n+9) { animation-delay: .5s; }
}

/* ---- hero-zoom detail reveal (content streams in after the thumbnail fills the screen) ---- */
/* hidden only BEFORE reveal; once .dz-go lands, base state is visible so content
   can never get stranded invisible if the entrance animation is interrupted */
.dz-stagger:not(.dz-go) > * { opacity: 0; transform: translateY(18px); }
@media (prefers-reduced-motion: no-preference) {
  .dz-stagger.dz-go > * { animation: fadeUp .5s var(--ease) both; }
  .dz-stagger.dz-go > *:nth-child(1) { animation-delay: 0s; }
  .dz-stagger.dz-go > *:nth-child(2) { animation-delay: .07s; }
  .dz-stagger.dz-go > *:nth-child(3) { animation-delay: .14s; }
  .dz-stagger.dz-go > *:nth-child(4) { animation-delay: .21s; }
  .dz-stagger.dz-go > *:nth-child(5) { animation-delay: .28s; }
  .dz-stagger.dz-go > *:nth-child(6) { animation-delay: .35s; }
  .dz-stagger.dz-go > *:nth-child(n+7) { animation-delay: .42s; }
}
@media (prefers-reduced-motion: reduce) {
  .dz-stagger > * { opacity: 1 !important; transform: none !important; }
}
/* ---- liquid tab indicator ---- */
@keyframes blobSquash {
  0%   { transform: scale(1, 1); }
  35%  { transform: scale(1.16, 0.9); }
  68%  { transform: scale(0.97, 1.03); }
  100% { transform: scale(1, 1); }
}

.skeleton {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* spinner */
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.25); border-top-color: #fff;
  animation: spin .8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton, .spinner { animation: none !important; }
}

/* ============================================================
   TWEAK: Phone frame on/off
   Strips the iOS bezel so the screen renders as a bare 402-wide
   canvas. The status bar stays (acts as a top safe-area); the
   notch island + home-indicator are hardware cues, so they go.
   ============================================================ */
.no-frame .device {
  border-radius: 0;
  background: var(--bg);
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.no-frame .island,
.no-frame .home-indicator { display: none; }

/* ============================================================
   TWEAK: Backdrop colour (the stage BEHIND the device)
   Only affects the area around the phone — the app's own screens
   are untouched. Most visible with the phone frame on.
   ============================================================ */
body.backdrop-light .stage {
  background:
    radial-gradient(1100px 760px at 50% 8%, rgba(50,236,124,0.07), transparent 60%),
    linear-gradient(168deg, #FFFFFF 0%, #F4F7F5 60%, #EEF2F0 100%);
}
body.backdrop-light .device {
  box-shadow:
    0 40px 90px rgba(40,60,50,0.22),
    0 0 0 11px #16161a, 0 0 0 13px #2a2a30, 0 0 0 14px rgba(0,0,0,0.04);
}
body.backdrop-light.no-frame .device {
  box-shadow: 0 30px 80px rgba(40,60,50,0.18);
}
