:root {
  --accent: oklch(46% 0.2 320);
  --accent-2: oklch(62% 0.12 60);
  --accent-light: oklch(94% 0.05 320);
  --bg: #f8f6fb;
  --bg-alt: #efe8f5;
  --bg-card: #ffffff;
  --text: #1c1428;
  --text-mid: #614870;
  --text-faint: #a080b0;
  --border: rgba(28, 20, 40, 0.09);
  --border-strong: rgba(28, 20, 40, 0.18);
  --shadow: 0 2px 12px rgba(28, 20, 40, 0.07);
  --shadow-lg: 0 8px 40px rgba(28, 20, 40, 0.12);
  
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

[data-theme="dark"] {
  --bg: #100c18;
  --bg-alt: #18102a;
  --bg-card: #201535;
  --text: #ede8f5;
  --text-mid: #9478b0;
  --text-faint: #584568;
  --border: rgba(237, 232, 245, 0.08);
  --border-strong: rgba(237, 232, 245, 0.16);
  --accent-light: oklch(18% 0.09 320);
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.45);
}

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

html { font-size: 16px; }

body { 
    background: var(--bg); 
    color: var(--text); 
    transition: background 0.35s, color 0.35s; 
    overflow-x: hidden;
    font-family: var(--font-sans);
    line-height: 1.8;
}

/* ── Layout ── */
.container { max-width: 860px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── Typography ── */
.display { font-family: var(--font-serif); }
.mono { font-family: var(--font-mono); }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-serif); font-weight: 600; }

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px); padding: 0 24px;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer; color: var(--text);
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  text-decoration: none;
  font-family: var(--font-serif);
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 6px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
  color: var(--text-mid); background: none; border: none; cursor: pointer;
  transition: background 0.15s, color 0.15s; font-family: inherit;
  text-decoration: none;
}
.nav-link:hover { background: var(--bg-alt); color: var(--text); }
.nav-link.active { color: var(--accent); background: var(--accent-light); }
.sep { width: 1px; height: 18px; background: var(--border); margin: 0 6px; flex-shrink: 0; }

.dark-toggle {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  border-radius: 8px; border: 1px solid var(--border); background: none;
  color: var(--text-mid); cursor: pointer; font-size: 12px; font-weight: 500;
  transition: background 0.15s, color 0.15s; font-family: inherit; white-space: nowrap;
}
.dark-toggle:hover { background: var(--bg-alt); color: var(--text); }

/* ── Animations ── */
.page { animation: fadeUp 0.25s ease both; min-height: 70vh; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 10px; font-size: 15px; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.15s; font-family: inherit; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: var(--bg-alt); transform: translateY(-1px); }
.btn-sm { padding: 9px 18px; font-size: 14px; border-radius: 8px; }

/* ── Flashes ── */
.flash {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-strong);
    background: var(--bg-card);
    font-size: 14px;
}
.flash-error { color: #c53030; border-color: #feb2b2; background: #fff5f5; }
.flash-success { color: #2f855a; border-color: #9ae6b4; background: #f0fff4; }

/* ── Hero ── */
.hero { padding: 80px 0 56px; }
.hero-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(42px, 7vw, 72px); font-weight: 600;
  line-height: 1.08; letter-spacing: -0.02em; color: var(--text); margin-bottom: 28px;
}
.hero-title em { font-style: italic; color: var(--accent); }
.hero-body { font-size: 18px; line-height: 1.7; color: var(--text-mid); max-width: 540px; margin-bottom: 40px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-stat {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-faint);
  padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-card);
  margin-bottom: 60px;
}
.hero-stat-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ── Cards ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-bottom: 80px; }
.card {
  background: var(--bg-card); border-radius: 16px; padding: 28px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.15s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--accent-light); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--accent); }
.card-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.card-body { font-size: 14px; line-height: 1.6; color: var(--text-mid); margin-bottom: 20px; }
.card-link { font-size: 13.5px; font-weight: 600; color: var(--accent); background: none; border: none; cursor: pointer; padding: 0; font-family: inherit; transition: letter-spacing 0.15s; text-decoration: none; }
.card-link:hover { letter-spacing: 0.01em; }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 48px 0; }
.inline-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ── Survey ── */
.survey-wrap { padding: 60px 0 80px; }
.progress-bar-wrap { height: 3px; background: var(--bg-alt); border-radius: 2px; margin-bottom: 56px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s ease; }
.survey-q-num { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.survey-question { font-size: clamp(20px, 3.5vw, 32px); font-weight: 400; line-height: 1.35; color: var(--text); margin-bottom: 16px; max-width: 640px; }
.survey-question strong { font-weight: 700; color: var(--accent); font-style: italic; background: var(--accent-light); padding: 1px 8px 2px; border-radius: 5px; display: inline-block; }
.prompt-blank { color: var(--text-faint); letter-spacing: -0.05em; user-select: none; }
.survey-hint { font-size: 15px; color: var(--text-faint); margin-bottom: 48px; }

.slider-wrap { max-width: 580px; margin-bottom: 24px; }
.slider-track-labels { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--text-faint); margin-bottom: 16px; font-variant-numeric: tabular-nums; }
.slider-container { position: relative; height: 44px; display: flex; align-items: center; }
.slider-track { position: absolute; left: 0; right: 0; height: 4px; background: var(--bg-alt); border-radius: 2px; }
.slider-fill { position: absolute; left: 0; height: 4px; background: var(--accent); border-radius: 2px; }
.slider-input { position: absolute; left: 0; right: 0; width: 100%; opacity: 0; height: 44px; cursor: pointer; z-index: 2; margin: 0; -webkit-appearance: none; }
.slider-thumb { position: absolute; width: 24px; height: 24px; background: var(--bg-card); border: 2.5px solid var(--accent); border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,0.15); transform: translateX(-12px); pointer-events: none; top: 50%; margin-top: -12px; transition: box-shadow 0.15s; }
.slider-badge {
  position: absolute; top: -42px; background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 6px;
  transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  opacity: 0; transition: opacity 0.2s;
}
.slider-badge.show { opacity: 1; }
.slider-badge::after { content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); border: 4px solid transparent; border-top-color: var(--accent); border-bottom: none; }
.survey-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 44px; }
.survey-note { font-size: 13px; color: var(--text-faint); padding: 10px 14px; border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border); display: inline-flex; gap: 8px; align-items: center; margin-top: 16px; }
.unit-select { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-family: inherit; font-size: 13px; padding: 2px 4px; outline: none; cursor: pointer; }
.unit-select:focus { border-color: var(--accent); }

/* ── Results ── */
.results-wrap { padding: 60px 0 80px; }
.results-layout { display: grid; grid-template-columns: 210px 1fr; gap: 48px; }
@media (max-width: 720px) { .results-layout { grid-template-columns: 1fr; } }
.results-sidebar { position: sticky; top: 76px; align-self: start; }
.sidebar-word { display: block; padding: 8px 14px; border-radius: 8px; font-size: 14px; color: var(--text-mid); background: none; border: none; cursor: pointer; text-align: left; width: 100%; transition: background 0.12s, color 0.12s; font-family: inherit; text-decoration: none; }
.sidebar-word:hover { background: var(--bg-alt); color: var(--text); }
.sidebar-word.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.result-item { margin-bottom: 36px; }
.result-word-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.result-phrase { font-size: 17px; font-weight: 600; color: var(--text); }
.result-meta { font-size: 13px; color: var(--text-faint); }
.result-bar-wrap { position: relative; height: 30px; background: var(--bg-alt); border-radius: 6px; margin-bottom: 6px; overflow: hidden; }
.result-bar-fill { position: absolute; top: 0; left: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, var(--accent-light), color-mix(in oklch, var(--accent) 40%, var(--accent-light))); transition: width 0.9s cubic-bezier(0.34, 1.2, 0.64, 1); }
.result-marker { position: absolute; top: 50%; transform: translateY(-50%) translateX(-50%); width: 14px; height: 14px; border-radius: 50%; z-index: 2; box-shadow: 0 0 0 2.5px var(--bg-card); }
.result-marker-you { background: var(--accent); }
.result-marker-avg { background: var(--accent-2); }
.result-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); margin-top: 4px; font-variant-numeric: tabular-nums; }
.result-legend { display: flex; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-mid); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Prose (privacy, etc.) ── */
.prose h2 { font-size: 20px; margin: 32px 0 12px; }
.prose p { margin-bottom: 14px; color: var(--text-mid); }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 14.5px; }
.prose th, .prose td { border: 1px solid var(--border-strong); padding: 10px 12px; text-align: left; vertical-align: top; color: var(--text-mid); }
.prose th { background: var(--bg-alt); font-weight: 600; color: var(--text); }
.prose ul { margin: 0 0 18px 32px; }
.prose li { margin-bottom: 6px; color: var(--text-mid); }

/* ── About ── */
.about-wrap { padding: 60px 0 80px; }
.about-title { font-size: 36px; font-weight: 600; color: var(--text); margin-bottom: 40px; }
.about-section { margin-bottom: 52px; }
.about-section-title { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 18px; }
.about-body { font-size: 16px; line-height: 1.85; color: var(--text-mid); }
.about-body p { margin-bottom: 18px; }
.about-cite { padding: 22px 26px; border-left: 3px solid var(--accent); background: var(--bg-card); border-radius: 0 10px 10px 0; margin: 28px 0; font-style: italic; font-size: 18px; color: var(--text); line-height: 1.65; }
.about-cite cite { display: block; font-style: normal; font-size: 13px; color: var(--text-faint); margin-top: 10px; }
.about-list { margin-left: 20px; margin-bottom: 18px; color: var(--text-mid); }
.about-list li { margin-bottom: 8px; }

/* ── Session ── */
.session-wrap { padding: 40px 0 80px; }
.session-title { font-size: 32px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.session-sub { font-size: 16px; color: var(--text-mid); margin-bottom: 32px; max-width: 600px; }

.use-cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 48px; }
.use-case-card { background: var(--bg-alt); padding: 20px; border-radius: 12px; border: 1px solid var(--border); }
.use-case-label { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.use-case-desc { font-size: 13px; color: var(--text-mid); line-height: 1.5; }

.stacked-form { max-width: 480px; }

/* ── Footer ── */
.footer { border-top: 1px solid var(--border); padding: 32px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--text-faint); margin-top: 80px; }
.footer-links { display: flex; gap: 20px; }
.footer-link { color: var(--text-faint); background: none; border: none; cursor: pointer; font-size: 13px; font-family: inherit; transition: color 0.12s; text-decoration: none; }
.footer-link:hover { color: var(--text); }

/* ── Form Elements ── */
.form-field { margin-bottom: 24px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; display: block; }
.form-input { width: 100%; padding: 13px 16px; font-size: 15px; font-family: inherit; background: var(--bg-card); border: 1.5px solid var(--border-strong); border-radius: 10px; color: var(--text); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.form-hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }

@media (max-width: 640px) {
  .hero { padding: 40px 0; }
  .hero-title { font-size: 42px; }
  .cards-grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; text-align: center; }
}
