/* ============================================================
   CAM Review Deck — shared stylesheet
   Pilot Mastery Lab visual identity (visual-identity-skool.md v1.0)
   Used by every per-folder review tool. Edit once, propagates to all.
   ============================================================ */
:root {
  /* Locked palette */
  --deep-aviation: #14334D;
  --aviation-blue: #1E4D72;
  --sky-blue: #4F8FC0;
  --slate: #5A6671;
  --light-slate: #C9D2D9;
  --orange: #F26A21;
  --off-white: #F6F8FA;
  --ink: #16202B;

  /* Flight-deck-at-dusk derived tones */
  --bg-0: #0B1B2A;
  --bg-1: #102A40;
  --panel: rgba(30, 77, 114, 0.28);
  --panel-solid: #173C58;
  --panel-edge: rgba(79, 143, 192, 0.30);
  --panel-edge-strong: rgba(79, 143, 192, 0.55);
  --text: #E6EEF5;
  --text-dim: #9DB2C4;
  --text-faint: #6B8299;
  --glow-orange: rgba(242, 106, 33, 0.45);
  --good: #3fae6e;
  --good-bright: #4fd089;

  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --font-head: 'Montserrat', sans-serif;
  --font-body: 'Source Sans 3', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-0);
  background-image:
    radial-gradient(120% 90% at 82% -10%, rgba(242,106,33,0.10) 0%, rgba(242,106,33,0) 45%),
    radial-gradient(100% 80% at 12% 0%, rgba(79,143,192,0.16) 0%, rgba(79,143,192,0) 50%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-0) 55%, #081320 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(79,143,192,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,143,192,0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 90%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#root { position: relative; z-index: 1; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px 96px; }

/* ---------- HUD top bar ---------- */
.hud {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(11,27,42,0.92), rgba(11,27,42,0.55));
  border-bottom: 1px solid var(--panel-edge);
}
.hud-inner { max-width: 1080px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 16px; }
.mark {
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--text);
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
}
.mark .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 12px var(--glow-orange); animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.45} }
.hud-domain {
  font-family: var(--font-head); font-weight: 600; font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--sky-blue);
  border-left: 1px solid var(--panel-edge); padding-left: 16px;
}
.hud-spacer { flex: 1; }
.hud-home {
  font-family: var(--font-head); font-weight: 600; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim);
  background: var(--panel); border: 1px solid var(--panel-edge);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: all 0.2s ease;
}
.hud-home:hover { color: var(--text); border-color: var(--panel-edge-strong); }

/* ---------- eyebrow / headings ---------- */
.eyebrow {
  font-family: var(--font-head); font-weight: 600; font-size: 11px;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--orange);
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--orange); opacity: 0.7; }
h1 { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.01em; font-size: clamp(34px, 6vw, 58px); line-height: 1.02; margin: 18px 0 0; }
h1 .accent { color: var(--sky-blue); }
.lede { color: var(--text-dim); font-size: 18px; max-width: 60ch; margin-top: 18px; }

/* ---------- hero / stats ---------- */
.hero { padding: 56px 0 8px; }
.stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.stat { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--r-md); padding: 16px 20px; min-width: 124px; backdrop-filter: blur(6px); }
.stat .v { font-family: var(--font-head); font-weight: 700; font-size: 30px; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat .v .u { font-size: 15px; color: var(--text-faint); margin-left: 2px; }
.stat .k { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); margin-top: 4px; font-family: var(--font-head); font-weight: 600; }
.stat.crit .v { color: var(--orange); }

/* ---------- mode grid ---------- */
.section-label { font-family: var(--font-head); font-weight: 600; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-faint); margin: 56px 0 18px; display: flex; align-items: center; gap: 12px; }
.section-label::after { content:""; flex:1; height:1px; background: var(--panel-edge); }
.modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.mode-card {
  position: relative; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--panel-edge);
  border-radius: var(--r-lg); padding: 26px; overflow: hidden;
  backdrop-filter: blur(8px); transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  color: inherit; font: inherit;
}
.mode-card::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); background: radial-gradient(120% 120% at 110% -10%, rgba(79,143,192,0.18), transparent 55%); opacity: 0; transition: opacity 0.25s ease; pointer-events: none; }
.mode-card:hover { transform: translateY(-4px); border-color: var(--panel-edge-strong); box-shadow: 0 18px 40px -22px rgba(0,0,0,0.8); }
.mode-card:hover::after { opacity: 1; }
.mode-num { font-family: var(--font-head); font-weight: 700; font-size: 12px; letter-spacing: 0.2em; color: var(--text-faint); }
.mode-glyph { font-size: 30px; line-height: 1; margin: 14px 0 16px; display: block; }
.mode-title { font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.mode-desc { color: var(--text-dim); font-size: 15px; margin-top: 8px; }
.mode-meta { margin-top: 18px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sky-blue); font-family: var(--font-head); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.mode-card.is-crit .mode-meta { color: var(--orange); }

/* ---------- sub-objective map ---------- */
.subobj { display: grid; gap: 14px; }
.so-card { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--r-md); padding: 22px 24px; backdrop-filter: blur(6px); }
.so-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.so-tag { font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; color: var(--bg-0); background: var(--sky-blue); padding: 3px 10px; border-radius: 6px; }
.so-title { font-family: var(--font-head); font-weight: 600; font-size: 18px; }
.so-blurb { color: var(--text-dim); font-size: 15px; margin: 10px 0 14px; }
.kw { display: flex; flex-wrap: wrap; gap: 7px; }
.kw span { font-size: 12px; color: var(--light-slate); background: rgba(79,143,192,0.12); border: 1px solid var(--panel-edge); padding: 4px 10px; border-radius: 999px; font-family: var(--font-body); }
.so-refs { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.so-refs a { color: var(--sky-blue); font-size: 13px; text-decoration: none; border-bottom: 1px solid transparent; width: fit-content; transition: border-color 0.2s; }
.so-refs a:hover { border-bottom-color: var(--sky-blue); }

/* ---------- generic view shell ---------- */
.view { padding: 44px 0 0; animation: fadeUp 0.5s ease both; }
@keyframes fadeUp { from{opacity:0; transform: translateY(14px)} to{opacity:1; transform:none} }
.view-head { margin-bottom: 26px; }
.view-head h2 { font-family: var(--font-head); font-weight: 700; font-size: clamp(26px,4vw,38px); letter-spacing: -0.01em; margin-top: 12px; }
.view-head p { color: var(--text-dim); margin-top: 8px; max-width: 58ch; }

.progress-rail { height: 4px; background: rgba(255,255,255,0.07); border-radius: 999px; overflow: hidden; margin-top: 22px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--sky-blue), var(--aviation-blue)); border-radius: 999px; transition: width 0.4s ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); font-family: var(--font-head); font-weight: 600; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.pill { font-family: var(--font-head); font-weight: 600; font-size: 12px; letter-spacing: 0.06em; padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: all 0.2s; background: var(--panel); border: 1px solid var(--panel-edge); color: var(--text-dim); }
.pill:hover { color: var(--text); }
.pill.active { background: var(--sky-blue); color: var(--bg-0); border-color: var(--sky-blue); }

/* ---------- flashcard ---------- */
.flash-stage { perspective: 1600px; }
.flash { position: relative; width: 100%; min-height: 320px; cursor: pointer; transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(0.4,0.2,0.2,1); }
.flash.flipped { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--r-lg); padding: 40px; display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--panel-edge); backdrop-filter: blur(8px); }
.flash-front { background: linear-gradient(155deg, rgba(30,77,114,0.42), rgba(16,42,64,0.42)); }
.flash-back { transform: rotateY(180deg); background: linear-gradient(155deg, rgba(20,51,77,0.6), rgba(11,27,42,0.6)); border-color: var(--panel-edge-strong); }
.flash .corner { position: absolute; top: 22px; left: 26px; display: flex; gap: 8px; align-items: center; }
.flash .corner .so-tag { font-size: 12px; }
.flash .flip-hint { position: absolute; bottom: 20px; right: 26px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); font-family: var(--font-head); font-weight: 600; }
.flash-q { font-family: var(--font-head); font-weight: 600; font-size: 24px; line-height: 1.3; }
.flash-a { font-size: 18px; color: var(--text); line-height: 1.5; }
.flash-a strong { color: var(--sky-blue); }
.crit-chip { font-family: var(--font-head); font-weight: 700; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange); border: 1px solid var(--glow-orange); border-radius: 999px; padding: 3px 9px; display: inline-flex; align-items: center; gap: 6px; }
.crit-chip::before { content:""; width:6px; height:6px; border-radius:50%; background: var(--orange); box-shadow: 0 0 8px var(--glow-orange); }

.controls { display: flex; gap: 12px; margin-top: 26px; align-items: center; }
.btn { font-family: var(--font-head); font-weight: 600; font-size: 14px; letter-spacing: 0.04em; padding: 12px 22px; border-radius: var(--r-sm); cursor: pointer; transition: all 0.2s; border: 1px solid var(--panel-edge); background: var(--panel); color: var(--text); }
.btn:hover:not(:disabled) { border-color: var(--panel-edge-strong); transform: translateY(-1px); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #1a0c03; }
.btn.primary:hover { box-shadow: 0 10px 26px -12px var(--glow-orange); }
.btn.ghost { background: transparent; }
.controls .grow { flex: 1; }

/* ---------- quiz ---------- */
.q-card { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--r-lg); padding: 30px; backdrop-filter: blur(8px); }
.q-num { font-family: var(--font-head); font-weight: 700; font-size: 12px; letter-spacing: 0.18em; color: var(--text-faint); display: flex; align-items: center; gap: 12px; }
.q-text { font-family: var(--font-head); font-weight: 600; font-size: 22px; line-height: 1.35; margin: 16px 0 24px; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; font: inherit; cursor: pointer; color: var(--text); background: rgba(255,255,255,0.03); border: 1px solid var(--panel-edge); border-radius: var(--r-sm); padding: 15px 18px; transition: all 0.18s; display: flex; align-items: center; gap: 14px; }
.opt:hover:not(:disabled) { border-color: var(--sky-blue); background: rgba(79,143,192,0.10); }
.opt:disabled { cursor: default; }
.opt .key { font-family: var(--font-head); font-weight: 700; font-size: 13px; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 6px; display: grid; place-items: center; background: rgba(255,255,255,0.06); color: var(--text-dim); }
.opt.correct { border-color: var(--good); background: rgba(63,174,110,0.14); }
.opt.correct .key { background: var(--good); color: #05210f; }
.opt.wrong { border-color: var(--orange); background: rgba(242,106,33,0.12); }
.opt.wrong .key { background: var(--orange); color: #1a0c03; }
.opt.dim { opacity: 0.5; }

.explain { margin-top: 20px; border-left: 2px solid var(--sky-blue); padding: 4px 0 4px 18px; animation: fadeUp 0.35s ease both; }
.explain.crit { border-left-color: var(--orange); }
.explain .lbl { font-family: var(--font-head); font-weight: 700; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sky-blue); margin-bottom: 6px; }
.explain.crit .lbl { color: var(--orange); }
.explain p { color: var(--text-dim); font-size: 15px; }
.explain .src { margin-top: 10px; font-size: 12px; color: var(--text-faint); font-style: italic; }

/* results */
.result { text-align: center; padding: 30px 0; animation: fadeUp 0.5s ease both; }
.score-ring { position: relative; width: 220px; height: 220px; margin: 10px auto 24px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-ring .num b { font-family: var(--font-head); font-weight: 700; font-size: 56px; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.score-ring .num span { font-family: var(--font-head); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); display: block; margin-top: 6px; }
.verdict { font-family: var(--font-head); font-weight: 700; font-size: 26px; margin-bottom: 8px; }
.verdict.pass { color: var(--good-bright); }
.verdict.mid { color: var(--sky-blue); }
.verdict.low { color: var(--orange); }

/* ---------- traps ---------- */
.trap-card { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--r-lg); overflow: hidden; backdrop-filter: blur(8px); }
.trap-believe { padding: 30px; border-bottom: 1px dashed var(--panel-edge); background: rgba(242,106,33,0.06); }
.trap-believe .lbl, .trap-truth .lbl { font-family: var(--font-head); font-weight: 700; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; gap: 9px; }
.trap-believe .lbl { color: var(--orange); }
.trap-believe .lbl::before { content:"⚠"; font-size: 14px; }
.trap-believe p { font-size: 20px; font-family: var(--font-head); font-weight: 500; line-height: 1.35; }
.trap-truth { padding: 30px; transition: opacity 0.3s ease, filter 0.3s ease; }
.trap-truth .lbl { color: var(--good-bright); }
.trap-truth .lbl::before { content:"✓"; font-size: 14px; }
.trap-truth p { font-size: 20px; font-family: var(--font-head); font-weight: 600; color: var(--text); line-height: 1.35; }
.trap-truth.hidden { filter: blur(9px); opacity: 0.5; user-select: none; }
.trap-truth.hidden p { color: var(--text-dim); }

/* ---------- scenarios ---------- */
.scn-card { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--r-lg); padding: 32px; backdrop-filter: blur(8px); }
.scn-prompt { font-size: 18px; line-height: 1.6; color: var(--text); }
.scn-prompt .role { color: var(--sky-blue); font-family: var(--font-head); font-weight: 700; }
.scn-ask { margin-top: 18px; padding: 16px 18px; border-radius: var(--r-sm); background: rgba(79,143,192,0.10); border: 1px solid var(--panel-edge); font-style: italic; color: var(--light-slate); font-size: 15px; }
.scn-answer { margin-top: 22px; border-top: 1px solid var(--panel-edge); padding-top: 22px; animation: fadeUp 0.4s ease both; }
.scn-answer .lbl { font-family: var(--font-head); font-weight: 700; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--orange); margin-bottom: 12px; }
.scn-answer p { color: var(--text-dim); font-size: 16px; line-height: 1.6; margin-bottom: 12px; }
.scn-answer strong { color: var(--text); }
.scn-answer em { color: var(--light-slate); font-style: italic; }
.scn-src { font-size: 12px; color: var(--text-faint); font-style: italic; margin-top: 8px; }

/* footer */
.foot { margin-top: 70px; padding-top: 26px; border-top: 1px solid var(--panel-edge); font-size: 13px; color: var(--text-faint); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.foot b { color: var(--text-dim); font-family: var(--font-head); font-weight: 600; letter-spacing: 0.04em; }

/* ---------- cheat sheet (print / PDF) ---------- */
.sheet { background: #ffffff; color: #16202B; border-radius: 12px; padding: 40px 44px; box-shadow: 0 20px 60px -30px rgba(0,0,0,0.8); font-family: var(--font-body); }
.sheet-head { border-bottom: 3px solid var(--orange); padding-bottom: 14px; margin-bottom: 8px; }
.sheet-title { font-family: var(--font-head); font-weight: 700; font-size: 26px; color: var(--aviation-blue); letter-spacing: -0.01em; }
.sheet-sub { font-size: 11px; letter-spacing: 0.06em; color: var(--slate); margin-top: 6px; text-transform: uppercase; font-family: var(--font-head); font-weight: 600; }
.sheet-section { margin-top: 22px; }
.sheet-section h3 { font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--aviation-blue); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; border-left: 3px solid var(--orange); padding-left: 10px; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sheet-table th { text-align: left; background: #eef3f7; color: var(--slate); font-family: var(--font-head); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 9px; border: 1px solid #d7e0e8; }
.sheet-table td { padding: 6px 9px; border: 1px solid #d7e0e8; vertical-align: top; line-height: 1.4; }
.sheet-table td strong { color: var(--aviation-blue); }
.sheet-table tr { break-inside: avoid; }
.sheet-dl dt { font-family: var(--font-head); font-weight: 700; font-size: 12.5px; color: var(--ink); margin-top: 11px; }
.sheet-dl dd { font-size: 12.5px; color: #33414e; margin-left: 0; margin-top: 2px; line-height: 1.45; }
.sheet-dl dd strong { color: var(--aviation-blue); }
.sheet-dl dt, .sheet-dl dd { break-inside: avoid; }
.sheet-so { font-size: 12.5px; margin-bottom: 6px; line-height: 1.4; }
.sheet-so strong { color: var(--aviation-blue); font-family: var(--font-head); }
.sheet-kw { color: var(--slate); }
.sheet-foot { margin-top: 24px; padding-top: 12px; border-top: 1px solid #d7e0e8; font-size: 10px; color: var(--slate); text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-head); }

@media print {
  body::before, body::after { display: none !important; }
  body { background: #fff !important; }
  .hud, .noprint { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .view { padding: 0; animation: none; }
  .sheet { box-shadow: none; border-radius: 0; padding: 0; }
  .sheet-section { margin-top: 16px; }
  @page { margin: 14mm; }
}

@media (max-width: 720px) {
  .modes { grid-template-columns: 1fr; }
  .hud-domain { display: none; }
  .flash-face { padding: 28px; }
  .sheet { padding: 26px 24px; }
}
