/* Discovery page — You Circle orbital UI
 * Light theme with intro splash animation */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --text-primary: #1a1a2e;
  --text-secondary: #6b6b80;
  --accent: #3b82f6;
  --border: rgba(0, 0, 0, 0.08);
  --ring-bg: rgba(0, 0, 0, 0.04);
}

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

body.discovery-page {
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════
   INTRO SPLASH — logo draw animation
   Phase 1 (0.4s):  Logo strokes draw sequentially
   Phase 2 (3.2s):  Tagline fades in below
   Phase 3 (5.0s):  Splash fades, landing page enters
   ══════════════════════════════════════════ */
.intro-splash {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary);
  transition: opacity 0.9s ease;
}
body:not(.intro-active) .intro-splash {
  opacity: 0; pointer-events: none;
}

.intro-center {
  display: flex; flex-direction: column;
  align-items: center; gap: 2rem;
}

/* ── Brand: animated logo SVG ── */
.intro-brand {
  display: flex; align-items: center; justify-content: center;
}
.intro-logo { width: 320px; }
.intro-logo svg { width: 100%; height: auto; overflow: visible; }

/* All logo strokes start hidden */
.logo-outer, .logo-inner, .logo-hline, .logo-tab, .logo-one, .logo-zero {
  fill: none;
}
.logo-outer {
  stroke-dasharray: 302; stroke-dashoffset: 302;
}
.logo-inner {
  stroke-dasharray: 183; stroke-dashoffset: 183;
}
.logo-hline {
  stroke-dasharray: 112; stroke-dashoffset: 112;
}
.logo-tab {
  stroke-dasharray: 72; stroke-dashoffset: 72;
}
.logo-one {
  stroke-dasharray: 102; stroke-dashoffset: 102;
}
.logo-zero {
  stroke-dasharray: 250; stroke-dashoffset: 250;
}
.logo-dev { opacity: 0; }

/* Stroke drawing animation */
@keyframes drawStroke { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }

/* Staggered drawing — triggered by intro-phase-ring */
.intro-phase-ring .logo-outer {
  animation: drawStroke 1.2s cubic-bezier(0.65, 0, 0.35, 1) 0s forwards;
}
.intro-phase-ring .logo-inner {
  animation: drawStroke 1s cubic-bezier(0.65, 0, 0.35, 1) 0.35s forwards;
}
.intro-phase-ring .logo-hline {
  animation: drawStroke 0.7s cubic-bezier(0.65, 0, 0.35, 1) 0.65s forwards;
}
.intro-phase-ring .logo-tab {
  animation: drawStroke 0.5s cubic-bezier(0.65, 0, 0.35, 1) 0.95s forwards;
}
.intro-phase-ring .logo-one {
  animation: drawStroke 0.6s cubic-bezier(0.65, 0, 0.35, 1) 1.25s forwards;
}
.intro-phase-ring .logo-zero {
  animation: drawStroke 1s cubic-bezier(0.65, 0, 0.35, 1) 1.55s forwards;
}
.intro-phase-ring .logo-dev {
  animation: fadeIn 0.8s ease-out 2.2s forwards;
}

/* Tagline — fades in after logo draws */
.intro-tagline {
  font-family: 'Sora', sans-serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--text-primary); text-align: center;
  letter-spacing: 0.04em;
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.intro-phase-ring .intro-tagline {
  opacity: 1; transform: translateY(0);
  transition-delay: 2.6s;
}
body:not(.intro-active) .intro-tagline {
  opacity: 0; transform: translateY(-12px);
  transition: all 0.5s ease-in 0.05s;
}

/* Subtitle — fades up at phase title */
.intro-title {
  font-family: 'Sora', sans-serif;
  font-size: 2.25rem; font-weight: 800;
  color: var(--text-primary); text-align: center;
  letter-spacing: -0.03em; line-height: 1.25;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.intro-phase-title .intro-title {
  opacity: 1; transform: translateY(0);
}

/* Exit: elements fade out upward */
body:not(.intro-active) .intro-brand {
  opacity: 0; transform: translateY(-16px);
  transition: all 0.5s ease-in;
}
body:not(.intro-active) .intro-title {
  opacity: 0; transform: translateY(-12px);
  transition: all 0.5s ease-in 0.1s;
}

@media (max-width: 768px) {
  .intro-logo { width: 220px; }
  .intro-title { font-size: 1.5rem; }
}

/* ══════════════════════════════════════════
   LANDING ENTRANCE — header suppressed during intro
   ══════════════════════════════════════════ */
body.intro-active .discovery-header {
  opacity: 0; transform: translateY(-100%);
}
.discovery-header {
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}

/* ══════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════ */
.discovery-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem; height: 56px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .discovery-header {
  background: rgba(8, 8, 10, 0.85);
}

/* Hamburger — two lines */
.header-hamburger {
  display: flex; flex-direction: column; gap: 6px;
  background: none; border: none; cursor: pointer;
  padding: 8px 4px; width: 36px;
}
.header-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-primary); border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* Center logo + wordmark */
.header-logo-center {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 0.3rem;
  text-decoration: none;
}
.header-logo-svg { height: 24px; width: auto; }
.header-logo-text {
  font-family: 'Sora', sans-serif;
  font-size: 0.8125rem; font-weight: 500;
  color: var(--text-primary); letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0; transition: opacity 0.5s ease;
}
.header-phase-draw .header-logo-text {
  opacity: 1; transition-delay: 1.1s;
}

/* Header logo — stroke drawing animation */
.hdr-outer, .hdr-inner, .hdr-hline, .hdr-tab, .hdr-one, .hdr-zero {
  fill: none;
}
.hdr-outer { stroke-dasharray: 151; stroke-dashoffset: 151; }
.hdr-inner { stroke-dasharray: 88; stroke-dashoffset: 88; }
.hdr-hline { stroke-dasharray: 56; stroke-dashoffset: 56; }
.hdr-tab { stroke-dasharray: 48; stroke-dashoffset: 48; }
.hdr-one { stroke-dasharray: 58; stroke-dashoffset: 58; }
.hdr-zero { stroke-dasharray: 139; stroke-dashoffset: 139; }

.header-phase-draw .hdr-outer {
  animation: drawStroke 0.8s cubic-bezier(0.65, 0, 0.35, 1) 0s forwards;
}
.header-phase-draw .hdr-inner {
  animation: drawStroke 0.6s cubic-bezier(0.65, 0, 0.35, 1) 0.15s forwards;
}
.header-phase-draw .hdr-hline {
  animation: drawStroke 0.5s cubic-bezier(0.65, 0, 0.35, 1) 0.3s forwards;
}
.header-phase-draw .hdr-tab {
  animation: drawStroke 0.4s cubic-bezier(0.65, 0, 0.35, 1) 0.45s forwards;
}
.header-phase-draw .hdr-one {
  animation: drawStroke 0.4s cubic-bezier(0.65, 0, 0.35, 1) 0.6s forwards;
}
.header-phase-draw .hdr-zero {
  animation: drawStroke 0.6s cubic-bezier(0.65, 0, 0.35, 1) 0.75s forwards;
}

/* Login link */
.header-login {
  font-size: 0.8125rem; font-weight: 500;
  color: var(--text-secondary); text-decoration: none;
  padding: 0.4rem 0.75rem; border-radius: 6px;
  transition: color 0.2s;
}
.header-login:hover { color: var(--accent); }

/* Dropdown menu */
.header-dropdown {
  position: absolute; top: 56px; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 49;
}
[data-theme="dark"] .header-dropdown {
  background: rgba(22, 22, 26, 0.97);
}
.header-dropdown-link {
  display: block; padding: 0.875rem 1.5rem;
  font-size: 0.9375rem; font-weight: 500;
  color: var(--text-primary); text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}
.header-dropdown-link:last-child { border-bottom: none; }
.header-dropdown-link:hover {
  background: rgba(59, 130, 246, 0.06); color: var(--accent);
}

/* ══════════════════════════════════════════
   MAIN LAYOUT
   ══════════════════════════════════════════ */
.discovery-main {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100vh;
  padding-top: 56px; gap: 0;
  transition: gap 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ══════════════════════════════════════════
   AI TUTOR — GLOWING GLASS ORB
   ══════════════════════════════════════════ */
.tutor-circle-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.75rem; opacity: 0;
  transition: opacity 0.8s ease;
}
body.tutor-phase-sweep .tutor-circle-wrap { opacity: 1; }

/* ── Orb container ── */
.tutor-orb {
  position: relative;
  width: 140px; height: 140px;
  display: flex; align-items: center; justify-content: center;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1),
              height 1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Ambient glow halo behind orb ── */
.orb-glow {
  position: absolute; inset: -24px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(59, 130, 246, 0.25) 0%,
    rgba(59, 130, 246, 0.08) 50%,
    transparent 70%);
  opacity: 0;
  transition: opacity 1s ease, inset 1s cubic-bezier(0.22, 1, 0.36, 1);
  animation: orbGlowPulse 4s ease-in-out infinite;
}
body.tutor-phase-sweep .orb-glow { opacity: 1; }

/* ── 3D glass sphere ── */
.orb-sphere {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 35% 30%,
    rgba(96, 165, 250, 0.9) 0%,
    rgba(59, 130, 246, 0.85) 30%,
    rgba(37, 99, 235, 0.95) 70%,
    rgba(29, 78, 216, 1) 100%
  );
  box-shadow:
    inset 0 -8px 20px rgba(0, 0, 0, 0.25),
    inset 0 4px 12px rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(59, 130, 246, 0.3),
    0 8px 32px rgba(59, 130, 246, 0.3),
    0 20px 60px rgba(59, 130, 246, 0.15);
  display: flex; align-items: center; justify-content: center;
  transform: scale(0);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              width 1s cubic-bezier(0.22, 1, 0.36, 1),
              height 1s cubic-bezier(0.22, 1, 0.36, 1);
  animation: orbIdle 6s ease-in-out infinite;
}
body.tutor-phase-sweep .orb-sphere { transform: scale(1); }

/* ── Glass highlight (top-left specular) ── */
.orb-highlight {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 30% 20%,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.15) 30%,
    transparent 55%
  );
  pointer-events: none;
}

/* ── Mic icon on orb ── */
.orb-mic {
  width: 36px; height: 36px;
  color: rgba(255, 255, 255, 0.9);
  position: relative; z-index: 2;
  opacity: 0; transform: scale(0.5);
  transition: opacity 0.6s ease, transform 0.6s ease,
              width 1s cubic-bezier(0.22, 1, 0.36, 1),
              height 1s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
}
body.tutor-phase-mic .orb-mic {
  opacity: 1; transform: scale(1);
  animation: orbMicPulse 3s ease-in-out infinite 0.5s;
}

/* ── Large orb (before settle) ── */
body.tutor-phase-sweep:not(.tutor-phase-settle) .tutor-orb {
  width: 180px; height: 180px;
}
body.tutor-phase-sweep:not(.tutor-phase-settle) .orb-glow {
  inset: -36px;
}
body.tutor-phase-sweep:not(.tutor-phase-settle) .orb-mic {
  width: 44px; height: 44px;
}

/* Tutor text — typewriter then settles to label */
.tutor-text {
  font-family: 'Sora', sans-serif;
  font-size: 1.25rem; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  min-height: 1.75em; text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease, font-size 0.6s ease,
              color 0.5s ease, letter-spacing 0.5s ease;
}
body.tutor-phase-type .tutor-text { opacity: 1; }
body.tutor-phase-type .tutor-text::after {
  content: '|'; color: var(--accent);
  font-weight: 300; margin-left: 1px;
  animation: cursorBlink 0.6s step-end infinite;
}
.tutor-text.done::after { animation: none; opacity: 0; }
.tutor-text.settled {
  font-size: 0.875rem; color: var(--accent);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.tutor-text.settled::after { display: none; }

/* ── Orb animations ── */
@keyframes orbGlowPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.08); }
}
@keyframes orbIdle {
  0%, 100% { transform: scale(1) translateY(0); }
  50%      { transform: scale(1.02) translateY(-2px); }
}
@keyframes orbMicPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.06); opacity: 1; }
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ══════════════════════════════════════════
   ROLE SELECTION
   ══════════════════════════════════════════ */
.role-select {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 320px; padding: 0 1.25rem;
  gap: 1rem;
  opacity: 0; max-height: 0; overflow: hidden; pointer-events: none;
}
body.tutor-phase-buttons .discovery-main { gap: 2.5rem; }
body.tutor-phase-buttons .role-select {
  opacity: 1; max-height: 300px; overflow: visible; pointer-events: auto;
  transition: opacity 0.5s ease, max-height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.role-select > * { opacity: 0; transform: translateY(16px); }
body.tutor-phase-buttons .role-select > :nth-child(1) {
  animation: roleItemIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
body.tutor-phase-buttons .role-select > :nth-child(2) {
  animation: roleItemIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}
body.tutor-phase-buttons .role-select > :nth-child(3) {
  animation: roleItemIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}
@keyframes roleItemIn {
  0% { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

.role-btn {
  display: block; width: 100%; text-align: center;
  padding: 0.9375rem 1.5rem; border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem; font-weight: 600;
  font-family: inherit; text-decoration: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px var(--shadow);
}
.role-btn:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.role-btn:active { transform: scale(0.98); transition-duration: 0.1s; }

.role-divider {
  display: flex; align-items: center; gap: 1rem;
  width: 100%;
}
.role-divider::before,
.role-divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}
.role-divider-text {
  font-size: 0.75rem; font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── Circle stage (concentric rings) ── */
.circle-stage-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%;
}

.circle-stage {
  position: relative;
  width: var(--stage-w, 1015px);
  height: var(--stage-h, 700px);
  flex-shrink: 0;
}

/* Ambient glow behind You Circle */
.circle-stage::before {
  content: '';
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle,
    rgba(59, 130, 246, 0.06) 0%,
    rgba(59, 130, 246, 0.02) 40%,
    transparent 70%);
  pointer-events: none;
  animation: ambientPulse 8s ease-in-out infinite;
}

/* ── Option circles ── */
.circle-option {
  position: absolute; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  color: var(--text-primary);
  font-weight: 500; font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  text-align: center; line-height: 1.3;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  animation: optionReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  box-shadow: 0 2px 16px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03);
  z-index: 2;
}

.circle-option::before {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 35% 25%, rgba(255,255,255,0.5) 0%, transparent 55%);
  pointer-events: none;
}

.circle-option:hover {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.07);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 0 40px rgba(59,130,246,0.08);
  transform: scale(1.08);
}
.circle-option:active { transform: scale(0.96); transition-duration: 0.1s; }
.circle-option:disabled { cursor: wait; opacity: 0.5; }

.circle-option-text {
  position: relative; z-index: 1; letter-spacing: 0.01em;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.circle-stage.is-transitioning .circle-option {
  opacity: 0; transform: scale(0.8); transition: all 0.25s ease-in;
}

/* ── Center circle + ring ── */
.circle-user-wrap {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 120px; height: 120px; z-index: 1;
}

.circle-user-ring {
  position: absolute; inset: -50px;
  width: 220px; height: 220px;
}

.circle-progress-arc {
  transition: stroke-dashoffset 0.8s ease;
  transform: rotate(-90deg); transform-origin: center;
  filter: drop-shadow(0 0 8px rgba(59,130,246,0.25));
  animation: ringBreathe 4s ease-in-out infinite;
}

.circle-user {
  width: 120px; height: 120px; border-radius: 50%;
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg-card);
  box-shadow: 0 0 0 1px var(--border), 0 8px 48px var(--shadow-md);
  z-index: 2;
}
.circle-user::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.6) 0%, transparent 50%);
  pointer-events: none;
}

.circle-user-label {
  font-size: 0.8125rem; font-weight: 600;
  color: var(--text-primary); letter-spacing: 0.04em;
  text-transform: uppercase; opacity: 0.6;
  position: relative; z-index: 1;
}

.circle-understood {
  font-size: 0.5625rem; font-weight: 600;
  color: var(--text-secondary); opacity: 0.4;
  letter-spacing: 0.08em; text-transform: uppercase;
  position: absolute; bottom: 20px; z-index: 1;
}
.circle-understood-pct {
  font-weight: 700; color: var(--accent); opacity: 1;
}

/* ── Loading ── */
.circle-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.circle-loading-spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid rgba(59,130,246,0.15);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

/* ── Chat-style question + input ── */
.discovery-chat-area {
  position: relative; z-index: 5;
  width: 100%; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 0.625rem;
  padding: 0 1rem;
}

.chat-thread { display: flex; flex-direction: column; gap: 0.625rem; }
.chat-row { display: flex; }
.chat-row--ai { justify-content: flex-start; }
.chat-row--user { justify-content: flex-end; }

.chat-bubble {
  max-width: 85%; padding: 0.75rem 1.125rem;
  font-size: 0.9375rem; line-height: 1.5;
  font-family: inherit;
}
.chat-bubble--ai {
  background: var(--bg-secondary);
  color: var(--text-primary); font-weight: 500;
  border-radius: 18px 18px 18px 4px;
}
.chat-bubble--user {
  background: var(--accent);
  color: #fff; font-weight: 500;
  border-radius: 18px 18px 4px 18px;
}

.chat-input-wrap { margin-top: 0.25rem; }
.chat-input {
  width: 100%; padding: 0.875rem 1.25rem;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9375rem; font-family: inherit;
  line-height: 1.5;
  outline: none; resize: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.chat-input::placeholder { color: var(--text-secondary); opacity: 0.5; }
.chat-input:focus {
  border-color: rgba(59,130,246,0.5);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08), 0 0 0 3px rgba(59,130,246,0.1);
}

/* ══════════════════════════════════════════
   COURSE CARDS
   ══════════════════════════════════════════ */
.discovery-courses {
  width: 100%; max-width: 520px; margin: 0 auto;
}
.discovery-back-link {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: none; border: none; color: var(--text-secondary);
  font-size: 0.8125rem; font-family: inherit; cursor: pointer;
  padding: 0; margin-bottom: 0.75rem; transition: color 0.15s;
}
.discovery-back-link:hover { color: var(--accent); }
.discovery-more-wrap { text-align: center; margin-top: 1rem; }
.discovery-more-link {
  background: none; border: none; color: var(--text-secondary);
  font-size: 0.8125rem; font-family: inherit; cursor: pointer;
  padding: 0; transition: color 0.15s;
}
.discovery-more-link:hover { color: var(--accent); }

.discovery-cards-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.discovery-card {
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  text-decoration: none; color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.discovery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  border-color: rgba(59,130,246,0.2);
}

.discovery-card-thumb {
  width: 100%; aspect-ratio: 16/9;
  overflow: hidden; background: var(--bg-primary);
}
.discovery-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.discovery-card-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(59,130,246,0.12) 0%, rgba(59,130,246,0.04) 100%);
  font-size: 2rem; font-weight: 700; color: var(--accent);
}

.discovery-card-body { padding: 0.875rem 1rem; }
.discovery-card-title {
  font-size: 0.9375rem; font-weight: 600;
  line-height: 1.3; margin-bottom: 0.25rem;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.discovery-card-creator {
  font-size: 0.8125rem; color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.discovery-card-meta {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem;
}
.discovery-card-level {
  text-transform: capitalize;
  color: var(--text-secondary);
  padding: 0.125rem 0.5rem; border-radius: 999px;
  background: var(--accent-soft);
}
.discovery-card-price { font-weight: 600; color: var(--text-primary); }
.discovery-card-price--free { color: #16a34a; }

/* ── Empty state ── */
.discovery-empty {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-secondary);
}
.discovery-empty-sub {
  font-size: 0.875rem; opacity: 0.6; margin-top: 0.25rem;
}
.discovery-cta-btn {
  display: inline-block; margin-top: 1rem;
  padding: 0.625rem 2rem; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-size: 0.875rem; font-weight: 600;
  text-decoration: none; transition: opacity 0.2s;
}
.discovery-cta-btn:hover { opacity: 0.85; }

/* ══════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════ */
@keyframes optionReveal {
  0% { opacity: 0; transform: scale(0.4) translateY(16px); filter: blur(6px); }
  60% { opacity: 1; transform: scale(1.05) translateY(-2px); filter: blur(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes ambientPulse {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.5; transform: translate(-50%, -50%) scale(1.1); }
}
@keyframes ringBreathe {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(59,130,246,0.2)); }
  50% { filter: drop-shadow(0 0 16px rgba(59,130,246,0.4)); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════
   MOBILE LAYOUT
   ══════════════════════════════════════════ */
.mobile-discovery,
.mobile-input-bar,
.mobile-courses-wrap { display: none; }

@keyframes orbitSweep {
  0%   { transform: rotate(-90deg); opacity: 0; }
  8%   { opacity: 1; }
  75%  { opacity: 1; }
  100% { transform: rotate(270deg); opacity: 0; }
}

@keyframes mobileOptionFade {
  0% { opacity: 0; transform: translateY(16px); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ══════════════════════════════════════════
   DISCOVERY FLOW — text-based learner flow
   ══════════════════════════════════════════ */

/* Flow states — spacing */
.discovery-main.flow-ask,
.discovery-main.flow-results { gap: 1.5rem; }

/* Hide role buttons in ask/results steps */
.flow-ask .role-select,
.flow-results .role-select {
  opacity: 0 !important; max-height: 0 !important;
  overflow: hidden; pointer-events: none;
  transition: opacity 0.4s ease, max-height 0.5s ease;
}

/* Discovery question — typewriter text */
.discovery-question {
  font-family: 'Sora', sans-serif;
  font-size: 1.25rem; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-align: center;
  min-height: 1.75em;
}
.discovery-question::after {
  content: '|'; color: var(--accent);
  font-weight: 300; margin-left: 1px;
  animation: cursorBlink 0.6s step-end infinite;
}
.discovery-question.done::after {
  animation: none; opacity: 0;
}

/* Chat input for discovery */
.discovery-input-wrap {
  width: 100%; max-width: 420px;
  padding: 0 1rem;
}

/* Compact orb in results state */
.flow-results .tutor-orb {
  width: 60px !important; height: 60px !important;
}
.flow-results .orb-glow { inset: -12px !important; }
.flow-results .orb-mic { width: 20px !important; height: 20px !important; }
.flow-results .tutor-text { display: none; }

/* Results grid — 3 placeholder cards */
.results-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; width: 100%; max-width: 640px;
  padding: 0 1rem;
}

.result-card {
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  transition: transform 0.2s, box-shadow 0.2s;
}
.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.result-card { text-decoration: none; color: inherit; }

.result-card-thumb {
  width: 100%; aspect-ratio: 16/9; overflow: hidden;
}
.result-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.result-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(59,130,246,0.12) 0%, rgba(59,130,246,0.04) 100%);
  font-size: 2rem; font-weight: 700; color: #3b82f6;
}

.result-card-body { padding: 0.75rem 0.875rem; }
.result-card-title {
  font-size: 0.875rem; font-weight: 600;
  line-height: 1.3; margin-bottom: 0.25rem;
  color: var(--text-primary);
}
.result-card-creator {
  font-size: 0.75rem; color: var(--text-secondary);
}

/* Refine prompt */
.refine-prompt {
  font-size: 0.875rem; color: var(--text-secondary);
  text-align: center; font-weight: 500;
}

@media (max-width: 768px) {
  .discovery-cards-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
}
