/* ======================================================================
   MGEQuant · Option A "Guided front door" · assets/css/option-a.css
   Loaded AFTER each page's own styles. Keeps the glow, grid and brand.
   Changes: readable typography, skip link, nav search, ticker pause,
   three doors, start-here path, glossary tooltips, bar-by-bar hero demo,
   search dialog, focus rings, 44px tap targets.
   ====================================================================== */

/* ---------- typography ---------- */
html { font-size: 106.25%; }                       /* 17px base: every rem size grows 6% */
:root { --text: #d6dae2; --text-dim: #aeb5c2; --silver-dim: #c0c6d1; --a-link: #8cc6ff; }
:root[data-theme="light"] { --text: #3b4351; --text-dim: #5c6575; --silver-dim: #464f60; --a-link: #1f66d6; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --text: #3b4351; --text-dim: #5c6575; --silver-dim: #464f60; --a-link: #1f66d6; } }
body { line-height: 1.65; }
/* sentence case and normal spacing instead of tiny spaced-out capitals.
   The wordmark and the big MGEQUANT title keep their capitals. */
body *:not(.accent):not(svg *) { text-transform: none !important; letter-spacing: normal !important; }
.site-nav .brand .bt > span, .hero h1, footer .brand span, .brand b { text-transform: uppercase !important; }
.site-nav .brand .bt > span, footer .brand span { letter-spacing: 0.03em !important; }
.hero h1 { letter-spacing: -0.01em !important; }
.site-nav .brand .bt small { font-size: 0.78rem; color: var(--text-dim); }
.site-nav { gap: 6px 16px !important; }
.site-nav .links { gap: 2px 16px !important; }
.site-nav .links a { font-size: 1rem; color: var(--silver-dim); padding: 10px 2px; border-bottom-width: 2px; }
.site-nav .links a:hover { color: var(--a-link); }
.labs-strip { font-size: 0.95rem; }
.eyebrow { font-size: 1rem; }
.hero .headline { font-weight: 650; }
.hero .lead { font-size: 1.12rem; }
.hero .dse { font-size: 0.9rem; }
.ticker-track span { font-size: 0.9rem; }
.btn { font-size: 0.95rem; padding: 12px 20px; min-height: 44px; }
.pipe-note, .latest time, .rcard .more, .sec-link, .disclaimer, footer a { font-size: max(0.92rem, 1em); }
.latest time { font-size: 0.88rem; }
.disclaimer { color: var(--text-dim); }
/* white text on the bright blue button was below AA; use the deeper blue */
.btn-solid { background: #1b5fe0; border-color: #1b5fe0; color: #fff; }
.btn-solid:hover { background: #174fc0 !important; border-color: #174fc0; }

/* ---------- accessibility ---------- */
:focus-visible { outline: 3px solid var(--a-link); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 1000; background: #1b5fe0; color: #fff; padding: 12px 18px; border-radius: 8px; font-weight: 700; transition: top .15s; }
.skip-link:focus { top: 12px; color: #fff; }
main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.theme-toggle { min-width: 44px; min-height: 44px; }

/* ---------- nav search button ---------- */
.nav-search { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: color-mix(in oklab, var(--blue) 8%, transparent); color: var(--silver); font-size: 0.95rem; cursor: pointer; font-family: inherit; }
.nav-search:hover { border-color: var(--blue); color: var(--silver); }
.nav-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-search kbd { display: none; }
@media (max-width: 640px) { .nav-search kbd { display: none; } }

/* ---------- ticker pause ---------- */
.ticker-wrap { position: relative; }
.ticker-pause { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 3; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-panel); color: var(--silver); font: inherit; font-size: 0.85rem; cursor: pointer; }
.ticker-pause:hover { border-color: var(--blue); }
@media (max-width: 640px) { .ticker-pause { min-height: 44px; } }
.ticker.paused .ticker-track, .ticker-wrap.paused .ticker-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none !important; } }

/* ---------- hero: copy + interactive demo ---------- */
.hero { align-items: start; }
.hero .who { margin: 0 0 14px; max-width: 34em; font-size: 1.05rem; color: var(--silver); }
.hero .who b { color: var(--a-link); font-weight: 650; }
.hero-visual.hx-wrap { min-height: 0 !important; overflow: visible !important; aspect-ratio: auto !important; }
.hero-visual.hx-wrap::after { display: none !important; }
#hx .hx-card { background: var(--bg-panel); border: 1px solid color-mix(in oklab, var(--blue) 45%, var(--border)); border-radius: 14px; padding: 14px 14px 12px; box-shadow: 0 0 40px -14px color-mix(in oklab, var(--blue) 70%, transparent); position: relative; z-index: 1; }
#hx h2 { margin: 0; font-size: 1.15rem; color: var(--silver); }
#hx .hx-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; }
#hx .hx-sample { display: inline-block; font-size: 0.85rem; color: var(--text-dim); border: 1px dashed var(--border); border-radius: 999px; padding: 1px 10px; }
#hx .hx-svg { width: 100%; height: auto; display: block; background: #090b0f; border-radius: 10px; cursor: pointer; touch-action: manipulation; }
#hx .hx-explain { min-height: 96px; margin-top: 10px; font-size: 1rem; line-height: 1.5; color: var(--text); }
#hx .hx-chip { display: inline-block; min-width: 2.2em; text-align: center; font-weight: 700; padding: 1px 8px; border-radius: 6px; margin-right: 6px; color: #0a0c10; }
#hx .hx-dim { color: var(--text-dim); display: block; margin-top: 4px; font-size: 0.92rem; }
#hx .hx-legend { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 8px; font-size: 0.88rem; color: var(--text-dim); }
#hx .hx-legend i { font-style: normal; font-weight: 700; margin-right: 4px; }
#hx .hx-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; font-size: 0.95rem; }
#hx .hx-controls button { background: transparent; color: var(--silver); border: 1px solid var(--border); border-radius: 8px; padding: 0 14px; min-height: 44px; min-width: 44px; cursor: pointer; font: inherit; }
#hx .hx-controls button:hover { border-color: var(--blue); }
#hx .hx-controls button[data-a="play"] { border-color: var(--blue); background: color-mix(in oklab, var(--blue) 14%, transparent); }
#hx .hx-controls label { color: var(--text); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; min-height: 44px; }
#hx .hx-counter { color: var(--text-dim); font-variant-numeric: tabular-nums; }
#hx .hx-more { margin-top: 8px; font-size: 0.95rem; }
#hx .hx-more a { color: var(--a-link); }
:root[data-theme="light"] #hx .hx-card { box-shadow: 0 10px 30px -18px rgba(22,104,220,.5); }

/* ---------- three doors ---------- */
.doors { padding: 8px 0 26px; }
.doors h2, .startpath h2 { margin: 0 0 6px; font-size: clamp(1.4rem, 3vw, 1.9rem); color: var(--silver); }
.doors > p, .startpath > p { margin: 0 0 16px; color: var(--text); }
.door-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.door { display: flex; flex-direction: column; gap: 10px; padding: 20px 20px 18px; border-radius: 14px; background: var(--bg-panel); border: 1px solid color-mix(in oklab, var(--blue) 40%, var(--border)); position: relative; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.door:hover, .door:focus-within { border-color: var(--blue); transform: translateY(-3px); box-shadow: 0 16px 34px -18px rgba(59,139,255,.7); }
.door .door-n { font-size: 0.9rem; color: var(--a-link); font-weight: 700; }
.door h3 { margin: 0; font-size: 1.28rem; line-height: 1.25; color: var(--silver); }
.door p { margin: 0; color: var(--text); }
.door .door-links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px 14px; padding-top: 6px; }
.door .door-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; color: var(--a-link); border-bottom: 1px solid transparent; }
.door .door-links a:hover { border-bottom-color: currentColor; }
.door .door-links a.main { color: #fff; background: #1b5fe0; padding: 0 16px; border-radius: 8px; }
.door .door-links a.main:hover { background: #174fc0; border-bottom-color: transparent; }
@media (max-width: 900px) { .door-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- start here ---------- */
.startpath { padding: 4px 0 30px; }
.steps { list-style: none; counter-reset: st; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.steps li { counter-increment: st; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px 18px 16px 18px; position: relative; }
.steps li::before { content: counter(st); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #1b5fe0; color: #fff; font-weight: 800; margin-bottom: 10px; box-shadow: 0 0 16px -2px var(--blue); }
.steps h3 { margin: 0 0 6px; font-size: 1.12rem; color: var(--silver); }
.steps p { margin: 0 0 8px; color: var(--text); }
.steps a.go { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; color: var(--a-link); }
@media (max-width: 900px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* ---------- glossary tooltips ---------- */
a.gl { color: inherit; border-bottom: 1px dotted var(--a-link); cursor: help; text-decoration: none; }
a.gl:hover, a.gl:focus-visible { color: var(--a-link); border-bottom-style: solid; }
.gl-pop { position: absolute; z-index: 900; max-width: min(320px, calc(100vw - 24px)); padding: 12px 14px; border-radius: 10px; background: var(--bg-panel); color: var(--text); border: 1px solid var(--blue); box-shadow: 0 14px 34px -10px rgba(0,0,0,.6), 0 0 22px -8px var(--blue); font-size: 0.95rem; line-height: 1.5; }
.gl-pop b { display: block; color: var(--silver); margin-bottom: 2px; }
.gl-pop a { color: var(--a-link); display: inline-block; margin-top: 4px; }
#glossary dl { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 10px 20px; margin: 10px 0 0; }
#glossary dt { color: var(--silver); font-weight: 700; }
#glossary dd { margin: 0; color: var(--text); }
@media (max-width: 640px) { #glossary dl { grid-template-columns: 1fr; gap: 2px; } #glossary dd { margin-bottom: 10px; } }

/* ---------- search dialog ---------- */
.sd-back { position: fixed; inset: 0; z-index: 2000; background: rgba(3,5,10,.72); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 12px 12px; }
.sd-back[hidden] { display: none; }
.sd { width: min(680px, 100%); max-height: 84vh; display: flex; flex-direction: column; background: var(--bg-panel); border: 1px solid var(--blue); border-radius: 14px; box-shadow: 0 0 60px -12px var(--blue), 0 30px 60px -20px rgba(0,0,0,.7); overflow: hidden; }
.sd-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.sd-top svg { width: 20px; height: 20px; color: var(--a-link); flex-shrink: 0; }
.sd-input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--silver); font: inherit; font-size: 1.1rem; min-height: 44px; outline: none; }
.sd-input::placeholder { color: var(--text-dim); }
.sd-close { min-height: 44px; min-width: 44px; background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--silver); font: inherit; cursor: pointer; }
.sd-body { overflow-y: auto; padding: 6px 8px 10px; }
.sd-hint { padding: 8px 10px; color: var(--text-dim); font-size: 0.92rem; }
.sd-sugg { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 10px 10px; }
.sd-sugg button { min-height: 44px; padding: 0 14px; border-radius: 999px; background: color-mix(in oklab, var(--blue) 10%, transparent); border: 1px solid var(--border); color: var(--silver); font: inherit; cursor: pointer; }
.sd-sugg button:hover { border-color: var(--blue); }
.sd-list { list-style: none; margin: 0; padding: 0; }
.sd-item a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); border: 1px solid transparent; }
.sd-item a[aria-selected="true"], .sd-item a:hover { background: color-mix(in oklab, var(--blue) 14%, transparent); border-color: color-mix(in oklab, var(--blue) 55%, transparent); }
.sd-item .sd-t { display: flex; align-items: baseline; gap: 10px; color: var(--silver); font-weight: 650; }
.sd-badge { flex-shrink: 0; font-size: 0.78rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--a-link); }
.sd-item .sd-x { display: block; margin-top: 2px; font-size: 0.92rem; color: var(--text-dim); }
.sd mark { background: color-mix(in oklab, var(--blue) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.sd-foot { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 14px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 0.85rem; }
.sd-foot kbd { font: inherit; border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
@media (max-width: 640px) { .sd-foot { display: none; } .sd-back { padding-top: 4vh; } }

/* ---------- misc ---------- */
@media (max-width: 640px) {
  .site-nav .links a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer a, footer nav a, footer .legal-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .filter-chip, .devlog-card-link { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .door, .btn { transition: none; } .door:hover { transform: none; } }
@media (max-width: 640px) { .nav-search { padding: 0; width: 44px; justify-content: center; } .nav-search .ns-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .site-nav .brand .bt small { display: none; } }
