/* ==========================================================================
   Components - "Refraction" theme (PRISM family): dark, rounded, spectrum-lit.
   Modern cards with a spectrum top-edge, glass nav, pill buttons, glow.
   ========================================================================== */

/* --- Site header / nav (glass + spectrum rule) -------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 10, 26, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header::before { content: ""; display: block; height: 3px; background: var(--spectrum); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 72px; flex-wrap: wrap; }
.wordmark { display: flex; flex-direction: column; line-height: 1; text-decoration: none; }
.wordmark__name { font-family: var(--font-display); font-size: 1.18rem; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
.wordmark__sub { font-size: 0.6rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--brass-500); margin-top: 5px; font-weight: 700; }
.wordmark__spectrum { display: inline-block; width: 34px; height: 3px; margin-top: 7px; border-radius: 3px; background: var(--spectrum); }

.nav { display: flex; align-items: center; gap: var(--space-4); }
.nav__list { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0; align-items: center; }
.nav__link {
  font-size: 0.84rem; font-weight: 600; color: var(--ink-700); text-decoration: none;
  padding: 8px 14px; border-radius: 999px; transition: var(--dur) var(--ease); white-space: nowrap;
}
.nav__link:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.nav__link[aria-current="page"] { color: #1a1330; background: var(--brass-500); }

.nav__toggle {
  display: none; background: rgba(255,255,255,.05); border: 1px solid var(--line-strong);
  border-radius: 999px; width: 46px; height: 42px; cursor: pointer; align-items: center; justify-content: center;
}
.nav__toggle span, .nav__toggle span::before, .nav__toggle span::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--ink-900); position: relative; transition: var(--dur);
}
.nav__toggle span::before { position: absolute; top: -6px; }
.nav__toggle span::after { position: absolute; top: 6px; }

/* --- Buttons (pill) ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-text); font-size: 0.84rem; font-weight: 700; letter-spacing: 0.01em;
  padding: 0.85rem 1.5rem; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform var(--dur) var(--ease), background var(--dur), color var(--dur), box-shadow var(--dur), border-color var(--dur);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--brass-500); color: #1a1330; }
.btn--primary:hover { background: var(--brass-400); color: #1a1330; box-shadow: 0 12px 30px -10px rgba(255,198,41,.5); }
.btn--brass { background: var(--brass-500); color: #1a1330; }
.btn--brass:hover { background: var(--brass-400); color: #1a1330; box-shadow: 0 12px 30px -10px rgba(255,198,41,.5); }
.btn--ghost { background: rgba(255,255,255,0.04); color: var(--ink-900); border-color: var(--line-strong); }
.btn--ghost:hover { background: rgba(255,255,255,0.09); color: #fff; }
.btn--outline-light { background: transparent; color: var(--ink-900); border-color: var(--line-strong); }
.btn--outline-light:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: var(--brass-400); }

/* --- Ornament divider --------------------------------------------------- */
.ornament { display: flex; align-items: center; gap: var(--space-4); margin: var(--space-7) 0; }
.ornament::before, .ornament::after { content: ""; height: 1px; flex: 1; background: var(--line-strong); }
.ornament__mark { width: 8px; height: 8px; transform: rotate(45deg); background: var(--brass-500); box-shadow: 0 0 14px rgba(255,198,41,.6); }
.ornament--light::before, .ornament--light::after { background: rgba(255,255,255,0.18); }

.cat-no { font-family: var(--font-display); font-style: normal; font-weight: 800; font-size: var(--fs-300); color: var(--brass-500); letter-spacing: 0; }

/* --- HERO --------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; min-height: 92vh; display: flex; align-items: center;
  color: var(--wall-text);
  background:
    radial-gradient(820px 480px at 50% -4%, var(--glow-warm-strong), transparent 60%),
    radial-gradient(1100px 720px at 88% 116%, rgba(77,139,255,0.18), transparent 58%),
    radial-gradient(900px 600px at 6% 90%, rgba(255,198,41,0.10), transparent 55%),
    linear-gradient(180deg, #0c0817, #0e0a1a 70%, #120c22);
  border-bottom: 1px solid var(--line);
}
.hero__inner { max-width: 920px; position: relative; z-index: 2; padding-block: var(--space-9); }
.hero .eyebrow { color: var(--brass-500); }
.hero h1 { color: #fff; font-weight: 800; font-size: clamp(2.8rem, 6.6vw, 5.4rem); line-height: 1.02; letter-spacing: -0.03em; margin-top: var(--space-4); text-shadow: 0 0 40px rgba(164,92,224,.25); }
.hero h1 em { font-style: normal; background: var(--spectrum-soft); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { font-size: clamp(1.05rem, 2.1vw, 1.32rem); color: var(--wall-text-soft); margin-top: var(--space-5); max-width: 58ch; line-height: 1.55; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-7); }
.hero__thread { height: 3px; width: 170px; margin-top: var(--space-7); border-radius: 3px; background: var(--spectrum); }
.hero__rule { height: 4px; width: 120px; margin-top: var(--space-7); border-radius: 3px; background: var(--spectrum); }
.hero__cue { position: absolute; left: 50%; bottom: var(--space-5); transform: translateX(-50%); z-index: 2; font-size: var(--fs-50); letter-spacing: 0.22em; text-transform: uppercase; color: var(--wall-text-soft); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero__cue span { font-size: 1rem; opacity: 0.8; }

/* --- Sections ----------------------------------------------------------- */
.section { padding: var(--space-9) 0; position: relative; }
.section--paper { background: var(--paper-200); border-block: 1px solid var(--line); }
.section--wall {
  color: var(--wall-text-soft);
  background: radial-gradient(900px 520px at 80% 0%, var(--glow-warm-strong), transparent 60%), linear-gradient(180deg, #120c22, #0a0712);
  border-block: 1px solid var(--line);
}
.section--ink { background: var(--paper-300); color: var(--wall-text-soft); border-block: 1px solid var(--line); }
.section--wall h2, .section--wall h3, .section--ink h2, .section--ink h3 { color: #fff; }
.section--wall .eyebrow, .section--ink .eyebrow { color: var(--brass-500); }
.section__head { max-width: var(--measure); margin-bottom: var(--space-7); }
.section__head h2 { margin-top: var(--space-3); }
.section__head .lead { margin-top: var(--space-4); }

/* --- Gallery plates (modern cards, spectrum top-edge) ------------------- */
.gallery-grid, .wing-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.plate, .wing-card {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--paper-300), var(--paper-200));
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6);
  text-decoration: none; color: var(--ink-900); min-height: 300px; overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur), border-color var(--dur);
}
.plate::before, .wing-card::before {
  content: ""; position: absolute; left: 0; top: 0; height: 4px; width: 100%;
  background: var(--key, var(--spectrum)); opacity: 0.9; transform: scaleX(0.22); transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.plate:hover, .wing-card:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: var(--shadow-lg); color: var(--ink-900); }
.plate:hover::before, .wing-card:hover::before { transform: scaleX(1); }
.plate__img { display: block; width: calc(100% + 2 * var(--space-6)); height: 190px; object-fit: cover; object-position: center 22%; margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-6)) var(--space-4); border-bottom: 1px solid var(--line); background: var(--paper-100); }
.plate__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.plate__no { font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: var(--key, var(--brass-500)); }
.plate__status { font-size: var(--fs-50); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); }
.plate__status--open { color: var(--conf-verified); }
.plate__status--mem { color: var(--brass-400); }
.plate__kicker { display: block; margin-top: var(--space-5); font-size: var(--fs-50); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; color: var(--key, var(--brass-500)); }
.plate__title { font-size: var(--fs-500); font-weight: 800; margin-top: var(--space-2); line-height: 1.08; color: #fff; }
.plate__caption { color: var(--ink-700); font-size: var(--fs-100); margin-top: var(--space-3); line-height: 1.55; }
.plate__view { margin-top: auto; padding-top: var(--space-5); font-weight: 700; font-size: 0.82rem; color: var(--key, var(--brass-500)); display: inline-flex; align-items: center; gap: 7px; }
.plate:hover .plate__view { gap: 12px; }

/* spectrum keys */
.key-red { --key: var(--spec-red); } .key-orange { --key: var(--spec-orange); }
.key-gold { --key: var(--spec-gold); } .key-green { --key: var(--spec-green); }
.key-blue { --key: var(--spec-blue); } .key-violet { --key: var(--spec-violet); }
.key-brass { --key: var(--brass-500); }

/* --- Plaque ------------------------------------------------------------- */
.plaque { background: rgba(255,198,41,0.06); border: 1px solid var(--line); border-left: 3px solid var(--brass-500); border-radius: var(--radius); padding: var(--space-5) var(--space-6); font-size: var(--fs-100); color: var(--ink-700); }
.plaque__label { font-size: var(--fs-50); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; color: var(--brass-500); margin-bottom: var(--space-2); }
.plaque--quote p { font-family: var(--font-display); font-size: var(--fs-300); font-weight: 600; line-height: 1.45; color: #fff; }

/* --- Confidence chips --------------------------------------------------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-50); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 11px; border-radius: 100px; border: 1px solid currentColor; background: rgba(255,255,255,0.05); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip--verified { color: var(--conf-verified); }
.chip--corroborated { color: var(--conf-corroborated); }
.chip--oral { color: var(--conf-oral); }
.chip--unknown { color: var(--conf-unknown); }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* --- Source note -------------------------------------------------------- */
.source-note { font-size: var(--fs-50); color: var(--ink-500); line-height: 1.5; border-left: 2px solid var(--line-strong); padding-left: var(--space-3); margin-top: var(--space-3); }
.source-note strong { color: var(--ink-700); font-weight: 600; }

/* --- Image-pending placeholder ------------------------------------------ */
.img-pending { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); text-align: center; background: repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 13px, rgba(255,255,255,0.05) 13px 26px); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-500); padding: var(--space-7); min-height: 220px; position: relative; }
.img-pending__label { font-size: var(--fs-50); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; color: var(--brass-500); }
.img-pending__note { font-size: var(--fs-100); max-width: 34ch; }

/* --- Figures ------------------------------------------------------------ */
.figure-row { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.figure { border-top: 2px solid var(--brass-500); padding-top: var(--space-3); }
.figure__num { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-600); line-height: 1; color: #fff; }
.figure__label { font-size: var(--fs-100); color: var(--ink-500); margin-top: var(--space-2); }

/* --- Pull quote --------------------------------------------------------- */
.pullquote { margin: var(--space-8) 0; padding: var(--space-2) 0 var(--space-2) var(--space-6); border-left: 3px solid var(--brass-500); }
.pullquote p { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.45rem, 3vw, 2.1rem); line-height: 1.28; color: #fff; max-width: 26ch; }
.pullquote cite { display: block; margin-top: var(--space-4); font-family: var(--font-text); font-style: normal; font-size: var(--fs-50); letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass-500); }

/* --- Forms -------------------------------------------------------------- */
.form { background: var(--paper-300); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-7); }
.form-grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr 1fr; }
.form-field { display: flex; flex-direction: column; gap: var(--space-2); }
.form-field--full { grid-column: 1 / -1; }
.form-field label { font-size: var(--fs-100); font-weight: 600; color: var(--ink-900); }
.form-field .hint { font-size: var(--fs-50); color: var(--ink-500); }
.form-field input, .form-field select, .form-field textarea { font-family: var(--font-text); font-size: var(--fs-100); color: var(--ink-900); background: var(--paper-100); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; width: 100%; }
.form-field textarea { min-height: 130px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--purple-bright); box-shadow: 0 0 0 3px rgba(164,92,224,0.25); }
.form__note { font-size: var(--fs-50); color: var(--ink-500); margin-top: var(--space-4); line-height: 1.5; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* --- Footer ------------------------------------------------------------- */
.site-footer { background: var(--ink-950); color: var(--wall-text-soft); padding: var(--space-8) 0 var(--space-6); position: relative; z-index: 1; }
.site-footer a { color: var(--wall-text); text-decoration: none; }
.site-footer a:hover { color: var(--brass-400); }
.footer-grid { display: grid; gap: var(--space-6); grid-template-columns: 1.5fr 1fr 1fr; }
.footer-grid h4 { color: #fff; font-size: var(--fs-200); margin-bottom: var(--space-3); font-weight: 700; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.footer-grid li { font-size: var(--fs-100); }
.footer__brandline { font-size: var(--fs-100); color: var(--ink-500); max-width: 42ch; margin-top: var(--space-3); line-height: 1.6; }
.footer__spectrum { height: 3px; margin-bottom: var(--space-7); border-radius: 3px; background: var(--spectrum); }
.footer__legal { margin-top: var(--space-7); padding-top: var(--space-4); border-top: 1px solid var(--line); font-size: var(--fs-50); color: var(--ink-500); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); }

/* --- Scroll reveal (fail-safe) ------------------------------------------ */
html.reveal-ready .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); will-change: opacity, transform; }
html.reveal-ready .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.reveal-ready .reveal { opacity: 1; transform: none; transition: none; } }

/* --- Tour pager (prev / lobby / next) ----------------------------------- */
.pager { position: relative; z-index: 1; width: min(100% - 2.5rem, var(--container)); margin: 0 auto; padding: var(--space-7) 0 var(--space-8); display: flex; align-items: stretch; justify-content: space-between; gap: var(--space-3); border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager__btn, .pager__lobby { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; border-radius: var(--radius); padding: 0.85rem 1.3rem; min-height: 48px; transition: transform var(--dur) var(--ease), background var(--dur), border-color var(--dur), color var(--dur); }
.pager__btn { background: rgba(255,255,255,0.04); border: 1px solid var(--line-strong); color: var(--ink-900); flex: 1 1 220px; max-width: 340px; }
.pager__btn:hover { background: rgba(255,255,255,0.09); color: #fff; transform: translateY(-2px); }
.pager__prev { justify-content: flex-start; }
.pager__next { justify-content: flex-end; text-align: right; margin-left: auto; }
.pager__lbl { display: flex; flex-direction: column; line-height: 1.15; font-size: 0.92rem; }
.pager__lbl--r { align-items: flex-end; }
.pager__lbl small { font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-500); font-weight: 700; }
.pager__arrow { font-size: 1.15rem; color: var(--brass-500); }
.pager__lobby { background: var(--brass-500); color: #1a1330; font-size: 0.85rem; align-self: center; white-space: nowrap; }
.pager__lobby:hover { background: var(--brass-400); color: #1a1330; transform: translateY(-2px); }
@media (max-width: 640px) { .pager { flex-direction: column; } .pager__btn, .pager__lobby { max-width: none; width: 100%; justify-content: center; } .pager__next { text-align: center; } .pager__lobby { order: -1; } }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) {
  .nav__toggle { display: inline-flex; }
  .nav__list {
    position: fixed; inset: 75px 0 auto 0; flex-direction: column; gap: 0;
    background: #0e0a1a; border-bottom: 1px solid var(--line); padding: var(--space-3) var(--space-5) var(--space-5);
    transform: translateY(-130%); transition: transform var(--dur) var(--ease); box-shadow: var(--shadow); margin: 0;
  }
  .nav__list.is-open { transform: translateY(0); }
  .nav__list .nav__link { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); display: block; border-radius: 0; }
  .hero { min-height: 86vh; }
}
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }
