/* ============================================
   VOX POPULI ETF — Design Tokens & Styles
   Clean white bg, dark slate/navy-to-black,
   Cinzel display + Inter body
   ============================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Type Scale --- */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Fonts */
  --font-display: 'Cinzel', 'Georgia', serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* --- Color Palette: Light (default) --- */
:root, [data-theme="light"] {
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;
  --color-surface-2: #f1f3f5;
  --color-surface-offset: #e9ecef;
  --color-divider: #dee2e6;
  --color-border: #ced4da;

  --color-text: #1a1d23;
  --color-text-muted: #6c757d;
  --color-text-faint: #adb5bd;
  --color-text-inverse: #ffffff;

  /* Primary: dark slate-navy */
  --color-primary: #1e293b;
  --color-primary-hover: #334155;
  --color-primary-active: #0f172a;

  /* Accent: muted steel blue */
  --color-accent: #475569;
  --color-accent-light: #64748b;

  /* Table header */
  --color-thead: #1e293b;
  --color-thead-text: #ffffff;

  /* Links */
  --color-link: #2563eb;
  --color-link-hover: #1d4ed8;

  /* Positive/Negative for financial data */
  --color-positive: #16a34a;
  --color-negative: #dc2626;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --color-bg: #000000;
  --color-surface: #0d0d0d;
  --color-surface-2: #161616;
  --color-surface-offset: #111111;
  --color-divider: #202020;
  --color-border: #2e2e2e;

  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-text-faint: #64748b;
  --color-text-inverse: #000000;

  --color-primary: #cbd5e1;
  --color-primary-hover: #e2e8f0;
  --color-primary-active: #94a3b8;

  --color-accent: #94a3b8;
  --color-accent-light: #cbd5e1;

  --color-thead: #111111;
  --color-thead-text: #e2e8f0;

  --color-link: #60a5fa;
  --color-link-hover: #93bbfd;

  --color-positive: #4ade80;
  --color-negative: #f87171;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.6);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.8);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #000000;
    --color-surface: #0d0d0d;
    --color-surface-2: #161616;
    --color-surface-offset: #111111;
    --color-divider: #202020;
    --color-border: #2e2e2e;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-text-faint: #64748b;
    --color-text-inverse: #000000;
    --color-primary: #cbd5e1;
    --color-primary-hover: #e2e8f0;
    --color-primary-active: #94a3b8;
    --color-accent: #94a3b8;
    --color-accent-light: #cbd5e1;
    --color-thead: #111111;
    --color-thead-text: #e2e8f0;
    --color-link: #60a5fa;
    --color-link-hover: #93bbfd;
    --color-positive: #4ade80;
    --color-negative: #f87171;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.6);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.8);
  }
}

/* ============================================
   LAYOUT
   ============================================ */

.site-wrapper {
  width: 100%;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 calc(90px + var(--space-6)); /* clear the 90px fixed side columns */
}

.container--narrow {
  max-width: var(--content-default);
}

/* ============================================
   INTRO SEQUENCE (5 stacked assets)
   ============================================ */

/* Scroll lock during intro animation */
body.intro-locked {
  overflow: hidden;
  /* Force Safari to the top of the page — prevents any
     scroll restoration from clipping the tagline */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
}

/* Undo the fixed positioning once the intro is done.
   JS removes .intro-locked to restore normal scrolling. */

.intro {
  background: var(--color-bg);
  /* Tightened: was calc(100vh - 220px) — reduce dead space above tagline */
  min-height: calc(100vh - 320px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-6);
  padding-bottom: var(--space-4);
  text-align: center;
  position: relative;
  /* No transition by default — added dynamically via .is-compressing */
}

/* JS adds this class once the header bar is revealed.
   The intro section shrinks instantly (no CSS transition)
   so the single smooth scroll handles all the motion. */
.intro.is-compressing {
  min-height: calc(100vh - 480px);
  padding-top: var(--space-6);
  padding-bottom: var(--space-4);
}

.intro__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-10);
  width: 100%;
  max-width: var(--content-wide);
}



/* Site content wrapper — starts invisible, faded in by scroll JS */
.site-content {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Tagline — pure text, Cinzel display font.
   Each word is a .tagword span; all start opacity:0,
   JS adds .is-visible to fade them in one at a time. */
.intro__tagline {
  width: 100%;
  max-width: 1100px;
  font-family: var(--font-display);
  font-size: clamp(0.82rem, 3.6vw, 3.2rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: capitalize;
  color: var(--color-text);
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  /* Prevent layout shift from cycle words */
  min-height: 1.4em;
  /* Safety: if text still overflows, don't break layout */
  overflow: hidden;
}

/* ============================================
   HEADER BAR — sits at the bottom of the intro section.
   Uses position:sticky so it scrolls naturally with the
   page and locks to the viewport top once it reaches it.
   ============================================ */

.header-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  text-align: center;
  border-bottom: 1px solid var(--color-divider);
  width: 100%;
  /* Hidden until JS reveals after fade sequence */
  opacity: 0;
  transition: opacity 1.8s ease;
}

/* JS adds this to fade in; scrolling does all the movement */
.header-bar.is-visible {
  opacity: 1;
}

/* JS adds this class once header is stuck at the top (for column logic) */
.header-bar.is-stuck {
  /* no visual change needed — sticky handles positioning */
}

.header-bar__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-bar__inner img {
  width: 100%;
  max-width: 900px;
  height: auto;
  display: block;
}

/* ============================================
   TAGWORD REVEAL — pure-text approach
   Each .tagword starts invisible (opacity: 0) and
   fades in when JS adds .is-visible.
   The .tagword--cycle span contains the rotating last word.
   ============================================ */

.tagword {
  opacity: 0;
  transition: opacity 0.35s ease;
  display: inline;
}

.tagword.is-visible {
  opacity: 1;
}

/* Middle dots get a little horizontal spacing */
.tagword--dot {
  padding: 0 0.15em;
}

/* The cycle container holds 4 words stacked;
   only the active one is visible at a time. */
.tagword--cycle {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
}

.cycle-word {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.cycle-word--active {
  opacity: 1;
}

/* Words 2-4 sit on top of word 1 so they don't create extra width */
.cycle-word[data-idx="1"],
.cycle-word[data-idx="2"],
.cycle-word[data-idx="3"] {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
}

/* ============================================
   SIDE COLUMNS — viewport-fixed pillars
   
   Fixed to the browser viewport. They appear
   once the user scrolls past the line5 header
   and stay locked in place while page content
   scrolls between them.

   ┌────────┐
   │ CROWN  │  ← column-top.png (always visible)
   ├────────┤
   │ SHAFT  │  ← column-mid.png tile (fills viewport gap)
   ├────────┤
   │  BASE  │  ← column-bottom.png (always visible)
   └────────┘
   ============================================ */

.side-column {
  position: fixed;
  /* top is set dynamically by JS (bottom of sticky header) */
  /* bottom is set dynamically by JS (top of footer bar) */
  bottom: 0;
  width: 90px;        /* match your column PNG width */
  display: flex;
  flex-direction: column;
  pointer-events: none;
  z-index: 90;        /* below sticky header (100) but above content */
  /* Hidden by default; JS adds .is-visible once user scrolls past line5 */
  opacity: 0;
  transition: opacity 0.5s ease;
}

.side-column.is-visible {
  opacity: 1;
}

.side-column--left {
  left: 0;
}

.side-column--right {
  right: 0;
}

/* Crown: decorative top cap, always fully visible */
.side-column__crown {
  display: block;
  width: 100%;
  height: auto;
  flex-shrink: 0;
}

/* Base: decorative bottom cap, always fully visible */
.side-column__base {
  display: block;
  width: 100%;
  height: auto;
  flex-shrink: 0;
}

/* Shaft: repeating tile that fills viewport between crown and base */
.side-column__shaft {
  flex: 1;
  background: url('./assets/images/column-mid.jpg') repeat-y center top;
  background-size: 100% auto;
  min-height: 0;
}

/* On narrow screens, hide the columns and footer bar, and remove their padding */
@media (max-width: 900px) {
  .side-column {
    display: none;
  }
  .viewport-footer-bar {
    display: none !important;
  }
  .container {
    padding: 0 var(--space-6); /* drop the 90px column clearance */
  }
  .footer {
    padding-bottom: var(--space-10); /* no need for 60px footer-bar clearance */
  }
}

/* ============================================
   VIEWPORT FOOTER BAR — thin decorative strip
   fixed to the bottom of the viewport, spanning
   full width. Appears/disappears with the columns.
   ============================================ */

.viewport-footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;       /* capped height */
  z-index: 91;        /* above columns, below sticky header */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: var(--color-bg); /* matches page bg in both light and dark mode */
  display: flex;
  justify-content: center;
  align-items: center;
}

.viewport-footer-bar.is-visible {
  opacity: 1;
}

.viewport-footer-bar img {
  display: block;
  max-width: 100%;
  max-height: 60px;   /* never taller than 60px */
  width: auto;
  height: auto;
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
  padding: clamp(var(--space-10), 6vw, var(--space-20)) 0;
}

.section--alt {
  background: var(--color-surface);
}

.section__header {
  margin-bottom: var(--space-8);
}

.section__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
}

.section__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

/* ============================================
   FUND OVERVIEW — 2 column layout
   ============================================ */

.fund-overview {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--space-8);
  align-items: start;
}

@media (max-width: 768px) {
  .fund-overview {
    grid-template-columns: 1fr;
  }
}

.fund-overview__text h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
  letter-spacing: 0.02em;
}

.fund-overview__text p {
  font-size: var(--text-base);
  color: var(--color-text);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

/* Investor Materials sidebar */
.investor-materials {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-divider);
}

.investor-materials h4 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-3);
  letter-spacing: 0.02em;
}

.investor-materials__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.investor-materials__item a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  color: var(--color-link);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition-interactive);
}

.investor-materials__item a:hover {
  color: var(--color-link-hover);
}

.investor-materials__item a svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

/* ============================================
   DATA TABLES
   ============================================ */

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.data-card {
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-card__header {
  background: var(--color-thead);
  color: var(--color-thead-text);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.data-card__header .date {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-xs);
  opacity: 0.8;
  text-transform: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-divider);
}

.data-table th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table td {
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--color-surface);
}

/* Fund details key-value table */
.kv-table td:first-child {
  font-weight: 500;
  color: var(--color-text-muted);
  width: 50%;
}

.kv-table td:last-child {
  font-weight: 600;
  text-align: right;
}

/* ============================================
   PERFORMANCE TABLES
   ============================================ */

.performance-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-6);
}

.performance-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.performance-table thead th {
  background: var(--color-thead);
  color: var(--color-thead-text);
  padding: var(--space-3) var(--space-4);
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.performance-table thead th:first-child {
  text-align: left;
}

.performance-table tbody td {
  padding: var(--space-3) var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--color-divider);
}

.performance-table tbody td:first-child {
  text-align: left;
  font-weight: 600;
}

.performance-table tbody tr:hover td {
  background: var(--color-surface);
}

/* ============================================
   PREMIUM/DISCOUNT CHART
   ============================================ */

.chart-container {
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

#premiumDiscountChart {
  width: 100%;
  height: 400px;
}

.chart-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.chart-summary__item {
  text-align: center;
  padding: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-md);
}

.chart-summary__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.chart-summary__value {
  font-size: var(--text-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chart-summary__value--premium { color: var(--color-positive); }
.chart-summary__value--par { color: var(--color-text); }
.chart-summary__value--discount { color: var(--color-negative); }

/* ============================================
   HOLDINGS
   ============================================ */

.holdings-controls {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  align-items: center;
}

.holdings-controls .btn {
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-bg);
  cursor: pointer;
}

.holdings-controls .btn:hover {
  background: var(--color-surface);
}

.holdings-controls .btn--active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

.holdings-controls .btn--active:hover {
  background: var(--color-primary-hover);
}

.holdings-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.holdings-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.holdings-table thead th {
  background: var(--color-thead);
  color: var(--color-thead-text);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.holdings-table thead th:first-child {
  text-align: right;
}

.holdings-table tbody td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--color-divider);
}

.holdings-table tbody td:first-child {
  text-align: right;
}

.holdings-table tbody tr:hover td {
  background: var(--color-surface);
}

/* ============================================
   DISCLOSURES
   ============================================ */

.disclosures {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.disclosures p {
  margin-bottom: var(--space-4);
  max-width: none;
}

.disclosures a {
  color: var(--color-link);
  text-decoration: underline;
}

.disclosures a:hover {
  color: var(--color-link-hover);
}

.disclosures strong {
  color: var(--color-text);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  color: var(--color-text-muted);
  padding: var(--space-10) 0;
  padding-bottom: calc(var(--space-10) + 60px); /* extra room so fixed footer bar doesn't cover content */
  text-align: center;
}

.footer__brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.footer__copy {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.footer__attribution {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer__attribution a {
  color: var(--color-text-faint);
  text-decoration: none;
}

.footer__attribution a:hover {
  color: var(--color-text-muted);
}

/* ============================================
   UTILITIES
   ============================================ */

.text-positive { color: var(--color-positive) !important; }
.text-negative { color: var(--color-negative) !important; }
.text-muted { color: var(--color-text-muted) !important; }

/* Bid-ask note */
.data-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-border);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
  /* Smaller nav text on mobile */
  .site-nav__link {
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    padding: var(--space-3) var(--space-3);
  }

  .theme-toggle {
    padding: var(--space-2) var(--space-3);
  }

  .theme-toggle svg {
    width: 14px;
    height: 14px;
  }

  .chart-summary {
    grid-template-columns: 1fr;
  }

  .data-grid {
    grid-template-columns: 1fr;
  }



  .header-bar__inner {
    padding: var(--space-2) var(--space-4);
  }

  /* Tighten container padding on small phones */
  .container {
    padding: 0 var(--space-4);
  }

  /* Let performance tables scroll horizontally with a visible hint */
  .performance-table {
    min-width: 500px;
    font-size: var(--text-xs);
  }

  .performance-table thead th {
    padding: var(--space-2) var(--space-3);
  }

  .performance-table tbody td {
    padding: var(--space-2) var(--space-3);
  }

  /* Holdings table — tighter on mobile */
  .holdings-table {
    min-width: 550px;
    font-size: var(--text-xs);
  }

  .holdings-table thead th {
    padding: var(--space-2) var(--space-3);
  }

  .holdings-table tbody td {
    padding: var(--space-2) var(--space-3);
  }

  /* Holdings controls — allow wrapping */
  .holdings-controls {
    flex-wrap: wrap;
  }

  /* Fund overview text */
  .fund-overview__text h3 {
    font-size: var(--text-base);
  }

  /* Section titles */
  .section__title {
    font-size: var(--text-lg);
  }

  /* Investor materials — full width on mobile */
  .investor-materials {
    padding: var(--space-3) var(--space-4);
  }
}

/* ============================================
   SITE NAV
   ============================================ */

.site-nav {
  position: sticky;
  top: 0; /* will be adjusted by JS if header-bar height is known */
  z-index: 99;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  display: none; /* hidden until intro completes — JS sets display:flex */
  align-items: center; /* ready for when JS makes it flex */
}

.site-nav.is-visible {
  display: flex;
}

/* Scrollable link strip — grows to fill available space beside the toggle */
.site-nav__inner {
  flex: 1;
  min-width: 0; /* allow flex child to shrink below content size */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 var(--space-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.site-nav__inner::-webkit-scrollbar { display: none; }

.site-nav__link {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav__link:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

/* ============================================
   THEME TOGGLE
   ============================================ */

.theme-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-left: 1px solid var(--color-divider);
  cursor: pointer;
  padding: var(--space-2) var(--space-4);
  color: var(--color-text-muted);
  align-self: stretch; /* fill full nav height so border looks crisp */
  border-radius: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Show moon in light mode, sun in dark mode */
:root:not([data-theme="dark"]) .theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: block; }

/* Invert B&W graphics in dark mode */
[data-theme="dark"] .header-bar__inner img,
[data-theme="dark"] .side-column__crown,
[data-theme="dark"] .side-column__base,
[data-theme="dark"] .side-column__shaft,
[data-theme="dark"] .viewport-footer-bar img {
  filter: invert(1);
}

/* Footer bar and column shaft backgrounds match pure black in dark mode */
[data-theme="dark"] .viewport-footer-bar {
  background: #000000;
}

/* Smooth theme transitions */
body, .site-nav, .site-content, table, .stats-grid__item {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
/* header-bar needs opacity 1.8s for the intro fade-in, plus theme transitions */
.header-bar {
  transition: opacity 1.8s ease, background-color 0.25s ease, border-color 0.25s ease;
}

/* ============================================
   DC ADVISOR LINK (blue hyperlink in intro)
   ============================================ */

.dc-link {
  color: #0066cc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dc-link:hover {
  color: #004499;
}

/* ============================================
   VOTE LINK — more prominent
   ============================================ */

.vote-link {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.vote-link:hover {
  opacity: 0.7;
}

/* ============================================
   INVESTOR MATERIALS GROUP LABELS
   ============================================ */

.investor-materials__group-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin: var(--space-4) 0 var(--space-1);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--color-divider);
}

.investor-materials__group-label:first-of-type {
  margin-top: var(--space-2);
}

/* ============================================
   FOOTER CONTACT
   ============================================ */

.footer__contact {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.footer__contact a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer__contact a:hover {
  color: var(--color-text);
}

/* ============================================
   PREMIUM/DISCOUNT STATS — monochrome
   ============================================ */

/* Override the green/orange with monochrome */
.chart-summary__value--premium { color: var(--color-text) !important; }
.chart-summary__value--discount { color: var(--color-text-muted) !important; }
