/* SimuVeda 2.0 — main site styles. Tokens follow SIMUVEDA_FRONTEND_DESIGN.md §3. */
:root {
  --bg: #050B18; --bg-2: #081428; --surface: #0D1B30; --surface-raised: #11233D;
  --text: #F5F9FF; --muted: #A9BDD5; --cyan: #22D3EE; --blue: #3B82F6; --border: #233954;
  --focus: #67E8F9; --live: #34D399; --soon: #FBBF24;
  --radius: 14px; --radius-sm: 10px; --max: 1280px; --gutter: 24px;
  --t: 200ms; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1rem/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--cyan); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--cyan); color: #04121c; padding: 10px 16px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.panel { background: linear-gradient(180deg, var(--surface-raised), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); }
.ic { flex: none; }

/* buttons */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; font-weight: 650; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background var(--t), box-shadow var(--t), transform var(--t), border-color var(--t); }
.btn-primary { background: linear-gradient(135deg, var(--cyan), #38BDF8); color: #03131d; }
.btn-primary:hover { box-shadow: 0 0 0 4px rgba(34, 211, 238, .18), 0 8px 24px rgba(34, 211, 238, .25); }
.btn-ghost { background: transparent; color: var(--text); border-color: #3A5577; }
.btn-ghost:hover { border-color: var(--cyan); background: rgba(34, 211, 238, .06); }
.btn-lg { min-height: 52px; padding: 12px 24px; font-size: 1.02rem; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(5, 11, 24, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(35, 57, 84, .7); }
.hdr { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.45rem; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.brand-ic { color: var(--cyan); }
.brand-v { color: var(--cyan); }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.nav-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 8px 14px; white-space: nowrap; border-radius: 999px; color: #D8E4F2; text-decoration: none; font-weight: 550; background: none; border: 0; cursor: pointer; transition: background var(--t), color var(--t); }
.nav-link:hover { color: var(--text); background: rgba(59, 130, 246, .12); }
.nav-link.is-active { background: rgba(59, 130, 246, .22); color: var(--text); }
.mm-trigger[aria-expanded="true"] { background: rgba(59, 130, 246, .22); }
.mm-trigger[aria-expanded="true"] .ic { transform: rotate(180deg); }
.mm-trigger .ic { transition: transform var(--t); }
.hdr-search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 14px; min-height: 44px; width: min(300px, 26vw); color: var(--muted); }
.hdr-search:focus-within { border-color: var(--cyan); }
.hdr-search input, .mn-search input { background: none; border: 0; outline: none; width: 100%; min-height: 42px; color: var(--text); }
.hdr-search input::placeholder, .mn-search input::placeholder, .f-q input::placeholder { color: #8DA3BE; }
.mn-toggle { display: none; margin-left: auto; width: 48px; height: 48px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; align-items: center; justify-content: center; }

/* mega menu */
.mm { position: relative; }
.mm-menu { position: absolute; top: calc(100% + 10px); left: -20px; width: min(860px, calc(100vw - 48px)); display: grid; grid-template-columns: 250px 1fr; background: #0B172B; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.mm-menu[hidden] { display: none; }
.mm-subjects { list-style: none; margin: 0; padding: 10px; border-right: 1px solid var(--border); }
.mm-subject { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; color: #E1EAF5; text-align: left; cursor: pointer; font-weight: 550; transition: background var(--t); }
.mm-subject:hover, .mm-subject[aria-selected="true"] { background: rgba(59, 130, 246, .18); }
.mm-subject[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--accent); }
.mm-ico { color: var(--accent); display: inline-flex; }
.mm-chev { margin-left: auto; color: var(--muted); }
.mm-panel { display: grid; grid-template-columns: 1fr 220px; gap: 0; }
.mm-panel[hidden] { display: none; }
.mm-topics { padding: 12px; }
.mm-topics ul { list-style: none; margin: 0; padding: 0; }
.mm-topics a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; transition: background var(--t); }
.mm-topics a:hover { background: rgba(59, 130, 246, .14); }
.mm-t { display: block; font-weight: 600; }
.mm-h { display: block; font-size: .86rem; color: var(--muted); }
.mm-all { display: flex !important; align-items: center; gap: 6px; color: var(--cyan) !important; font-weight: 650; }
.mm-feature { margin: 12px; padding: 14px; border-radius: 12px; background: var(--surface-raised); border: 1px solid var(--border); text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 6px; transition: border-color var(--t); }
a.mm-feature:hover { border-color: var(--cyan); }
.mm-feature-k { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.mm-feature-t { font-weight: 700; }
.mm-feature-d { font-size: .88rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mm-feature-go { display: inline-flex; align-items: center; gap: 6px; color: var(--cyan); font-weight: 650; font-size: .9rem; margin-top: auto; }

/* mobile nav */
.mobile-nav { border-top: 1px solid var(--border); background: var(--bg-2); padding: 12px var(--gutter) 24px; max-height: calc(100vh - 72px); overflow-y: auto; }
.mobile-nav[hidden] { display: none; }
.mn-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; margin-bottom: 8px; color: var(--muted); }
.mn-link { display: flex; align-items: center; min-height: 48px; padding: 0 8px; color: var(--text); text-decoration: none; font-weight: 600; border-bottom: 1px solid rgba(35, 57, 84, .6); }
.mn-label { margin: 16px 8px 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.mn-acc { border-bottom: 1px solid rgba(35, 57, 84, .6); }
.mn-acc summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 8px; cursor: pointer; font-weight: 600; }
.mn-acc summary::-webkit-details-marker { display: none; }
.mn-acc[open] .mn-chev { transform: rotate(180deg); }
.mn-chev { margin-left: auto; transition: transform var(--t); }
.mn-acc ul { list-style: none; margin: 0 0 8px; padding: 0 0 0 38px; }
.mn-acc a { display: flex; align-items: center; min-height: 44px; color: #D6E2F0; text-decoration: none; }

/* hero */
.hero { position: relative; padding: 56px 0 64px; background: radial-gradient(900px 500px at 85% 20%, rgba(59, 130, 246, .18), transparent 60%), radial-gradient(700px 400px at 10% 90%, rgba(34, 211, 238, .08), transparent 60%); border-bottom: 1px solid rgba(35, 57, 84, .6); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .3); color: var(--cyan); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 850; letter-spacing: -0.035em; margin: 20px 0 18px; line-height: 1.02; }
.grad { background: linear-gradient(90deg, var(--cyan), #60A5FA); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 32px; }
.benefits { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 14px 28px; color: #D0DCEA; font-size: .95rem; }
.benefits li { display: flex; align-items: center; gap: 10px; }
.b-ic { display: inline-flex; width: 40px; height: 40px; border-radius: 10px; align-items: center; justify-content: center; background: var(--surface-raised); border: 1px solid var(--border); color: var(--cyan); }

/* sorting visualizer */
.viz { padding: 18px; box-shadow: var(--shadow); }
.viz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.viz-head h2 { font-size: 1.15rem; margin: 0; }
.viz-head p { margin: 0; color: var(--muted); font-size: .85rem; }
.viz-ic { display: inline-flex; width: 42px; height: 42px; border-radius: 10px; align-items: center; justify-content: center; background: rgba(59, 130, 246, .15); color: #93C5FD; flex: none; }
.viz-head select { margin-left: auto; min-height: 44px; padding: 6px 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; }
.viz-bars { position: relative; height: 220px; display: flex; align-items: flex-end; gap: 6px; padding: 16px 12px 8px; background: rgba(5, 11, 24, .6); border: 1px solid var(--border); border-radius: 12px; }
.bar { position: relative; flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #4F7CF7, #3054D9); transition: height var(--t), background var(--t); }
.bar span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: .72rem; font-weight: 700; color: var(--text); }
.bar.cmp { background: linear-gradient(180deg, #FB923C, #EA580C); }
.bar.swp { background: linear-gradient(180deg, #67E8F9, #06B6D4); }
.bar.done { background: linear-gradient(180deg, #34D399, #059669); }
.bar.cmp::after, .bar.swp::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 6px; height: 6px; transform: translateX(-50%); border-radius: 50%; background: currentColor; color: var(--text); }
.viz-status { min-height: 1.6em; margin: 10px 2px 6px; font-size: .9rem; color: var(--muted); }
.viz-controls { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; }
.viz-step { font-size: .85rem; padding: 6px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); white-space: nowrap; }
.viz-controls input[type=range] { width: 100%; accent-color: var(--cyan); min-height: 28px; }
.viz-btns { display: flex; gap: 10px; align-items: center; }
.viz-btns button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: border-color var(--t), background var(--t); }
.viz-btns button:hover { border-color: var(--cyan); }
.viz-btns .viz-play { width: 54px; height: 54px; background: linear-gradient(135deg, var(--cyan), var(--blue)); border: 0; color: #03131d; }
.viz-speed { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); justify-self: end; }
.viz-speed input { width: 110px !important; }
.viz-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 600; text-decoration: none; }
.viz-more:hover { text-decoration: underline; }

/* sections */
.section { padding: 56px 0 8px; }
.section-sm { padding: 40px 0 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.sec-head h2, .how h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.sec-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; text-decoration: none; }
.sec-link:hover { text-decoration: underline; }

/* subject cards */
.subject-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.subject-grid-sm { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.subject-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; min-height: 170px; border-radius: var(--radius); text-decoration: none; color: var(--text); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 18%, var(--surface)) 0%, var(--surface) 70%); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); transition: transform var(--t), box-shadow var(--t), border-color var(--t); }
.subject-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 22%, transparent); }
.sc-ico { display: inline-flex; width: 48px; height: 48px; border-radius: 12px; align-items: center; justify-content: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--bg)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.sc-ico-lg { width: 68px; height: 68px; border-radius: 16px; flex: none; }
.sc-title { font-weight: 750; font-size: 1.05rem; }
.sc-desc { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.sc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: .88rem; }
.sc-count { color: #DCE7F3; font-weight: 600; }
.sc-soon { color: var(--soon); }
.sc-go { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }

/* simulator cards */
.sim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 18px; }
.sim-card { display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); overflow: hidden; transition: transform var(--t), border-color var(--t), box-shadow var(--t); }
.sim-card:hover { transform: translateY(-3px); border-color: #3B6FB0; box-shadow: var(--shadow); }
.sim-card.is-soon { opacity: .85; }
.sim-card.is-soon:hover { transform: none; box-shadow: none; }
.card-media { position: relative; aspect-ratio: 16 / 10; background: var(--bg-2); border-bottom: 1px solid var(--border); }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.card-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--accent); background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%); }
.card-badges { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: .74rem; font-weight: 750; letter-spacing: .02em; border: 1px solid transparent; }
.badge-live { background: #064E3B; color: #A7F3D0; border-color: #10B981; }
.badge-live::before { content: "●"; font-size: .6rem; }
.badge-soon { background: #422006; color: #FDE68A; border-color: #B45309; }
.badge-beginner { background: #0B3B2E; color: #BBF7D0; border-color: #15803D; }
.badge-intermediate { background: #3B2A06; color: #FDE68A; border-color: #CA8A04; }
.badge-advanced { background: #3F0D12; color: #FECACA; border-color: #DC2626; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px; flex: 1; }
.card-title { font-size: 1.08rem; margin: 0; }
.card-desc { color: var(--muted); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-size: .84rem; color: #C9D6E6; }
.card-meta .ic { color: var(--accent); }
.card-class { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 0; font-size: .8rem; }
.cc-bands { color: #E9D9A6; font-weight: 650; }
.cc-syl { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.class-note { margin: -8px 0 18px; }
.class-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.class-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; min-height: 150px; border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); --accent: #E9B949; transition: transform var(--t), border-color var(--t); }
.class-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.cl-title { font-weight: 800; font-size: 1.25rem; color: var(--accent); }
.cl-desc { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.card-link { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; text-decoration: none; color: var(--cyan); }
.card-link:hover span:first-child { text-decoration: underline; }
.card-soon { margin-top: auto; font-size: .85rem; color: var(--soon); min-height: 44px; display: flex; align-items: center; }

/* how it works */
.how-steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: s; }
.how-steps li { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.how-n { display: inline-flex; width: 36px; height: 36px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 800; color: #03131d; background: linear-gradient(135deg, var(--cyan), var(--blue)); margin-bottom: 10px; }
.how-steps h3 { font-size: 1.1rem; margin: 0 0 6px; }
.how-steps p { color: var(--muted); margin: 0; font-size: .93rem; }

/* paths */
.path-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.path-card { padding: 20px; }
.path-k { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--cyan); font-weight: 650; margin: 0 0 8px; }
.path-card h3 { font-size: 1.15rem; }
.path-card p { color: var(--muted); font-size: .93rem; }
.path-card ol { margin: 0; padding-left: 1.3rem; display: grid; gap: 6px; }
.path-card li a { font-weight: 600; }
.path-card li.is-soon { color: var(--muted); }

/* stats */
.stats { margin-top: 56px; padding: 36px 0; border-top: 1px solid var(--border); background: linear-gradient(180deg, rgba(13, 27, 48, .6), transparent); }
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.st-n { display: block; font-size: 2.1rem; font-weight: 850; letter-spacing: -0.02em; }
.st-l { color: var(--muted); font-size: .92rem; }

/* listing pages */
.page { padding: 28px 0 56px; }
.page h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr) auto auto; gap: 14px; align-items: end; padding: 16px; margin: 24px 0 12px; }
.f-field { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); font-weight: 600; min-width: 0; }
.f-field select, .f-qwrap { min-height: 44px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); padding: 0 10px; width: 100%; }
.f-qwrap { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.f-qwrap input { background: none; border: 0; outline: none; width: 100%; min-height: 42px; color: var(--text); }
.f-qwrap:focus-within, .f-field select:focus { border-color: var(--cyan); }
.f-check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: .9rem; color: #D6E2F0; }
.f-check input { width: 20px; height: 20px; accent-color: var(--cyan); }
.results-count { color: var(--muted); font-size: .92rem; margin: 6px 0 16px; min-height: 1.4em; }
.empty { padding: 32px; text-align: center; margin-top: 8px; }
.empty[hidden] { display: none; }
.subj-hero { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }
.chip { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; transition: border-color var(--t), background var(--t); }
.chip:hover { border-color: var(--cyan); }
.chip[aria-pressed="true"] { background: rgba(34, 211, 238, .16); border-color: var(--cyan); color: var(--text); }
.chip[aria-pressed="true"]::before { content: "✓ "; }
.soon-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.soon-list li { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px dashed #3A5577; background: rgba(13, 27, 48, .5); }
.soon-list li[hidden], .sim-card[hidden] { display: none; }
.soon-t { display: block; font-weight: 650; }
.soon-d { display: block; color: var(--muted); font-size: .88rem; }
.prose h2 { font-size: 1.35rem; margin-top: 1.6em; }
.prose p, .prose li { color: #D0DCEA; }

/* footer */
.site-footer { margin-top: 64px; border-top: 1px solid var(--border); background: var(--bg-2); }
.ftr { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-top: 40px; padding-bottom: 24px; }
.ftr-brand p { color: var(--muted); max-width: 26rem; margin-top: 12px; }
.ftr-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.ftr ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.ftr ul a { display: inline-flex; align-items: center; min-height: 36px; color: #D6E2F0; text-decoration: none; }
.ftr ul a:hover { color: var(--cyan); text-decoration: underline; }
.ftr-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 28px; border-top: 1px solid rgba(35, 57, 84, .6); color: var(--muted); font-size: .88rem; }
.ftr-base p { margin: 0; }
.ftr-base a { color: var(--muted); }

/* responsive */
@media (max-width: 1279px) {
  .hdr-cta { display: none; }
  .nav-link { padding: 8px 10px; }
  .main-nav { margin-left: 4px; gap: 0; }
}
@media (max-width: 1180px) {
  .subject-grid, .subject-grid-sm, .class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hdr-search { width: 200px; }
  .filters { grid-template-columns: 1fr 1fr 1fr; }
  .f-q { grid-column: 1 / -1; }
}
@media (max-width: 1023px) {
  .main-nav, .hdr-search, .hdr-cta { display: none; }
  .mn-toggle { display: inline-flex; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .how-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ftr { grid-template-columns: 1fr 1fr; }
  .ftr-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .hero { padding: 36px 0 44px; }
  .subject-grid, .subject-grid-sm { grid-template-columns: 1fr; }
  .subject-card { min-height: 0; }
  .how-steps { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .f-check, #f-reset { grid-column: span 1; }
  .viz-bars { height: 170px; gap: 4px; padding: 16px 8px 8px; }
  .bar span { font-size: .62rem; }
  .viz-controls { grid-template-columns: 1fr; }
  .viz-step { justify-self: start; }
  .viz-btns { justify-content: center; }
  .viz-speed { justify-self: stretch; }
  .viz-speed input { flex: 1; width: auto !important; }
  .viz-head { flex-wrap: wrap; }
  .viz-head select { margin-left: 0; width: 100%; }
  .subj-hero { flex-direction: column; gap: 12px; }
  .btn-lg { width: 100%; }
}
@media (max-width: 400px) {
  .filters { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .brand { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; scroll-behavior: auto !important; }
  .subject-card:hover, .sim-card:hover { transform: none; }
}
