/**
 * Punjab 360 Knowledge Portal — unified design system
 *
 * Single source of truth for all public surfaces and the operator console.
 * Aligns with PEDS (Part II §A.1): multiscript-ready, citation-forward,
 * strong contrast, restrained motion, no clichéd visual stereotypes.
 *
 * Architecture
 * ─────────────
 * 0. Design tokens (custom properties)
 * 1. Reset & base
 * 2. Typography scale
 * 3. Shell — header, main variants, footer
 * 4. Components — buttons, cards, forms, chips, badges
 * 5. Ask surface
 * 6. Home — hero, pillar grid
 * 7. Atlas pages — pillar / era / entity
 * 8. Explore & Learn
 * 9. Sources index
 * 10. Console (operator)
 * 11. Utilities
 * 12. Responsive
 */

/* ─────────────────────────────────────────────────────────────
   0. Design tokens
   ───────────────────────────────────────────────────────────── */
:root {
  /* Chromatic palette */
  --navy:         #0d1f2e;
  --navy-mid:     #152a3d;
  --navy-dark:    #07131e;
  --teal:         #0d7377;
  --teal-hover:   #0a5c60;
  --teal-soft:    #e2f2f3;
  --gold:         #b8890f;
  --gold-bright:  #d4a41a;
  --gold-soft:    #fef8e7;
  --sand:         #f4efe5;
  --paper:        #faf8f4;
  --paper-2:      #f0ebe0;
  --ink:          #1a1f26;
  --ink-mid:      #2e3540;
  --muted:        #5c6474;
  --border:       #ddd8cc;
  --border-strong: #c4bfb2;
  --danger:       #7f1d1d;
  --danger-bg:    #fef2f2;
  --danger-border: #f5c6c6;
  --success:      #14532d;
  --success-bg:   #f0fdf4;
  --success-border: #bbf7d0;

  /* Surfaces */
  --surface-header: var(--navy);
  --surface-hero:   var(--navy-dark);
  --surface-body:   var(--sand);
  --surface-card:   var(--paper);
  --surface-footer: var(--navy);

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(13, 31, 46, 0.05);
  --shadow-sm: 0 2px 6px rgba(13, 31, 46, 0.07);
  --shadow-md: 0 4px 18px rgba(13, 31, 46, 0.09);
  --shadow-lg: 0 12px 40px rgba(13, 31, 46, 0.11);

  /* Typography */
  --font-display: 'Playfair Display', 'Noto Serif', Georgia,
                  'Noto Serif Gurmukhi', 'Times New Roman', serif;
  --font-ui:      Inter, 'Noto Sans', 'Noto Sans Gurmukhi',
                  'Segoe UI', system-ui, sans-serif;
  --font-mono:    ui-monospace, 'Cascadia Code', Consolas, monospace;

  /* Type scale (fluid) */
  --text-xs:   clamp(0.72rem, 0.68rem + 0.18vw, 0.8rem);
  --text-sm:   clamp(0.82rem, 0.78rem + 0.2vw, 0.9rem);
  --text-base: clamp(0.95rem, 0.88rem + 0.3vw, 1.05rem);
  --text-lg:   clamp(1.1rem,  0.98rem + 0.5vw, 1.25rem);
  --text-xl:   clamp(1.3rem,  1.1rem + 0.9vw, 1.6rem);
  --text-2xl:  clamp(1.6rem,  1.2rem + 1.8vw, 2.2rem);
  --text-3xl:  clamp(2rem,    1.4rem + 2.8vw, 3rem);

  /* Layout */
  --header-h:   3.5rem;
  --max-prose:  42rem;
  --max-wide:   72rem;
}

/* ─────────────────────────────────────────────────────────────
   1. Reset & base
   ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--teal-soft);
  color: var(--ink);
}

img, svg { max-width: 100%; display: block; }

a { color: var(--teal); }
a:hover { color: var(--teal-hover); }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

/* ─────────────────────────────────────────────────────────────
   2. Typography helpers
   ───────────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; left: .75rem; top: .75rem; z-index: 2000;
  width: auto; height: auto;
  padding: .5rem 1rem;
  background: var(--teal); color: #fff;
  text-decoration: none; border-radius: var(--r-md);
  font-weight: 600; box-shadow: var(--shadow-md);
}

/* ─────────────────────────────────────────────────────────────
   3. Shell — header
   ───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--surface-header);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.site-header__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 1.25rem;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Brand */
.brand-lockup {
  display: flex; flex-direction: column; gap: .05rem;
  line-height: 1.1; flex-shrink: 0;
}
.brand-lockup__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700;
  letter-spacing: -.01em;
}
.brand-lockup__title a {
  color: #fff; text-decoration: none;
}
.brand-lockup__title a:hover { color: var(--gold-bright); }
.brand-lockup__tag {
  margin: 0;
  font-size: .65rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.55);
}

/* Primary nav */
.site-nav--primary {
  display: flex; align-items: center; flex-wrap: nowrap;
  gap: .25rem; flex: 1; justify-content: center;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.site-nav--primary::-webkit-scrollbar { display: none; }

.site-nav--primary a {
  display: inline-flex; align-items: center;
  padding: .4rem .8rem;
  font-size: var(--text-sm); font-weight: 500;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.site-nav--primary a:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.site-nav--primary a[aria-current="page"] {
  background: rgba(13,115,119,.35);
  color: #fff;
  border-color: rgba(13,115,119,.5);
}
.site-nav--primary a:focus-visible {
  outline: 2px solid var(--gold-bright); outline-offset: 2px;
}

/* Locale */
.site-header__locale {
  display: flex; align-items: center; gap: .3rem;
  flex-shrink: 0;
}
.site-header__locale-label {
  font-size: .65rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255,255,255,.4);
  margin-right: .15rem;
}
.locale-pill {
  padding: .18rem .45rem;
  border-radius: var(--r-xs);
  border: 1px solid rgba(255,255,255,.18);
  font-size: .7rem; color: rgba(255,255,255,.8);
}
.locale-pill--active {
  background: var(--teal);
  border-color: var(--teal); color: #fff;
}
.locale-pill--soon { opacity: .45; cursor: default; }

/* Mobile nav toggle (hidden above breakpoint) */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: .4rem; color: rgba(255,255,255,.85);
  margin-left: auto;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* ─────────────────────────────────────────────────────────────
   3b. Main variants
   ───────────────────────────────────────────────────────────── */
.site-main {
  min-height: 60vh;
}

/* Narrow prose pages */
.site-main--prose {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* Wide surface pages (sources, lens, explore) */
.site-main--surface {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* Home — no top margin; hero handles spacing */
.site-main--home { max-width: none; margin: 0; padding: 0; }

/* ─────────────────────────────────────────────────────────────
   3c. Footer
   ───────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface-footer);
  color: rgba(255,255,255,.75);
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 2rem 1.25rem 2.5rem;
}
.site-footer__inner {
  max-width: var(--max-wide); margin: 0 auto;
  display: grid; gap: 1.5rem;
}

@media (min-width: 48rem) {
  .site-footer__inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

.site-footer__mission {
  margin: 0 0 .5rem;
  font-family: var(--font-display);
  font-size: var(--text-lg); font-style: italic;
  color: rgba(255,255,255,.9); line-height: 1.4;
}
.site-footer__tagline {
  margin: 0 0 1.25rem;
  font-size: var(--text-sm);
  color: rgba(255,255,255,.5);
}
.site-footer__public {
  display: flex; flex-wrap: wrap; gap: .35rem 1rem;
  margin: 0 0 .75rem;
}
.site-footer__public a {
  font-size: var(--text-sm); font-weight: 500;
  color: var(--gold-bright); text-decoration: none;
}
.site-footer__public a:hover { text-decoration: underline; }

.site-footer__locale-foot {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.4);
}
.site-footer__locale-foot a {
  color: rgba(255,255,255,.55); margin-right: .4rem; text-decoration: none;
}
.site-footer__locale-foot a:hover { color: rgba(255,255,255,.85); }

.site-footer__operator { text-align: right; }
.site-footer__operator-label {
  display: block; font-size: .62rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.3); margin-bottom: .5rem;
}
.site-footer__utility {
  display: flex; flex-direction: column; gap: .25rem; align-items: flex-end;
}
.site-footer__utility a {
  font-size: var(--text-xs); color: rgba(255,255,255,.45);
  text-decoration: none; font-weight: 500;
}
.site-footer__utility a:hover { color: rgba(255,255,255,.8); }

/* ─────────────────────────────────────────────────────────────
   4. Components
   ───────────────────────────────────────────────────────────── */

/* — Buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem;
  padding: .55rem 1.2rem;
  font: inherit; font-size: var(--text-sm); font-weight: 600;
  border: none; border-radius: var(--r-md);
  cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-hover); color: #fff; box-shadow: var(--shadow-sm); }

.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-mid); color: #fff; }

.btn--gold { background: var(--gold); color: #fff; }
.btn--gold:hover { background: #9a730c; color: #fff; }

.btn--ghost {
  background: transparent; color: var(--teal);
  border: 1.5px solid var(--teal);
  box-shadow: none;
}
.btn--ghost:hover { background: var(--teal-soft); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #6b1818; color: #fff; }

.btn--sm { padding: .35rem .75rem; font-size: var(--text-xs); border-radius: var(--r-sm); }
.btn--lg { padding: .75rem 1.65rem; font-size: var(--text-lg); border-radius: var(--r-lg); }
.btn--wide { width: 100%; }

/* — Cards — */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-xs);
}

.card__eyebrow {
  margin: 0 0 .3rem;
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold);
}
.card__statement {
  margin: 0 0 .5rem;
  font-size: var(--text-base); font-weight: 600;
  line-height: 1.45; color: var(--ink);
}
.card__meta {
  margin: .6rem 0 0;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--muted);
  font-family: var(--font-mono);
  display: flex; flex-wrap: wrap; gap: .25rem .6rem;
  align-items: center;
}
.card__meta code {
  background: var(--paper-2);
  padding: .05em .3em; border-radius: var(--r-xs);
  font-family: var(--font-mono);
}
.card__meta-sep { color: var(--border-strong); }

/* Claim card variant */
.claim-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: .9rem 1.1rem;
}
.claim-card + .claim-card { margin-top: .55rem; }
.claim-card__stmt {
  margin: 0 0 .35rem;
  font-size: var(--text-base); line-height: 1.5;
  color: var(--ink);
}
.claim-card__meta {
  font-size: var(--text-xs); color: var(--muted);
  font-family: var(--font-mono);
  display: flex; flex-wrap: wrap; gap: .2rem .55rem; align-items: center;
}
.claim-card__meta code {
  background: var(--paper-2); padding: .05em .3em;
  border-radius: var(--r-xs);
}

/* — Form elements — */
.form-field { margin-bottom: 1rem; }
.form-label {
  display: block; margin-bottom: .35rem;
  font-size: var(--text-sm); font-weight: 600; color: var(--ink-mid);
}
.form-input, .form-textarea, .form-select {
  width: 100%; padding: .6rem .8rem;
  font: inherit; font-size: var(--text-sm);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,115,119,.18);
}
.form-textarea { resize: vertical; min-height: 5rem; }

/* — Alert banners — */
.alert {
  padding: .7rem 1rem;
  border-radius: var(--r-md);
  font-size: var(--text-sm); line-height: 1.45;
  margin-bottom: 1rem;
}
.alert--error   { background: var(--danger-bg);  border: 1px solid var(--danger-border);  color: var(--danger); }
.alert--success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success); }

/* — Badges — */
.badge {
  display: inline-flex; align-items: center;
  padding: .18rem .55rem;
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.badge--teal    { background: var(--teal-soft);  color: var(--teal); }
.badge--gold    { background: var(--gold-soft);   color: var(--gold); }
.badge--navy    { background: rgba(13,31,46,.08); color: var(--navy); }
.badge--muted   { background: var(--paper-2);     color: var(--muted); border: 1px solid var(--border); }
.badge--danger  { background: var(--danger-bg);   color: var(--danger); }

/* — Chips / pills — */
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-block;
  padding: .28rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--ink-mid);
  text-decoration: none;
  font-size: var(--text-sm); font-weight: 500;
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover, .chip:focus { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }

/* ─────────────────────────────────────────────────────────────
   5. Ask surface
   ───────────────────────────────────────────────────────────── */
.ask-wrap {
  max-width: 46rem; margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
.ask-wrap h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl); font-weight: 700;
  line-height: 1.15; letter-spacing: -.03em;
  color: var(--ink); margin: 0 0 .4rem;
}
.ask-wrap .lede {
  margin: 0 0 1.75rem;
  font-size: var(--text-lg); color: var(--muted); line-height: 1.55;
}

.ask-form {
  display: flex; flex-direction: column; gap: .65rem;
  margin-bottom: 1.5rem;
}
.ask-form textarea {
  width: 100%;
  padding: .85rem 1rem;
  font: inherit; font-size: var(--text-base);
  color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-lg);
  resize: vertical; min-height: 4.5rem;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
}
.ask-form textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,115,119,.18), var(--shadow-sm);
}
.ask-form-row { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; }

.ask-result-panel {
  margin-top: 1.5rem;
  padding: 1.25rem 1.35rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.ask-result-header {
  display: flex; align-items: center; gap: .65rem;
  margin-bottom: 1rem;
}

.ask-chunks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .65rem; }
.ask-chunk {
  padding: .9rem 1rem;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.ask-chunk__excerpt {
  margin: 0 0 .5rem;
  font-size: var(--text-base); line-height: 1.6; color: var(--ink);
}
.ask-chunk__meta {
  margin: 0; font-size: var(--text-xs); color: var(--muted);
  font-family: var(--font-mono);
  display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: center;
}
.ask-chunk__source { font-weight: 600; color: var(--ink-mid); }
.ask-chunk__sep { color: var(--border-strong); }
.ask-chunk__meta code {
  background: var(--paper); padding: .04em .3em; border-radius: var(--r-xs);
}

.ask-off-domain {
  margin-top: 1.5rem; padding: .85rem 1rem;
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: var(--text-sm); color: var(--ink);
  line-height: 1.55;
}

.ask-meta {
  margin: .75rem 0 0; font-size: var(--text-xs); color: var(--muted);
  display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center;
  font-family: var(--font-mono);
}
.ask-meta__label { font-weight: 600; color: var(--ink-mid); }
.ask-meta code { background: var(--paper-2); padding: .04em .3em; border-radius: var(--r-xs); }

/* ─────────────────────────────────────────────────────────────
   6. Home — hero + pillar grid + claims peek
   ───────────────────────────────────────────────────────────── */
.home-hero {
  position: relative;
  min-height: clamp(28rem, 72vh, 52rem);
  display: flex; align-items: flex-end;
  padding: clamp(3rem, 8vw, 6rem) 1.25rem clamp(3rem, 10vw, 6rem);
  overflow: hidden;
  /* Dark gradient base */
  background: linear-gradient(
    165deg,
    var(--navy-dark) 0%,
    color-mix(in srgb, var(--navy) 80%, var(--teal)) 50%,
    var(--navy-dark) 100%
  );
  color: #fff;
}

/* Five rivers — decorative vertical bands */
.home-hero__rivers {
  position: absolute; inset: 0; pointer-events: none;
  opacity: .25;
  background: repeating-linear-gradient(
    100deg,
    rgba(13,115,119,.7)  0%, rgba(13,115,119,.7)  6%,
    transparent          6%, transparent           20%,
    rgba(13,115,119,.45) 20%, rgba(13,115,119,.45) 28%,
    transparent          28%, transparent           44%,
    rgba(13,115,119,.35) 44%, rgba(13,115,119,.35) 52%,
    transparent          52%, transparent           66%,
    rgba(180,145,60,.35) 66%, rgba(180,145,60,.35) 74%,
    transparent          74%, transparent           88%,
    rgba(13,115,119,.3)  88%, rgba(13,115,119,.3)  96%,
    transparent          96%, transparent           100%
  );
}
/* Radial fade so bands don't overwhelm */
.home-hero__rivers::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 110% 75% at 50% 100%, transparent 20%, rgba(7,19,30,.65) 100%);
}

.home-hero__inner {
  position: relative; z-index: 1;
  max-width: 44rem; width: 100%;
}

.home-hero__eyebrow {
  margin: 0 0 .6rem;
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-bright);
}

.home-hero__title {
  margin: 0 0 .5rem;
  font-family: var(--font-display);
  font-size: var(--text-3xl); font-weight: 700;
  line-height: 1.08; letter-spacing: -.02em;
  color: #fff;
}

.home-hero__sub {
  margin: 0 0 1.75rem;
  font-family: var(--font-display);
  font-size: var(--text-xl); font-style: italic; font-weight: 400;
  line-height: 1.3;
  color: rgba(255,255,255,.72);
}

.home-search-form {
  display: flex; flex-direction: column; gap: .55rem;
  max-width: 36rem;
}
.home-search-input {
  width: 100%; padding: .85rem 1.1rem;
  font: inherit; font-size: var(--text-base);
  color: var(--ink); background: rgba(255,255,255,.97);
  border: 2px solid transparent; border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  transition: border-color .15s, box-shadow .15s;
}
.home-search-input:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(212,164,26,.35);
}
.home-search-input::placeholder { color: var(--muted); }
.home-search-row { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }

.home-chips { margin: 1rem 0 0; }
.home-chips__label {
  font-size: var(--text-xs); color: rgba(255,255,255,.6);
  margin: 0 0 .45rem;
}
.home-chips .chips .chip {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.2);
  color: rgba(255,255,255,.88);
}
.home-chips .chips .chip:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.4);
  color: #fff;
}

/* Below-hero body */
.home-body { background: var(--sand); }

.home-section {
  max-width: var(--max-wide); margin: 0 auto;
  padding: 3rem 1.25rem;
}
.home-section + .home-section {
  border-top: 1px solid var(--border);
}

.home-section__eyebrow {
  margin: 0 0 .3rem;
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold);
}
.home-section__title {
  margin: 0 0 .6rem;
  font-family: var(--font-display);
  font-size: var(--text-xl); font-weight: 700;
  color: var(--ink); line-height: 1.2;
}
.home-section__lede {
  margin: 0 0 1.75rem;
  font-size: var(--text-lg); color: var(--muted); line-height: 1.55;
  max-width: 38rem;
}

/* Pillar grid */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  gap: .85rem;
}
.pillar-card {
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1rem 1.05rem 1.15rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-top: 3px solid var(--teal);
  border-radius: 0 0 var(--r-md) var(--r-md);
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.pillar-card:hover {
  border-top-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.pillar-card:focus-visible {
  outline: 2px solid var(--teal); outline-offset: 2px;
}
.pillar-card__name {
  font-family: var(--font-display);
  font-size: var(--text-lg); font-weight: 700;
  color: var(--ink-mid); line-height: 1.2;
}
.pillar-card__hint {
  font-size: var(--text-xs); color: var(--muted); line-height: 1.35;
}

/* Recent claims peek */
.claims-peek {
  display: grid; gap: .6rem;
}
.claims-more {
  margin-top: .85rem;
  font-size: var(--text-sm); font-weight: 600;
}
.claims-more a { color: var(--teal); text-decoration: none; }
.claims-more a:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────────────────
   7. Atlas pages — pillar / era / entity
   ───────────────────────────────────────────────────────────── */
.atlas-page {
  max-width: var(--max-prose); margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.atlas-breadcrumb {
  margin: 0 0 1.5rem;
  font-size: var(--text-xs); color: var(--muted);
  display: flex; flex-wrap: wrap; gap: .3rem; align-items: center;
}
.atlas-breadcrumb a {
  color: var(--muted); text-decoration: none; font-weight: 500;
}
.atlas-breadcrumb a:hover { color: var(--teal); }
.atlas-breadcrumb__sep { opacity: .5; }

.atlas-header { margin-bottom: 1.75rem; }
.atlas-kicker {
  margin: 0 0 .3rem;
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold);
}
.atlas-title {
  margin: 0 0 .45rem;
  font-family: var(--font-display);
  font-size: var(--text-2xl); font-weight: 700;
  line-height: 1.15; letter-spacing: -.03em;
  color: var(--ink);
}
.atlas-meta {
  display: flex; flex-wrap: wrap; gap: .35rem .75rem;
  align-items: center; margin: 0;
}
.atlas-meta__item {
  font-size: var(--text-xs); color: var(--muted);
  display: flex; align-items: center; gap: .3rem;
}

/* Horizontal rule with era dates */
.atlas-timeline-bar {
  display: flex; align-items: center; gap: .75rem;
  margin: .75rem 0 1.5rem;
  padding: .65rem 1rem;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.atlas-timeline-bar__dates {
  font-family: var(--font-display); font-style: italic;
  font-size: var(--text-lg); color: var(--navy);
}
.atlas-timeline-bar__span {
  font-size: var(--text-xs); color: var(--muted);
}

/* Editorial body */
.atlas-body { margin: 0 0 2rem; }
.atlas-body p {
  font-size: var(--text-base); line-height: 1.75;
  color: var(--ink-mid); margin: 0 0 1.1rem;
}
.atlas-body p:last-child { margin-bottom: 0; }

.atlas-draft-notice {
  margin: 0 0 1.75rem;
  padding: .85rem 1rem .85rem 1.2rem;
  border-left: 3px solid var(--border-strong);
  background: var(--paper-2);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: var(--text-sm); color: var(--muted);
  font-style: italic;
}

/* Claims section within atlas pages */
.atlas-claims { margin-top: 2.5rem; }
.atlas-claims__header {
  display: flex; align-items: baseline; gap: .75rem;
  margin: 0 0 1rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--border);
}
.atlas-claims__title {
  font-family: var(--font-display);
  font-size: var(--text-xl); font-weight: 700;
  color: var(--ink); margin: 0;
}
.atlas-claims__count {
  font-size: var(--text-sm); color: var(--muted);
  font-family: var(--font-mono);
}
.atlas-claims__empty {
  padding: 1rem 1.1rem;
  background: var(--paper-2);
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: var(--text-sm); color: var(--muted); font-style: italic;
}
.atlas-claims__list { list-style: none; padding: 0; margin: 0; }

/* Entity type badge */
.entity-type-badge {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem;
  background: var(--gold-soft);
  border: 1px solid rgba(184,137,15,.25);
  border-radius: var(--r-pill);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold);
}

/* ─────────────────────────────────────────────────────────────
   8. Explore & Learn
   ───────────────────────────────────────────────────────────── */
.page-header {
  max-width: var(--max-wide); margin: 0 auto;
  padding: 2rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl); font-weight: 700;
  color: var(--ink); margin: 0 0 .4rem;
  letter-spacing: -.03em; line-height: 1.15;
}
.page-header .lede { margin: 0; font-size: var(--text-lg); color: var(--muted); line-height: 1.55; }

.learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: .75rem;
  margin-bottom: 2.5rem;
}
.learn-card {
  display: flex; flex-direction: column; gap: .3rem;
  padding: 1rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
.learn-card:hover { border-color: var(--teal); box-shadow: var(--shadow-md); }
.learn-card:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.learn-card__title { font-weight: 700; font-size: var(--text-base); color: var(--ink); }
.learn-card__hint { font-size: var(--text-xs); color: var(--muted); line-height: 1.35; }

.hub-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.hub-section:last-of-type { border-bottom: none; }
.hub-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl); color: var(--ink);
  margin: 0 0 .35rem;
}
.hub-section h3 {
  font-size: var(--text-sm); font-weight: 700;
  color: var(--teal); text-transform: uppercase;
  letter-spacing: .07em; margin: 1.25rem 0 .3rem;
}
.hub-section p { font-size: var(--text-sm); color: var(--muted); }

.explore-pillar-strip {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-bottom: 1.75rem;
}
.explore-pillar-chip {
  padding: .45rem 1rem;
  background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--text-sm); font-weight: 600;
  color: var(--teal); text-decoration: none;
  transition: background .15s, border-color .15s;
}
.explore-pillar-chip:hover {
  background: var(--teal-soft); border-color: var(--teal);
}

/* ─────────────────────────────────────────────────────────────
   9. Sources index
   ───────────────────────────────────────────────────────────── */
.sources-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.sources-table th {
  text-align: left; padding: .5rem .75rem;
  border-bottom: 2px solid var(--border);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.sources-table td {
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink-mid); vertical-align: top;
}
.sources-table tr:last-child td { border-bottom: none; }
.sources-table tr:hover td { background: var(--paper-2); }
.sources-table .src-title { font-weight: 600; color: var(--ink); }
.sources-table code { font-family: var(--font-mono); background: var(--paper-2); padding: .05em .3em; border-radius: var(--r-xs); }

/* ─────────────────────────────────────────────────────────────
   10. Console (operator)
   ───────────────────────────────────────────────────────────── */
.console-shell {
  min-height: 100vh; background: var(--sand);
}
.console-header {
  background: var(--navy-dark);
  padding: .85rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.console-header__brand {
  font-family: var(--font-display); font-size: 1rem; font-weight: 700;
  color: rgba(255,255,255,.9); text-decoration: none;
}
.console-header__label {
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.4); margin-left: auto;
}
.console-nav {
  display: flex; gap: .25rem; align-items: center; margin-left: 1rem;
}
.console-nav a {
  padding: .3rem .65rem;
  font-size: var(--text-xs); font-weight: 500;
  color: rgba(255,255,255,.7); text-decoration: none;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: background .15s;
}
.console-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }

.console-main {
  max-width: 64rem; margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.console-main h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl); font-weight: 700;
  color: var(--ink); margin: 0 0 .35rem; letter-spacing: -.03em;
}
.console-main .lede { margin: 0 0 2rem; font-size: var(--text-lg); color: var(--muted); }

.console-section { margin-bottom: 2.5rem; }
.console-section h2 {
  font-size: var(--text-lg); font-weight: 700;
  color: var(--ink); margin: 0 0 1rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--border);
}

/* ─────────────────────────────────────────────────────────────
   11. Utility
   ───────────────────────────────────────────────────────────── */
.nav-footer {
  margin-top: 2.5rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  display: flex; flex-wrap: wrap; gap: .3rem .85rem;
}
.nav-footer a { color: var(--teal); text-decoration: none; font-weight: 500; }
.nav-footer a:hover { text-decoration: underline; }

code { font-family: var(--font-mono); font-size: .88em; }
code:not(.no-bg) {
  background: rgba(13,31,46,.07);
  padding: .1em .35em; border-radius: var(--r-xs);
}

.lede { margin: 0 0 1.35rem; color: var(--muted); font-size: var(--text-lg); line-height: 1.55; }
.lede strong { color: var(--ink); font-weight: 650; }

.surface-page__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl); font-weight: 700;
  color: var(--ink); margin: 0 0 .5rem;
  letter-spacing: -.03em; line-height: 1.15;
}
.surface-lede { font-size: var(--text-base); color: var(--muted); line-height: 1.6; margin: 0 0 1.5rem; }

/* Trust rules list */
.trust-rules { list-style: none; padding: 0; margin: 0; counter-reset: rule; }
.trust-rules li {
  counter-increment: rule; position: relative;
  padding: .7rem .85rem .7rem 2.4rem;
  margin-bottom: .5rem;
  background: var(--paper-2); border: 1px solid var(--border);
  border-radius: var(--r-md); line-height: 1.5;
  font-size: var(--text-sm);
}
.trust-rules li::before {
  content: counter(rule);
  position: absolute; left: .65rem; top: 50%; transform: translateY(-50%);
  width: 1.35rem; height: 1.35rem;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800;
  color: #fff; background: var(--teal); border-radius: 50%;
}

/* ─────────────────────────────────────────────────────────────
   12. Responsive
   ───────────────────────────────────────────────────────────── */
@media (max-width: 39.9rem) {
  /* Mobile nav */
  .site-nav--primary { display: none; }
  .site-nav--primary.is-open { display: flex; flex-direction: column; }
  .nav-toggle { display: flex; }

  /* Nav full-width overlay on small screens */
  .site-header { flex-wrap: wrap; }
  .site-header__inner { flex-wrap: wrap; position: relative; }
  .site-nav--primary.is-open {
    order: 3; flex-basis: 100%;
    padding: .5rem 0 .75rem;
    border-top: 1px solid rgba(255,255,255,.1);
  }

  /* Hide locale on tiny screens */
  .site-header__locale { display: none; }

  /* Stack hero actions */
  .home-search-row { flex-direction: column; align-items: stretch; }
  .home-search-row .btn { width: 100%; }
}

@media (min-width: 40rem) {
  .pillar-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .learn-grid  { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (min-width: 64rem) {
  .home-hero { min-height: 56vh; }
  .pillar-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ─────────────────────────────────────────────────────────────
   Legacy shims — classes still referenced by older templates
   ───────────────────────────────────────────────────────────── */
.public-place { max-width: var(--max-prose); margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.public-place__header { margin-bottom: 1.75rem; }
.public-place__kicker { margin: 0 0 .3rem; font-size: var(--text-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.public-place__title { margin: 0; font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; line-height: 1.15; letter-spacing: -.03em; color: var(--ink); }
.public-place__lede p { font-size: var(--text-base); line-height: 1.75; color: var(--ink-mid); margin: 0 0 1rem; }
.public-place__meta { margin-top: .75rem; font-size: var(--text-xs); color: var(--muted); }
.public-place__claims { margin-top: 2.5rem; }
.public-place__claims h2 { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; color: var(--ink); margin: 0 0 1rem; padding-bottom: .65rem; border-bottom: 1px solid var(--border); }
.public-place__empty { padding: .85rem 1rem; background: var(--paper-2); border: 1px solid var(--border); border-radius: var(--r-md); font-size: var(--text-sm); color: var(--muted); font-style: italic; }
.site-main--atlas { max-width: var(--max-prose); margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.site-main--surface { max-width: var(--max-wide); margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.ask-result { padding: 1.25rem; background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.ask-result__badge { display: inline-flex; align-items: center; padding: .18rem .55rem; font-size: var(--text-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-radius: var(--r-sm); margin-bottom: .65rem; }
.ask-result__badge--archive  { background: var(--teal-soft); color: var(--teal); }
.ask-result__badge--boundary { background: var(--gold-soft); color: var(--gold); }
.ask-result__badge--partial  { background: var(--teal-soft); color: var(--teal); }
.ask-result__badge--abstention { background: var(--paper-2); color: var(--muted); border: 1px solid var(--border); }
.ask-layout { display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { .ask-layout--split { grid-template-columns: 1fr 1fr; align-items: start; } }
.ask-query-box { padding: 1rem; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.ask-query-box textarea, .ask-query-box input[type="search"] { width: 100%; padding: .75rem; border: 1px solid var(--border); border-radius: var(--r-md); font: inherit; min-height: 3.5rem; resize: vertical; }
.ask-query-box button { margin-top: .75rem; padding: .6rem 1.2rem; background: var(--teal); color: #fff; border: none; border-radius: var(--r-md); font-weight: 600; cursor: pointer; }
.ask-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.ask-chips__label { font-size: var(--text-sm); color: var(--muted); }
.ask-chip { display: inline-block; padding: .28rem .7rem; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--paper); color: var(--ink-mid); text-decoration: none; font-size: var(--text-sm); font-weight: 500; transition: border-color .15s, background .15s; }
.ask-chip:hover, .ask-chip:focus { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.ask-off-domain { margin-top: 1rem; padding: .75rem; border-left: 3px solid var(--gold); background: var(--gold-soft); font-size: var(--text-sm); color: var(--ink); }
.ask-meta { margin: .75rem 0 0; font-size: var(--text-xs); color: var(--muted); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ask-meta__label { font-weight: 600; color: var(--ink-mid); }
.ask-meta__sep { color: var(--border-strong); }
.explore-pillar { padding: .75rem; background: var(--paper); border-radius: var(--r-md); border: 1px solid var(--border); font-size: var(--text-sm); font-weight: 600; color: var(--teal); text-align: center; }
.explore-pillars { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; margin-bottom: 1.25rem; }
@media (min-width: 40rem) { .explore-pillars { grid-template-columns: repeat(4, 1fr); } }
.explore-filters { padding: 1rem; background: var(--paper); border-radius: var(--r-md); border: 1px solid var(--border); font-size: var(--text-sm); }
.explore-filters h2 { margin: 0 0 .5rem; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.explore-filters label { display: block; margin: .35rem 0; cursor: pointer; }
.explore-layout { display: grid; gap: 1.5rem; }
@media (min-width: 52rem) { .explore-layout { grid-template-columns: 1fr 14rem; } }
.explore-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media (min-width: 36rem) { .explore-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 56rem) { .explore-grid { grid-template-columns: repeat(4, 1fr); } }
.explore-card { padding: .85rem; background: var(--paper); border-radius: var(--r-md); box-shadow: var(--shadow-xs); border: 1px solid var(--border); font-size: var(--text-sm); color: var(--muted); }
.learn-hub-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; margin-bottom: 2rem; }
@media (min-width: 40rem) { .learn-hub-grid { grid-template-columns: repeat(4, 1fr); } }
.learn-hub-card { display: block; padding: .85rem; background: var(--paper); border-radius: var(--r-md); border: 1px solid var(--border); text-decoration: none; color: var(--teal); font-weight: 600; font-size: var(--text-sm); box-shadow: var(--shadow-xs); }
.learn-hub-card:hover { border-color: var(--teal); }
.learn-hub-section { margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.learn-hub-section h2 { font-family: var(--font-display); color: var(--ink); font-size: var(--text-xl); margin: 0 0 .5rem; }
.learn-hub-section h3 { font-size: 1rem; margin: 1.25rem 0 .35rem; color: var(--teal); }
.site-footer--surface { background: var(--navy); color: rgba(255,255,255,.85); border-top: none; max-width: none; }
.site-footer--surface .site-footer__mission { color: rgba(255,255,255,.88); }
.site-footer--surface .site-footer__modes { color: rgba(255,255,255,.65); }
.site-footer__public { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1rem 0; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12); font-size: var(--text-sm); }
.site-footer__public a { color: var(--gold-bright); text-decoration: none; }
.site-footer__public a:hover { text-decoration: underline; }
.site-footer__modes { margin: 0 0 1rem; font-size: var(--text-xs); color: var(--muted); }
.site-footer__mission { margin: 0 0 .85rem; font-size: var(--text-base); }
.site-footer__utility { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: var(--text-xs); }
.site-footer__utility a { color: var(--muted); text-decoration: none; font-weight: 500; }
.site-footer__utility a:hover, .site-footer__utility a:focus-visible { color: var(--teal); text-decoration: underline; }
.site-footer__locale-foot { margin-top: .75rem; font-size: var(--text-xs); color: rgba(255,255,255,.5); }
.site-footer__locale-foot a { color: rgba(255,255,255,.65); margin-right: .5rem; }
.site-footer__operator { margin-top: .5rem; }
.site-footer__operator-label { display: block; font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .45rem; }
.site-footer__operator .site-footer__utility { padding-top: 0; border-top: none; }
