/* ==========================================================================
   CertiFluent — "Command Deck"
   The cloud engineer's habitat: IDE/terminal-native. Dark-first (light supported).
   Signature: the answer reveal is a code-review DIFF — your pick (−) vs the
   verified answer (+) — with sources rendered as evidence / import paths.
   Palette is space-navy + electric cyan + warm coral — deliberately NOT the
   default acid-green-on-black. System fonts only (org-laptop safe); mono-forward.
   ========================================================================== */

:root, [data-theme="dark"] {
  --bg:          #0a0e1a;   /* deep space navy, blue-black */
  --bg-grid:     #0e1424;   /* faint panel wash */
  --panel:       #111a2e;   /* raised surface */
  --panel-2:     #0d1526;
  --line:        #1f2b45;   /* hairlines */
  --line-bright: #2c3c5e;
  --ink:         #e7edf9;   /* primary text */
  --ink-dim:     #aab6d0;
  --muted:       #6b7a9c;   /* labels, comments */
  --cyan:        #2ee6d6;   /* VERIFIED / brand / primary accent */
  --cyan-dim:    #1aa89b;
  --cyan-glow:   rgba(46,230,214,.14);
  --coral:       #ff6f61;   /* your (wrong) pick / incorrect */
  --coral-dim:   #c9483d;
  --coral-glow:  rgba(255,111,97,.12);
  --amber:       #f5b544;   /* citation markers / warnings */
  --add-bg:      rgba(46,230,214,.09);   /* diff + line */
  --del-bg:      rgba(255,111,97,.09);   /* diff − line */
  --shadow:      0 0 0 1px var(--line), 0 24px 60px -30px rgba(0,0,0,.8);
}

[data-theme="light"] {
  --bg:          #f4f6fb;
  --bg-grid:     #eef1f8;
  --panel:       #ffffff;
  --panel-2:     #f7f9fd;
  --line:        #dde3ef;
  --line-bright: #c6d0e3;
  --ink:         #0f1b30;
  --ink-dim:     #33436a;
  --muted:       #67759a;
  --cyan:        #0d9488;   /* darkened for contrast on light */
  --cyan-dim:    #0b7d73;
  --cyan-glow:   rgba(13,148,136,.10);
  --coral:       #d64534;
  --coral-dim:   #b23a2b;
  --coral-glow:  rgba(214,69,52,.08);
  --amber:       #b7791f;
  --add-bg:      rgba(13,148,136,.08);
  --del-bg:      rgba(214,69,52,.07);
  --shadow:      0 0 0 1px var(--line), 0 18px 44px -28px rgba(15,27,48,.28);
}

* { box-sizing: border-box; }

:root {
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Code", ui-monospace, "Menlo", "Consolas", monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --measure: 46rem;
  --radius: 10px;
  --radius-sm: 6px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 80% -10%, var(--cyan-glow), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, var(--coral-glow), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 60rem; margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--cyan); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.eyebrow {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--cyan);
}

/* ==========================================================================
   Masthead — a shell prompt line
   ========================================================================== */
.masthead {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.masthead .wrap { display: flex; align-items: center; gap: .9rem; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-word { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.brand-word .accent { color: var(--cyan); }
.prompt {
  font-family: var(--mono); font-size: .82rem; color: var(--muted);
  border-left: 1px solid var(--line); padding-left: .9rem;
}
.prompt .path { color: var(--ink-dim); }
.prompt .blink { color: var(--cyan); animation: blink 1.1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.spacer { flex: 1; }
.theme-toggle {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .04em;
  border: 1px solid var(--line-bright); background: transparent; color: var(--muted);
  border-radius: 999px; padding: .3rem .7rem; cursor: pointer; display: inline-flex; gap: .4rem;
}
.theme-toggle:hover { border-color: var(--cyan); color: var(--cyan); }

main { padding: 3rem 0 6rem; }

/* ==========================================================================
   Page head
   ========================================================================== */
.page-head { margin-bottom: 2.5rem; }
.crumb { font-family: var(--mono); font-size: .8rem; }
.page-head h1 {
  font-family: var(--sans); font-weight: 800; font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.05; letter-spacing: -.03em; margin: .5rem 0 .6rem;
}
.page-head h1 .hl { color: var(--cyan); }
.lede { color: var(--ink-dim); max-width: var(--measure); margin: 0; font-size: 1.08rem; }

.badge-demo {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .14em;
  color: var(--amber); border: 1px solid var(--amber); border-radius: 4px;
  padding: .12rem .4rem; vertical-align: .32em; margin-left: .6rem;
}

/* progress: a status bar */
.status { display: flex; align-items: center; gap: .8rem; margin-top: 1.4rem; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.status .bar { flex: 0 0 200px; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.status .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan-dim), var(--cyan)); transition: width .35s ease; }

/* ==========================================================================
   Browse-by-provider chip nav
   ========================================================================== */
.provider-nav { margin: 0 0 2.5rem; }
.provider-nav-label { display: block; margin-bottom: .7rem; }
.provider-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.provider-chip {
  display: inline-flex; align-items: baseline; gap: .45rem;
  font-family: var(--mono); font-size: .82rem; color: var(--ink-dim);
  background: var(--panel-2); border: 1px solid var(--line-bright);
  border-radius: 999px; padding: .38rem .8rem; text-decoration: none;
  transition: border-color .14s, color .14s, background .14s;
}
.provider-chip:hover { border-color: var(--cyan); color: var(--cyan); text-decoration: none; }
.provider-chip .chip-count {
  font-size: .72rem; color: var(--muted);
  background: var(--bg-grid); border-radius: 999px; padding: .05rem .4rem;
}
.provider-chip:hover .chip-count { color: var(--cyan); }
.vendor-section { margin-bottom: 2.75rem; scroll-margin-top: 76px; }
.vendor-section-head { margin-bottom: .8rem; }

/* ==========================================================================
   Exam index — repo-list cards
   ========================================================================== */
.exam-card {
  display: block; background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.5rem; margin-bottom: 1rem; color: var(--ink);
  position: relative; overflow: hidden; transition: border-color .16s, transform .16s;
}
.exam-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--cyan); opacity: 0; transition: opacity .16s;
}
.exam-card:hover { border-color: var(--line-bright); transform: translateY(-2px); text-decoration: none; }
.exam-card:hover::before { opacity: 1; }
.exam-card .vendor { font-family: var(--mono); font-size: .76rem; color: var(--cyan); letter-spacing: .04em; }
.exam-card h2 { font-family: var(--sans); font-weight: 700; font-size: 1.4rem; letter-spacing: -.01em; margin: .3rem 0 .4rem; }
.exam-card .count { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.exam-card .go { color: var(--cyan); }

/* objectives as a weighted manifest */
.objectives { list-style: none; padding: 0; margin: 1rem 0 0; }
.objectives li { display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: .9rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.objectives li:last-child { border-bottom: 0; }
.objectives .code { font-family: var(--mono); font-size: .8rem; color: var(--cyan); }
.objectives .oname { font-size: .98rem; }
.objectives .wt { font-family: var(--mono); font-size: .78rem; color: var(--muted); text-align: right; }
.objectives .wtbar { grid-column: 2 / 4; height: 3px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: -.3rem; }
.objectives .wtbar i { display: block; height: 100%; background: var(--cyan-dim); }

/* ==========================================================================
   THE STUDY SHEET — stacked question consoles
   ========================================================================== */
.sheet { display: flex; flex-direction: column; gap: 1.5rem; }

.qitem {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 78px;
}
/* console title bar */
.qbar {
  display: flex; align-items: center; gap: .7rem;
  background: var(--panel-2); border-bottom: 1px solid var(--line);
  padding: .55rem .95rem; font-family: var(--mono); font-size: .76rem; color: var(--muted);
}
.qbar .qid { color: var(--cyan); font-weight: 700; }
.qbar .tag { color: var(--muted); }
.qbar .tag b { color: var(--ink-dim); font-weight: 500; }
.qbar .type { margin-left: auto; padding: .1rem .45rem; border: 1px solid var(--line-bright); border-radius: 4px; }
.qbar .lamp { width: 9px; height: 9px; border-radius: 50%; background: var(--line-bright); }
.qbar .lamp.ok { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.qbar .lamp.no { background: var(--coral); box-shadow: 0 0 8px var(--coral); }

.qmain { padding: 1.4rem 1.5rem 1.6rem; }
.stem { font-family: var(--sans); font-size: 1.2rem; line-height: 1.45; font-weight: 600; margin: 0 0 1.2rem; max-width: var(--measure); }

/* options */
.opts { list-style: none; padding: 0; margin: 0 0 1.1rem; display: flex; flex-direction: column; gap: .5rem; max-width: var(--measure); }
.opt {
  display: flex; align-items: flex-start; gap: .75rem;
  border: 1px solid var(--line-bright); border-radius: var(--radius-sm);
  padding: .7rem .85rem; cursor: pointer; background: var(--panel-2);
  font-family: var(--mono); font-size: .95rem; transition: border-color .12s, background .12s;
}
.opt:hover { border-color: var(--cyan); }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt .key {
  font-family: var(--mono); font-weight: 700; color: var(--muted);
  border: 1px solid var(--line-bright); border-radius: 4px; min-width: 1.5rem;
  text-align: center; line-height: 1.4; transition: all .12s;
}
.opt .otext { flex: 1; font-family: var(--sans); font-size: 1rem; padding-top: .05rem; }
.opt .verdict { font-family: var(--mono); font-size: .78rem; align-self: center; }
.opt.chosen { border-color: var(--cyan); background: var(--cyan-glow); }
.opt.chosen .key { border-color: var(--cyan); color: var(--cyan); }
.opt.is-correct { border-color: var(--cyan); background: var(--add-bg); }
.opt.is-correct .key { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-glow); }
.opt.is-correct .verdict { color: var(--cyan); }
.opt.is-wrongpick { border-color: var(--coral); background: var(--del-bg); }
.opt.is-wrongpick .key { border-color: var(--coral); color: var(--coral); }
.opt.is-wrongpick .verdict { color: var(--coral); }

.btn {
  font-family: var(--mono); font-size: .9rem; font-weight: 600; letter-spacing: .02em;
  background: var(--cyan); color: #04201d; border: 0; border-radius: var(--radius-sm);
  padding: .6rem 1.15rem; cursor: pointer; transition: filter .12s;
}
.btn::before { content: "▸ "; }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--cyan); border: 1px solid var(--line-bright); }
.btn.ghost:hover { border-color: var(--cyan); }
.btn.ghost::before { content: ""; }

/* ==========================================================================
   THE REVEAL — a code-review diff (the signature)
   ========================================================================== */
.reveal { max-width: var(--measure); margin-top: 1.1rem; }
.diff {
  font-family: var(--mono); font-size: .88rem; line-height: 1.7;
  border: 1px solid var(--line-bright); border-radius: var(--radius-sm);
  background: var(--bg-grid); overflow: hidden;
}
.diff-head {
  padding: .4rem .85rem; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase;
  display: flex; gap: .5rem; align-items: center;
}
.diff-head .verdict-word { font-weight: 700; letter-spacing: .02em; text-transform: none; font-size: .82rem; }
.diff-head .verdict-word.ok { color: var(--cyan); }
.diff-head .verdict-word.no { color: var(--coral); }
.diff-row { display: flex; gap: .6rem; padding: .18rem .85rem; white-space: pre-wrap; }
.diff-row .sign { width: 1ch; flex: none; }
.diff-row.del { background: var(--del-bg); color: var(--coral); }
.diff-row.add { background: var(--add-bg); color: var(--cyan); }
.diff-row.del .sign::before { content: "−"; }
.diff-row.add .sign::before { content: "+"; }
.diff-row .label { color: var(--muted); min-width: 8.5ch; }

.why { margin: 1.1rem 0; font-family: var(--sans); }
.why .lead { font-family: var(--mono); font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; display: block; margin-bottom: .3rem; }
.why .lead::before { content: "// "; }
/* inline citation markers */
.cite { font-family: var(--mono); font-size: .72em; vertical-align: .3em; color: var(--cyan); font-weight: 700; text-decoration: none; padding: 0 .1em; }
.cite:hover { text-decoration: underline; }

/* sources as evidence / import lines */
.refs { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--panel-2); }
.refs-head { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: .45rem .85rem; border-bottom: 1px solid var(--line); }
.refs-head::before { content: "import "; color: var(--cyan); }
.ref { padding: .7rem .85rem; }
.ref + .ref { border-top: 1px solid var(--line); }
.ref .rtop { font-family: var(--mono); font-size: .82rem; display: flex; gap: .5rem; align-items: baseline; }
.ref .marker { color: var(--amber); font-weight: 700; }
.ref .src { color: var(--cyan); word-break: break-all; }
.ref .pub { color: var(--muted); }
.ref .quote {
  display: block; margin-top: .4rem; font-family: var(--sans); font-style: italic;
  color: var(--ink-dim); border-left: 2px solid var(--cyan-dim); padding-left: .7rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-foot { border-top: 1px solid var(--line); }
.site-foot .wrap { padding: 1.6rem 1.5rem; font-family: var(--mono); font-size: .76rem; color: var(--muted); line-height: 1.7; }
.site-foot .wrap::before { content: "# "; color: var(--cyan); }

/* ==========================================================================
   a11y + responsive
   ========================================================================== */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 3px; }
.opt:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 2px var(--cyan-glow); }

@media (max-width: 640px) {
  .prompt { display: none; }
  .stem { font-size: 1.08rem; }
  .status .bar { flex-basis: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
