/* SSN visual direction B, "Instrument panel" (approved 2026-09-26; mockup at
   docs/mockups/visual-refresh/?d=b). Loaded after each page's own stylesheet by Learn,
   the lessons, the tool list, the tools and the AMS guide. Navy and red only.

   The look: a graph-paper band behind the top of every page, white cards with a soft
   frosted edge, crisp line icons in white "instrument" chips with a small red light, and
   on each topic tile an icon-only diagram of one relationship from its field.
   Motion: one slow drift behind the Learn home hero and the tile sweeps, paused off screen
   (js/ssn-icons.js) and off entirely under prefers-reduced-motion.
   Tool pages keep their dark theme untouched: every rule here sits under :root:not([data-theme="dark"]). */

:root {
  --b-navy: #03202f; --b-navy-2: #0a4a68; --b-navy-tint: #d7e3e9; --b-navy-wash: #eef3f6;
  --b-red: #bd202e; --b-red-tint: #f4cbcf; --b-red-wash: #fbeaec;
  --b-ink-2: #3d5361; --b-ink-3: #5d6d79; --b-bg: #f4f6f7;
  --b-edge: rgba(3, 32, 47, .12); --b-edge-hi: rgba(3, 32, 47, .28); /* .12, not the mockup's .09: card edges stay visible in bright sun */
  --b-card: rgba(255, 255, 255, .8);
  --b-shadow: 0 1px 2px rgba(3, 32, 47, .04), 0 8px 24px rgba(3, 32, 47, .05);
  --b-shadow-hi: 0 2px 4px rgba(3, 32, 47, .06), 0 18px 40px rgba(3, 32, 47, .12);
}

/* ---- the graph-paper band: fades into the page below the first screen ---- */
:root:not([data-theme="dark"]) body {
  background-color: var(--b-bg);
  background-image:
    linear-gradient(180deg, rgba(244, 246, 247, 0) 0, rgba(244, 246, 247, .55) 360px, var(--b-bg) 620px),
    linear-gradient(rgba(3, 32, 47, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(3, 32, 47, .055) 1px, transparent 1px),
    linear-gradient(rgba(3, 32, 47, .028) 1px, transparent 1px), linear-gradient(90deg, rgba(3, 32, 47, .028) 1px, transparent 1px);
  background-size: 100% 100%, 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  background-repeat: no-repeat, repeat, repeat, repeat, repeat;
}

/* ---- icons ---- */
.ssn-ic { width: 20px; height: 20px; flex: none; }
.ico svg { stroke-width: 1.75; }

/* The instrument chip: white, navy line icon, small red light. */
.b-medal, .tile .ico, .phead-t .ico, .grp-h > .ico {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; padding: 0; border-radius: 12px;
  background: #fff; color: var(--b-navy); border: 1px solid rgba(3, 32, 47, .14); box-shadow: 0 2px 6px rgba(3, 32, 47, .08);
}
.b-medal .ssn-ic, .tile .ico svg, .grp-h > .ico svg { width: 22px; height: 22px; }
.b-medal::after, .tile .ico::after, .phead-t .ico::after, .grp-h > .ico::after {
  content: ""; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--b-red); box-shadow: 0 0 0 3px rgba(189, 32, 46, .12);
}
.phead-t .ico { width: 60px; height: 60px; border-radius: 16px; }
.phead-t .ico svg { width: 30px; height: 30px; }
.phead-t .ico::after { top: 8px; right: 8px; }

/* ---- cards: white with a frosted edge ---- */
.tile, .door:not(.main), .qcard, .ev-card, .orient, .edu-strip, .block, .side .card, .pitem, .mis:not(.is-case), .quick, .week-door,
.tc-sec, .tc-card, .learning-page .lesson-card, main.lesson-v2 .card {
  background: var(--b-card); border: 1px solid var(--b-edge); box-shadow: var(--b-shadow);
}
/* Blur only on the larger panels; long lists stay solid so phones stay smooth. */
.tile, .door:not(.main), .ev-card, .tc-sec, main.lesson-v2 > .card:first-of-type { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tile, .door:not(.main), .qcard, .ev-card, .orient, .edu-strip, .block, .side .card, .pitem, .mis:not(.is-case), .quick, .week-door,
  .tc-sec, .tc-card, .learning-page .lesson-card, main.lesson-v2 .card { background: #fff; }
}
.tile, .door:not(.main), .qcard, .pitem, .tc-card, .next-main, .week-door, .mis:not(.is-case) {
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.tile:hover, .tile:focus-visible, .door:not(.main):hover, .door:not(.main):focus-visible, .qcard:hover, .pitem:hover,
.tc-card:hover, .tc-card:focus-visible, .next-main:hover, .week-door:hover, .mis:not(.is-case):hover {
  transform: translateY(-3px); border-color: var(--b-edge-hi); box-shadow: var(--b-shadow-hi);
}

/* ---- Learn home ---- */
.hb { position: relative; isolation: isolate; }
.hb::before { /* a soft navy glow that drifts slowly behind the book */
  content: ""; position: absolute; z-index: -1; pointer-events: none; inset: -10% -6% -10% 30%;
  background: radial-gradient(34% 40% at 70% 45%, rgba(10, 74, 104, .13), transparent 70%), radial-gradient(24% 28% at 20% 80%, rgba(189, 32, 46, .07), transparent 70%);
  animation: b-drift 30s ease-in-out infinite alternate; will-change: transform;
}
.hb.is-off::before, .b-hidden .hb::before { animation-play-state: paused; }
@keyframes b-drift { from { transform: translate3d(-3%, 2%, 0); } to { transform: translate3d(3%, -2%, 0); } }
.cta-row .btn.big { background: var(--b-navy); box-shadow: 0 10px 24px rgba(3, 32, 47, .18); transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease; }
.cta-row .btn.big:hover { background: var(--b-navy-2); transform: translateY(-2px); }
.cta-row .btn.big.red { background: #fff; color: var(--b-red); border: 1px solid var(--b-red-tint); box-shadow: 0 4px 14px rgba(3, 32, 47, .06); }
.cta-row .btn.big.red:hover { background: #fff; border-color: var(--b-red); }
.proof .nums { padding: 12px 18px; border: 1px solid var(--b-edge); border-radius: 14px; background: var(--b-card); box-shadow: var(--b-shadow); gap: 0; }
.proof .nums div { padding: 0 20px; }
.proof .nums div:first-child { padding-left: 0; }
.proof .nums div + div { border-left: 1px solid var(--b-navy-tint); }
.proof .nums span { color: var(--b-ink-3); }

/* Doors with an instrument chip (data-b-icon), and the course cards. */
.door[data-b-icon] { position: relative; padding-left: 86px; }
.door[data-b-icon] > .b-medal { position: absolute; left: 24px; top: 24px; }
.door[href^="path.html"] { border-top: 3px solid var(--b-navy); }
.door .lab { color: var(--b-red); }
.door:not(.main) .cta { display: inline-flex; align-items: center; gap: 6px; }

/* Topic tiles use one symbol. The title and description carry the detail. */
.tile { border-radius: 16px; overflow: hidden; isolation: isolate; }
.tile .b { color: var(--b-ink-2); }
.tile .c { color: var(--b-ink-3); }
.b-topic-symbol {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px;
  color: var(--b-navy); background: var(--b-navy-wash); border: 1px solid rgba(3, 32, 47, .12);
  border-radius: 18px; transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.b-topic-symbol svg { display: block; width: 34px; height: 34px; }
.tile:hover .b-topic-symbol, .tile:focus-visible .b-topic-symbol {
  color: var(--b-red); background: var(--b-red-wash); border-color: rgba(189, 32, 46, .24);
}

/* ---- other Learn pages ---- */
.phead-t { gap: 20px; }
.qtopic .ico { background: #fff; border: 1px solid rgba(3, 32, 47, .14); }
.pitem > .ico { background: #fff; border: 1px solid rgba(3, 32, 47, .14); }
.pitem .num { box-shadow: inset 0 0 0 1px rgba(3, 32, 47, .1); }
.ev-check { border-left: 4px solid var(--b-red); }
.edu-strip { border-radius: 18px; background: linear-gradient(120deg, #fff, var(--b-navy-wash)); }

/* ---- lessons ---- */
main.lesson-v2 .card { border-radius: 18px; }
main.lesson-v2 .card:hover { box-shadow: var(--b-shadow-hi); }
main.lesson-v2 > .card:first-of-type { /* the title sits on graph paper that fades out before the reading starts */
  background-color: #fff;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .2) 0, #fff 150px),
    linear-gradient(rgba(3, 32, 47, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(3, 32, 47, .05) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px, 24px 24px;
  background-repeat: no-repeat, repeat, repeat;
}
main.lesson-v2 .choice { transition: transform .2s ease, border-color .2s ease, background-color .2s ease; }
main.lesson-v2 .choice:hover:not([disabled]) { transform: translateX(3px); }

/* ---- the tool list ---- */
.tc-sec { border-radius: 20px; padding: 22px 24px 24px; position: relative; }
.tc-sec-head { align-items: center; gap: 6px 14px; }
.tc-sec-head > .b-medal { order: -1; }
.tc-card { border-radius: 14px; background: #fff; }
.tc-tag { border-radius: 6px; }
.tc-search { border-radius: 14px; box-shadow: var(--b-shadow); border-color: var(--b-edge); }
.tc-index a { align-items: center; }
.tc-index a em { flex: 1; font-style: normal; }
.tc-index a .ssn-ic { width: 18px; height: 18px; color: var(--b-navy-2); }
.tc-index a[aria-current], .tc-index a:hover { color: var(--b-navy); }

/* ---- tool pages: lighter touch; the charts are left alone ---- */
:root:not([data-theme="dark"]) .tool-main .calc-card { border-color: var(--b-edge); box-shadow: var(--b-shadow); border-radius: 16px; }

/* ---- the AMS guide: lighter touch ---- */
.learning-page .lesson-card { border-radius: 18px; }
.learning-page .build-step-list a { border-radius: 10px; }

/* ---- phones ---- */
@media (max-width: 760px) {
  .proof .nums { width: 100%; justify-content: space-between; padding: 12px 14px; }
  .proof .nums div { padding: 0 10px; }
  .door[data-b-icon] { padding-left: 24px; padding-top: 84px; }
}
@media (max-width: 640px) {
  .tc-sec { padding: 16px; }
}

/* ---- motion off for people who ask for less ---- */
@media (prefers-reduced-motion: reduce) {
  .hb::before { animation: none !important; }
  .tile, .door, .qcard, .pitem, .tc-card, .next-main, .week-door, .mis, main.lesson-v2 .choice, .cta-row .btn.big { transition: none !important; }
  .tile:hover, .tile:focus-visible, .door:hover, .door:focus-visible, .qcard:hover, .pitem:hover, .tc-card:hover, .tc-card:focus-visible,
  .next-main:hover, .week-door:hover, .mis:hover, main.lesson-v2 .choice:hover:not([disabled]), .cta-row .btn.big:hover { transform: none !important; }
}

/* ---- print: plain white paper ---- */
@media print {
  body { background: #fff !important; background-image: none !important; }
  .hb::before, .b-topic-symbol { display: none !important; }
  .tile, .door, .qcard, .ev-card, .block, .card, .pitem, .tc-sec, .tc-card { background: #fff !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
