/* ==========================================================================
   Hall of Foundations — annex component layer
   Cipher Museum · Smithsonian Dark / Scholarly Gold
   Loads AFTER css/museum.css and styles the wing's exhibit components with
   the museum's tokens (surfaces --s1..--s5, text --tx/--tx2/--tx3, accents
   --gold/--red/--green, fonts --fd/--fb/--fm). The wing's original
   ink-on-vellum palette survives only as semantic aliases so the exhibits'
   SVG and JS can keep addressing one name per role.
   ========================================================================== */

:root {
  /* Semantic aliases onto museum tokens. museum.css owns the raw values;
     --gold is museum's own token and is deliberately not redefined here. */
  --ink: var(--tx);              /* primary foreground (was dark ink) */
  --ink-soft: var(--tx2);        /* secondary foreground */
  --vellum: var(--s1);           /* page-level surface (was vellum) */
  --vellum-deep: var(--s4);
  --parchment: var(--s2);        /* raised panel surface (was parchment) */
  --vermilion: var(--red);       /* the wing's accent, museum red */
  --vermilion-soft: #d98a7a;
  --rule: var(--s5);
  --muted: var(--tx3);
  --teal: var(--green);          /* secondary accent for data/second-object */
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 28px; }
.wrap-wide { max-width: 1040px; margin: 0 auto; padding: 0 28px; }

/* ---- masthead (hall banner beneath the museum nav) ---- */
.masthead {
  border-bottom: 1px solid var(--gold-b);
  padding: 22px 0 14px;
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 8px;
}
.masthead .home, .masthead .hall {
  font: 600 0.72rem/1 var(--fm);
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-dim);
  text-decoration: none;
}
.masthead .home:hover { color: var(--gold); }

/* ---- hero ---- */
.hero { padding: 60px 0 36px; }
.hero .kicker {
  font: 600 0.78rem/1 var(--fm);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--vermilion); margin-bottom: 22px;
}
.hero h1 {
  font-weight: 600; font-size: clamp(2.3rem, 6vw, 4rem);
  line-height: 1.1; margin-bottom: 22px; color: var(--tx);
}
.hero .standfirst {
  font-size: clamp(1.05rem, 2.2vw, 1.26rem);
  color: var(--ink-soft); max-width: 620px;
}

/* ---- honesty / note banner ---- */
.honesty {
  margin: 8px 0 48px;
  border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, var(--gold-glow), transparent);
  padding: 16px 20px; font-size: 0.98rem; color: var(--ink-soft);
}
.honesty strong { color: var(--ink); font-variant: small-caps; letter-spacing: 0.03em; }

/* ---- section scaffolding ---- */
section.exhibit { padding: 30px 0; border-top: 1px solid var(--rule); }
.step-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.step-num {
  font: 600 0.82rem/1 var(--fm);
  color: var(--vermilion); letter-spacing: 0.1em; flex: none; padding-top: 6px;
}
.step-head h2 {
  font-weight: 600; font-size: clamp(1.5rem, 3.4vw, 2rem);
  line-height: 1.2; color: var(--tx);
}
section.exhibit p { margin: 0 0 16px; max-width: 680px; }
section.exhibit p .term { font-style: italic; color: var(--gold-lt); }
.aside {
  font-size: 0.9rem; color: var(--muted); font-style: italic;
  border-top: 1px dotted var(--rule); padding-top: 12px; margin-top: 6px;
}
.eq {
  font: 500 1.05rem/1.5 var(--fm);
  background: var(--s3); border: 1px solid var(--s5);
  padding: 14px 18px; margin: 6px 0 20px; display: inline-block;
  color: var(--gold-lt); border-radius: var(--r);
}

/* ---- interactive lab frame ---- */
.lab {
  background: var(--parchment); border: 1px solid var(--s4);
  border-radius: var(--rl); margin: 8px 0 20px; overflow: hidden;
  box-shadow: var(--sh);
}
.lab-stage { position: relative;
  background: radial-gradient(ellipse at 50% 40%, #22222c 0%, var(--parchment) 70%); }
.lab svg, .lab canvas { display: block; width: 100%; height: auto; touch-action: manipulation; }
.lab-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 16px; border-top: 1px solid var(--s4); background: var(--s1);
}
.lab-bar button {
  font: 600 0.8rem/1 var(--fm); letter-spacing: 0.04em;
  background: var(--gold); color: var(--black); border: none;
  padding: 10px 16px; border-radius: var(--r); cursor: pointer; transition: background 0.15s;
}
.lab-bar button:hover { background: var(--gold-lt); }
.lab-bar button.ghost { background: transparent; color: var(--tx2); border: 1px solid var(--s5); }
.lab-bar button.ghost:hover { border-color: var(--gold); color: var(--gold); }
.lab-bar label {
  font: 600 0.78rem/1 var(--fm); color: var(--muted);
  letter-spacing: 0.04em; display: flex; align-items: center; gap: 8px;
}
.lab-bar input[type=range] { accent-color: var(--gold); cursor: pointer; }
.lab-bar select {
  font: 600 0.78rem var(--fm); padding: 7px 10px;
  border: 1px solid var(--s5); border-radius: var(--r); background: var(--s3); color: var(--tx);
}
.lab-bar .readout {
  font: 500 0.82rem/1.4 var(--fm);
  color: var(--muted); margin-left: auto; text-align: right;
}
.lab-bar .readout b { color: var(--gold-lt); }
.lab-hint {
  padding: 10px 16px; font-size: 0.86rem; color: var(--muted);
  background: var(--s1); border-top: 1px dotted var(--s4);
}
.lab-hint kbd {
  font: 600 0.78rem var(--fm); background: var(--s3);
  border: 1px solid var(--s5); border-radius: 3px; padding: 1px 6px; color: var(--gold-lt);
}

/* ---- accessible fallback controls (keyboard alternative to pointer labs) ---- */
.vh {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.a11y-fallback {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 12px 16px; border-top: 1px dotted var(--s4); background: var(--s1);
}
.a11y-fallback label {
  font: 600 0.78rem/1 var(--fm); color: var(--muted);
  letter-spacing: 0.04em; display: flex; align-items: center; gap: 8px;
}
.a11y-fallback select {
  font: 600 0.78rem var(--fm); padding: 7px 10px;
  border: 1px solid var(--s5); border-radius: var(--r);
  background: var(--s3); color: var(--tx);
}
.a11y-fallback button {
  font: 600 0.78rem/1 var(--fm); letter-spacing: 0.04em;
  background: var(--gold); color: var(--black); border: none;
  padding: 9px 15px; border-radius: var(--r); cursor: pointer;
}
.a11y-fallback button:hover { background: var(--gold-lt); }
svg.curve { display: block; width: 100%; height: auto; touch-action: manipulation; }

/* ---- pull quote ---- */
.pull {
  font-size: clamp(1.3rem, 3.2vw, 1.8rem); font-style: italic; line-height: 1.3;
  color: var(--tx); border-left: 3px solid var(--vermilion);
  padding: 6px 0 6px 24px; margin: 20px 0; max-width: 640px;
}

/* ---- ladder / list ---- */
.ladder { list-style: none; margin: 6px 0 20px; }
.ladder li {
  display: grid; grid-template-columns: 150px 1fr; gap: 18px;
  padding: 14px 0; border-bottom: 1px solid var(--s4); align-items: baseline;
}
.ladder li:last-child { border-bottom: none; }
.ladder .rung {
  font: 600 0.78rem/1.3 var(--fm);
  color: var(--vermilion); letter-spacing: 0.04em; text-transform: uppercase;
}
.ladder .rung span { display: block; color: var(--muted); font-weight: 500;
  text-transform: none; letter-spacing: 0; margin-top: 3px; }
.ladder .gloss { color: var(--ink-soft); font-size: 0.98rem; }

/* ---- crypto connection card ---- */
.connect { background: var(--s2); color: var(--tx2); border: 1px solid var(--gold-b);
  border-radius: var(--rl); padding: 34px 32px; margin: 12px 0 24px; }
.connect h3 { font-weight: 600; font-size: 1.35rem; margin-bottom: 14px; color: var(--tx); }
.connect p { color: var(--tx2); max-width: none; }
.connect .flag {
  font: 600 0.72rem/1 var(--fm); letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--vermilion); margin-bottom: 16px;
}
.connect strong { color: var(--gold-lt); }
.connect a { color: var(--gold); }

/* ==========================================================================
   INDEX PAGE
   ========================================================================== */
.wing-intro { padding: 8px 0 30px; max-width: 680px; }
.wing-intro p { margin-bottom: 16px; color: var(--ink-soft); font-size: 1.08rem; }

.group-label {
  font: 600 0.76rem/1 var(--fm); letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--vermilion);
  padding: 34px 0 4px; border-top: 1px solid var(--s4); margin-top: 20px;
}
.group-label:first-of-type { border-top: none; }
.group-sub { font-size: 0.94rem; color: var(--muted); font-style: italic; margin-bottom: 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px;
  background: var(--s4); border: 1px solid var(--s4); }
.card {
  background: var(--s2); padding: 22px 22px 20px; text-decoration: none;
  color: var(--tx); display: flex; flex-direction: column; gap: 8px;
  transition: background 0.15s, transform 0.15s; min-height: 150px;
}
.card:hover { background: var(--s3); }
.card .cnum { font: 600 0.72rem/1 var(--fm); color: var(--vermilion); letter-spacing: 0.1em; }
.card h3 { font-weight: 600; font-size: 1.18rem; line-height: 1.2; color: var(--tx); }
.card .sym { font-family: var(--fm); color: var(--teal); font-size: 0.92rem; }
.card p { font-size: 0.9rem; color: var(--muted); line-height: 1.45; margin-top: auto; }

/* ---- responsive / motion (a11y + focus states come from museum.css) ---- */
@media (max-width: 560px) {
  .ladder li { grid-template-columns: 1fr; gap: 4px; }
  .lab-bar .readout { margin-left: 0; width: 100%; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
