/* Voice Language Partner — "conversation-first" design system */

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --ink: #17181c;
  --muted: #64676e;
  --line: #e8e6e1;

  --brand: #3457b2;        /* was #2749d6 — calmer, less neon */
  --brand-dark: #27438c;
  --brand-tint: #eef2fb;
  --coral: #e0603f;        /* was #f05b3c — softer terracotta */
  --coral-tint: #fbece7;
  --green: #1e8e4e;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(23,24,28,.05), 0 8px 24px rgba(23,24,28,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

   --inverse: #17181c;          /* surfaces that stay dark in light mode */
  --on-inverse: #ffffff;
  --on-inverse-muted: rgba(255, 255, 255, .7);
  --surface-alt: #fcfcfb;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); display: inline-flex; align-items: flex-end; justify-content: center; gap: 2px; padding-bottom: 6px; }
.brand-mark i { width: 3px; background: #fff; border-radius: 2px; display: block; }
.brand-mark i:nth-child(1) { height: 6px; }
.brand-mark i:nth-child(2) { height: 11px; }
.brand-mark i:nth-child(3) { height: 8px; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; text-decoration: none; border: 1px solid transparent;
  cursor: pointer; transition: background .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: center; }


.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand); background: var(--brand-tint);
  padding: 5px 12px; border-radius: 6px; margin-bottom: 20px;
}
/* overflow safety — apply everywhere */


/* ---------- Live demo card ---------- */
.demo-wrap { position: relative; }
.demo-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.demo-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.demo-title { font-size: 13px; font-weight: 700; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--coral); text-transform: uppercase; letter-spacing: .08em; }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.lang-tabs { display: flex; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.lang-tab {
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
}
.lang-tab.active { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.demo-body { padding: 18px; min-height: 300px; display: flex; flex-direction: column; gap: 12px; }

.bubble {
  max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 14px;
  line-height: 1.45; opacity: 0; transform: translateY(6px);
  animation: rise .3s forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }
.bubble.agent { background: var(--brand-tint); color: var(--ink); border-bottom-left-radius: 4px; align-self: flex-start; }
.bubble.user  { background: var(--inverse); color: var(--on-inverse); border-bottom-right-radius: 4px; align-self: flex-end; }
.bubble .tag { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .55; margin-bottom: 2px; }

/* speaking waveform — pure CSS equalizer on the last agent bubble */
.speaking { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; margin-left: 8px; }
.speaking i { width: 3px; background: var(--brand); border-radius: 2px; animation: eq .8s infinite ease-in-out; }
.speaking i:nth-child(1) { height: 5px; }
.speaking i:nth-child(2) { height: 11px; animation-delay: .15s; }
.speaking i:nth-child(3) { height: 7px; animation-delay: .3s; }
@keyframes eq { 0%,100% { transform: scaleY(.5); } 50% { transform: scaleY(1.4); } }

/* scorecard that appears after the conversation */
.scorecard { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface-alt); opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s; align-self: stretch; }
.scorecard.show { opacity: 1; transform: none; }
.scorecard-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.scorecard-head strong { font-size: 13px; }
.score-big { font-size: 26px; font-weight: 800; color: var(--green); }
.score-row { display: flex; align-items: center; gap: 10px; font-size: 12px; margin-top: 6px; }
.score-row span { width: 86px; color: var(--muted); }
.bar { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; width: 0; transition: width .8s ease; }
.score-tip { margin-top: 10px; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.score-row { gap: 12px; }
.score-row span { width: 90px; flex-shrink: 0; }
.score-row b { min-width: 28px; text-align: right; flex-shrink: 0; }

.demo-caption { text-align: center; font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-head { max-width: 560px; margin-bottom: 40px; }
.section-head h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.section-head p { color: var(--muted); margin-top: 10px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; position: relative;
}
.step-num {
  width: 32px; height: 32px; border-radius: 10px; background: var(--coral-tint);
  color: var(--coral); font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.step h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--muted); }

/* report features: asymmetric two-column with a static scorecard mock */
.report-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
.feature-list { list-style: none; margin-top: 20px; }
.feature-list li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.feature-list li:last-child { border-bottom: 0; }
.feature-list b { display: block; font-size: 15px; }
.feature-list span { font-size: 14px; color: var(--muted); }

/* languages strip */
.lang-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.lang-chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 16px; font-size: 14px; font-weight: 600;
}
.lang-chip small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }

/* CTA band */
.cta-band { background: var(--inverse); color: var(--on-inverse); border-radius: var(--radius); padding: 64px 56px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.cta-band h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.cta-band p { color: var(--on-inverse-muted); margin-top: 8px; font-size: 15px; }
.cta-band .btn-primary { background: var(--coral); }
.cta-band .btn-primary:hover { background: #d94a2c; }
.nav-links a.btn { color: #fff; }   /* beats .nav-links a gray override */


/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; margin-top: 32px; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero { padding: 40px 0 32px; }
  .section { padding: 44px 0; }
  .hero-grid, .report-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .demo-body { min-height: 0; }
  .cta-band { flex-direction: column; text-align: center; padding: 36px 24px; }
  .site-footer .container { flex-direction: column; align-items: center; text-align: center; }

  /* header: stop the wrap-crunch */
  .site-header .container { height: auto; flex-wrap: wrap; gap: 10px; padding-top: 12px; padding-bottom: 12px; }
  .brand { font-size: 15px; }
  .nav-links { gap: 12px; margin-left: auto; }
  .nav-links a:not(.btn) { display: none; }
  .btn { white-space: nowrap; }
  .nav-links a.btn { padding: 8px 14px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .lang-tab { padding: 6px 12px; }
  .demo-head { flex-wrap: wrap; gap: 6px; }
  .cta-band { padding: 28px 18px; }
  .score-row span { width: 74px; }
  .bubble { max-width: 92%; }
}

/* ---------- Overflow + fluid type ---------- */
/* NOTE: no grid-template-columns here — they live in the rules above,
   so the media queries can override them on mobile. */
html, body { overflow-x: clip; }
.demo-card, .demo-wrap, .step, .scorecard { min-width: 0; }
.bubble { overflow-wrap: anywhere; }

.hero h1 { font-size: clamp(30px, 4.5vw, 46px); }
.section-head h2 { font-size: clamp(22px, 3vw, 28px); }
.cta-band h2 { font-size: clamp(20px, 2.6vw, 26px); }
.score-row b { white-space: nowrap; }

/* ---------- Theme toggle (icon button) ---------- */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  cursor: pointer; transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }

/* sun shows in light mode, moon in dark mode */
.icon-btn .icon-moon { display: none; }
[data-theme="dark"] .icon-btn .icon-sun { display: none; }
[data-theme="dark"] .icon-btn .icon-moon { display: block; }


/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg: #121316;
  --surface: #1a1c21;
  --surface-alt: #202228;
  --ink: #e8e6e3;
  --muted: #9a9ca3;
  --line: #2a2d34;

  --brand: #7d95e6;            /* lighter blue — readable on dark */
  --brand-dark: #93a9ec;       /* hover: lighter, not darker, on dark bg */
  --brand-tint: #1e2540;       /* dark blue wash for agent bubbles */
  --coral: #ef7d5e;
  --coral-tint: #38231c;
  --green: #4caf7d;

  --inverse: #e8e6e3;          /* user bubble / CTA flip to light */
  --on-inverse: #17181c;
  --on-inverse-muted: rgba(23, 24, 28, .7);

  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
}

/* smooth swap */
body { transition: background .2s ease, color .2s ease; }




/* ---------- Auth page ---------- */
.auth-wrap { max-width: 440px; margin: 0 auto; }

.auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px;
}
.auth-tabs { display: flex; gap: 6px; margin-bottom: 28px; background: var(--bg); border-radius: var(--radius-sm); padding: 4px; }
.auth-tab {
  flex: 1; padding: 9px 0; border: none; border-radius: 9px; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: var(--font);
}
.auth-tab.active { background: var(--inverse); color: var(--on-inverse); }
.auth-form h1 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 4px; }
.auth-form .muted { margin-bottom: 24px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); font-size: 15px; font-family: var(--font);
}
.field input:focus, .field select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.field small { display: block; margin-top: 4px; }
.form-error {
  background: var(--danger-tint, #faeceb); color: var(--danger, #b3423a);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-bottom: 16px;
}
.btn-block { width: 100%; text-align: center; margin-top: 8px; }
.btn:disabled { opacity: .6; cursor: default; }

@media (max-width: 480px) {
  .auth-card { padding: 24px 18px; }
}

/* ---------- Practice / report pages ---------- */
.practice-wrap, .report-page { max-width: 720px; margin: 0 auto; }
.practice-status { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
#transcript { max-height: 480px; overflow-y: auto; }

@media (max-width: 480px) {
  .practice-status { flex-direction: column; align-items: stretch; }
  .practice-status > div:last-child { display: flex; gap: 8px; }
  .practice-status .btn { flex: 1; }
}
.field[hidden] { display: none !important; }


/* ---------- Dashboard ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.dash-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.dash-card-head span { font-weight: 700; text-transform: capitalize; font-size: 17px; }
.dash-card-head b { font-size: 32px; letter-spacing: -0.02em; }
.dash-stat {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 9px 0;
}
.dash-stat span { color: var(--muted); }

.dash-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dash-table th {
  text-align: left;
  padding: 14px 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}
.dash-table td { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dash-table tbody tr:hover { background: var(--surface-alt); }
.dash-table tbody tr:last-child td { border-bottom: 0; }
.dash-table a { color: var(--brand); text-decoration: none; font-weight: 600; }
.dash-table a:hover { text-decoration: underline; }
.status-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand);
  text-transform: capitalize;
}
.status-chip.completed { background: #e7f5ec; color: var(--green); }
.status-chip.active { background: var(--coral-tint); color: var(--coral); }

@media (max-width: 640px) {
  .dash-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
}
