/* OpSync voice demo. Phone-call screen in the OpSync frame (black + neon green).
   Mobile first: base styles are the phone, min-width queries add the desktop layout. */
:root {
  --ink: #050807;
  --panel: #0c1210;
  --panel-2: #121a17;
  --line: #1f2b27;
  --text: #eef3f1;
  --muted: #9fb0aa;
  --green: #00ff88;
  --green-deep: #00c96b;
  --red: #ff4d4d;
  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--ink); color: var(--text);
  font-family: var(--body); font-size: 1rem; line-height: 1.55;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: var(--green); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }

/* Demo disclosure bar */
.demo-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: #0a1411; border-bottom: 1px solid var(--line); font-size: .9rem; color: var(--muted);
}
.demo-bar__tag {
  font-family: var(--display); font-weight: 600; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); background: var(--green); padding: 3px 8px; border-radius: 4px;
}
.demo-bar__text { flex: 1 1 220px; min-width: 0; }
.demo-bar__brand { color: var(--text); text-decoration: none; white-space: nowrap; }
.demo-bar__brand b { color: var(--green); font-family: var(--display); }

/* Layout */
.stage {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px;
  max-width: 1120px; margin: 0 auto; padding: 28px 16px 56px;
}

/* The phone */
.phone { display: flex; justify-content: center; }
.phone__screen {
  width: 100%; max-width: 380px; text-align: center;
  background: radial-gradient(120% 70% at 50% 0%, #0f2a20 0%, var(--panel) 55%);
  border: 1px solid var(--line); border-radius: 36px; padding: 22px 22px 26px;
  box-shadow: 0 30px 80px -30px rgba(0, 255, 136, .18), inset 0 0 0 6px #070b0a;
}
.phone__carrier { display: flex; justify-content: space-between; margin: 0 6px 26px; font-size: .8rem; color: var(--muted); }
.phone__clock { font-variant-numeric: tabular-nums; }
.phone__avatar {
  position: relative; width: 112px; height: 112px; margin: 0 auto 20px; border-radius: 50%;
  display: grid; place-items: center; background: #0a1a14; border: 1px solid #1d3a2e; color: var(--green);
}
.phone__flame { width: 46px; height: 46px; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--green); opacity: 0; }
.phone__name { font-family: var(--display); font-weight: 700; font-size: clamp(1.9rem, 7vw, 2.4rem); line-height: 1.1; margin: 0; letter-spacing: -.01em; }
.phone__sub { margin: 6px 0 22px; color: var(--muted); }
.phone__status { min-height: 1.6em; margin: 0; font-weight: 500; }
.phone__timer { margin: 4px 0 0; font-family: var(--display); font-variant-numeric: tabular-nums; color: var(--muted); }
.phone__actions { margin-top: 26px; display: flex; justify-content: center; }
.phone__note { margin: 14px 0 0; font-size: .82rem; color: var(--muted); }

.call-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; min-width: 200px; padding: 0 28px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 1.1rem/1 var(--display); color: var(--ink); background: var(--green);
  transition: transform .2s var(--ease), background-color .2s var(--ease);
}
.call-btn svg { width: 22px; height: 22px; }
.call-btn:hover { transform: translateY(-1px); background: #33ffa0; }
.call-btn:active { transform: scale(.97); }
.call-btn[disabled] { opacity: .6; cursor: progress; }

/* States */
[data-state="idle"] .ring { animation: ring 2.4s var(--ease) infinite; }
[data-state="idle"] .ring--2 { animation-delay: .8s; }
[data-state="idle"] .ring--3 { animation-delay: 1.6s; }
@keyframes ring { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.7); opacity: 0; } }
[data-state="speaking"] .phone__avatar { box-shadow: 0 0 0 6px rgba(0, 255, 136, .15), 0 0 40px rgba(0, 255, 136, .35); }
[data-state="speaking"] .ring--1 { opacity: .5; animation: pulse 1s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1.05); } 50% { transform: scale(1.18); } }
[data-state="listening"] .phone__avatar { border-color: var(--green); }
[data-state="connecting"] .phone__avatar { opacity: .7; }
[data-state="live"] .call-btn, [data-state="speaking"] .call-btn, [data-state="listening"] .call-btn { background: var(--red); color: var(--ink); }
[data-state="live"] .call-btn svg, [data-state="speaking"] .call-btn svg, [data-state="listening"] .call-btn svg { transform: rotate(135deg); }

/* Script cards */
.script h2, .connect h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 5vw, 1.8rem); line-height: 1.2; margin: 0 0 10px; }
.script__lede { color: var(--muted); margin: 0 0 18px; max-width: 60ch; }
.callers { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.caller { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.caller__who { margin: 0; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acct { font-family: var(--display); font-size: .82rem; letter-spacing: .04em; color: var(--green); background: #0a1a14; border: 1px solid #1d3a2e; padding: 1px 8px; border-radius: 6px; }
.caller__say { margin: 8px 0 4px; font-weight: 600; font-size: 1.05rem; color: var(--text); }
.caller__expect { margin: 0; color: var(--muted); font-size: .93rem; }
.script__tip { margin: 14px 0 0; color: var(--muted); font-size: .9rem; }

/* Connect */
.connect { border-top: 1px solid var(--line); padding-top: 32px; }
.steps { margin: 0 0 24px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; color: var(--muted); }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font: 600 .9rem/1 var(--display); color: var(--ink); background: var(--green);
}
.steps b { color: var(--text); }
.cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px; width: 100%;
  border-radius: 12px; border: 1px solid var(--green); color: var(--green); text-decoration: none; font: 600 1rem/1.2 var(--display);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.cta:hover { background: var(--green); color: var(--ink); }

.foot { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: .85rem; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 460px; margin: 0 auto; padding: 14px 16px; border-radius: 12px;
  background: #2a1414; border: 1px solid #5a2323; color: #ffd9d9; font-size: .95rem;
}

/* Bigger screens */
@media (min-width: 900px) {
  .stage { grid-template-columns: 400px minmax(0, 1fr); column-gap: 64px; row-gap: 48px; padding-top: 48px; align-items: start; }
  .phone { grid-row: span 2; position: sticky; top: 32px; }
  .callers { grid-template-columns: 1fr 1fr; }
  .cta { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
[data-state="live"] .call-btn:hover, [data-state="speaking"] .call-btn:hover, [data-state="listening"] .call-btn:hover { background: #ff6b6b; }
