/* ==========================================================================
   Engrain design system — tokens, typography, and the refined visual layer.
   Soft serif (Fraunces, SOFT axis) for voice, Geist for interface, Geist Mono for data.
   ========================================================================== */
:root {
  --bg: #f8f6f2;
  --bg-elev: #fbf9f6;
  --surface: #fffefc;
  --surface-2: #f2efe9;
  --surface-3: #e8e3da;
  --ink: #1b1713;
  --ink-2: #5a534b;
  --ink-3: #928a7f;
  --line: #e9e4db;
  --line-strong: #d6cfc3;
  --accent: #ff5a1f;
  --accent-2: #e8470d;
  --accent-ink: #d2420c;
  --accent-soft: #fff0e6;
  --accent-grad: linear-gradient(110deg, #ff4d14 0%, #ff7a2f 45%, #ffae5c 100%);
  --on-accent: #ffffff;
  --m-new: #a39d93;
  --m-blind: #e5484d;
  --m-shaky: #d99a2b;
  --m-fading: #8a86d6;
  --m-learning: #3d8bcc;
  --m-solid: #2f9a6b;
  --ok: #2f9a6b;
  --bad: #e5484d;
  --shadow: 0 1px 0 rgb(27 23 19 / 0.03), 0 10px 30px -14px rgb(60 40 20 / 0.16);
  --shadow-lg: 0 26px 60px -22px rgb(60 40 20 / 0.3), 0 2px 6px rgb(27 23 19 / 0.05);
  --radius: 16px;
  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --grain-opacity: 0.045;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #110f0d; --bg-elev: #15120f; --surface: #1a1714; --surface-2: #221e1a; --surface-3: #2d2823;
    --ink: #f4ede4; --ink-2: #b1a89c; --ink-3: #766d62; --line: #29241f; --line-strong: #3a342d;
    --accent: #ff6326; --accent-2: #ff7d45; --accent-ink: #ff7a3d; --accent-soft: #2c170b;
    --accent-grad: linear-gradient(110deg, #ff5a1f 0%, #ff8a3d 45%, #ffc078 100%);
    --m-new: #5a544c; --m-blind: #ff5d61; --m-shaky: #eab04a; --m-fading: #a29ef0; --m-learning: #5aa7e8; --m-solid: #3ebd86;
    --ok: #3ebd86; --bad: #ff5d61;
    --shadow: 0 1px 0 rgb(255 255 255 / 0.02), 0 12px 30px -14px rgb(0 0 0 / 0.7);
    --shadow-lg: 0 30px 80px -24px rgb(0 0 0 / 0.85), 0 0 0 1px rgb(255 255 255 / 0.04);
    --grain-opacity: 0.06;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #110f0d; --bg-elev: #15120f; --surface: #1a1714; --surface-2: #221e1a; --surface-3: #2d2823;
  --ink: #f4ede4; --ink-2: #b1a89c; --ink-3: #766d62; --line: #29241f; --line-strong: #3a342d;
  --accent: #ff6326; --accent-2: #ff7d45; --accent-ink: #ff7a3d; --accent-soft: #2c170b;
  --accent-grad: linear-gradient(110deg, #ff5a1f 0%, #ff8a3d 45%, #ffc078 100%);
  --m-new: #5a544c; --m-blind: #ff5d61; --m-shaky: #eab04a; --m-fading: #a29ef0; --m-learning: #5aa7e8; --m-solid: #3ebd86;
  --ok: #3ebd86; --bad: #ff5d61;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.02), 0 12px 30px -14px rgb(0 0 0 / 0.7);
  --shadow-lg: 0 30px 80px -24px rgb(0 0 0 / 0.85), 0 0 0 1px rgb(255 255 255 / 0.04);
  --grain-opacity: 0.06;
  color-scheme: dark;
}

/* ---------- base ---------- */
body { font: 400 15px/1.55 var(--font); letter-spacing: -0.005em; font-feature-settings: "ss01", "cv11"; }
body::after { /* fine paper grain over everything — the "grain" in Engrain */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 300; opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] body::after { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::after { mix-blend-mode: screen; } }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
h1, h2, .serif, .brand-word { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 0; font-optical-sizing: auto; }
h1, h2 { font-weight: 420; letter-spacing: -0.015em; }
h1 em, h2 em, blockquote em { font-variation-settings: "SOFT" 100, "WONK" 1; }
h3 { font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: 1.75rem; line-height: 1.1; }
em.serif, .serif { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; }
code, kbd, .mono { font-family: var(--mono); }
.muted { color: var(--ink-2); }
.eyebrow, .side-label {
  font-family: var(--mono); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
}
.eyebrow { color: var(--accent-ink); }
.i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -0.2em; }
.i.sm { width: 15px; height: 15px; }
.i.lg { width: 22px; height: 22px; }
a { text-underline-offset: 3px; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 0; font: inherit; }
.brand-mark { width: 28px; height: 28px; color: inherit; flex: none; }
.brand-word { font-size: 1.55rem; font-weight: 560; line-height: 1; letter-spacing: -0.02em; text-transform: lowercase; padding-bottom: 3px; }
.sidebar .brand { padding: 4px 8px 10px; }

/* ---------- buttons & controls ---------- */
.btn { border-radius: 999px; font-weight: 500; letter-spacing: -0.005em; padding: 9px 18px; transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease), box-shadow 0.25s var(--ease), color 0.2s; }
.btn .i { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-2); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 10px 26px -10px color-mix(in srgb, var(--accent) 90%, transparent); }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ink:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 86%, var(--accent)); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-strong); }
.btn-danger { background: var(--bad); }
.btn-sm { padding: 6px 13px; font-size: 0.84rem; }
.btn-lg { padding: 13px 24px; font-size: 0.98rem; }
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.icon-btn { border-radius: 10px; color: var(--ink-2); }
.icon-btn .i { width: 18px; height: 18px; }
.icon-btn.sm .i { width: 16px; height: 16px; }
.chip { border-radius: 999px; font-size: 0.84rem; border-color: var(--line-strong); background: transparent; }
.chip:hover { border-color: var(--ink-3); background: var(--surface); }
.tag { font-family: var(--mono); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; }
input[type="text"], input:not([type]), input[type="email"], input[type="password"], input[type="number"], input[type="date"], textarea, select {
  border-color: var(--line-strong); background: var(--surface); border-radius: 10px; transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.field { font-weight: 500; font-size: 0.82rem; }
kbd { font-size: 0.68rem; border-radius: 5px; }

/* ---------- shell ---------- */
.sidebar { background: var(--bg-elev); border-right: 1px solid var(--line); padding: 18px 12px 14px; gap: 6px; }
.side-nav { font-weight: 500; color: var(--ink-2); gap: 10px; }
.side-nav.active { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.side-nav-ico { width: auto; display: grid; place-items: center; }
.side-head { margin: 18px 4px 4px 9px; }
.subject-link { border-radius: 10px; }
.subject-link:hover { background: var(--surface-2); }
.subject-link.active { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.subject-link > a { padding: 7px 8px; font-weight: 450; font-size: 0.9rem; }
.pip { font-family: var(--mono); font-size: 0.66rem; }
.pip-blind { background: color-mix(in srgb, var(--m-blind) 16%, transparent); color: var(--m-blind); }
.side-foot { border-top: 1px solid var(--line); padding-top: 10px; }
.avatar-ini { background: var(--ink); color: var(--bg); font-family: var(--display); font-size: 1rem; font-weight: 400; }
.side-tools .status { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-3); }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.dot-warn { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }

.topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); min-height: 62px; }
.topbar-title h1 { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; font-size: 1.6rem; letter-spacing: -0.01em; }
.tab { font-weight: 500; font-size: 0.88rem; color: var(--ink-3); }
.tab.active { border-bottom-color: var(--ink); }
.tab-badge { font-family: var(--mono); font-size: 0.64rem; background: var(--accent); }
.banner { border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 0.84rem; display: flex; gap: 10px; align-items: center; }
.banner::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.banner-bad::before { background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 18%, transparent); }
.exam-chip { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.02em; display: inline-flex; gap: 6px; align-items: center; }
.exam-chip .i { width: 13px; height: 13px; }

/* subject glyphs */
.sbadge { width: 26px; height: 26px; border-radius: 8px; color: var(--sc); background: color-mix(in srgb, var(--sc) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sc) 26%, transparent); font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; font-size: 0.95rem; }
.sbadge .i { width: 15px; height: 15px; }
.sbadge.lg { width: 44px; height: 44px; border-radius: 12px; font-size: 1.45rem; }
.sbadge.lg .i { width: 21px; height: 21px; }

/* cards, panels */
.overall, .next, .graph-wrap, .deck-hero, .question, .flash, .calib, .sum-block, .first-subject, .guide-doc, .doc, .card-row, .quiz-item, .dropzone, .callout {
  border-color: var(--line); box-shadow: var(--shadow);
}
.overall h2, .summary h2, .done-card h2, .empty h2, .map-empty h2, .chat-empty h2 { font-size: 2rem; }
.score-ring b, .deck-stat b, .stat-grid b { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; }
.deck-stat b { font-size: 2.4rem; }
.step-ico, .action-ico { background: var(--surface-2); color: var(--ink); }
.step-ico .i, .action-ico .i { width: 16px; height: 16px; }
.step-fix .step-ico { color: var(--m-blind); background: color-mix(in srgb, var(--m-blind) 12%, transparent); }
.step.first { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.step.first .step-ico { background: var(--accent); color: #fff; }
.diff-ico { font-size: 0; }
.blind-alert strong, .root-alert strong { display: inline-flex; align-items: center; gap: 6px; }
.prose h1 { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; font-size: 2.4rem; }
.prose h2 { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; font-size: 1.6rem; }
.bubble { background: var(--ink); color: var(--bg); }
.opt-key { font-family: var(--mono); font-weight: 500; }
.conf b { font-weight: 500; }
.conf-sure b::before, .conf-think b::before, .conf-guess b::before { content: none; }
.conf { gap: 6px; }
.conf .meter-dots { display: flex; gap: 3px; }
.conf .meter-dots i { width: 14px; height: 4px; border-radius: 2px; background: var(--surface-3); }
.conf .meter-dots i.on { background: var(--accent); }
.modal { border-radius: 20px; border: 1px solid var(--line); }
.modal-body h2 { font-size: 1.9rem; }
.menu { border-radius: 14px; }
.menu button { font-size: 0.88rem; }
.menu button .i { width: 16px; height: 16px; color: var(--ink-3); }
.menu button.danger .i { color: var(--bad); }
.toast { border-radius: 12px; font-size: 0.88rem; background: var(--ink); color: var(--bg); }
.toast-success { background: var(--ink); color: var(--bg); box-shadow: inset 3px 0 0 var(--ok), var(--shadow-lg); }
.toast-error { background: var(--ink); color: var(--bg); box-shadow: inset 3px 0 0 var(--bad), var(--shadow-lg); }
.toast-warn { background: var(--ink); color: var(--bg); box-shadow: inset 3px 0 0 var(--accent), var(--shadow-lg); }
.busy-pill { font-size: 0.85rem; }
.dots i, .typing i { background: var(--accent); }
.icon-opt .i { width: 18px; height: 18px; }
.icon-opt { display: grid; place-items: center; font-family: var(--display); font-size: 1.15rem; font-weight: 400; }
.icon-opt.on { color: var(--accent-ink); }
.file-pick { display: flex; align-items: center; gap: 8px; }

/* ==========================================================================
   Landing
   ========================================================================== */
.lp { position: relative; overflow-x: clip; }
.lp-nav {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 16px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid transparent; transition: border-color 0.3s;
}
.lp-nav.scrolled { border-bottom-color: var(--line); }
.lp-links { display: flex; gap: 26px; margin-left: 12px; }
.lp-links a { color: var(--ink-2); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.lp-links a:hover { color: var(--ink); }
.lp-nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.lp-hero { position: relative; min-height: calc(100dvh - 64px); display: grid; align-items: center; padding: 40px clamp(16px, 5vw, 64px) 72px; isolation: isolate; }
.lp-field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.lp-hero::before { /* soften the field behind the copy */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 70% at 18% 52%, var(--bg) 20%, color-mix(in srgb, var(--bg) 70%, transparent) 55%, transparent 80%);
}
.lp-hero-copy { max-width: 720px; position: relative; pointer-events: none; }
.lp-hero-copy > * { pointer-events: auto; }
.lp-kicker { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); padding: 7px 14px 7px 8px; border: 1px solid var(--line-strong); border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(8px); }
.lp-kicker b { font-weight: 500; color: var(--bg); background: var(--ink); padding: 2px 8px; border-radius: 999px; letter-spacing: 0.08em; }
.lp-hero h1 { font-size: clamp(3rem, 7vw, 6.2rem); line-height: 0.98; letter-spacing: -0.03em; margin: 26px 0 26px; font-weight: 400; }
.lp-hero h1 em { font-style: italic; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.06em; }
.lp-hero .lede { font-size: clamp(1.02rem, 1.5vw, 1.18rem); color: var(--ink-2); max-width: 52ch; margin: 0 0 34px; line-height: 1.6; }
.lp-ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.lp-hint { position: absolute; left: clamp(16px, 5vw, 64px); bottom: 28px; display: flex; gap: 22px; flex-wrap: wrap; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.lp-hint span { display: inline-flex; align-items: center; gap: 8px; }
.lp-hint i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); display: inline-block; }
.lp-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 170px; padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(6px) scale(0.98); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.lp-tip.on { opacity: 1; transform: none; }
.lp-tip strong { display: block; font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; font-size: 1.15rem; line-height: 1.1; }
.lp-tip small { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }
.lp-tip small i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.lp-tip .bar { height: 3px; border-radius: 2px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.lp-tip .bar b { display: block; height: 100%; background: var(--c); }

.lp-section { padding: clamp(72px, 11vw, 140px) clamp(16px, 5vw, 64px); max-width: 1320px; margin: 0 auto; }
.lp-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 48px; }
.lp-head h2 { font-size: clamp(2.3rem, 4.4vw, 3.8rem); line-height: 1.02; letter-spacing: -0.025em; margin: 14px 0 0; font-weight: 400; }
.lp-head h2 em { font-style: italic; color: var(--accent-ink); }
.lp-head > p { color: var(--ink-2); font-size: 1.05rem; max-width: 48ch; margin: 0; justify-self: end; }

.lp-method { display: grid; grid-template-columns: minmax(280px, 0.85fr) 1.4fr; gap: 28px; align-items: stretch; }
.lp-modes { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.lp-mode { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 22px 6px 22px 0; cursor: pointer; color: var(--ink-3); transition: color 0.3s; }
.lp-mode .num { font-family: var(--mono); font-size: 0.72rem; padding-top: 8px; letter-spacing: 0.06em; }
.lp-mode h3 { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; font-size: 1.75rem; line-height: 1.1; margin: 0; color: inherit; transition: color 0.3s; }
.lp-mode p { grid-column: 2; margin: 0; font-size: 0.92rem; color: var(--ink-2); max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.5s var(--ease), opacity 0.4s, margin 0.4s; }
.lp-mode::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0; background: var(--accent); }
.lp-mode:hover { color: var(--ink-2); }
.lp-mode.on { color: var(--ink); }
.lp-mode.on p { max-height: 140px; opacity: 1; margin-top: 8px; }
.lp-mode.on::after { animation: progress var(--cycle, 7s) linear forwards; }
.lp-mode.on.held::after { animation: none; width: 100%; }
@keyframes progress { to { width: 100%; } }
.lp-demo { position: relative; min-height: 520px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(120% 90% at 70% 10%, color-mix(in srgb, var(--accent) 7%, var(--surface)) 0%, var(--surface) 55%); box-shadow: var(--shadow-lg); }
.lp-demo canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.lp-demo-hud { position: absolute; left: 18px; right: 18px; top: 16px; display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); pointer-events: none; }
.lp-demo-hud .live { display: inline-flex; align-items: center; gap: 8px; }
.lp-demo-hud .live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
.lp-demo-caption { position: absolute; left: 18px; bottom: 16px; right: 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; pointer-events: none; }
.lp-demo-caption p { margin: 0; max-width: 44ch; font-size: 0.86rem; color: var(--ink-2); background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(8px); padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); }
.lp-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: flex-end; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.lp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lp-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.lp-feature { position: relative; padding: 34px 30px 38px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; isolation: isolate; }
.lp-feature::before { /* cursor spotlight */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%);
}
.lp-feature:hover::before { opacity: 1; }
.lp-feature .i { width: 22px; height: 22px; color: var(--accent-ink); }
.lp-feature h3 { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; font-size: 1.6rem; margin: 22px 0 8px; }
.lp-feature p { margin: 0; color: var(--ink-2); font-size: 0.94rem; max-width: 36ch; }
.lp-feature .idx { position: absolute; top: 30px; right: 26px; font-family: var(--mono); font-size: 0.68rem; color: var(--ink-3); }

.lp-quote { text-align: center; max-width: 1100px; }
.lp-quote blockquote { margin: 0; font-family: var(--display); font-variation-settings: "SOFT" 100; font-size: clamp(1.9rem, 4vw, 3.4rem); line-height: 1.1; letter-spacing: -0.02em; }
.lp-quote blockquote em { color: var(--ink-3); }
.lp-quote blockquote strong { font-weight: 400; font-style: italic; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 64px; text-align: left; border-top: 1px solid var(--line); }
.lp-steps div { padding: 26px 26px 0 0; }
.lp-steps b { font-family: var(--mono); font-weight: 500; font-size: 0.72rem; color: var(--accent-ink); letter-spacing: 0.08em; }
.lp-steps h3 { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; font-size: 1.45rem; margin: 10px 0 6px; }
.lp-steps p { margin: 0; color: var(--ink-2); font-size: 0.92rem; }

.lp-cta { position: relative; margin: 0 clamp(16px, 5vw, 64px) 40px; border-radius: 28px; overflow: hidden; padding: clamp(56px, 9vw, 110px) clamp(24px, 6vw, 80px); background: #0b0b0a; color: #f1efe9; isolation: isolate; }
.lp-cta canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.9; }
.lp-cta h2 { font-size: clamp(2.4rem, 5.4vw, 4.6rem); line-height: 1; letter-spacing: -0.025em; margin: 0 0 18px; max-width: 14ch; font-weight: 400; }
.lp-cta h2 em { font-style: italic; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-cta p { color: #a8a49b; max-width: 46ch; margin: 0 0 30px; font-size: 1.05rem; }
.lp-cta .btn-ghost { color: #f1efe9; border-color: #3a3833; }
.lp-cta .btn-ghost:hover { background: #1c1b19; }
.lp-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 26px clamp(16px, 5vw, 64px) 40px; color: var(--ink-3); font-size: 0.82rem; }
.lp-foot .brand-word { font-size: 1.25rem; }
.lp-foot .brand-mark { width: 22px; height: 22px; }
.reveal-up { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal-up.in { opacity: 1; transform: none; }

/* ==========================================================================
   Auth
   ========================================================================== */
.auth-split { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: #0b0b0a; color: #f1efe9; padding: 34px clamp(24px, 4vw, 52px); display: flex; flex-direction: column; justify-content: space-between; isolation: isolate; }
.auth-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.auth-art .brand { color: #f1efe9; }
.auth-art blockquote { margin: 0; font-family: var(--display); font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.08; letter-spacing: -0.02em; max-width: 18ch; }
.auth-art blockquote em { color: #ff8a4c; }
.auth-art cite { display: block; margin-top: 14px; font-style: normal; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: #8f8b82; }
.auth-side { display: grid; place-items: center; padding: 40px 20px; position: relative; }
.auth-side .auth-card { box-shadow: none; border: 0; background: transparent; padding: 0; width: min(400px, 100%); gap: 16px; }
.auth-card h1 { font-weight: 420; font-size: 2.3rem; line-height: 1.05; letter-spacing: -0.02em; }
.auth-back { position: absolute; top: 24px; right: 24px; display: flex; gap: 6px; align-items: center; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.dash { max-width: 1180px; padding: 44px clamp(16px, 4vw, 48px) 80px; }
.greet { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: end; padding: 6px 0 36px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.greet h1 { font-weight: 400; font-size: clamp(2.5rem, 5vw, 4.2rem); line-height: 1; letter-spacing: -0.03em; margin: 14px 0 16px; }
.greet h1 em { font-style: italic; color: var(--accent-ink); }
.greet .lede { color: var(--ink-2); font-size: 1rem; }
.daily-quote { margin: 0; padding-left: 20px; border-left: 1px solid var(--line-strong); }
.daily-quote p { margin: 0; font-family: var(--display); font-style: italic; font-size: 1.35rem; line-height: 1.25; color: var(--ink); }
.daily-quote cite { display: block; margin-top: 10px; font-style: normal; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.today { gap: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 40px; }
.today-card { border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; padding: 20px 22px; align-items: flex-start; flex-direction: column; gap: 14px; }
.today-card:last-child { border-right: 0; }
.today-card .t-label { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.today-card .t-label .i { width: 15px; height: 15px; }
.today-card b { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; font-size: 2.6rem; line-height: 0.9; letter-spacing: -0.02em; }
.today-card b small { font-family: var(--font); font-size: 0.95rem; color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
.today-card .t-sub { font-size: 0.8rem; color: var(--ink-3); margin-top: -6px; }
.today-card.alert { background: color-mix(in srgb, var(--m-blind) 5%, transparent); }
.today-card.alert b { color: var(--m-blind); }
.today-card .goal-line { width: 100%; height: 3px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: -4px; }
.today-card .goal-line i { display: block; height: 100%; background: var(--accent); }
.dash-block > h2, .block-head h2 { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; font-size: 2rem; letter-spacing: -0.02em; }
.block-head { margin-bottom: 18px; }
.up-next { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.up-next li { display: grid; grid-template-columns: 40px auto 1fr auto; gap: 16px; align-items: center; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.up-next .n { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); }
.up-next li:first-child .n { color: var(--accent-ink); }
.up-next strong { display: block; font-weight: 500; font-size: 1rem; }
.up-next small { display: block; color: var(--ink-3); font-size: 0.84rem; margin-top: 2px; }
.up-next li:not(:first-child) small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-grid { gap: 16px; }
.subject-card { padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); gap: 10px; transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s; }
.subject-card::before { display: none; }
.subject-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--sc) 40%, var(--line)); }
.subject-card h3 { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; font-size: 1.7rem; line-height: 1.05; letter-spacing: -0.01em; margin: 10px 0 2px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.1em; }
.sc-bar { height: 2px; }
.sc-meta { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; }
.sc-meta b { font-weight: 500; }
.sc-exam { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; }
.sc-exam .i { width: 14px; height: 14px; }
.subject-card.add { border: 1px dashed var(--line-strong); box-shadow: none; background: transparent; min-height: 190px; }
.subject-card.add:hover { transform: none; border-color: var(--accent); color: var(--ink); }
.subject-card.add .i { width: 22px; height: 22px; color: var(--accent-ink); }
.first-subject { border-radius: 22px; padding: 40px; }
.first-subject .start { box-shadow: none; border-color: var(--line-strong); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .lp-method { grid-template-columns: 1fr; }
  .lp-demo { min-height: 440px; }
  .lp-features { grid-template-columns: repeat(2, 1fr); }
  .lp-head { grid-template-columns: 1fr; gap: 16px; }
  .lp-head > p { justify-self: start; }
  .greet { grid-template-columns: 1fr; gap: 20px; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-art { min-height: 260px; }
  .auth-art blockquote { font-size: 1.7rem; }
}
@media (max-width: 860px) {
  .lp-links { display: none; }
  .lp-nav { gap: 12px; padding: 12px 16px; }
  .lp-nav-right .btn-ghost { display: none; }
  .lp-hero { min-height: 88dvh; padding-top: 24px; }
  .lp-hero::before { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 40%, transparent), color-mix(in srgb, var(--bg) 80%, transparent) 60%, var(--bg)); }
  .lp-hint { position: static; margin-top: 36px; gap: 12px 18px; }
  .lp-features { grid-template-columns: 1fr; }
  .lp-steps { grid-template-columns: 1fr; }
  .lp-steps div { padding-right: 0; }
  .lp-foot { flex-direction: column; text-align: center; }
  .up-next li { grid-template-columns: auto 1fr; }
  .up-next .n { display: none; }
  .up-next li .btn { grid-column: 1 / -1; justify-self: start; }
  .today-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .today-card:nth-child(odd) { border-right: 1px solid var(--line); }
  .today-card:nth-last-child(-n + 2) { border-bottom: 0; }
  .today-card b { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal-up { opacity: 1; transform: none; transition: none; }
  .lp-mode.on::after { animation: none; width: 100%; }
}

@media (max-width: 860px) {
  .lp-field { opacity: 0.55; }
}
