/* ============================================================
   FocusRoom — Global styles & components
   ============================================================ */

/* ---------- Fonts (self-hosted Inter variable — offline, premium) ---------- */
@font-face {
  font-family: "InterVariable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/InterVariable.woff2") format("woff2");
}
@font-face {
  font-family: "InterVariable";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/InterVariable-Italic.woff2") format("woff2");
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-optical-sizing: auto;
  font-feature-settings: "cv05" 1, "cv11" 1, "ss03" 1, "calt" 1;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Fine film-grain texture — adds depth without cost. Sits above the bg,
   below content, and never intercepts pointer events. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#app { position: relative; z-index: 1; }

img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; border-radius: 6px; }

::selection { background: var(--brand-500); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--brand-500); color: #fff; padding: 10px 16px; border-radius: 10px;
  transition: top var(--dur-2) var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* ---------- Layout primitives ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s-5); }
.container-wide { max-width: var(--container-wide); }
.section { padding-block: clamp(56px, 9vw, 120px); position: relative; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.grid { display: grid; }
.gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); }
.gap-5 { gap: var(--s-5); } .gap-6 { gap: var(--s-6); }
.center { align-items: center; justify-content: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--brand-300); display: inline-flex; align-items: center; gap: 8px;
}
.gradient-text {
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
h1, h2, h3 { line-height: var(--lh-tight); letter-spacing: -0.02em; font-weight: 700; }
h1 { letter-spacing: -0.035em; font-weight: 780; }
h2 { letter-spacing: -0.028em; font-weight: 760; }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-2); max-width: 60ch; line-height: 1.55; letter-spacing: -0.006em; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface-3);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 20px; border-radius: var(--r-full); border: 1px solid var(--line-strong);
  background: var(--btn-bg); color: var(--text); font-weight: 600; font-size: var(--fs-sm);
  cursor: pointer; white-space: nowrap; position: relative;
  transition: transform var(--dur-1) var(--ease-out), background var(--dur-2), border-color var(--dur-2), box-shadow var(--dur-2), opacity var(--dur-2);
  min-height: 44px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  --btn-bg: var(--grad-brand); border-color: transparent; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px -8px var(--brand-glow);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 2px 4px rgba(0,0,0,0.3), 0 14px 38px -8px var(--brand-glow); }
.btn-ghost { --btn-bg: rgba(255,255,255,0.02); border-color: var(--line-strong); box-shadow: var(--ring-inset); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-subtle { --btn-bg: var(--surface-2); border-color: var(--line); }
.btn-danger { --btn-bg: rgba(255,90,106,0.12); border-color: rgba(255,90,106,0.3); color: #ff8a95; }
.btn-danger:hover { background: rgba(255,90,106,0.2); }
.btn-lg { padding: 15px 28px; font-size: var(--fs-body); min-height: 52px; }
.btn-sm { padding: 8px 14px; min-height: 38px; font-size: var(--fs-xs); }
.btn-icon { padding: 10px; width: 42px; height: 42px; min-height: 0; }
.btn-block { width: 100%; }

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5);
  position: relative; overflow: hidden; box-shadow: var(--ring-inset);
}
.card::before { content: ""; position: absolute; inset: 0; background: var(--grad-surface); pointer-events: none; }
.card > * { position: relative; }
.card-hover { transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-2), box-shadow var(--dur-2); }
.card-hover:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--ring-inset), var(--shadow-lg); }

.glass {
  background: rgba(20,20,28,0.55); backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%); border: 1px solid var(--line-strong);
}
:root[data-theme="light"] .glass { background: rgba(255,255,255,0.65); }

.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: var(--r-full);
  background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-2);
  font-weight: 500;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-green); flex: none; }
.dot.live { box-shadow: 0 0 0 0 rgba(61,220,132,0.6); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%{box-shadow:0 0 0 0 rgba(61,220,132,0.5)} 70%{box-shadow:0 0 0 8px rgba(61,220,132,0)} 100%{box-shadow:0 0 0 0 rgba(61,220,132,0)} }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 600; background: rgba(109,92,255,0.14); color: var(--brand-300);
  border: 1px solid rgba(109,92,255,0.24);
}

/* ---------- Avatars ---------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem; color: #fff; flex: none; letter-spacing: -0.02em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent; transition: border-color var(--dur-2), background var(--dur-2);
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad-brand); flex: none;
  display: grid; place-items: center; box-shadow: 0 4px 14px -4px var(--brand-glow);
}
.brand-mark svg { width: 20px; height: 20px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 9px 14px; border-radius: 10px; color: var(--text-2); font-size: var(--fs-sm); font-weight: 500;
  transition: color var(--dur-1), background var(--dur-1);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-actions { display: flex; align-items: center; gap: var(--s-3); }
.nav-toggle { display: none; }

/* ============================================================
   LANDING
   ============================================================ */
.hero { position: relative; padding-top: clamp(48px, 8vw, 96px); padding-bottom: clamp(56px, 9vw, 110px); overflow: hidden; }
.hero-bg {
  position: absolute; inset: -10% -10% 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(50% 55% at 68% 8%, rgba(109,92,255,0.30), transparent 60%),
    radial-gradient(45% 50% at 20% 30%, rgba(52,224,196,0.12), transparent 60%),
    radial-gradient(60% 60% at 50% -5%, rgba(163,79,255,0.16), transparent 65%);
  filter: blur(10px);
}
.hero-grid-lines {
  position: absolute; inset: 0; z-index: 0; opacity: 0.5; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: radial-gradient(80% 60% at 50% 20%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(80% 60% at 50% 20%, #000 0%, transparent 75%);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: var(--fs-display); margin-block: 20px 22px; }
.hero .lead { margin-bottom: 30px; }
.hero-cta { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-bottom: 30px; }
.hero-social { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; color: var(--text-3); font-size: var(--fs-sm); }
.hero-avatars { display: flex; }
.hero-avatars .avatar { width: 34px; height: 34px; margin-left: -10px; border: 2px solid var(--bg); }
.hero-avatars .avatar:first-child { margin-left: 0; }

/* Floating hero "study room" preview built with CSS */
.hero-visual { position: relative; }
.room-preview {
  border-radius: var(--r-xl); border: 1px solid var(--line-strong); background: var(--surface);
  box-shadow: var(--shadow-lg); overflow: hidden; transform: perspective(1400px) rotateY(-9deg) rotateX(4deg);
  transition: transform var(--dur-4) var(--ease-out);
}
.hero-visual:hover .room-preview { transform: perspective(1400px) rotateY(-4deg) rotateX(2deg); }
.rp-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.rp-dots { display: flex; gap: 6px; }
.rp-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--surface-3); }
.rp-body { padding: 16px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.rp-cam {
  aspect-ratio: 16/10; border-radius: 14px; background:
    radial-gradient(120% 90% at 30% 10%, rgba(109,92,255,0.35), transparent 60%),
    linear-gradient(160deg, #1b1b28, #0f0f16);
  position: relative; overflow: hidden; border: 1px solid var(--line);
}
.rp-cam .face { position: absolute; left: 50%; top: 54%; transform: translate(-50%,-50%); width: 46%; }
.rp-cam .focus-tag {
  position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: rgba(61,220,132,0.16); color: var(--accent-green); border: 1px solid rgba(61,220,132,0.3);
  display: flex; align-items: center; gap: 6px;
}
.rp-side { display: grid; gap: 10px; grid-auto-rows: min-content; }
.rp-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.rp-stat b { font-size: 1.3rem; letter-spacing: -0.02em; }
.rp-ring { --p: 78; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; margin-inline: auto;
  background: conic-gradient(var(--brand-500) calc(var(--p)*1%), var(--surface-3) 0); }
.rp-ring span { width: 56px; height: 56px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; }
.rp-participants { display: flex; gap: 6px; padding: 0 16px 16px; }
.rp-participants .avatar { width: 30px; height: 30px; font-size: 11px; }

.float-badge {
  position: absolute; padding: 10px 14px; border-radius: 14px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: floaty 5s ease-in-out infinite;
}
.float-badge.a { top: -18px; right: 8%; background: var(--surface); border: 1px solid var(--line-strong); }
.float-badge.b { top: 44%; left: -26px; background: var(--surface); border: 1px solid var(--line-strong); animation-delay: 1.4s; }
@keyframes floaty { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }

/* Marquee logos / exam strip */
.exam-strip { border-block: 1px solid var(--line); background: var(--bg-1); }
.exam-strip .container { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; justify-content: center; padding-block: 26px; }
.exam-strip span { color: var(--text-3); font-weight: 700; letter-spacing: 0.02em; font-size: 1.1rem; opacity: 0.7; }

/* Section header */
.section-head { text-align: center; max-width: 680px; margin: 0 auto clamp(40px, 6vw, 68px); }
.section-head h2 { font-size: var(--fs-h2); margin-block: 14px; }
.section-head p { color: var(--text-2); }

/* Feature grid */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.feature-card { padding: var(--s-6); border-radius: var(--r-lg); }
.feature-ico {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px;
  background: rgba(109,92,255,0.12); color: var(--brand-300); border: 1px solid rgba(109,92,255,0.2);
}
.feature-ico svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-2); font-size: var(--fs-sm); }
/* Uniform 3×2 feature grid — every card equal, no gaps */
.feature-ico { transition: transform var(--dur-2) var(--ease-spring); }
.feature-card:hover .feature-ico { transform: translateY(-2px) scale(1.05); }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); counter-reset: step; }
.step { position: relative; padding-top: 12px; }
/* Connecting rail between steps — reads as a journey, not three islands */
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 35px; left: 62px; right: -18px; height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}
.step-num {
  width: 46px; height: 46px; border-radius: 14px; background: var(--grad-brand); color: #fff; display: grid; place-items: center;
  font-weight: 700; margin-bottom: 18px; position: relative; z-index: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 8px 22px -8px var(--brand-glow);
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--text-2); font-size: var(--fs-sm); }

/* Stats band */
.stats-band { background: linear-gradient(180deg, var(--surface) 0%, var(--bg-1) 100%); border-block: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5); text-align: center; }
.stat-big { font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-3); font-size: var(--fs-sm); margin-top: 4px; }

/* Testimonials */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.testi { padding: var(--s-5); border-radius: var(--r-lg); display: flex; flex-direction: column; }
.testi p { font-size: var(--fs-sm); color: var(--text); margin-bottom: 18px; line-height: 1.65; flex: 1; }
.testi .testi-user { padding-top: 16px; border-top: 1px solid var(--line); }
.testi-user { display: flex; align-items: center; gap: 12px; }
.testi-user b { font-size: var(--fs-sm); display: block; }
.testi-user small { color: var(--text-3); font-size: var(--fs-xs); }
.stars { color: var(--accent-amber); font-size: 13px; letter-spacing: 2px; margin-bottom: 12px; }

/* Roadmap */
.roadmap { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.road-item { padding: var(--s-5); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.road-item .badge { margin-bottom: 14px; }
.road-item.done { border-color: rgba(61,220,132,0.3); }
.road-item.done .badge { background: rgba(61,220,132,0.14); color: var(--accent-green); border-color: rgba(61,220,132,0.3); }
.road-item.now { border-color: rgba(109,92,255,0.4); box-shadow: var(--shadow-glow); }
.road-item h3 { font-size: 1.05rem; margin-bottom: 8px; }
.road-item p { color: var(--text-2); font-size: var(--fs-sm); }

/* FAQ */
.faq { max-width: 760px; margin-inline: auto; display: grid; gap: 12px; }
.faq-item { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.faq-q { width: 100%; text-align: left; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; background: none; border: none; font-weight: 600; font-size: var(--fs-body); }
.faq-q .chev { transition: transform var(--dur-2) var(--ease-out); color: var(--text-3); flex: none; }
.faq-item[open] .chev { transform: rotate(180deg); }
.faq-a { padding: 0 22px 20px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.65; }

/* CTA band */
.cta-band { position: relative; overflow: hidden; }
.cta-card { text-align: center; padding: clamp(40px, 6vw, 72px); border-radius: var(--r-xl); border: 1px solid var(--line-strong);
  background: radial-gradient(120% 140% at 50% 0%, rgba(109,92,255,0.25), transparent 60%), var(--surface); }
.cta-card h2 { font-size: var(--fs-h2); margin-bottom: 14px; }
.cta-card p { color: var(--text-2); max-width: 52ch; margin: 0 auto 28px; }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--bg-1); padding-block: var(--s-8) var(--s-6); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--s-6); margin-bottom: var(--s-7); }
.footer h4 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 16px; }
.footer-links { display: grid; gap: 10px; }
.footer-links a { color: var(--text-2); font-size: var(--fs-sm); transition: color var(--dur-1); }
.footer-links a:hover { color: var(--text); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: var(--s-5); border-top: 1px solid var(--line); color: var(--text-3); font-size: var(--fs-xs); flex-wrap: wrap; }

/* ============================================================
   ROOMS
   ============================================================ */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.subnav { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 60; }
.subnav .container { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.subnav-title { display: flex; align-items: center; gap: 12px; font-weight: 600; }

.rooms-head { padding-block: var(--s-7) var(--s-5); }
.rooms-head h1 { font-size: var(--fs-h1); margin-bottom: 10px; }
/* Room grid; card visuals live in dashboard.css (see "ROOM PICKER"). */
.rooms-grid { display: grid; gap: var(--s-4); padding-bottom: var(--s-8); }

/* ============================================================
   STUDY SESSION
   ============================================================ */
.session { min-height: 100vh; display: flex; flex-direction: column; background:
  radial-gradient(90% 60% at 100% 0%, rgba(109,92,255,0.08), transparent 55%),
  radial-gradient(70% 50% at 0% 100%, rgba(52,224,196,0.06), transparent 55%), var(--bg); }
.session-bar { height: 60px; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding-inline: var(--s-5); gap: 16px; justify-content: space-between; flex: none; }
.session-room { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.session-body {
  flex: 1; display: grid; grid-template-columns: 1fr 340px; gap: var(--s-4);
  padding: var(--s-4) var(--s-5); align-items: start; min-height: 0;
}
.session-main { display: grid; grid-template-rows: auto auto; gap: var(--s-4); min-width: 0; }

/* Camera stage */
.cam-stage { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: #06060a; aspect-ratio: 16/9; }
.cam-stage video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); background: #06060a; }
.cam-stage canvas.overlay { position: absolute; inset: 0; width: 100%; height: 100%; transform: scaleX(-1); pointer-events: none; }
.cam-placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; }
.cam-placeholder .ph-ico { width: 64px; height: 64px; border-radius: 18px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 16px; border: 1px solid var(--line); }
.cam-hud { position: absolute; inset: 0; pointer-events: none; }
.cam-status {
  position: absolute; top: 14px; left: 14px; pointer-events: auto;
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: var(--fs-sm);
  background: rgba(8,8,12,0.6); backdrop-filter: blur(10px); border: 1px solid var(--line-strong);
  transition: color var(--dur-2), border-color var(--dur-2), transform var(--dur-1);
  cursor: pointer; color: var(--text); font: inherit; font-weight: 600;
}
.cam-status:hover { transform: translateY(-1px); }
.cam-status.focused { color: var(--accent-green); border-color: rgba(61,220,132,0.4); }
.cam-status.distracted { color: var(--accent-amber); border-color: rgba(255,181,71,0.4); }
.cam-status.away { color: var(--accent-rose); border-color: rgba(255,107,139,0.4); }
.cam-timer {
  position: absolute; top: 14px; right: 14px; pointer-events: auto; font-family: var(--font-mono);
  font-size: 1.05rem; font-weight: 600; padding: 8px 14px; border-radius: 12px;
  background: rgba(8,8,12,0.6); backdrop-filter: blur(10px); border: 1px solid var(--line-strong); font-variant-numeric: tabular-nums;
}
.cam-controls { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); pointer-events: auto; display: flex; gap: 10px; }
.cam-detector {
  position: absolute; bottom: 16px; left: 14px; pointer-events: none; display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); padding: 6px 11px; border-radius: 999px;
  background: rgba(8,8,12,0.55); backdrop-filter: blur(10px); border: 1px solid var(--line);
}
.cam-detector .dot { background: var(--text-3); box-shadow: none; }
.cam-detector.pro { color: var(--brand-300); border-color: rgba(109,92,255,0.35); }
.cam-detector.pro .dot { background: var(--brand-400); }

/* Focus meter bar under cam */
.metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.metric .m-label { color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.metric .m-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.metric .m-value small { font-size: 0.9rem; color: var(--text-3); font-weight: 600; }

/* Right rail */
.session-rail { display: grid; gap: var(--s-4); align-content: start; min-height: 0; }
.rail-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); }
.rail-card h3 { font-size: 0.95rem; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

/* Focus ring big */
.focus-ring-wrap { display: flex; align-items: center; gap: 16px; }
.focus-ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--brand-500) calc(var(--p)*1%), var(--surface-3) 0); transition: background var(--dur-3) var(--ease-out); }
.focus-ring > span { width: 72px; height: 72px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; flex-direction: column; text-align: center; }
.focus-ring b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.focus-ring small { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* Goal progress */
.goal-bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.goal-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--grad-brand); width: 0%; transition: width var(--dur-3) var(--ease-out); }

/* Participants list */
.participants { display: grid; gap: 8px; max-height: 260px; overflow-y: auto; margin: -4px; padding: 4px; }
.participant { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 12px; transition: background var(--dur-1); }
.participant:hover { background: var(--surface-2); }
.participant .p-info { flex: 1; min-width: 0; }
.participant .p-info b { font-size: var(--fs-sm); font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant .p-info small { font-size: var(--fs-xs); color: var(--text-3); }
.participant .p-time { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: tabular-nums; }
.p-focus-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ============================================================
   AI TUTOR PANEL
   ============================================================ */
.tutor { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.tutor-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-4); border-bottom: 1px solid var(--line); }
.tutor-head .ai-avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--grad-aurora); display: grid; place-items: center; }
.tutor-search { padding: 10px var(--s-4); border-bottom: 1px solid var(--line); }
.input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px;
  color: var(--text); font-size: var(--fs-sm); transition: border-color var(--dur-2), background var(--dur-2);
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--brand-500); background: var(--surface); }
textarea.input { resize: none; min-height: 46px; max-height: 140px; line-height: 1.5; }
.tutor-thread { flex: 1; overflow-y: auto; padding: var(--s-4); display: flex; flex-direction: column; gap: 16px; min-height: 200px; }
.tutor-empty { margin: auto; text-align: center; color: var(--text-3); padding: 20px; }
.tutor-empty .suggest { display: grid; gap: 8px; margin-top: 18px; }
.chip { padding: 9px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); cursor: pointer; text-align: left; transition: border-color var(--dur-1), background var(--dur-1); color: var(--text-2); }
.chip:hover { border-color: var(--brand-500); color: var(--text); }
.msg { display: flex; gap: 10px; max-width: 100%; }
.msg .bubble { padding: 12px 14px; border-radius: 14px; font-size: var(--fs-sm); line-height: 1.6; overflow-wrap: anywhere; }
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble { background: var(--grad-brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai .bubble { background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; width: 100%; }
.msg .m-ava { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 12px; }
.msg.ai .m-ava { background: var(--grad-aurora); }
.msg.user .m-ava { background: var(--surface-3); }
.tutor-input { padding: var(--s-4); border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-end; }

/* Markdown content */
.md p { margin-bottom: 10px; } .md p:last-child { margin-bottom: 0; }
.md h1,.md h2,.md h3 { margin: 14px 0 8px; line-height: 1.3; }
.md h1 { font-size: 1.15rem; } .md h2 { font-size: 1.05rem; } .md h3 { font-size: 0.95rem; }
.md ul, .md ol { margin: 8px 0 10px 20px; display: grid; gap: 5px; }
.md ul { list-style: disc; } .md ol { list-style: decimal; }
.md code { font-family: var(--font-mono); font-size: 0.85em; background: var(--surface-3); padding: 2px 6px; border-radius: 6px; }
.md pre { background: #0a0a10; border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; margin: 10px 0; position: relative; }
.md pre code { background: none; padding: 0; font-size: 0.82rem; line-height: 1.55; }
.md pre .copy-code { position: absolute; top: 8px; right: 8px; font-size: 11px; padding: 4px 8px; border-radius: 7px; background: var(--surface-3); border: 1px solid var(--line); cursor: pointer; color: var(--text-2); }
.md blockquote { border-left: 3px solid var(--brand-500); padding-left: 12px; color: var(--text-2); margin: 8px 0; }
.md strong { color: var(--text); font-weight: 700; }
.md .katex-inline { font-family: var(--font-mono); color: var(--brand-300); }
.md a { color: var(--brand-300); text-decoration: underline; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: typing 1.2s infinite; }
.typing i:nth-child(2){ animation-delay: .2s } .typing i:nth-child(3){ animation-delay: .4s }
@keyframes typing { 0%,60%,100%{ opacity:.3; transform: translateY(0) } 30%{ opacity:1; transform: translateY(-3px) } }

/* ============================================================
   BREAK
   ============================================================ */
.break-screen { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: var(--s-6);
  background: radial-gradient(80% 60% at 50% 30%, rgba(52,224,196,0.12), transparent 60%), var(--bg); }
.break-inner { max-width: 520px; width: 100%; }
.breath { width: 200px; height: 200px; border-radius: 50%; margin: 0 auto 36px; position: relative; display: grid; place-items: center; }
.breath::before { content:""; position: absolute; inset: 0; border-radius: 50%; background: var(--grad-aurora); opacity: 0.25; filter: blur(20px); animation: breathe 8s var(--ease-in-out) infinite; }
.breath-core { width: 120px; height: 120px; border-radius: 50%; background: var(--grad-brand); display: grid; place-items: center; color: #fff; font-weight: 600; animation: breathe 8s var(--ease-in-out) infinite; box-shadow: 0 0 60px -10px var(--brand-glow); }
@keyframes breathe { 0%,100%{ transform: scale(0.82) } 50%{ transform: scale(1.05) } }
.break-timer { font-size: clamp(3rem, 8vw, 4.5rem); font-weight: 800; font-family: var(--font-mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ============================================================
   SUMMARY
   ============================================================ */
.summary { min-height: 100vh; padding-bottom: var(--s-8); }
.summary-hero { text-align: center; padding-block: var(--s-8) var(--s-6); position: relative; overflow: hidden; }
.summary-hero .confetti { position: absolute; inset: 0; pointer-events: none; }
.summary-hero h1 { font-size: var(--fs-h1); margin-block: 12px; }
.summary-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--s-4); }
.big-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
.stat-card { padding: var(--s-5); border-radius: var(--r-lg); }
.stat-card .sc-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.stat-card .sc-val { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-card .sc-label { color: var(--text-3); font-size: var(--fs-sm); }
.stat-card .sc-sub { font-size: var(--fs-xs); margin-top: 6px; }

/* Weekly chart */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart .bar { width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: var(--grad-brand); min-height: 4px; transition: height var(--dur-4) var(--ease-out); position: relative; }
.chart .bar.today { background: var(--grad-aurora); }
.chart .bar-col small { font-size: var(--fs-xs); color: var(--text-3); }

/* Achievements */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.ach { text-align: center; padding: 16px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); transition: transform var(--dur-2); }
.ach.locked { opacity: 0.4; filter: grayscale(1); }
.ach.unlocked:hover { transform: translateY(-3px); }
.ach .ach-emoji { font-size: 28px; margin-bottom: 8px; }
.ach b { font-size: var(--fs-xs); display: block; } .ach small { font-size: 10px; color: var(--text-3); }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings { max-width: 820px; margin-inline: auto; padding-block: var(--s-7) var(--s-8); }
.settings h1 { font-size: var(--fs-h1); margin-bottom: 8px; }
.set-section { margin-top: var(--s-6); }
.set-section > h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 14px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); margin-bottom: 10px; }
.set-row .sr-text b { display: block; font-size: var(--fs-sm); margin-bottom: 3px; }
.set-row .sr-text small { color: var(--text-3); font-size: var(--fs-xs); }
.set-row .sr-control { flex: none; }

/* Toggle */
.toggle { --w: 46px; --h: 26px; position: relative; width: var(--w); height: var(--h); border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-strong); cursor: pointer; transition: background var(--dur-2); flex: none; }
.toggle::after { content:""; position: absolute; top: 2px; left: 2px; width: calc(var(--h) - 6px); height: calc(var(--h) - 6px); border-radius: 50%; background: #fff; transition: transform var(--dur-2) var(--ease-spring); box-shadow: var(--shadow-sm); }
.toggle[aria-checked="true"] { background: var(--brand-500); border-color: var(--brand-500); }
.toggle[aria-checked="true"]::after { transform: translateX(calc(var(--w) - var(--h) - 0px + 4px)); }

.field { display: grid; gap: 6px; }
.field label { font-size: var(--fs-sm); font-weight: 600; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { padding: 8px 16px; border-radius: 9px; background: none; border: none; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); transition: background var(--dur-1), color var(--dur-1); }
.seg button[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }

/* ============================================================
   TOASTS & MODALS
   ============================================================ */
.toast-host { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; pointer-events: none; max-width: min(92vw, 380px); }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: var(--elevated); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  animation: toast-in var(--dur-3) var(--ease-spring);
}
.toast.out { animation: toast-out var(--dur-2) var(--ease-in-out) forwards; }
.toast .t-ico { width: 22px; height: 22px; flex: none; }
.toast b { font-size: var(--fs-sm); display: block; }
.toast p { font-size: var(--fs-xs); color: var(--text-2); margin-top: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

.modal-overlay { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 20px; background: rgba(4,4,8,0.62); backdrop-filter: blur(6px); animation: fade var(--dur-2); }
.modal { width: 100%; max-width: 480px; background: var(--elevated); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--shadow-lg); animation: modal-in var(--dur-3) var(--ease-spring); }
.modal h2 { font-size: 1.3rem; margin-bottom: 8px; }
.modal p { color: var(--text-2); font-size: var(--fs-sm); margin-bottom: 22px; }
@keyframes fade { from { opacity: 0 } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.97) } }

/* ---------- View transitions ---------- */
.view-enter { animation: view-in var(--dur-3) var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE — real layout changes, not shrinking
   ============================================================ */
@media (max-width: 1080px) {
  .session-body { grid-template-columns: 1fr; }
  .session-rail { grid-template-columns: 1fr 1fr; display: grid; }
  .session-rail .rail-card.tutor-card { grid-column: 1 / -1; }
  .feature-grid, .testi-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-card.span-2 { grid-column: span 2; }
  .roadmap { grid-template-columns: repeat(2, 1fr); }
  .summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.open .nav-links { display: flex; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 16px; gap: 4px; background: var(--elevated); border-bottom: 1px solid var(--line); }
  .nav.open .nav-links a { padding: 12px 14px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; margin-bottom: 12px; }
  .room-preview { transform: none; }
  .float-badge { display: none; }
  .steps { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-6); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-5); }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .container { padding-inline: var(--s-4); }
  .feature-grid, .testi-grid, .roadmap { grid-template-columns: 1fr; }
  .feature-card.span-2 { grid-column: auto; }
  .session-rail { grid-template-columns: 1fr; }
  .hero-cta .btn { flex: 1; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .cam-controls { flex-wrap: wrap; justify-content: center; }
  .set-row { flex-direction: column; align-items: flex-start; }
}

/* Print — PDF report */
@media print {
  body { background: #fff; color: #000; }
  .no-print { display: none !important; }
  .print-report { display: block !important; }
}
.print-report { display: none; }
