/* smallcase AI — intro page. Light page; the video sits in a dark navy card (#1E1A6B sampled from the video). */
:root {
  --navy: #1E196A;
  --navy-deep: #16124F;
  --blue: #1F7AE0;
  --blue-hover: #1867C2;
  --purple: #7E4DFF;
  --bg: #F5F7FA;
  --text: #2F363F;
  --text-2: #5A6270;
  --text-3: #7A8290;
  --border: #E1E5EC;
  --white: #fff;
  --faint: rgba(255, 255, 255, .5);
  /* Seven metric-chip colours from the video, in story order. */
  --chips: linear-gradient(90deg, #7E4DFF, #1F7AE0, #19AF55, #F5A623, #22B8CF, #E8578B, #12A594);
  --radius: 18px;
  --focus: 0 0 0 2px var(--white), 0 0 0 4px var(--blue);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --topbar-h: 56px;
  --footer-h: 44px;
  --meta-h: 48px;      /* row above the video incl. gap */
  --hero-h: 176px;     /* heading block incl. margin; JS replaces with the measured value */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
button { font: inherit; color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  padding: 10px 14px; border-radius: 10px;
  background: var(--navy); color: var(--white); font-weight: 600; text-decoration: none;
}
.skip-link:focus-visible { top: 12px; }

/* ---------- Top bar ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px, 3vw, 32px);
  position: relative; z-index: 2;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--white);
  box-shadow: 0 0 0 1px var(--border), 0 1px 3px rgba(30, 25, 106, .08);
}
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.brand-ai {
  background: linear-gradient(90deg, var(--purple), var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.top-link {
  font-size: 13px; font-weight: 500; color: var(--text-2); text-decoration: none;
  padding: 6px 2px; border-radius: 6px;
  transition: color .2s var(--ease);
}
.top-link:hover { color: var(--navy); }

/* ---------- Main ---------- */
.main {
  flex: 1;
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px clamp(16px, 3vw, 32px) 16px;
}
.glow {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(45% 45% at 50% 22%, rgba(31, 122, 224, .07), transparent 70%),
    radial-gradient(40% 45% at 50% 70%, rgba(126, 77, 255, .06), transparent 70%);
}

/* ---------- Heading ---------- */
.hero {
  position: relative; z-index: 1;
  max-width: 900px; text-align: center;
  margin: 0 auto 26px;
}
.eyebrow {
  margin: 0;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--blue);
}
.headline {
  margin: 12px 0 0;
  font-size: clamp(32px, min(4.2vw, 6.4vh), 56px);
  line-height: 1.08; letter-spacing: -.025em; font-weight: 600;
  color: var(--navy);
  text-wrap: balance;
}
.subline {
  margin: 12px auto 0;
  font-size: clamp(16px, min(1.5vw, 2.3vh), 20px);
  color: var(--text-2);
  max-width: 62ch;
  text-wrap: balance;
}
.nowrap { white-space: nowrap; }

/* ---------- Player ---------- */
.player {
  position: relative; z-index: 1;
  /* Large but always fits the viewport height on desktop (heading + meta row + chrome subtracted). */
  width: min(1100px, 92vw, 100%,
             calc((100svh - var(--topbar-h) - var(--footer-h) - var(--hero-h) - var(--meta-h) - 28px) * 16 / 9));
  min-width: min(100%, 560px);
}

/* Row above the video: length on the left, the way out on the right. */
.meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
  min-height: calc(var(--meta-h) - 10px);
}
.duration {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.duration-icon { font-size: 10px; }
.skip-demo {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 16px;
  border-radius: 999px;
  background: var(--white); color: var(--blue);
  border: 1px solid #CFE0F6;
  font-size: 14px; font-weight: 600; text-decoration: none;
  box-shadow: 0 1px 2px rgba(30, 25, 106, .06);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.skip-demo:hover { background: #EEF5FD; border-color: var(--blue); color: var(--blue-hover); }
.skip-demo span { transition: transform .2s var(--ease); }
.skip-demo:hover span { transform: translateX(3px); }

.frame {
  position: relative;
  border-radius: var(--radius);
  box-shadow:
    0 1px 2px rgba(30, 25, 106, .08),
    0 24px 60px -18px rgba(30, 25, 106, .35),
    0 10px 24px -12px rgba(30, 25, 106, .2);
}

.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy-deep);
}
.stage video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* Full-surface click target: toggles pause. */
.hit {
  position: absolute; inset: 0; z-index: 1;
  border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer;
  border-radius: var(--radius);
}
.hit:focus-visible { box-shadow: inset 0 0 0 3px #9DB8FF; }

.big-play {
  position: absolute; z-index: 2; left: 50%; top: 50%;
  width: 76px; height: 76px; margin: -38px 0 0 -38px;
  border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .95); color: var(--navy);
  box-shadow: 0 10px 30px rgba(5, 3, 40, .45);
  pointer-events: none; /* clicks fall through to .hit */
}
.big-play svg { width: 34px; height: 34px; margin-left: 4px; }
.big-play.is-start { pointer-events: auto; }

/* Thin progress line along the bottom edge of the video. */
.progress {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  height: 16px; display: flex; align-items: flex-end;
  cursor: pointer;
}
.progress-track { width: 100%; height: 3px; background: rgba(255, 255, 255, .16); transition: height .2s var(--ease); }
.progress:hover .progress-track, .progress:focus-visible .progress-track { height: 5px; }
.progress:focus-visible { box-shadow: inset 0 0 0 2px #9DB8FF; }
.progress-fill {
  height: 100%; width: 100%;
  background: var(--chips);
  transform-origin: left center; transform: scaleX(0);
}

/* ---------- Controls (overlaid on desktop, a row below the video on mobile) ---------- */
.bar { pointer-events: none; }
.is-ended .bar { display: none; }
.bar > * { pointer-events: auto; }

.ctl {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(22, 18, 79, .55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--white); font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), opacity .3s var(--ease);
}
.ctl:hover { background: rgba(22, 18, 79, .8); border-color: rgba(255, 255, 255, .35); }
.ctl svg { width: 18px; height: 18px; }
.ctl .i-sound { display: none; }
.ctl[aria-pressed="true"] .i-sound { display: block; }
.ctl[aria-pressed="true"] .i-muted { display: none; }

.time {
  font-size: 12px; color: rgba(255, 255, 255, .7);
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
  pointer-events: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}

@media (min-width: 721px) {
  .bar .ctl { position: absolute; z-index: 4; left: 16px; bottom: 20px; }
  .bar .time { position: absolute; z-index: 4; right: 18px; bottom: 26px; }
  /* Quiet while playing; full strength on hover or keyboard focus. */
  .frame.is-playing.is-idle .time { opacity: 0; }
  .frame.is-playing.is-idle .ctl { opacity: .7; }
  .frame.is-playing.is-idle .progress-track { opacity: .55; }
}

/* ---------- End state (dark overlay on the dark video card) ---------- */
.end {
  position: absolute; inset: 0; z-index: 10;
  display: grid; place-items: center;
  border-radius: var(--radius);
  color: var(--white);
  background: radial-gradient(70% 80% at 50% 45%, rgba(30, 25, 106, .82), rgba(22, 18, 79, .94));
  -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
  animation: fade-in .45s var(--ease) both;
}
.end-card {
  width: min(640px, 88%);
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  animation: rise .5s .05s var(--ease) both;
}
.end-line {
  width: 112px; height: 3px; border-radius: 3px;
  background: var(--chips);
  margin-bottom: 26px;
}
.end-title {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 50px);
  line-height: 1.06; letter-spacing: -.025em; font-weight: 700;
}
.end-title:focus-visible { box-shadow: none; }
.end-sub {
  margin: 14px 0 0;
  font-size: clamp(15px, 1.5vw, 18px);
  color: rgba(255, 255, 255, .8);
  max-width: 34ch;
}
.end-actions {
  margin-top: 30px;
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.end .btn:focus-visible { box-shadow: 0 0 0 2px var(--navy), 0 0 0 4px #9DB8FF; }
.btn-primary {
  min-height: 56px; padding: 0 30px; font-size: 17.5px;
  background: var(--white); color: var(--navy);
  box-shadow: 0 10px 30px -8px rgba(126, 77, 255, .65), 0 2px 6px rgba(5, 3, 40, .3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 36px -8px rgba(126, 77, 255, .8), 0 2px 6px rgba(5, 3, 40, .3); }
.btn-primary span { transition: transform .2s var(--ease); }
.btn-primary:hover span { transform: translateX(3px); }
.btn-ghost {
  background: transparent; color: var(--white);
  border-color: rgba(255, 255, 255, .32);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .55); }

.end-hint {
  margin: 18px 0 0;
  font-size: 13px; color: var(--faint);
  max-width: 46ch;
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Footer ---------- */
.footer {
  min-height: var(--footer-h);
  display: flex; align-items: center; justify-content: center;
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
  font-size: 11.5px; color: var(--text-3); text-align: center;
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  :root { --radius: 14px; }
  .topbar { height: 52px; }
  .top-link { display: none; } /* the skip button sits right above the video */
  .main { justify-content: flex-start; padding: 20px 16px 24px; }
  .hero { margin-bottom: 22px; }
  .eyebrow { font-size: 11px; letter-spacing: .12em; line-height: 1.7; }
  .eyebrow .nowrap { display: block; }
  .eyebrow-dot { display: none; }
  .headline { margin-top: 10px; }
  .subline { font-size: 16px; }

  .player { width: 100%; min-width: 0; }
  .meta { margin-bottom: 12px; }
  .skip-demo { min-height: 46px; padding: 0 20px; font-size: 15px; background: var(--blue); color: var(--white); border-color: var(--blue); }
  .skip-demo:hover { background: var(--blue-hover); color: var(--white); }
  .big-play { width: 64px; height: 64px; margin: -32px 0 0 -32px; }

  .frame { box-shadow: none; }
  .stage { box-shadow: 0 16px 40px -16px rgba(30, 25, 106, .35); }
  /* End card takes the stage; Watch again brings the video back. */
  .is-ended .stage { display: none; }

  .bar {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 0 0;
  }
  .ctl {
    height: 44px; padding: 0 16px; font-size: 15px;
    background: var(--white); color: var(--navy); border-color: var(--border);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .ctl:hover { background: #EEF1F6; border-color: var(--border); }
  .time { margin-left: auto; font-size: 13px; color: var(--text-3); text-shadow: none; }

  .end {
    position: static;
    background: radial-gradient(90% 80% at 50% 40%, #241E7A, var(--navy-deep));
    -webkit-backdrop-filter: none; backdrop-filter: none;
    padding: 36px 20px 28px;
    box-shadow: 0 16px 40px -16px rgba(30, 25, 106, .35);
  }
  .end-card { width: 100%; }
  .end-line { margin-bottom: 20px; }
  .end-sub { font-size: 16px; }
  .end-actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 380px; margin-top: 26px; }
  .btn { min-height: 52px; }
  .btn-primary { min-height: 58px; }
  .end-hint { display: none; }
}

@media (max-height: 640px) and (min-width: 721px) {
  .end-line { margin-bottom: 14px; }
  .end-actions { margin-top: 18px; }
  .end-hint { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
  .btn-primary:hover, .btn-primary:hover span, .skip-demo:hover span { transform: none; }
}

/* Voiceover: make the muted state an obvious call to unmute */
.ctl[aria-pressed="false"] {
  background: #fff; color: #1E196A; border-color: #fff; font-weight: 600;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); animation: sound-pulse 2.4s ease-out 1s 3;
}
.ctl[aria-pressed="false"]:hover { background: #F5F7FA; }
.frame.is-playing.is-idle .ctl[aria-pressed="false"] { opacity: 1; }
@keyframes sound-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); } 70% { box-shadow: 0 0 0 12px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
@media (prefers-reduced-motion: reduce) { .ctl[aria-pressed="false"] { animation: none; } }
@media (max-width: 720px) { .ctl[aria-pressed="false"] { border-color: #1E196A; box-shadow: none; } }
