/* ============================================================
   Copperline demo — intro trailer overlay
   Plays on load; "Try the demo" reveals the Intelligence Center
   blurred behind it. Fully self-contained (no app tokens needed).
   ============================================================ */

:root{
  --intro-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
                "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* The React app sitting behind the video: mostly blurred, faintly visible */
#root{ transition: filter .5s ease, transform .5s ease; }
body.intro-active #root{
  filter: blur(22px) saturate(1.05);
  transform: scale(1.04);
  pointer-events: none;
  user-select: none;
}
body.intro-active{ overflow: hidden; }

/* Full-viewport layer — above the app and the Ask launcher */
#intro{
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  background: radial-gradient(120% 120% at 50% 30%, rgba(0,0,0,.48), rgba(0,0,0,.74));
  opacity: 1; transition: opacity .45s ease;
  -webkit-font-smoothing: antialiased;
  font-family: var(--intro-sans);
}
#intro.fading{ opacity: 0; }

/* Video card — never fullscreen unless toggled */
.intro-card{
  position: relative;
  width: min(1120px, 100%);
  max-height: 86vh;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.55), 0 2px 10px rgba(0,0,0,.4);
  transform: translateY(8px) scale(.985);
  opacity: 0;
  animation: introRise .5s cubic-bezier(.2,.7,.2,1) .05s forwards;
}
@keyframes introRise{ to{ transform: none; opacity: 1; } }

.intro-card video{
  width: 100%; height: 100%; display: block;
  object-fit: contain; background: #000;
}
.intro-card:fullscreen{
  width: 100vw; height: 100vh; max-height: none;
  aspect-ratio: auto; border-radius: 0;
}

/* -------- "Tap for sound" (shown while muted) -------- */
.tap-sound{
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; cursor: pointer;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.28));
  color: #fff; text-align: center;
  transition: opacity .3s ease;
}
.tap-sound.hidden{ opacity: 0; pointer-events: none; }
.tap-sound .ring{
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse{ 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.06); } }
.tap-sound .ring svg{ width: 38px; height: 38px; }
.tap-sound .label{ font: 600 15px/1.2 var(--intro-sans); letter-spacing: .01em;
  text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.tap-sound .sub{ font: 500 12.5px/1.3 var(--intro-sans); opacity: .78; }

/* -------- Fallback big play (if autoplay is blocked) -------- */
.big-play{
  position: absolute; inset: 0; z-index: 4; margin: auto;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25); cursor: pointer; color:#fff;
}
.big-play.show{ display: flex; }
.big-play .ring{ width: 92px; height: 92px; border-radius: 50%;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.4);
  display: grid; place-items: center; backdrop-filter: blur(8px); }
.big-play svg{ width: 40px; height: 40px; }

/* -------- Control bar -------- */
.intro-controls{
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 26px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.66));
  opacity: 0; transition: opacity .25s ease;
  font: 500 13px/1 var(--intro-sans); color: #fff;
}
.intro-card:hover .intro-controls,
.intro-controls.pinned{ opacity: 1; }

.ctl-btn{
  appearance: none; border: 0; background: transparent; color: #fff;
  width: 36px; height: 36px; border-radius: 9px; cursor: pointer;
  display: grid; place-items: center; flex: 0 0 auto;
  transition: background .15s ease;
}
.ctl-btn:hover{ background: rgba(255,255,255,.16); }
.ctl-btn svg{ width: 20px; height: 20px; }

.intro-time{ flex: 0 0 auto; font-variant-numeric: tabular-nums; opacity: .9;
  min-width: 82px; text-align: center; }

.intro-progress{
  flex: 1 1 auto; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,.28); cursor: pointer; position: relative;
}
.intro-progress .fill{
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: #fff; border-radius: 999px;
}

/* Skip link */
.intro-skip{
  position: absolute; top: 12px; right: 14px; z-index: 6;
  appearance: none; border: 0; cursor: pointer;
  background: rgba(0,0,0,.42); color: #fff;
  font: 600 12.5px/1 var(--intro-sans); letter-spacing: .01em;
  padding: 9px 14px; border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.22);
  transition: background .15s ease;
}
.intro-skip:hover{ background: rgba(0,0,0,.6); }

/* -------- End card: "Try the demo" -------- */
.intro-end{
  position: absolute; inset: 0; z-index: 7;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; text-align: center; color: #fff; padding: 24px;
  background: linear-gradient(180deg, rgba(0,0,0,.5), rgba(0,0,0,.72));
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.intro-end.show{ display: flex; animation: introRise .4s ease forwards; }
.intro-end .eyebrow{ font: 600 12px/1 var(--intro-sans); letter-spacing: .14em;
  text-transform: uppercase; opacity: .7; }
.intro-end h2{ margin: 0; font: 600 clamp(22px, 3.2vw, 34px)/1.1 var(--intro-sans);
  letter-spacing: -.01em; }
.intro-end p{ margin: 0; max-width: 42ch; font: 400 15px/1.5 var(--intro-sans); opacity: .82; }

.try-demo{
  appearance: none; border: 0; cursor: pointer;
  background: #fff; color: #111;
  font: 600 16px/1 var(--intro-sans); letter-spacing: .01em;
  padding: 16px 30px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
  transition: transform .15s ease, box-shadow .15s ease;
}
.try-demo:hover{ transform: translateY(-1px); box-shadow: 0 14px 50px rgba(0,0,0,.5); }
.try-demo svg{ width: 18px; height: 18px; }
.intro-replay{
  appearance: none; border: 1px solid rgba(255,255,255,.3); cursor: pointer;
  background: transparent; color: #fff;
  font: 500 13.5px/1 var(--intro-sans); padding: 10px 18px; border-radius: 999px;
  transition: background .15s ease;
}
.intro-replay:hover{ background: rgba(255,255,255,.14); }

/* Floating "Watch intro" replay pill (bottom-left, clear of the Ask launcher) */
.intro-watch-btn{
  position: fixed; left: 20px; bottom: 20px; z-index: 9000;
  appearance: none; cursor: pointer;
  background: rgba(20,26,40,.82); color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  font: 500 13px/1 var(--intro-sans);
  padding: 10px 15px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.32);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background .15s ease, transform .15s ease;
}
.intro-watch-btn:hover{ background: rgba(30,38,56,.92); transform: translateY(-1px); }
.intro-watch-btn svg{ width: 14px; height: 14px; }

@media (max-width: 640px){
  .intro-card{ width: 100%; }
  .intro-time{ min-width: 64px; font-size: 12px; }
  .intro-skip{ top: 10px; right: 10px; padding: 8px 12px; }
  .intro-watch-btn{ left: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce){
  .intro-card, .intro-end{ animation: none; opacity: 1; transform: none; }
  .tap-sound .ring{ animation: none; }
}
