/* ============================================================
   Antimony Magnetic Resonance Workbench
   Palette: warm near-black, cream, copper, silicon-blue
   ============================================================ */

:root {
  /* Surfaces — warm near-black, not pure */
  --ink-0:    #0a0907;
  --ink-1:    #100e0b;
  --ink-2:    #181410;
  --ink-3:    #211c17;

  /* Rules */
  --rule-1:   #2a241d;
  --rule-2:   #3a322a;

  /* Type — warm cream, three steps */
  --cream-1:  #f1ead9;
  --cream-2:  #c7bda9;
  --cream-3:  #837a6b;
  --cream-4:  #524a3f;

  /* Accents */
  --copper:   #d4a263;   /* warm — for symbols, hover, focus */
  --copper-d: #b3854a;
  --silicon:  #8db4ca;   /* cool — for live readouts (the things you change) */
  --silicon-d:#6594ad;

  /* Type system */
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", "Times New Roman", serif;

  /* Geometry */
  --max:   980px;
  --pad:   clamp(1.25rem, 3vw, 2.25rem);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink-0);
  color: var(--cream-1);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body {
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(212,162,99,0.05), transparent 60%),
    radial-gradient(900px 500px at 110% 20%, rgba(141,180,202,0.035), transparent 60%),
    var(--ink-0);
  min-height: 100vh;
}

/* Subtle grain — keeps dark surfaces from looking flat */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.workbench {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vh, 5rem) var(--pad) 6rem;
}

/* Allow specific blocks to break out of the centered column to full viewport width. */
.full-bleed,
.hero {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
}

/* ============================================================
   Masthead
   ============================================================ */

.masthead {
  margin-bottom: clamp(3rem, 8vh, 5rem);
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 1.5rem;
  display: inline-flex;
  align-items: center;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--copper);
  margin-right: 0.9rem;
  vertical-align: middle;
}

.masthead h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--cream-1);
}

.masthead h1 .punct {
  color: var(--copper);
  font-weight: 400;
}

.lede {
  margin: 0;
  max-width: 56ch;
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--cream-2);
  line-height: 1.65;
}

/* ============================================================
   Section heads — editorial, numbered, with rule
   ============================================================ */

.section {
  margin-top: clamp(2.5rem, 6vh, 4rem);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule-1);
}

.section-num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--copper);
  letter-spacing: 0.02em;
}

.section-head h2 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cream-1);
}

.section-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--rule-2), transparent);
}

.section-tag {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-3);
  font-weight: 400;
}

/* ============================================================
   Controls — sliders with big editorial readouts
   ============================================================ */

.panel-body {
  display: block;
}

.control,
.constant {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto auto;
  grid-template-areas:
    "label    readout"
    "slider   slider"
    "scale    scale"
    "hint     hint";
  column-gap: 2rem;
  row-gap: 0.6rem;
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--rule-1);
  align-items: baseline;
}

.control:last-child,
.constant:last-child {
  border-bottom: none;
}

/* Label cluster */
.control-label,
.const-head {
  grid-area: label;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.caps {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-2);
}

.sym {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--copper);
}

.sym sub, .sym sup { font-style: normal; }

/* Big readout */
.readout,
.const-readout {
  grid-area: readout;
  text-align: right;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.readout .num {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 200;
  letter-spacing: -0.02em;
  color: var(--silicon);   /* live values pop cool */
}

.readout .unit {
  font-size: 1rem;
  font-weight: 400;
  color: var(--cream-3);
  margin-left: 0.15em;
  letter-spacing: 0.02em;
}

.const-readout .num {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 200;
  letter-spacing: -0.01em;
  color: var(--cream-1);   /* constants are warm cream — they don't change */
}

.const-readout .exp {
  font-size: 1rem;
  color: var(--cream-2);
  font-weight: 300;
}

.const-readout .exp:not(:empty) {
  margin-left: 0.4em;
}

.const-readout .unit {
  font-size: 1rem;
  color: var(--cream-3);
}

.const-readout .unit:not(:empty) {
  margin-left: 0.4em;
}

/* Slider */
.control input[type="range"] {
  grid-area: slider;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  background: var(--rule-2);
  border-radius: 1px;
  outline: none;
  margin: 1rem 0 0.25rem;
  cursor: pointer;
}

.control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cream-1);
  border: 1px solid var(--copper);
  cursor: grab;
  box-shadow:
    0 0 0 4px rgba(212,162,99,0.0),
    0 2px 8px rgba(0,0,0,0.5);
  transition: box-shadow 0.18s ease, transform 0.12s ease;
}

.control input[type="range"]::-webkit-slider-thumb:hover,
.control input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 0 0 6px rgba(212,162,99,0.12),
    0 2px 8px rgba(0,0,0,0.5);
  transform: scale(1.05);
}

.control input[type="range"]:active::-webkit-slider-thumb {
  cursor: grabbing;
  background: var(--copper);
}

.control input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cream-1);
  border: 1px solid var(--copper);
  cursor: grab;
}

.scale {
  grid-area: scale;
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--cream-4);
  font-variant-numeric: tabular-nums;
  margin-top: 0.25rem;
}

.hint {
  grid-area: hint;
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--cream-3);
  max-width: 64ch;
  font-weight: 300;
  line-height: 1.6;
}

/* ============================================================
   Constants — like controls but no slider, click to copy
   ============================================================ */

.constant {
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "label    readout"
    "formula  formula"
    "hint     hint";
  padding-left: 0.5rem;
  margin-left: -0.5rem;
  padding-right: 0.5rem;
  margin-right: -0.5rem;
  border-radius: 4px;
  transition: background 0.18s ease;
  position: relative;
}

.constant .formula {
  grid-area: formula;
  margin: 0.4rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--cream-2);
  letter-spacing: 0.005em;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.constant .formula sub,
.constant .formula sup {
  font-style: normal;
}

.constant .formula .op {
  font-style: normal;
  color: var(--cream-3);
  margin: 0 0.25em;
}

.constant .formula .formula-note {
  display: block;
  font-style: italic;
  color: var(--cream-3);
  font-size: 0.85em;
  margin-top: 0.15rem;
  letter-spacing: 0;
}

.constant.copyable {
  cursor: pointer;
}

.constant::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 50%;
  width: 2px;
  height: 0;
  background: var(--copper);
  transform: translateY(-50%);
  transition: height 0.18s ease;
}

.constant.copyable:hover {
  background: rgba(212,162,99,0.025);
}

.constant.copyable:hover::before {
  height: 40%;
}

.constant.copied {
  background: rgba(212,162,99,0.08);
}

.constant.copied::after {
  content: "Copied";
  position: absolute;
  top: 1.5rem;
  right: 0;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper);
  animation: fade 0.6s ease;
}

@keyframes fade {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Tabs — pill switcher inside a detail panel
   ============================================================ */

.tabs {
  margin: 0.25rem 0 0.5rem;
}

.tab-bar {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.3rem;
  background: var(--ink-2);
  border: 1px solid var(--rule-1);
  border-radius: 999px;
  margin-bottom: 1rem;
}

.tab-pill {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--cream-3);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.tab-pill:hover { color: var(--cream-1); }

.tab-pill:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.tab-pill.active {
  background: var(--ink-0);
  color: var(--copper);
  box-shadow: 0 0 0 1px var(--rule-2);
}

.tab-count {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--cream-4);
  letter-spacing: 0;
  background: var(--ink-1);
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  min-width: 1.4em;
  text-align: center;
}

.tab-pill.active .tab-count {
  color: var(--copper-d);
  background: var(--ink-2);
}

/* ============================================================
   Subhead — group separator inside detail panels
   ============================================================ */

.subhead {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--cream-3);
}

.subhead:first-child {
  margin-top: 0.25rem;
}

.subhead-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--rule-1), transparent);
}

/* ============================================================
   Hero — live Zeeman ladder (full-bleed band)
   ============================================================ */

.hero {
  background:
    radial-gradient(900px 360px at 50% 60%, rgba(141,180,202,0.06), transparent 70%),
    linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(212,162,99,0.02) 50%, rgba(0,0,0,0) 100%),
    var(--ink-1);
  border-top:    1px solid var(--rule-1);
  border-bottom: 1px solid var(--rule-1);
  margin-top:    clamp(2rem, 5vh, 3rem);
  margin-bottom: clamp(2rem, 5vh, 3rem);
  padding:       clamp(1.5rem, 4vh, 2.5rem) clamp(1rem, 4vw, 3rem) clamp(1rem, 3vh, 2rem);
  display:       flex;
  flex-direction: column;
  align-items:   center;
  justify-content: center;
  gap:           1.25rem;
}

.hero-head,
.hero-foot {
  width: 100%;
  display: flex;
  justify-content: center;
}

.hero-stage {
  width: 100%;
  display: flex;
  justify-content: center;
  flex: 1;
}

/* ----- Atom selector pill bar ----- */

.atom-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.3rem;
  background: var(--ink-2);
  border: 1px solid var(--rule-1);
  border-radius: 14px;
  max-width: 100%;
}

.atom-pill {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  padding: 0.5rem 1.1rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  color: var(--cream-3);
  font-family: var(--sans);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  min-width: 4.5rem;
}

.atom-pill:hover { color: var(--cream-1); }

.atom-pill:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.atom-pill.active {
  background: var(--ink-0);
  color: var(--copper);
  box-shadow: 0 0 0 1px var(--rule-2);
}

.atom-pill .atom-symbol {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.1;
}

.atom-pill .atom-symbol sup {
  font-style: normal;
}

.atom-pill .atom-spin {
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-4);
  font-style: normal;
  font-weight: 500;
}

.atom-pill.active .atom-spin {
  color: var(--copper-d);
}

/* ----- Physics chain (input → energy → regime) ----- */

.physics-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: var(--serif);
  font-variant-numeric: tabular-nums;
  color: var(--cream-2);
  padding: 0.5rem 1rem;
  max-width: 100%;
}

.chain-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.chain-section.ratio {
  border-left: 1px solid var(--rule-1);
  padding-left: 1.5rem;
}

.chain-row {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  white-space: nowrap;
  font-size: 0.95rem;
}

.chain-sym {
  color: var(--copper);
  font-style: italic;
  font-size: 1rem;
  min-width: 1.6em;
}

.chain-sym i  { font-style: italic; }
.chain-sym sub { font-style: normal; }

.chain-eq {
  color: var(--cream-4);
  font-style: normal;
  font-family: var(--sans);
  font-weight: 300;
}

.chain-formula {
  color: var(--cream-3);
  font-style: italic;
  font-size: 0.9rem;
}

.chain-formula i { font-style: italic; }

.chain-val {
  color: var(--silicon);
  font-style: normal;
  font-family: var(--sans);
  font-weight: 300;
}

.chain-val .num  { color: var(--silicon); font-weight: 400; }
.chain-val .unit { color: var(--cream-3); }

.chain-val.ratio-val {
  color: var(--cream-1);
  font-weight: 500;
  font-size: 1.05rem;
}

.chain-arrow {
  color: var(--cream-4);
  font-size: 1.2rem;
  font-family: var(--sans);
}

.regime-row {
  align-items: center;
  gap: 0.55rem;
}

.regime-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cream-4);
  display: inline-block;
  transition: background 0.2s ease;
}

.regime-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--cream-3);
  font-style: normal;
}

.chain-section.ratio[data-regime="polarised"]    .regime-dot   { background: var(--copper); box-shadow: 0 0 8px rgba(212,162,99,0.5); }
.chain-section.ratio[data-regime="polarised"]    .regime-label { color: var(--copper); }
.chain-section.ratio[data-regime="transitional"] .regime-dot   { background: var(--cream-2); }
.chain-section.ratio[data-regime="transitional"] .regime-label { color: var(--cream-2); }
.chain-section.ratio[data-regime="thermal"]      .regime-dot   { background: var(--silicon); box-shadow: 0 0 8px rgba(141,180,202,0.4); }
.chain-section.ratio[data-regime="thermal"]      .regime-label { color: var(--silicon); }

@media (max-width: 720px) {
  .physics-chain { gap: 0.8rem; }
  .chain-section.ratio {
    border-left: none;
    border-top: 1px solid var(--rule-1);
    padding-left: 0;
    padding-top: 0.6rem;
  }
  .chain-arrow { display: none; }
}

/* ----- SET-readout trace (oscilloscope-style telegraph signal) ----- */

.set-trace {
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.5rem;
  font-family: var(--sans);
  color: var(--cream-2);
}

.trace-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-3);
  font-weight: 500;
  padding: 0 0.3rem;
}

.trace-title {
  color: var(--copper);
}

.trace-tuning {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.trace-tuning .tuning-label {
  color: var(--cream-4);
  font-weight: 500;
}

.trace-tuning .tuning-value {
  color: var(--cream-1);
  font-weight: 500;
  letter-spacing: 0.05em;
  min-width: 4em;
  text-align: right;
}

.resonance-badge {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  font-weight: 600;
  padding: 0.18em 0.55em;
  border-radius: 999px;
  border: 1px solid var(--rule-2);
  color: var(--cream-4);
  background: transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.resonance-badge[data-state="on"] {
  color: var(--copper);
  border-color: var(--copper);
  background: rgba(212,162,99,0.08);
  box-shadow: 0 0 12px rgba(212,162,99,0.25);
}

.trace-substat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-variant-numeric: tabular-nums;
}

.trace-substat .flip-count {
  color: var(--cream-1);
  font-weight: 600;
}

.trace-divider {
  color: var(--cream-4);
}

.trace-window {
  color: var(--cream-4);
}

.trace-body {
  position: relative;
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  align-items: stretch;
  height: clamp(220px, 32vh, 320px);
  border-top:    1px solid var(--rule-1);
  border-bottom: 1px solid var(--rule-1);
  background:
    linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 75%, rgba(0,0,0,0.25) 100%);
}

.trace-y-axis {
  position: relative;
  border-right: 1px solid var(--rule-1);
}

.trace-y-axis .y-tick {
  position: absolute;
  right: 0.6rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--copper);
  transform: translateY(-50%);
  font-variant-numeric: tabular-nums;
}

.trace-y-axis .y-tick.high { top: 18%; }
.trace-y-axis .y-tick.low  { top: 82%; }

.trace-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.trace-x-axis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-left: 3.5rem;            /* align with start of canvas (after y-axis col) */
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--cream-4);
  font-variant-numeric: tabular-nums;
}

.trace-x-axis > :nth-child(1) { text-align: left;   padding-left: 0.3rem; }
.trace-x-axis > :nth-child(2) { text-align: center; }
.trace-x-axis > :nth-child(3) { text-align: right;  padding-right: 0.3rem; }

.trace-x-axis .now-mark { color: var(--copper); font-weight: 500; }

/* ----- Atom info bar ----- */

.atom-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  font-family: var(--sans);
  justify-content: center;
}

.atom-info .info-pair {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  white-space: nowrap;
}

.atom-info .info-label {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--cream-4);
  font-style: normal;
}

.atom-info .info-label i {
  font-style: italic;
  font-family: var(--serif);
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  color: var(--cream-3);
}

.atom-info .info-value {
  font-size: 0.88rem;
  color: var(--cream-1);
  font-variant-numeric: tabular-nums;
  font-weight: 300;
}

/* ============================================================
   Navigation strip — section cards with live summaries
   ============================================================ */

.nav-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
}

.nav-card {
  appearance: none;
  -webkit-appearance: none;
  background: var(--ink-1);
  border: 1px solid var(--rule-1);
  border-radius: 8px;
  padding: 1rem 1.25rem 1.1rem;
  color: var(--cream-1);
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "meta     chevron"
    "summary  chevron";
  align-items: center;
  gap: 0.25rem 1rem;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
  position: relative;
}

.nav-card:hover:not(:disabled) {
  background: var(--ink-2);
  border-color: var(--rule-2);
}

.nav-card:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.nav-card:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.nav-card.open {
  background: var(--ink-2);
  border-color: var(--copper);
  box-shadow: 0 6px 24px rgba(212,162,99,0.06);
}

.nav-card .card-meta {
  grid-area: meta;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.nav-card .card-num {
  font-family: var(--serif);
  font-style: italic;
  color: var(--copper);
  font-size: 0.95rem;
}

.nav-card .card-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.nav-card .card-summary {
  grid-area: summary;
  font-size: 0.95rem;
  font-family: var(--sans);
  color: var(--silicon);
  font-variant-numeric: tabular-nums;
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-card .card-summary .muted { color: var(--cream-4); font-style: italic; }

.nav-card .card-chevron {
  grid-area: chevron;
  color: var(--cream-3);
  font-size: 0.9rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.nav-card.open .card-chevron {
  color: var(--copper);
  transform: rotate(180deg);
}

/* ============================================================
   Detail panel — accordion content
   ============================================================ */

.detail-panel {
  margin-top: 1rem;
  padding: 0;
  overflow: hidden;
  transition: padding 0.2s ease;
}

.detail-panel:not(.is-open) {
  padding: 0;
}

.detail-panel.is-open {
  padding: 1rem 0 0;
  animation: slide-in 0.22s ease;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 720px) {
  .nav-strip { grid-template-columns: 1fr; }
  .hero      { min-height: min(35vh, 320px); }
}

@media (max-width: 600px) {
  .control,
  .constant {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "readout"
      "slider"
      "scale"
      "hint";
    row-gap: 0.6rem;
  }
  .constant {
    grid-template-areas:
      "label"
      "readout"
      "hint";
  }
  .readout,
  .const-readout {
    text-align: left;
  }
  .section-tag { display: none; }
}

/* Reset some sub/sup baseline shenanigans */
sub, sup {
  font-size: 0.65em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sup { top: -0.5em; }
sub { bottom: -0.25em; }
