/* ==========================================================================
   RamanujaAI Personalized Learning — Concept Demonstration
   Visual identity: manuscript-inspired, restrained, scholarship-forward.
   ========================================================================== */

:root {
  --ink: #201d18;
  --ink-soft: #4a443b;
  --ink-faint: #756d5f;
  --paper: #fbf8f1;
  --paper-2: #f5efe2;
  --parchment: #efe6d2;
  --line: #ddd2ba;
  --line-soft: #e8dfcc;

  --saffron: #b26a1f;
  --saffron-deep: #8f4f12;
  --gold: #a8842e;
  --indigo: #2c3a63;
  --indigo-deep: #1f2a49;
  --maroon: #7c2d34;
  --sage: #4f6b5d;
  --teal: #2f6b6b;

  --ok: #3f6b45;
  --warn: #a8741c;
  --muted: #8a8172;

  --shadow-sm: 0 1px 2px rgba(32, 29, 24, 0.06), 0 2px 8px rgba(32, 29, 24, 0.05);
  --shadow-md: 0 4px 14px rgba(32, 29, 24, 0.09), 0 1px 3px rgba(32, 29, 24, 0.06);
  --shadow-lg: 0 18px 46px rgba(32, 29, 24, 0.16);

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1120px;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", "Segoe UI", Helvetica, Arial, "Helvetica Neue", sans-serif;
  --deva: "Kohinoor Devanagari", "Noto Serif Devanagari", "Nirmala UI", var(--serif);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(168, 132, 46, 0.05), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(44, 58, 99, 0.05), transparent 38%);
  background-attachment: fixed;
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.22;
  color: var(--ink);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.05rem); }
h3 { font-size: 1.22rem; }
h4 { font-size: 1.02rem; }

p { margin: 0 0 1rem; }

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

.deva, [lang="sa"] { font-family: var(--deva); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251, 248, 241, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 18px;
  min-height: 62px; padding: 8px 22px; max-width: 1280px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--serif); font-weight: 600; font-size: 1.12rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark { flex: none; width: 30px; height: 30px; }
.brand small { display: block; font-family: var(--sans); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }

.topnav { display: flex; gap: 6px; margin-left: 12px; }
.topnav button {
  font: inherit; font-size: 0.92rem; background: none; border: 0; color: var(--ink-soft);
  padding: 7px 12px; border-radius: 8px; cursor: pointer;
}
.topnav button:hover { background: var(--paper-2); color: var(--ink); }
.topnav button[aria-current="page"] { color: var(--ink); background: var(--parchment); font-weight: 600; }

.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.demo-pill {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em;
  color: var(--maroon); border: 1px solid rgba(124, 45, 52, 0.4);
  background: rgba(124, 45, 52, 0.06); padding: 3px 9px; border-radius: 999px;
}
.icon-btn {
  font: inherit; font-size: 0.82rem; cursor: pointer;
  background: none; border: 1px solid var(--line); color: var(--ink-soft);
  padding: 6px 11px; border-radius: 8px;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn[aria-pressed="true"] { background: var(--indigo); color: #fff; border-color: var(--indigo); }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 10px; border: 1px solid transparent;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
  text-align: center; line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--indigo); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--indigo-deep); }
.btn-gold { background: var(--saffron); color: #fff; }
.btn-gold:hover { background: var(--saffron-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper-2); border-color: var(--ink-faint); }
.btn-quiet { background: none; border: 0; color: var(--indigo); padding: 6px 4px; }
.btn-quiet:hover { text-decoration: underline; }
.btn-lg { padding: 15px 30px; font-size: 1.04rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------- Glass/panel surfaces ---------- */
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel.pad { padding: 26px 28px; }
.panel-quiet { background: var(--paper-2); box-shadow: none; }

.eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--saffron-deep); margin: 0 0 10px;
}
.lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 62ch; }
.muted { color: var(--ink-faint); }
.small { font-size: 0.86rem; }
.tiny { font-size: 0.76rem; }

/* ---------- Progress indicator ---------- */
.stepbar {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 22px; background: var(--paper-2); border-bottom: 1px solid var(--line);
}
.stepbar .step-label { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }
.stepbar .track { flex: 1; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.stepbar .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--saffron), var(--gold)); transition: width 0.4s ease; }

/* ---------- Screens ---------- */
.screen { display: none; padding: 34px 0 72px; }
.screen.active { display: block; animation: fade 0.35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.screen-head { max-width: 74ch; margin-bottom: 26px; }
.screen-head .kicker { color: var(--saffron-deep); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.74rem; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 62px 0 40px; }
.hero .container { position: relative; z-index: 2; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); margin-bottom: 0.3em; }
.hero .lede { font-size: 1.22rem; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-note { margin-top: 22px; font-size: 0.92rem; color: var(--ink-faint); max-width: 54ch; border-left: 3px solid var(--gold); padding-left: 14px; }

.hero-art { display: flex; justify-content: center; }
.hero-art svg { width: 100%; max-width: 360px; height: auto; }

.rules { display: flex; align-items: center; gap: 12px; color: var(--gold); margin: 0 0 16px; }
.rules::before, .rules::after { content: ""; height: 1px; background: currentColor; opacity: 0.5; flex: 1; }
.rules .diamond { width: 7px; height: 7px; transform: rotate(45deg); background: currentColor; flex: none; }

/* ---------- Card grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.card h3 { margin-bottom: 0.35em; }
.card .num { font-family: var(--serif); font-size: 0.9rem; color: var(--gold); font-weight: 700; letter-spacing: 0.1em; }
.card-accent { border-top: 3px solid var(--saffron); }

.icon-leaf { width: 30px; height: 30px; color: var(--saffron); margin-bottom: 10px; }

/* ---------- Option cards / form ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 26px; }
legend, .q-label { font-family: var(--serif); font-size: 1.28rem; font-weight: 600; margin-bottom: 14px; padding: 0; display: block; }

.option {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; margin-bottom: 11px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.option:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.option input { margin-top: 4px; accent-color: var(--indigo); width: 18px; height: 18px; flex: none; }
.option .o-title { font-weight: 600; }
.option .o-desc { font-size: 0.86rem; color: var(--ink-faint); }
.option.selected { border-color: var(--indigo); background: rgba(44, 58, 99, 0.05); box-shadow: 0 0 0 1px var(--indigo) inset; }
.option:focus-within { outline: 3px solid rgba(168, 132, 46, 0.4); outline-offset: 2px; }

.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.option-grid .option { margin-bottom: 0; }

.text-input, textarea.text-input {
  font: inherit; width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; color: var(--ink); resize: vertical;
}
.text-input:focus { outline: 3px solid rgba(44, 58, 99, 0.25); border-color: var(--indigo); }

/* screen-reader-friendly custom radio row for scale */
.scale { display: flex; gap: 8px; flex-wrap: wrap; }
.scale label {
  flex: 1; min-width: 74px; text-align: center; padding: 12px 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer;
}
.scale label:hover { border-color: var(--gold); }
.scale label.selected { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.scale input { position: absolute; opacity: 0; }
.scale .s-val { display: block; font-family: var(--serif); font-size: 1.4rem; font-weight: 700; }
.scale .s-lab { font-size: 0.7rem; line-height: 1.2; display: block; margin-top: 3px; }

/* ---------- Progress bars / meters ---------- */
.meter { margin-bottom: 15px; }
.meter-top { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 5px; }
.meter-track { height: 11px; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--sage)); border-radius: 999px; transition: width 0.8s ease; }
.meter-fill.gold { background: linear-gradient(90deg, var(--saffron), var(--gold)); }
.meter-fill.indigo { background: linear-gradient(90deg, var(--indigo), var(--teal)); }

.overall { display: flex; align-items: center; gap: 22px; }
.overall .big { font-family: var(--serif); font-size: 3.4rem; line-height: 1; font-weight: 700; color: var(--indigo); }

/* ---------- Stepper flow (study plan) ---------- */
.flow { display: flex; flex-direction: column; align-items: center; gap: 0; }
.flow .node {
  font-family: var(--serif); font-weight: 600; padding: 9px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm);
}
.flow .arrow { color: var(--gold); font-size: 1.1rem; line-height: 1; padding: 6px 0; }

.plan-day { display: grid; grid-template-columns: 92px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.plan-day:last-child { border-bottom: 0; }
.plan-day .daynum { font-family: var(--serif); text-align: center; }
.plan-day .daynum .d { font-size: 1.9rem; font-weight: 700; color: var(--saffron-deep); line-height: 1; }
.plan-day .daynum .l { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-faint); }
.plan-day h4 { margin: 0 0 3px; }
.pill { display: inline-block; font-size: 0.72rem; padding: 2px 10px; border-radius: 999px; background: var(--parchment); color: var(--ink-soft); border: 1px solid var(--line); margin: 4px 5px 0 0; }

/* ---------- Lesson tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 22px 0 24px; flex-wrap: wrap; }
.tab {
  font: inherit; cursor: pointer; background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 11px 18px; color: var(--ink-soft); font-weight: 600; letter-spacing: 0.04em;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--saffron-deep); border-bottom-color: var(--saffron); }
.tabpanel { display: none; }
.tabpanel.active { display: block; animation: fade 0.3s ease; }

.objectives { list-style: none; padding: 0; margin: 0; }
.objectives li { padding-left: 30px; position: relative; margin-bottom: 8px; }
.objectives li::before { content: "✓"; position: absolute; left: 0; color: var(--sage); font-weight: 700; }

.read-body { max-width: 68ch; font-size: 1.06rem; }
.read-body .list-block { background: var(--paper-2); border-left: 3px solid var(--saffron); padding: 14px 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 18px 0; }
.read-body .list-block ul { margin: 0; padding-left: 20px; }

/* Source card */
.source-card { border: 1px solid var(--gold); background: linear-gradient(180deg, rgba(168,132,46,0.07), rgba(168,132,46,0.02)); border-radius: var(--radius); padding: 20px 22px; margin-top: 26px; }
.source-card .tag { display: inline-block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; color: var(--maroon); border: 1px solid rgba(124,45,52,0.4); background: rgba(124,45,52,0.06); padding: 3px 9px; border-radius: 999px; margin-bottom: 12px; }
.source-card dl { margin: 0; display: grid; grid-template-columns: 120px 1fr; gap: 6px 16px; }
.source-card dt { font-weight: 700; color: var(--ink-soft); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.source-card dd { margin: 0; }

/* Media cards */
.media-card { display: grid; grid-template-columns: 190px 1fr; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.media-thumb { position: relative; background: var(--indigo); min-height: 150px; display: flex; align-items: center; justify-content: center; color: #fff; }
.media-thumb.audio { background: linear-gradient(135deg, var(--teal), var(--sage)); }
.media-thumb .play { width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--indigo); display: flex; align-items: center; justify-content: center; border: 0; cursor: pointer; box-shadow: var(--shadow-md); }
.media-thumb .play:hover { transform: scale(1.05); }
.media-thumb .play svg { width: 22px; height: 22px; margin-left: 3px; }
.media-body { padding: 20px 24px; }
.media-body .kicker { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--saffron-deep); font-weight: 700; }
.media-meta { display: flex; gap: 16px; font-size: 0.84rem; color: var(--ink-faint); margin: 8px 0 0; }

/* Simulated player */
.player { display: none; margin-top: 16px; }
.player.active { display: block; }
.player-stage { background: var(--indigo-deep); border-radius: var(--radius); padding: 20px; color: #f4f0e6; }
.player-stage .stage-title { font-family: var(--serif); font-size: 1.1rem; margin-bottom: 14px; }
.player-stage .diagram { display: flex; justify-content: center; padding: 6px 0 14px; }
.player-stage .diagram svg { width: 100%; max-width: 420px; height: auto; }
.player .narration { min-height: 3.2em; font-size: 1.02rem; color: #efe9db; }
.player .bar { margin-top: 16px; height: 6px; background: rgba(255,255,255,0.18); border-radius: 999px; overflow: hidden; }
.player .bar .fill { height: 100%; width: 0; background: var(--gold); transition: width 0.4s linear; }
.player .controls { display: flex; align-items: center; gap: 14px; margin-top: 13px; }
.player .controls .pbtn { background: rgba(255,255,255,0.14); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; font: inherit; }
.player .controls .pbtn:hover { background: rgba(255,255,255,0.24); }
.player .time { font-variant-numeric: tabular-nums; font-size: 0.86rem; color: #cfc6b3; }
.audio-wave { display: flex; gap: 4px; align-items: flex-end; height: 46px; justify-content: center; }
.audio-wave span { width: 5px; background: var(--gold); border-radius: 3px; animation: wave 1.1s ease-in-out infinite; }
@keyframes wave { 0%,100% { height: 8px; } 50% { height: 40px; } }
.audio-wave.paused span { animation-play-state: paused; }

/* ---------- Concept map ---------- */
.map-wrap { display: grid; grid-template-columns: 1fr 330px; gap: 24px; align-items: start; }
.map-canvas { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 30px 18px; min-height: 380px; overflow-x: auto; }
.map-row { display: flex; justify-content: center; gap: 40px; position: relative; }
.map-col { display: flex; flex-direction: column; align-items: center; }
.map-node {
  font: inherit; cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 1rem;
  padding: 11px 20px; border-radius: 12px; border: 2px solid var(--line);
  background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); transition: all 0.15s;
  min-width: 96px; text-align: center;
}
.map-node:hover, .map-node:focus-visible { border-color: var(--gold); transform: translateY(-2px); }
.map-node.active { border-color: var(--indigo); box-shadow: 0 0 0 4px rgba(44,58,99,0.14); }
.map-node.root { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.map-node.leaf { background: var(--parchment); }
.map-node.root.active { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(168,132,46,0.3); }
.map-connector { width: 2px; background: var(--line); margin: 0 auto; height: 26px; position: relative; }
.map-connector.branch { height: 22px; }
.map-fork { width: 62%; height: 22px; border-top: 2px solid var(--line); border-left: 2px solid var(--line); border-right: 2px solid var(--line); border-radius: 8px 8px 0 0; margin: 0 auto; }
.map-label { text-align: center; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin: 8px 0; }
.map-side { position: sticky; top: 82px; }
.concept-panel h3 { margin-bottom: 2px; }
.concept-panel .sa { font-family: var(--deva); color: var(--gold); font-size: 1.1rem; }
.concept-panel dl { margin: 14px 0; }
.concept-panel dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); font-weight: 700; margin-top: 10px; }
.concept-panel dd { margin: 2px 0 0; }
.chip { display: inline-block; font-size: 0.78rem; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper-2); margin: 3px 4px 0 0; cursor: pointer; }
.chip:hover { border-color: var(--indigo); }
.chip.plain { cursor: default; }

/* ---------- Tutor chat ---------- */
.chat { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.chat-head { padding: 15px 20px; border-bottom: 1px solid var(--line); background: var(--paper-2); display: flex; align-items: center; gap: 11px; }
.chat-head .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--indigo); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 700; }
.chat-log { padding: 20px; max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 82%; padding: 12px 16px; border-radius: 14px; font-size: 0.98rem; }
.msg.user { align-self: flex-end; background: var(--indigo); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--paper-2); border: 1px solid var(--line-soft); border-bottom-left-radius: 4px; }
.msg .grounded { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 0.84rem; }
.msg .grounded .g-label { font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; }
.msg .typing span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; background: var(--ink-faint); border-radius: 50%; animation: blink 1.2s infinite; }
.msg .typing span:nth-child(2) { animation-delay: 0.2s; }
.msg .typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
.chat-starters { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 14px; }
.starter-chip { font: inherit; font-size: 0.85rem; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--indigo); padding: 7px 13px; border-radius: 999px; }
.starter-chip:hover { background: var(--paper-2); border-color: var(--indigo); }
.chat-input { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--paper-2); }
.chat-input input { flex: 1; }
.chat-disclaimer { font-size: 0.78rem; color: var(--ink-faint); padding: 10px 20px; background: var(--parchment); border-top: 1px solid var(--line); }

/* ---------- Assessment ---------- */
.assess-q { margin-bottom: 26px; }
.assess-q .q-cat { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--saffron-deep); font-weight: 700; }
.feedback-box { border-radius: var(--radius-sm); padding: 14px 18px; margin-top: 12px; font-size: 0.94rem; }
.feedback-box.correct { background: rgba(63,107,69,0.09); border: 1px solid rgba(63,107,69,0.35); }
.feedback-box.incorrect { background: rgba(168,116,28,0.1); border: 1px solid rgba(168,116,28,0.4); }
.feedback-box .fb-title { font-weight: 700; }

.result-badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 0.86rem; padding: 6px 13px; border-radius: 999px; background: rgba(79,107,93,0.1); border: 1px solid rgba(79,107,93,0.35); color: var(--sage); font-weight: 600; }

/* ---------- Dashboard status list ---------- */
.status-list { list-style: none; padding: 0; margin: 0; }
.status-list li { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.status-list li:last-child { border-bottom: 0; }
.status-glyph { font-size: 1rem; width: 22px; text-align: center; flex: none; }
.status-glyph.mastered { color: var(--ok); }
.status-glyph.learning { color: var(--warn); }
.status-glyph.review { color: var(--muted); }
.status-name { flex: 1; }
.status-tag { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.status-tag.mastered { color: var(--ok); background: rgba(63,107,69,0.1); }
.status-tag.learning { color: var(--warn); background: rgba(168,116,28,0.12); }
.status-tag.review { color: var(--muted); background: rgba(138,129,114,0.12); }

/* ---------- Certificate ---------- */
.cert {
  position: relative; background: linear-gradient(160deg, #fffdf7, #f7efdd);
  border: 1px solid var(--gold); border-radius: 8px; padding: 52px 56px; text-align: center;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.cert::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(168,132,46,0.55); border-radius: 4px; pointer-events: none; }
.cert::after { content: ""; position: absolute; inset: 18px; border: 1px solid rgba(168,132,46,0.28); border-radius: 3px; pointer-events: none; }
.cert .cert-brand { font-family: var(--serif); font-size: 1.1rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--indigo); }
.cert .cert-sub { font-family: var(--serif); font-size: 1.35rem; margin: 10px 0 4px; color: var(--ink); }
.cert h2 { font-size: 1.9rem; letter-spacing: 0.04em; margin: 18px 0 6px; }
.cert .cert-type { font-size: 0.82rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--saffron-deep); }
.cert .cert-rule { width: 120px; height: 1px; background: var(--gold); margin: 22px auto; }
.cert .seal { width: 92px; height: 92px; margin: 16px auto; }
.cert .cert-meta { display: flex; justify-content: center; gap: 40px; margin-top: 22px; flex-wrap: wrap; }
.cert .cert-meta .m-label { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.cert .cert-meta .m-val { font-family: var(--serif); font-size: 1.05rem; }
.demo-watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-24deg); font-size: 5rem; font-weight: 800; color: rgba(124,45,52,0.06); letter-spacing: 0.2em; pointer-events: none; white-space: nowrap; }

/* ---------- Sponsor mode ---------- */
.sponsor-hero { background: var(--indigo-deep); color: #f2eee4; border-radius: var(--radius); padding: 44px 46px; }
.sponsor-hero h1 { color: #fff; }
.sponsor-hero .lede { color: #d9d2c2; }
.sponsor-hero .axes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.sponsor-hero .axis { border: 1px solid rgba(255,255,255,0.25); border-radius: 8px; padding: 9px 15px; font-family: var(--serif); }
.sponsor-hero .axis .plus { color: var(--gold); margin-left: 6px; }
.problem-list li { margin-bottom: 8px; }
.problem-list li::marker { color: var(--maroon); }
.stat { text-align: center; padding: 16px 10px; }
.stat .s-num { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--saffron-deep); }
.stat .s-lab { font-size: 0.82rem; color: var(--ink-faint); }

.arch { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 16px; overflow-x: auto; }
.arch svg { display: block; margin: 0 auto; min-width: 560px; }

.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; }
.compare .arrow-big { font-size: 2rem; color: var(--gold); text-align: center; }

/* ---------- Feedback ---------- */
.feedback-form .question-block { margin-bottom: 28px; }
.feedback-form .question-block > .q-label { font-size: 1.1rem; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-row label { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: 0.9rem; }
.checkbox-row label:hover { border-color: var(--gold); }
.checkbox-row input { accent-color: var(--indigo); }
.checkbox-row label.selected { border-color: var(--indigo); background: rgba(44,58,99,0.05); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(24,21,17,0.55); backdrop-filter: blur(3px); z-index: 120; display: none; align-items: center; justify-content: center; padding: 22px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-width: 620px; width: 100%; max-height: 88vh; overflow: auto; border: 1px solid var(--line); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 24px; }
.close-x { font: inherit; font-size: 1.4rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--ink-faint); padding: 4px 8px; border-radius: 6px; }
.close-x:hover { background: var(--paper-2); color: var(--ink); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: 200; font-size: 0.92rem; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 32px 0 44px; margin-top: 30px; color: var(--ink-faint); font-size: 0.86rem; }
.footer .container { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; gap: 16px; }

/* ---------- Presentation mode ---------- */
body.presenting { font-size: 20px; }
body.presenting .topnav { display: none; }
body.presenting .hero { padding: 80px 0 56px; }
body.presenting .panel.pad, body.presenting .card { padding: 34px 38px; }
body.presenting .screen { padding: 52px 0 100px; }
body.presenting .card h3, body.presenting h3 { font-size: 1.5rem; }
body.presenting .option { padding: 20px 24px; font-size: 1.05rem; }
body.presenting .btn { font-size: 1.05rem; padding: 15px 28px; }
body.presenting .map-node { font-size: 1.2rem; padding: 15px 26px; }
body.presenting .big { font-size: 4.4rem; }
body.presenting .container { max-width: 1240px; }

/* ---------- Print (certificate) ---------- */
@media print {
  .topbar, .stepbar, .footer, .no-print { display: none !important; }
  body { background: #fff; }
  .cert { box-shadow: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 300px; margin: 0 auto; }
  .map-wrap { grid-template-columns: 1fr; }
  .map-side { position: static; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .media-card { grid-template-columns: 1fr; }
  .media-thumb { min-height: 120px; }
  .cert { padding: 34px 22px; }
  .demo-watermark { font-size: 3rem; }
  .compare { grid-template-columns: 1fr; }
  .compare .arrow-big { transform: rotate(90deg); }
  .panel.pad { padding: 20px; }
  .source-card dl { grid-template-columns: 1fr; }
  .source-card dt { margin-top: 8px; }
  .hero { padding: 40px 0 24px; }
  .map-row { gap: 18px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

/* Focus visibility */
:focus-visible { outline: 3px solid rgba(168,132,46,0.55); outline-offset: 2px; border-radius: 6px; }
