/* ========================================================================
   Atom, Free AI Physics Tutor
   Dark only. Electric blue + cyan.
   ======================================================================== */

/* Display font for the tutor model names (Archimedes, Newton, etc.).
   Drop the font file into assets/ as HighCruiser.otf (or .woff2/.ttf).
   Falls back to Sora until the file is present. */
@font-face {
  font-family: 'High Cruiser';
  src: url('../assets/HighCruiser.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
.model-name { font-family: 'High Cruiser', 'Sora', sans-serif; letter-spacing: 0.01em; }

:root {
  --bg: #060a14;
  --bg-2: #0a101f;
  --bg-3: #0e1626;
  --fg: #eef2fa;
  --fg-muted: rgba(238, 242, 250, 0.64);
  --fg-subtle: rgba(238, 242, 250, 0.38);

  --accent: #3d7bff;
  --accent-2: #22d3ee;
  --accent-3: #38bdf8;
  --energy: #fbbf24;

  --grad: linear-gradient(135deg, #3d7bff 0%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(61,123,255,0.15), rgba(34,211,238,0.15));

  --line: rgba(238, 242, 250, 0.08);
  --line-2: rgba(238, 242, 250, 0.16);

  --card: rgba(15, 24, 42, 0.55);
  --card-hover: rgba(22, 34, 58, 0.80);
  --panel: rgba(12, 19, 34, 0.72);

  --input-bg: rgba(8, 13, 24, 0.70);
  --input-border: rgba(238, 242, 250, 0.13);

  --shadow-sm: 0 2px 10px rgba(0,0,0,0.35);
  --shadow: 0 12px 34px rgba(0,0,0,0.45);
  --shadow-lift: 0 22px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(61,123,255,0.22);
  --ring: 0 0 0 3px rgba(61,123,255,0.25);

  --icon-src: url("../assets/atom-icon-light.png");
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

h1, h2, h3, h4 {
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--fg);
}
h1 { font-size: clamp(2.6rem, 5.5vw, 4.3rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.8rem); }
h3 { font-size: clamp(1.12rem, 2vw, 1.35rem); }
p  { color: var(--fg-muted); }

a { color: var(--accent-2); text-decoration: none; transition: color 0.2s, opacity 0.2s; }
a:hover { opacity: 0.85; }

code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: var(--input-bg);
  padding: 0.12em 0.4em;
  border-radius: 5px;
  font-size: 0.88em;
}
pre {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
}
pre code { background: transparent; padding: 0; }

::selection { background: var(--accent); color: #fff; }

/* ---------- Layout helpers ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 6.5rem 0; position: relative; }
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.section-eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--grad);
  border-radius: 2px;
}
.section-heading { text-align: center; max-width: 720px; margin: 0 auto 3.5rem; }
.section-heading .section-eyebrow { justify-content: center; }
.section-heading p { margin-top: 1rem; font-size: 1.08rem; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.4rem;
  border-radius: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform 0.22s cubic-bezier(0.2,0.8,0.2,1), box-shadow 0.22s, background 0.22s, border-color 0.22s;
}
.btn-primary {
  background: linear-gradient(135deg, #2f6bff 0%, #17c6e8 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(47,107,255,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(47,107,255,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
  opacity: 1;
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: rgba(238,242,250,0.05);
  border-color: var(--line-2);
  color: var(--fg);
}
.btn-ghost:hover { transform: translateY(-2px); background: rgba(238,242,250,0.09); border-color: rgba(238,242,250,0.26); opacity: 1; }
.btn-lg { padding: 1rem 1.9rem; font-size: 1.03rem; border-radius: 15px; }

/* Glow CTA used in hero + bands */
.btn-glow {
  background: linear-gradient(135deg, #2f6bff 0%, #17c6e8 100%);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12) inset, 0 8px 30px rgba(47,107,255,0.45), 0 0 60px rgba(34,211,238,0.18);
}
.btn-glow:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18) inset, 0 14px 40px rgba(47,107,255,0.6), 0 0 90px rgba(34,211,238,0.28);
  opacity: 1;
}

/* ---------- Header: plain links, no pill bar ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.9rem 0;
  background: rgba(6, 10, 20, 0.72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.logo-link { display: flex; align-items: center; gap: 0.6rem; color: var(--fg); }
.logo-icon {
  width: 40px; height: 40px;
  background-image: var(--icon-src);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(61,123,255,0.5));
  transition: transform 0.5s ease;
}
.logo-link:hover .logo-icon { transform: rotate(90deg); }
.logo-word { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.5rem; letter-spacing: -0.03em; }

.nav-right { display: flex; align-items: center; gap: 1.75rem; }
.nav-links { display: flex; align-items: center; gap: 1.9rem; list-style: none; }
.nav-links a {
  position: relative;
  color: var(--fg-muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  transition: color 0.2s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--grad);
  border-radius: 2px;
  transition: right 0.25s cubic-bezier(0.2,0.8,0.2,1);
}
.nav-links a:hover { color: var(--fg); opacity: 1; }
.nav-links a:hover::after { right: 0; }
.nav-links a.active { color: var(--fg); }
.nav-links a.active::after { right: 0; }

.menu-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(238,242,250,0.05);
  border: 1px solid var(--line-2);
  color: var(--fg);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - 73px);
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: 2.5rem;
  max-width: 1260px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}
.hero-copy { max-width: 600px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 1rem;
  border-radius: 999px;
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.25);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-2);
  margin-bottom: 1.6rem;
}
.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
  animation: pulse 2s infinite;
}
.hero h1 { margin-bottom: 1.4rem; }
.hero h1 .accent {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .lead {
  font-size: clamp(1.05rem, 1.5vw, 1.18rem);
  margin-bottom: 2.4rem;
  color: var(--fg-muted);
  max-width: 540px;
}
.hero-cta { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.hero-meta { margin-top: 2.6rem; display: flex; gap: 2.4rem; flex-wrap: wrap; }
.hero-meta .stat strong {
  display: block;
  font-family: 'Sora', sans-serif;
  font-size: 1.65rem;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.hero-meta .stat span { font-size: 0.84rem; color: var(--fg-subtle); }

/* FBD pendulum stage */
.pendulum-col { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.pendulum-stage {
  position: relative;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 500 / 480;
  margin: 0 auto;
}
.pendulum-caption {
  text-align: center;
  padding: 1rem 1.6rem 1.1rem;
  border-radius: 18px;
  background: rgba(14, 22, 38, 0.55);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}
.pendulum-eq { color: var(--fg); font-size: 1.05rem; }
.pendulum-eq mjx-container { margin: 0 !important; }
.pendulum-live {
  margin-top: 0.35rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: 0.03em;
}
.pendulum-live span { display: inline-block; min-width: 2.2ch; text-align: right; }
.pendulum-glow {
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61,123,255,0.16), transparent 65%);
  filter: blur(24px);
  pointer-events: none;
}
#fbd-pendulum { width: 100%; height: 100%; position: relative; z-index: 1; overflow: visible; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s cubic-bezier(0.2,0.8,0.2,1), box-shadow 0.28s, background 0.28s, border-color 0.28s;
}
.card:hover {
  transform: translateY(-6px);
  background: var(--card-hover);
  border-color: var(--line-2);
  box-shadow: var(--shadow-lift);
}

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 1.4rem; }
.feature-card { padding: 1.9rem 1.75rem; }
.feature-icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  color: #fff; margin-bottom: 1.2rem;
  box-shadow: 0 8px 22px rgba(61,123,255,0.35);
}
.feature-card h3 { margin-bottom: 0.55rem; }
.feature-card p { font-size: 0.96rem; }

/* ---------- Why Atom: rocket mission + feature spine ---------- */
.why-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 3.5rem;
  align-items: center;
}
.why-visual { display: flex; flex-direction: column; gap: 0.7rem; }
.rocket-stage {
  position: relative; width: 100%; max-width: 580px;
  aspect-ratio: 500 / 580; margin: 0 auto;
}
.rocket-glow {
  position: absolute; inset: 4% 16% 58%; border-radius: 50%;
  background: radial-gradient(circle, rgba(61,123,255,0.14), transparent 65%);
  filter: blur(24px); pointer-events: none;
}
#rocket-anim { width: 100%; height: 100%; position: relative; z-index: 1; overflow: visible; }

/* Equations sit in their own band between the scene and the graphs, so they
   are always on screen with the visual and never cover the animation. */
.rocket-hud {
  position: absolute; z-index: 2;
  top: 46.9%; height: 10.3%; left: 3%; right: 3%;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.rocket-eq {
  color: var(--fg); font-size: 1rem; line-height: 1.35; text-align: center;
  width: 100%; padding: 0.3rem 0.7rem; border-radius: 10px;
  background: rgba(8, 13, 26, 0.5); border: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  white-space: nowrap; overflow: hidden;
}
.rocket-eq mjx-container { margin: 0 !important; }
.rocket-live { display: none; }

.why-content .section-eyebrow { display: block; }
.why-content h2 { margin: 0.3rem 0 0.7rem; }
.why-lead { color: var(--fg-muted); font-size: 1.06rem; line-height: 1.7; margin-bottom: 2.1rem; max-width: 30rem; }

.feature-spine { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 1.5rem; }
.feature-spine::before {
  content: ""; position: absolute; left: 25px; top: 18px; bottom: 18px; width: 2px;
  background: linear-gradient(to bottom, var(--accent) 0%, var(--accent-2) 55%, transparent 100%);
  opacity: 0.45;
}
.spine-item { display: grid; grid-template-columns: 52px 1fr; gap: 1.1rem; align-items: start; position: relative; }
.spine-node {
  width: 52px; height: 52px; border-radius: 15px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12, 19, 34, 0.92); border: 1px solid var(--line-2); color: var(--accent-2);
  box-shadow: 0 0 0 5px rgba(6,10,20,0.65), 0 6px 18px rgba(0,0,0,0.4);
  position: relative; z-index: 1;
  transition: transform 0.25s cubic-bezier(0.2,0.8,0.2,1), border-color 0.25s, box-shadow 0.25s, color 0.25s;
}
.spine-item:hover .spine-node {
  transform: translateY(-3px);
  border-color: rgba(34,211,238,0.55); color: #7ee7ff;
  box-shadow: 0 0 0 5px rgba(6,10,20,0.65), 0 10px 26px rgba(34,211,238,0.28);
}
.spine-text { padding-top: 0.15rem; }
.spine-text h3 { font-family: 'Sora', sans-serif; font-size: 1.14rem; margin: 0.3rem 0 0.28rem; }
.spine-text p { color: var(--fg-muted); font-size: 0.96rem; line-height: 1.55; margin: 0; }

/* ---------- Tier cards ---------- */
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 1.4rem; margin-top: 2.5rem; }
.tier-card {
  padding: 1.9rem 1.7rem;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 255px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.tier-card .glow {
  position: absolute; top: -40%; left: 50%;
  width: 160%; height: 80%;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--tier-color, var(--accent)) 0%, transparent 62%);
  opacity: 0.13;
  pointer-events: none;
  transition: opacity 0.3s;
}
.tier-card:hover .glow { opacity: 0.25; }
.tier-card.disabled { cursor: default; opacity: 0.78; }
.tier-card.disabled:hover { transform: none; box-shadow: var(--shadow-sm); background: var(--card); }
.tier-icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--tier-color, var(--accent));
  color: #fff;
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.35rem;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--tier-color, var(--accent)) 50%, transparent);
  margin-bottom: 0.4rem;
}
.tier-name { font-family: 'High Cruiser', 'Sora', sans-serif; font-size: 1.4rem; font-weight: 700; letter-spacing: 0.01em; }
.tier-level { font-size: 0.84rem; color: var(--fg-subtle); font-weight: 600; margin-bottom: 0.4rem; }
.tier-desc { color: var(--fg-muted); font-size: 0.9rem; flex-grow: 1; }
.tier-badge {
  align-self: flex-start;
  margin-top: 0.8rem;
  padding: 0.28rem 0.75rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tier-badge.available { background: rgba(34,211,238,0.14); color: var(--accent-2); border: 1px solid rgba(34,211,238,0.32); }
.tier-badge.prerelease { background: rgba(250,204,21,0.15); color: #fde047; border: 1px solid rgba(250,204,21,0.45); }
.tier-badge.coming { background: var(--input-bg); color: var(--fg-subtle); border: 1px solid var(--line); }

/* ---------- CTA band (dramatic) ---------- */
.cta-band {
  position: relative;
  padding: 4.5rem 2rem;
  text-align: center;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid rgba(61,123,255,0.25);
  background:
    radial-gradient(ellipse 70% 90% at 50% 110%, rgba(34,211,238,0.16), transparent 60%),
    radial-gradient(ellipse 60% 80% at 50% -20%, rgba(61,123,255,0.22), transparent 60%),
    var(--bg-2);
}
.cta-band::before {
  content: "";
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
  width: 60%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34,211,238,0.8), transparent);
}
.cta-band h2 { font-size: clamp(2rem, 4vw, 3rem); }
.cta-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 1.1rem;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(10,16,31,0.9));
}
.footer-top {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3.75rem 1.5rem 2.5rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand .logo-link { margin-bottom: 1rem; }
.footer-brand p { font-size: 0.92rem; max-width: 280px; }
.footer-social { display: flex; gap: 0.6rem; margin-top: 1.3rem; }
.footer-social a {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(238,242,250,0.05);
  border: 1px solid var(--line);
  color: var(--fg-muted);
  transition: transform 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}
.footer-social a:hover { transform: translateY(-3px); color: var(--fg); background: rgba(238,242,250,0.1); border-color: var(--line-2); }
.footer-col h4 {
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 1.05rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.footer-col a { color: var(--fg-muted); font-size: 0.94rem; font-weight: 500; }
.footer-col a:hover { color: var(--fg); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 1.4rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-subtle);
}

/* ---------- Animations ---------- */
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(1.25); } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; }
.reveal.in { animation: fadeInUp 0.7s cubic-bezier(0.2,0.8,0.2,1) forwards; }
.d1 { animation-delay: 0.1s; } .d2 { animation-delay: 0.2s; } .d3 { animation-delay: 0.3s; }

/* =======================================================================
   CHAT PAGE  (flexbox, robust)
   ======================================================================= */
.chat-app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* --- Sidebar --- */
.chat-sidebar {
  width: 272px;
  flex: 0 0 272px;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  min-height: 0;
}
.sidebar-head {
  padding: 1rem 1rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.sidebar-head .logo-icon { width: 32px; height: 32px; }
.sidebar-head .logo-word { font-size: 1.3rem; }

.new-chat-btn {
  margin: 0.5rem 0.9rem 0.9rem;
  padding: 0.72rem 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #2f6bff 0%, #17c6e8 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 5px 16px rgba(47,107,255,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.new-chat-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(47,107,255,0.48); }

.history-label {
  padding: 0.35rem 1.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.6rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-height: 0;
}
.history-list::-webkit-scrollbar { width: 6px; }
.history-list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.history-item {
  padding: 0.62rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--fg-muted);
  font-size: 0.88rem;
  transition: background 0.18s, color 0.18s;
}
.history-item:hover { background: rgba(238,242,250,0.05); color: var(--fg); }
.history-item.active { background: rgba(61,123,255,0.14); color: var(--fg); }
.history-item .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item .del {
  opacity: 0;
  border: none; background: transparent;
  color: var(--fg-subtle);
  cursor: pointer;
  padding: 2px; border-radius: 6px;
  display: flex;
  flex-shrink: 0;
}
.history-item:hover .del { opacity: 1; }
.history-item .del:hover { color: #f87171; }
.history-empty { padding: 0.9rem 1.15rem; font-size: 0.84rem; color: var(--fg-subtle); }

.sidebar-foot {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1.1rem;
}
.sidebar-foot a { color: var(--fg-muted); font-size: 0.85rem; font-weight: 500; }
.sidebar-foot a:hover { color: var(--fg); }

/* --- Main column --- */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  /* Translucent so the animated #bg-canvas shader (same moving gradient as the
     home page) shows through, dimmed just enough to stay easy on the eyes for
     long study sessions. */
  background: rgba(6, 10, 20, 0.34);
}
.chat-topbar {
  flex: 0 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-bottom: 1px solid var(--line);
}
.tier-picker {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.9rem;
  border-radius: 11px;
  background: rgba(238,242,250,0.04);
  border: 1px solid var(--line-2);
  cursor: pointer;
  color: var(--fg);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
  max-width: 100%;
  overflow: hidden;
}
.tier-picker:hover { background: rgba(238,242,250,0.08); border-color: rgba(238,242,250,0.24); }
.tier-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--tier-color, var(--accent));
  box-shadow: 0 0 8px var(--tier-color, var(--accent));
  flex-shrink: 0;
}
.tier-picker .lvl { opacity: 0.5; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: rgba(238,242,250,0.04);
  border: 1px solid var(--line);
  color: var(--fg-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(238,242,250,0.09); color: var(--fg); }
.mobile-menu-btn { display: none; }

/* Messages area */
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.chat-scroll::-webkit-scrollbar { width: 9px; }
.chat-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; }

.chat-messages {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.7rem;
}

.msg { display: flex; gap: 0.9rem; align-items: flex-start; animation: fadeInUp 0.3s ease; }
.msg.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 0.74rem;
}
.msg-avatar.user { background: linear-gradient(135deg, #2f6bff, #17c6e8); color: #fff; }
.msg-avatar.ai {
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  background-image: var(--icon-src);
  background-size: 64%;
  background-repeat: no-repeat;
  background-position: center;
}
.msg-body { max-width: min(640px, 82%); min-width: 0; }
.msg-bubble {
  padding: 0.9rem 1.15rem;
  border-radius: 16px;
  font-size: 0.98rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}
.msg.user .msg-bubble {
  background: linear-gradient(135deg, #2f6bff, #1f9edd);
  color: #fff;
  border-radius: 16px 16px 5px 16px;
  box-shadow: 0 4px 16px rgba(47,107,255,0.25);
}
.msg.ai .msg-bubble {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 5px 16px 16px 16px;
}
.msg-bubble p { color: inherit; margin-bottom: 0.55rem; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble ul, .msg-bubble ol { margin: 0.5rem 0 0.5rem 1.4rem; color: inherit; }
.msg-bubble li { margin-bottom: 0.3rem; }
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3 { color: inherit; margin: 0.7rem 0 0.4rem; font-size: 1.08rem; }
.msg-bubble code { color: inherit; }
.msg.user .msg-bubble pre { background: rgba(0,0,0,0.22); }

/* MathJax (CHTML output): let very wide display math scroll horizontally
   inside the bubble instead of overflowing the chat layout. */
.msg-bubble mjx-container { max-width: 100%; }
.msg-bubble mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; padding-bottom: 2px; margin: 0.5rem 0; }

/* Message action row (copy / edit / visualize) */
.msg-actions { margin-top: 0.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.msg.user .msg-actions { justify-content: flex-end; }
.msg-act {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: 'Inter', sans-serif; font-size: 0.76rem; font-weight: 600;
  color: var(--fg-subtle); background: transparent; border: 1px solid transparent;
  padding: 0.28rem 0.55rem; border-radius: 8px; cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.msg-act:hover { color: var(--fg); background: rgba(255,255,255,0.06); }
.msg-act.done { color: var(--accent-2); }
.msg-act svg { flex-shrink: 0; }

/* Inline message editor */
.msg-editor { width: 100%; }
.msg-editor textarea {
  width: 100%; background: var(--bg-3); border: 1px solid var(--input-border);
  border-radius: 14px; color: var(--fg); font-family: 'Inter', sans-serif;
  font-size: 0.98rem; line-height: 1.5; padding: 0.7rem 0.9rem;
  resize: vertical; min-height: 66px; outline: none;
}
.msg-editor textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }
.msg-editor-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.55rem; }
.me-save, .me-cancel {
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.82rem;
  padding: 0.45rem 0.95rem; border-radius: 10px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.me-save { border: none; background: linear-gradient(135deg, #2f6bff, #17c6e8); color: #fff; box-shadow: 0 4px 14px rgba(47,107,255,0.4); }
.me-save:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(47,107,255,0.55); }
.me-cancel { background: transparent; border: 1px solid var(--line-2); color: var(--fg-muted); }
.me-cancel:hover { background: rgba(255,255,255,0.05); color: var(--fg); }
.viz-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: 'Inter', sans-serif; font-size: 0.82rem; font-weight: 600;
  color: var(--accent-2);
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.28);
  padding: 0.4rem 0.8rem; border-radius: 10px; cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.viz-btn:hover:not(:disabled) { background: rgba(34,211,238,0.15); border-color: rgba(34,211,238,0.5); transform: translateY(-1px); }
.viz-btn:disabled { opacity: 0.75; cursor: default; }
.viz-btn svg { flex-shrink: 0; }
.viz-spin {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(34,211,238,0.35); border-top-color: var(--accent-2);
  display: inline-block; animation: vizspin 0.7s linear infinite;
}
@keyframes vizspin { to { transform: rotate(360deg); } }

.viz-holder { margin-top: 0.7rem; }
.viz-frame {
  width: 100%; height: 440px; border: 1px solid var(--line);
  border-radius: 14px; background: rgba(8,12,24,0.6);
  display: block;
}
.viz-error {
  font-size: 0.9rem; color: var(--fg-muted);
  background: rgba(255,255,255,0.03); border: 1px solid var(--line);
  border-radius: 12px; padding: 0.7rem 0.9rem;
}
.viz-error p { margin: 0; }

/* Narrated video lesson player */
.video-btn { color: #7ee0ff; }
.video-holder { margin-top: 0.7rem; }
.video-player {
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: rgba(8,12,24,0.55);
}
.vp-stage {
  position: relative; min-height: 240px; padding: 1.4rem 1.5rem 1.6rem;
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(61,123,255,0.16), transparent 65%),
    radial-gradient(ellipse 70% 60% at 100% 100%, rgba(34,211,238,0.12), transparent 60%),
    #0a1020;
  display: flex; flex-direction: column; justify-content: center;
}
.vp-kicker {
  position: absolute; top: 0.85rem; left: 1.5rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-2);
}
.vp-slide { animation: vpIn 0.4s ease; }
@keyframes vpIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.vp-heading { font-family: 'Sora', sans-serif; font-size: 1.35rem; font-weight: 700; margin: 0.4rem 0 0.7rem; color: #fff; }
.vp-bullets { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.4rem; }
.vp-bullets li { font-size: 1rem; color: #cdd8ef; line-height: 1.5; }
.vp-eq {
  margin-top: 1rem; align-self: center; text-align: center; overflow-x: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 1.1rem; color: var(--accent-2);
  background: rgba(34,211,238,0.08); border: 1px solid rgba(34,211,238,0.2);
  border-radius: 10px; padding: 0.5rem 0.95rem;
}
.vp-bar { height: 3px; background: rgba(255,255,255,0.08); }
.vp-fill { height: 100%; width: 0; background: var(--grad); transition: width 0.4s ease; }
.vp-controls {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.7rem 0.9rem; background: rgba(8,12,24,0.6);
}
.vp-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2f6bff, #17c6e8); color: #fff;
  box-shadow: 0 4px 14px rgba(47,107,255,0.4); transition: transform 0.15s, box-shadow 0.2s;
}
.vp-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(47,107,255,0.55); }
.vp-nav { display: flex; align-items: center; gap: 0.6rem; }
.vp-step {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--fg-muted);
  display: flex; align-items: center; justify-content: center; transition: background 0.16s, color 0.16s;
}
.vp-step:hover { background: rgba(255,255,255,0.12); color: var(--fg); }
.vp-count { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; color: var(--fg-muted); min-width: 48px; text-align: center; }
.vp-note { font-size: 0.76rem; color: var(--fg-subtle); margin-left: auto; }

.typing { display: inline-flex; gap: 5px; padding: 0.35rem 0; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-muted); animation: tb 1.2s infinite; }
.typing span:nth-child(2){ animation-delay: 0.15s; }
.typing span:nth-child(3){ animation-delay: 0.3s; }
@keyframes tb { 0%,60%,100%{ transform: translateY(0); opacity: 0.4; } 30%{ transform: translateY(-6px); opacity: 1; } }

/* Empty / welcome state */
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.2rem 1.5rem;
  gap: 0.6rem;
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
}
.chat-empty .big-icon {
  width: 68px; height: 68px;
  background-image: var(--icon-src);
  background-size: contain; background-repeat: no-repeat; background-position: center;
  filter: drop-shadow(0 0 14px rgba(34,211,238,0.65)) drop-shadow(0 0 34px rgba(61,123,255,0.5));
  animation: floatY 5s ease-in-out infinite, iconGlow 3.2s ease-in-out infinite alternate;
  margin-bottom: 0.15rem;
}
@keyframes iconGlow {
  from { filter: drop-shadow(0 0 12px rgba(34,211,238,0.5)) drop-shadow(0 0 28px rgba(61,123,255,0.4)); }
  to   { filter: drop-shadow(0 0 20px rgba(34,211,238,0.85)) drop-shadow(0 0 46px rgba(61,123,255,0.65)); }
}
.chat-empty h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.chat-empty .sub { font-size: 1rem; max-width: 460px; color: var(--fg-muted); }
.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  width: 100%;
  max-width: 560px;
  margin-top: 0.6rem;
}
.suggestion {
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: 'Inter', sans-serif;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
  line-height: 1.4;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.suggestion:hover {
  transform: translateY(-3px);
  background: var(--card-hover);
  border-color: rgba(61,123,255,0.35);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.suggestion .s-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.25rem;
}

/* Composer (AI prompt box) */
.chat-composer { flex: 0 0 auto; padding: 0.6rem 1.5rem 1.3rem; }
.composer-inner { max-width: 820px; margin: 0 auto; }

.prompt-box {
  border: 1px solid var(--input-border);
  border-radius: 26px;
  padding: 0.55rem 0.6rem 0.5rem 1.15rem;
  /* Faded take on the home-page gradient: gentle enough for long study sessions */
  background:
    linear-gradient(135deg, rgba(61,123,255,0.22) 0%, rgba(34,211,238,0.15) 52%, rgba(61,123,255,0.10) 100%),
    var(--bg-3);
  box-shadow: 0 10px 34px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.045);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.prompt-box:focus-within {
  border-color: rgba(61,123,255,0.55);
  box-shadow: var(--ring), 0 10px 34px rgba(0,0,0,0.4);
}
.prompt-box.recording { border-color: rgba(239,68,68,0.5); }

.composer-input {
  display: block; width: 100%;
  background: transparent; border: none; outline: none;
  color: var(--fg);
  font-family: 'Inter', sans-serif; font-size: 1rem; line-height: 1.5;
  resize: none; max-height: 200px; min-height: 26px;
  padding: 0.45rem 0.3rem 0.1rem 0;
}
.composer-input::placeholder { color: var(--fg-subtle); }
.prompt-box.recording .composer-input {
  height: 0 !important; min-height: 0; opacity: 0; overflow: hidden;
  padding: 0; pointer-events: none;
}

.prompt-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.6rem; padding-top: 0.35rem;
}
.prompt-caption { font-size: 0.72rem; color: var(--fg-subtle); padding-left: 0.15rem; }
.prompt-box.recording .prompt-caption { visibility: hidden; }

.pi-send {
  width: 40px; height: 40px; border-radius: 50%;
  border: none; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); color: var(--fg-subtle);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, color 0.2s;
}
.pi-send:hover:not(:disabled) { background: rgba(255,255,255,0.12); color: var(--fg); }
.pi-send.has-content {
  background: linear-gradient(135deg, #2f6bff, #17c6e8); color: #fff;
  box-shadow: 0 4px 14px rgba(47,107,255,0.45);
}
.pi-send.has-content:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(47,107,255,0.6); }
.pi-send.recording { background: rgba(239,68,68,0.16); color: #ef4444; }
.pi-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Voice recorder */
.voice-recorder { display: none; flex-direction: column; align-items: center; padding: 0.5rem 0 0.15rem; }
.prompt-box.recording .voice-recorder { display: flex; }
.vr-status {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.55rem;
  font-size: 0.82rem; color: var(--fg-muted); font-family: 'JetBrains Mono', monospace;
}
.vr-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: vrpulse 1s infinite; }
.vr-hint { color: var(--fg-subtle); font-family: 'Inter', sans-serif; }
@keyframes vrpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.vr-bars { display: flex; align-items: center; justify-content: center; gap: 2px; height: 34px; width: 100%; max-width: 420px; }
.vr-bar {
  width: 3px; border-radius: 3px;
  background: linear-gradient(to top, #3d7bff, #22d3ee);
  transform-origin: center bottom;
  animation: vrbar 0.6s ease-in-out infinite alternate;
}
@keyframes vrbar { from { transform: scaleY(0.28); opacity: 0.5; } to { transform: scaleY(1); opacity: 1; } }

.composer-hint { margin-top: 0.55rem; font-size: 0.74rem; color: var(--fg-subtle); text-align: center; }

/* ---------- Tier modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(3, 6, 13, 0.7);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; animation: fadeInUp 0.25s ease; }
.modal {
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2rem 1.7rem;
  border-radius: 24px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lift);
  position: relative;
}
.modal-head { text-align: center; margin-bottom: 1.5rem; }
.modal-head h2 { font-size: 1.55rem; }
.modal-head p { margin-top: 0.4rem; font-size: 0.93rem; }
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(238,242,250,0.05); border: 1px solid var(--line);
  color: var(--fg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.tier-rows { display: flex; flex-direction: column; gap: 0.7rem; }
.tier-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.tier-row:hover { transform: translateY(-2px); background: var(--card-hover); border-color: var(--line-2); }
.tier-row.disabled { cursor: default; opacity: 0.65; }
.tier-row.disabled:hover { transform: none; background: var(--card); }
.tier-row .r-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--tier-color, var(--accent));
  color: #fff; font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.2rem;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--tier-color, var(--accent)) 45%, transparent);
}
.tier-row .r-body { flex: 1; min-width: 0; }
.tier-row .r-name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.02rem; }
.tier-row .r-level { font-size: 0.8rem; color: var(--fg-subtle); }
.tier-row .r-badge {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.26rem 0.6rem; border-radius: 7px; flex-shrink: 0;
}
.tier-row .r-badge.available { background: rgba(34,211,238,0.14); color: var(--accent-2); }
.tier-row .r-badge.prerelease { background: rgba(250,204,21,0.15); color: #fde047; border: 1px solid rgba(250,204,21,0.4); letter-spacing: 0.02em; line-height: 1.2; text-align: center; max-width: 96px; }
.tier-row .r-badge.coming { background: var(--input-bg); color: var(--fg-subtle); }

/* ---------- About page ---------- */
.about-hero { padding: 6rem 1.5rem 2rem; text-align: center; }
.about-hero h1 { max-width: 880px; margin: 0 auto; }
.about-hero .lead { max-width: 640px; margin: 1.5rem auto 0; font-size: 1.15rem; color: var(--fg-muted); }
.about-content { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }
.prose-card { padding: 2.5rem 2.2rem; border-radius: 22px; }
.prose-card h2 { margin-bottom: 1rem; }
.prose-card p { font-size: 1.04rem; line-height: 1.75; }
.prose-card p + p { margin-top: 1rem; }
.attr-list {
  list-style: none; margin: 1rem 0; padding: 0;
  display: grid; gap: 0.6rem;
}
.attr-list li {
  font-size: 1.02rem; line-height: 1.6;
  padding: 0.7rem 1rem 0.7rem 2.4rem; position: relative;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.attr-list li::before {
  content: ""; position: absolute; left: 0.95rem; top: 1.15rem;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--grad); box-shadow: 0 0 8px var(--accent-2);
}
.attr-list a { color: var(--accent-2); }
.value-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.3rem; }
.value-card { padding: 1.7rem; }
.value-num {
  font-family: 'Sora', sans-serif; font-size: 2.1rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  display: block; margin-bottom: 0.45rem; line-height: 1;
}
.value-card h3 { margin-bottom: 0.4rem; }
.value-card p { font-size: 0.94rem; }

/* Founders */
.founders-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 3rem 4rem; margin: 0 auto; max-width: 720px;
}
.founder-card { text-align: center; }
.founder-photo {
  width: 224px; height: 224px; border-radius: 22px; overflow: hidden;
  margin: 0 auto 1.15rem; border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 14px 44px rgba(34,211,238,0.16), 0 6px 20px rgba(0,0,0,0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.founder-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.founder-card:hover .founder-photo {
  transform: translateY(-6px);
  box-shadow: 0 22px 60px rgba(34,211,238,0.28), 0 10px 26px rgba(0,0,0,0.5);
}
.founder-name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.32rem; }
.founder-role { color: var(--fg-muted); font-size: 0.95rem; margin-top: 0.25rem; }
.founders-mission {
  max-width: 760px; margin: 2.6rem auto 0; text-align: center;
  color: var(--fg-muted); font-size: 1.05rem; line-height: 1.75;
}

/* 404 */
.notfound {
  min-height: calc(100vh - 76px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem 1.5rem 4rem; gap: 0.5rem;
}
.nf-icon {
  width: 84px; height: 84px; margin-bottom: 0.6rem;
  background-image: var(--icon-src);
  background-size: contain; background-repeat: no-repeat; background-position: center;
  filter: drop-shadow(0 0 16px rgba(34,211,238,0.6)) drop-shadow(0 0 40px rgba(61,123,255,0.5));
  animation: floatY 5s ease-in-out infinite, iconGlow 3.2s ease-in-out infinite alternate;
}
.nf-code {
  font-family: 'Sora', sans-serif; font-weight: 800; line-height: 1;
  font-size: clamp(5rem, 16vw, 9rem); letter-spacing: -0.03em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 30px rgba(34,211,238,0.25));
}
.nf-title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-top: 0.4rem; }
.nf-sub { max-width: 520px; color: var(--fg-muted); font-size: 1.05rem; margin-top: 0.3rem; }
.nf-eq {
  font-family: 'JetBrains Mono', monospace; font-size: 0.95rem;
  color: var(--accent-2); background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.22); border-radius: 10px;
  padding: 0.4rem 0.9rem; margin: 1.1rem 0 0.4rem;
}
.nf-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; margin-top: 1.4rem; }

/* MathJax */
.MathJax { color: inherit !important; }
mjx-container { overflow-x: auto; overflow-y: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 1.5rem; }
  .hero-copy { max-width: 640px; margin: 0 auto; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero-cta, .hero-meta { justify-content: center; }
  .pendulum-col { order: -1; }
  .pendulum-stage { max-width: 420px; }
  .why-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .why-content h2, .why-content .section-eyebrow { text-align: center; }
  .why-lead { margin-left: auto; margin-right: auto; text-align: center; }
  .feature-spine { max-width: 30rem; margin: 0 auto; }
  .rocket-stage { max-width: 440px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .chat-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.2,0.8,0.2,1);
  }
  .chat-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lift); }
  .sidebar-scrim { display: none; position: fixed; inset: 0; z-index: 140; background: rgba(0,0,0,0.55); }
  .sidebar-scrim.show { display: block; }
  .mobile-menu-btn { display: flex; }
}
@media (max-width: 720px) {
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 1.25rem; right: 1.25rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.7rem;
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: 16px;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.65rem 0.9rem; border-radius: 10px; }
  .nav-links a::after { display: none; }
  .nav-links a:hover, .nav-links a.active { background: rgba(238,242,250,0.06); }
  .menu-toggle { display: flex; }
  .nav-right { gap: 0.75rem; }
  .section { padding: 4.5rem 0; }
  .footer-top { grid-template-columns: 1fr; }
  .msg-body { max-width: 88%; }
}

/* ============================================================
   COMPARE PAGE — tier comparison table + picker
   ============================================================ */
.cmp-wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }

/* --- scroll container so the table never breaks the layout --- */
.cmp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .5rem; }
.cmp-table {
  width: 100%;
  min-width: 780px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(14px);
}
.cmp-table th, .cmp-table td {
  padding: 1rem 1.1rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.94rem;
  line-height: 1.6;
  border-bottom: 1px solid var(--line);
}
.cmp-table tr:last-child th, .cmp-table tr:last-child td { border-bottom: 0; }
.cmp-table thead th { background: rgba(255,255,255,0.03); }

/* row label column */
.cmp-table tbody th {
  width: 168px;
  font-weight: 600;
  color: var(--fg-muted);
  font-size: 0.82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.015);
  border-right: 1px solid var(--line);
}
.cmp-table thead th:first-child { background: rgba(255,255,255,0.03); border-right: 1px solid var(--line); }

/* tier header cell */
.cmp-head { min-width: 190px; }
.cmp-head .cmp-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--tc); box-shadow: 0 0 12px var(--tc); margin-right: .5rem;
  vertical-align: middle;
}
.cmp-head .cmp-name {
  font-family: var(--font-display, inherit);
  font-weight: 700; font-size: 1.06rem; color: var(--tc);
  vertical-align: middle;
}
.cmp-head .cmp-sub { display: block; margin-top: .3rem; font-size: .82rem; color: var(--fg-muted); font-weight: 500; text-transform: none; letter-spacing: 0; }

.cmp-table code, .cmp-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .82rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .12rem .4rem;
  color: var(--fg);
  word-break: break-all;
}
.cmp-yes { color: var(--accent-2); font-weight: 600; }
.cmp-na  { color: var(--fg-muted); opacity: .6; }

/* --- picker cards --- */
.cmp-pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin-top: 2rem; }
.cmp-pick { padding: 1.5rem; border-left: 3px solid var(--tc); }
.cmp-pick h3 { font-size: 1.05rem; margin-bottom: .5rem; color: var(--tc); }
.cmp-pick p { font-size: .93rem; color: var(--fg-muted); margin-bottom: .9rem; }
.cmp-pick ul { list-style: none; padding: 0; margin: 0 0 1.1rem; }
.cmp-pick li { position: relative; padding-left: 1.15rem; font-size: .89rem; margin-bottom: .4rem; color: var(--fg-muted); }
.cmp-pick li::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--tc); }
.cmp-pick .btn { width: 100%; justify-content: center; }

/* --- note strip --- */
.cmp-note {
  margin-top: 1.5rem; padding: 1.1rem 1.3rem;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255,255,255,0.02);
  font-size: .9rem; color: var(--fg-muted); line-height: 1.65;
}
.cmp-note strong { color: var(--fg); }

@media (max-width: 640px) {
  .cmp-table th, .cmp-table td { padding: .8rem .85rem; font-size: .88rem; }
  .cmp-table tbody th { width: 130px; }
}
