/* Callive — design system
   Dark, premium, Apple-level restraint. One accent. Big type. Few words. */

:root {
  --bg: #09090b;
  --surface: #141418;
  --surface-2: #1c1c22;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --muted: #9a9aa3;
  --faint: #5c5c66;
  --accent: #32d74b;
  --accent-dim: rgba(50, 215, 75, 0.14);
  --danger: #ff453a;
  --danger-dim: rgba(255, 69, 58, 0.14);
  --warn: #ffd60a;
  --radius: 20px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Inter, Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::selection { background: rgba(50, 215, 75, 0.3); }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  cursor: pointer;
  color: inherit;
  background: none;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease,
    opacity 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #04180a;
  padding: 16px 34px;
  font-size: 18px;
  box-shadow: 0 8px 32px rgba(50, 215, 75, 0.25);
}
.btn-primary:hover { background: #46e05e; box-shadow: 0 10px 40px rgba(50, 215, 75, 0.35); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  padding: 14px 30px;
  font-size: 17px;
  box-shadow: 0 8px 28px rgba(255, 69, 58, 0.28);
}
.btn-danger:hover { background: #ff5b51; }

.btn-ghost {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 14px 28px;
  font-size: 16px;
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--border-strong); background: #232329; }

.btn-block { width: 100%; }

.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.link-quiet {
  color: var(--muted);
  font-size: 15px;
  transition: color 0.2s ease;
  background: none;
}
.link-quiet:hover { color: var(--text); }

/* ---------- Landing ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.logo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(50, 215, 75, 0.8);
}

.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 96px 24px 64px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.hero .sub {
  margin: 24px auto 40px;
  max-width: 520px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.45;
}
.hero .fine {
  margin-top: 16px;
  color: var(--faint);
  font-size: 14px;
}

/* Suggestion card mock on the landing page */
.hero-card {
  margin: 72px auto 0;
  max-width: 460px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.hero-card .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--danger);
  background: var(--danger-dim);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 14px;
}
.hero-card .say { font-size: 19px; font-weight: 600; line-height: 1.4; }
.hero-card .why { margin-top: 10px; color: var(--muted); font-size: 14px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 880px;
  margin: 48px auto 0;
  padding: 0 24px;
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.step .num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 10px;
}
.step h3 { font-size: 18px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 15px; }

.footer {
  text-align: center;
  padding: 64px 24px 40px;
  color: var(--faint);
  font-size: 13px;
}

/* ---------- Landing access gate ----------
   html[data-locked] is set synchronously in <head> before first paint,
   so a fresh visitor sees only the gate — never a flash of the site. */

.gate-screen { display: none; }
html[data-locked] .gate-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
html[data-locked] .site-content { display: none; }

/* ---------- App shell ---------- */

.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}
.screen.active { display: flex; }

.screen-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
}

.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  text-align: left;
}

/* ---------- Auth ---------- */

.auth-title { font-size: 32px; margin-bottom: 6px; }
.auth-sub { color: var(--muted); margin-bottom: 28px; font-size: 16px; }

.field { margin-bottom: 16px; text-align: left; }
.field input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 17px;
  padding: 15px 16px;
  outline: none;
  transition: border-color 0.2s ease;
}
.field input::placeholder { color: var(--faint); }
.field input:focus { border-color: var(--accent); }

.form-error {
  color: var(--danger);
  font-size: 14px;
  min-height: 21px;
  margin-bottom: 8px;
}

/* ---------- Mic permission ---------- */

.mic-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  font-size: 40px;
}

/* ---------- Dashboard ---------- */

.dash-greet { font-size: 40px; letter-spacing: -0.03em; margin-bottom: 8px; }
.dash-sub { color: var(--muted); font-size: 18px; margin-bottom: 48px; }

.start-call {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--accent);
  color: #04180a;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 0 0 0 rgba(50, 215, 75, 0.4), 0 24px 64px rgba(50, 215, 75, 0.3);
  animation: breathe 3s ease-in-out infinite;
  transition: transform 0.15s ease;
}
.start-call:hover { transform: scale(1.03); }
.start-call:active { transform: scale(0.97); }
.start-call .icon { font-size: 36px; }

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(50, 215, 75, 0.35), 0 24px 64px rgba(50, 215, 75, 0.3); }
  50% { box-shadow: 0 0 0 22px rgba(50, 215, 75, 0), 0 24px 64px rgba(50, 215, 75, 0.3); }
}

@media (prefers-reduced-motion: reduce) {
  .start-call { animation: none; }
}

/* ---------- Call screen ---------- */

/* Lock the call screen to the viewport so the transcript scrolls
   internally and the coach pane never leaves the screen */
.screen[data-screen="call"] {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.call-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
}
.call-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
}
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.call-timer {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.call-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  min-height: 0;
}

.transcript-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
}
.pane-label {
  padding: 18px 28px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.transcript {
  flex: 1;
  overflow-y: auto;
  padding: 8px 28px 28px;
}
.t-line { margin-bottom: 18px; max-width: 640px; }
.t-line .t-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 3px;
}
.t-line .t-meta .speaker-you { color: var(--accent); }
.t-line .t-meta .speaker-them { color: var(--muted); }
.t-line .t-text { font-size: 18px; line-height: 1.5; }
.t-line.interim .t-text { color: var(--muted); }
.t-empty {
  color: var(--faint);
  font-size: 16px;
  padding-top: 8px;
}

.coach-pane {
  display: flex;
  flex-direction: column;
  padding: 0 28px 24px;
  min-height: 0;
  overflow-y: auto;
}

.suggestion-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.suggestion-card.alert {
  border-color: rgba(255, 69, 58, 0.5);
  box-shadow: 0 0 40px rgba(255, 69, 58, 0.12);
}
.suggestion-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 16px;
}
.suggestion-card.alert .suggestion-tag { color: var(--danger); background: var(--danger-dim); }
.suggestion-say {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.suggestion-why { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.confidence {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
}
.confidence-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.confidence-head .label { font-size: 14px; font-weight: 600; color: var(--muted); }
.confidence-head .value {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.confidence-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.confidence-fill {
  height: 100%;
  width: 70%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.6s ease, background 0.6s ease;
}
.confidence-fill.low { background: var(--warn); }

/* ---------- Summary ---------- */

.summary-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 56px 24px 72px;
  text-align: center;
}
.score-ring {
  width: 148px;
  height: 148px;
  margin: 0 auto 8px;
  position: relative;
}
.score-ring svg { transform: rotate(-90deg); }
.score-ring .ring-bg { stroke: var(--surface-2); }
.score-ring .ring-fg {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}
.score-num {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.score-num small { font-size: 12px; font-weight: 600; color: var(--faint); letter-spacing: 0.08em; }

.summary-duration { color: var(--muted); font-size: 15px; margin-bottom: 32px; }

.summary-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 16px;
  text-align: left;
}
.summary-block h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}
.summary-block p, .summary-block li { font-size: 16px; line-height: 1.55; }
.summary-block ul { list-style: none; }
.summary-block li { padding-left: 24px; position: relative; margin-bottom: 8px; }
.summary-block li:last-child { margin-bottom: 0; }
.summary-block li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.summary-block.good li::before { background: var(--accent); }
.summary-block.fix li::before { background: var(--warn); }
.summary-block.goal { border-color: rgba(50, 215, 75, 0.35); }
.summary-block.goal p { font-size: 18px; font-weight: 600; }

.summary-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 36px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  /* On a phone the suggestion is the hero: coach on top, transcript scrolls below */
  .call-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .transcript-pane { border-right: none; }
  .coach-pane {
    order: -1;
    border-bottom: 1px solid var(--border);
    padding-top: 4px;
    padding-bottom: 18px;
    overflow-y: visible;
  }
  .suggestion-card { padding: 20px; }
  .suggestion-say { font-size: 18px; }
  .confidence { margin-top: 12px; padding: 14px 20px; }
  .confidence-head { margin-bottom: 8px; }
  .steps { grid-template-columns: 1fr; }
  .summary-actions { flex-direction: column; align-items: stretch; }
}
