/* ======================================================================
   /try — PROFESSIONAL DESIGN PASS (v5 "pro" layer)
   ----------------------------------------------------------------------
   Loads AFTER try.css. Pure visual enhancement layer — does not touch any
   JS hook (ids / structural classes). Elevates the page from "functional
   dashboard" to a premium SaaS product: layered surfaces, ambient
   backdrop, glass panels, sharper type hierarchy, tinted category pills,
   richer depth, and smoother micro-interactions.

   Strategy:
     - Re-declare design tokens (richer palette, real elevation ramp).
     - Reuse every existing selector; only override paint, not structure.
     - Dark-first; light mode kept tasteful via the same token swaps.
   ====================================================================== */

:root {
  /* Brand — slightly punchier, with a usable gradient pair */
  --green: #00E6A4;
  --green-deep: #00B98A;
  --green-bright: #5BFFCB;
  --grad-brand: linear-gradient(135deg, #00E6A4 0%, #38BDF8 55%, #7C5CFC 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(0,230,164,0.16), rgba(124,92,252,0.16));

  /* Refined neutral ramp (light) */
  --bg-page: #F4F6FB;
  --bg-card: #FFFFFF;
  --bg-soft: #F6F8FC;
  --text: #0B1220;
  --muted: #5B6577;

  /* Elevation ramp — soft, layered, premium */
  --shadow-card: 0 1px 2px rgba(15,23,42,0.04), 0 6px 24px rgba(15,23,42,0.06);
  --shadow-pop: 0 18px 48px rgba(15,23,42,0.16);
  --ring: 0 0 0 1px rgba(15,23,42,0.04);

  /* Tighter, more editorial type rhythm */
  --display: clamp(34px, 4.6vw, 52px);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* A deeper, cooler canvas with real surface layering */
    --bg-page: #070B14;
    --bg-card: #0E1626;
    --bg-soft: #141E33;
    --text: #EEF2F9;
    --text-soft: #D4DCEC;
    --muted: #8B97AD;
    --muted-strong: #C3CCDD;
    --border: rgba(255,255,255,0.07);
    --border-strong: rgba(255,255,255,0.14);
    --border-soft: rgba(255,255,255,0.05);
    --green-soft: rgba(0,230,164,0.14);
    --green-line: rgba(0,230,164,0.42);

    --shadow-card: 0 1px 2px rgba(0,0,0,0.5), 0 16px 48px rgba(0,0,0,0.55);
    --shadow-pop: 0 24px 64px rgba(0,0,0,0.7);
    --ring: 0 0 0 1px rgba(255,255,255,0.04);
    --grad-brand-soft: linear-gradient(135deg, rgba(0,230,164,0.18), rgba(124,92,252,0.18));
  }
}

/* ======================================================================
   AMBIENT PAGE BACKDROP
   Soft radial brand glows behind everything — gives depth without noise.
   ====================================================================== */
body {
  position: relative;
  background: var(--bg-page);
  letter-spacing: -0.005em;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(820px 420px at 18% -8%, rgba(0,230,164,0.10), transparent 60%),
    radial-gradient(760px 460px at 92% 4%, rgba(124,92,252,0.12), transparent 62%),
    radial-gradient(900px 600px at 50% 120%, rgba(56,189,248,0.07), transparent 60%);
}
.try-nav, .try-header, .try-main { position: relative; z-index: 1; }

/* ======================================================================
   TOP NAV — glassy, hairline
   ====================================================================== */
.try-nav {
  background: color-mix(in srgb, var(--bg-page) 72%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.try-logo { font-size: 16px; letter-spacing: -0.02em; }
.try-logo svg { filter: drop-shadow(0 2px 8px rgba(0,230,164,0.25)); }

/* ======================================================================
   HERO HEADER
   ====================================================================== */
.try-header { padding-top: clamp(40px, 7vw, 84px); padding-bottom: 28px; }
.try-header h1 {
  font-size: var(--display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
  background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--text) 62%, transparent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.try-tagline {
  font-size: 17px;
  color: var(--muted);
  max-width: 580px;
  letter-spacing: -0.01em;
}
.banner-pill {
  background: var(--grad-brand-soft);
  border: 1px solid var(--green-line);
  color: var(--green-deep);
  letter-spacing: 1.6px;
  padding: 5px 13px;
  box-shadow: 0 2px 12px rgba(0,230,164,0.18);
}
.try-header-cta-link {
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--green-line);
  background: var(--green-soft);
}
.try-header-cta-link:hover {
  background: var(--green-deep);
  color: #04231a;
  border-color: var(--green-deep);
}
@media (prefers-color-scheme: dark) {
  .try-header-cta-link:hover { color: #04231a; }
}

/* ======================================================================
   DEMO CARD SHELL — the centerpiece
   ====================================================================== */
.try-main { max-width: 1220px; }
.demo-card {
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  background: var(--bg-card);
  position: relative;
  isolation: isolate;
  grid-template-columns: 372px minmax(0, 1fr);
}
/* Hairline gradient frame so the card edge catches light */
.demo-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  padding: 1px;
  background: linear-gradient(160deg, rgba(255,255,255,0.10), transparent 36%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
}

/* ======================================================================
   LEFT RAIL
   ====================================================================== */
.try-rail { background: color-mix(in srgb, var(--bg-card) 88%, var(--bg-soft)); }
.rail-head {
  background: color-mix(in srgb, var(--bg-card) 82%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding-top: 22px;
  gap: 18px;
}
.rail-title { font-size: 15px; letter-spacing: -0.01em; }
.filter-label {
  font-size: 10.5px;
  letter-spacing: 1px;
  color: var(--muted);
}

/* Filter pills — compact, tactile, brand-active */
.filter-pill {
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 550;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  color: var(--muted-strong);
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .08s ease;
}
.filter-pill:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.filter-pill.is-active {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green-deep);
  box-shadow: 0 2px 10px rgba(0,230,164,0.16);
}
.filter-pill.is-active:hover { transform: none; }

.rail-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Question cards */
.rail-list { padding: 14px 14px 20px; gap: 10px; }
.rail-item {
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  padding: 14px 15px;
  transition: background .16s ease, border-color .16s ease, transform .14s ease, box-shadow .16s ease;
}
.rail-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}
.rail-item.is-active {
  background: color-mix(in srgb, var(--green-soft) 60%, var(--bg-card));
  border-color: var(--green-line);
  box-shadow: 0 0 0 1px var(--green-line), 0 10px 28px rgba(0,230,164,0.12);
}
.rail-item.is-active::before { width: 3px; background: var(--grad-brand); }
.rail-item-cat { font-size: 12px; font-weight: 600; }
.rail-item-cat .dot { width: 8px; height: 8px; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent); }
.rail-item-text { font-size: 14px; font-weight: 550; line-height: 1.5; }
.rail-item-diff { font-size: 10px; letter-spacing: 0.6px; padding: 3px 7px; }
.rail-item-play {
  width: 26px; height: 26px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
}
.rail-item:hover .rail-item-play { background: var(--grad-brand); border-color: transparent; color: #04231a; }
.rail-item.is-active .rail-item-play { background: var(--grad-brand); border-color: transparent; color: #04231a; }

/* ======================================================================
   STAGE — toolbar
   ====================================================================== */
.stage-top {
  background: color-mix(in srgb, var(--bg-card) 80%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.stage-toolbar-center { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.toolbar-avatar {
  background: var(--grad-brand);
  box-shadow: 0 2px 10px rgba(0,230,164,0.30);
}
.toolbar-avatar svg { color: #04231a !important; }
.try-icon-btn { border-radius: 10px; }
.try-icon-btn[aria-pressed="true"] {
  background: var(--green-soft);
  color: var(--green-deep);
  border-color: var(--green-line);
}

/* ======================================================================
   EMPTY STATE — richer, more inviting
   ====================================================================== */
.stage-empty { gap: 16px; min-height: 440px; padding: 40px 28px; }
.stage-empty-icon {
  width: 92px; height: 92px;
  background: var(--grad-brand-soft);
  border: 1px solid var(--border);
  color: var(--green-deep);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 12px 36px rgba(0,230,164,0.10);
  position: relative;
}
.stage-empty-icon::after {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1px dashed var(--green-line);
  opacity: 0.5;
}
.stage-empty-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.stage-empty-body { font-size: 15px; max-width: 480px; color: var(--muted); line-height: 1.6; }
.stage-empty-hint {
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
}
.stage-empty-hint kbd {
  background: var(--bg-card);
  border-color: var(--border-strong);
}

/* ======================================================================
   ACTIVE — question card
   ====================================================================== */
.stage-active { gap: 20px; }
.qa-card {
  background: var(--grad-brand-soft);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.qa-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(420px 180px at 0% 0%, rgba(0,230,164,0.10), transparent 70%);
  pointer-events: none;
}
.stage-avatar {
  background: var(--grad-brand);
  border: none;
  box-shadow: 0 8px 28px rgba(0,230,164,0.28);
}
.stage-avatar-fallback { color: #04231a; font-weight: 800; }
.stage-avatar.is-speaking { box-shadow: 0 0 0 4px var(--green-soft), 0 8px 28px rgba(0,230,164,0.42); }
.stage-question { font-size: 19px; font-weight: 550; letter-spacing: -0.01em; line-height: 1.5; }
.qa-meta .meta-pill {
  background: color-mix(in srgb, var(--bg-card) 78%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  font-size: 11.5px;
}

/* ======================================================================
   AUDIO STRIP
   ====================================================================== */
.audio-strip {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 11px 14px;
}
.audio-btn { background: var(--bg-card); }
.audio-btn:hover { background: var(--green-soft); color: var(--green-deep); border-color: var(--green-line); }
.audio-progress-bar { background: var(--grad-brand); }

/* ======================================================================
   ANSWER AREA
   ====================================================================== */
.stage-textarea {
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 14.5px;
  padding: 16px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.stage-textarea:focus {
  border-color: var(--green);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px var(--green-soft);
}

/* ======================================================================
   BUTTONS — confident, with brand gradient on primary
   ====================================================================== */
.btn-primary,
.btn-secondary,
.btn-ghost { border-radius: 12px; font-weight: 650; letter-spacing: -0.01em; }
.btn-primary {
  background: var(--grad-brand);
  background-size: 160% 160%;
  color: #04231a;
  border: none;
  box-shadow: 0 6px 20px rgba(0,230,164,0.28);
  transition: background-position .35s ease, transform .06s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-primary:hover {
  background-position: 100% 100%;
  color: #04231a;
  filter: brightness(1.04);
  box-shadow: 0 10px 28px rgba(0,230,164,0.36);
}
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] {
  background: var(--border-strong);
  color: var(--muted);
  box-shadow: none;
  filter: none;
}
.btn-secondary {
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-card); border-color: var(--green-line); }

/* ======================================================================
   CRITIQUE CARD
   ====================================================================== */
.critique {
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}
.critique-title { color: var(--muted); letter-spacing: 1px; }

/* Score chip — make it a focal brand element */
.critique-score {
  background: var(--grad-brand-soft);
  border: 1px solid var(--green-line);
  border-radius: 14px;
  padding: 6px 14px;
}
.critique-score .score-num {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* ======================================================================
   CODE BLOCK — slightly deeper surface for the pro look
   ====================================================================== */
.qa-code-body {
  background: #0A1120;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.3);
}

/* ======================================================================
   MODAL
   ====================================================================== */
.modal {
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  border: 1px solid var(--border);
}

/* ======================================================================
   MOTION POLISH
   ====================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .stage-active > * { animation: proRise .4s cubic-bezier(.22,.61,.36,1) both; }
  .stage-active > *:nth-child(2) { animation-delay: .04s; }
  .stage-active > *:nth-child(3) { animation-delay: .08s; }
  .stage-active > *:nth-child(4) { animation-delay: .12s; }
  @keyframes proRise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* == Layout round 2026-07: wider demo card, taller stage, promo section pushed down == */
@media (min-width: 980px) {
  .try-main { max-width: 1460px; }
  .demo-card {
    grid-template-columns: 344px minmax(0, 1fr);
    height: clamp(560px, calc(100vh - 128px), 1060px);
  }
  .try-below { margin-top: 130px; }
}
