/* Site-wide nav rail + home page ("Operator's Deck" — navy/gold) - added
   2026-10-01, replacing the old 4-level dropdown (nav.topbar/.menu* in
   style.css, now removed) on EVERY page in the app, not just the home
   page. Scoped entirely under the nr- (nav rail) / hp- (home page)
   prefixes below, deliberately never touching style.css's own tokens
   (--page/--surface/etc) or class names (.card, .kpi-xxx, etc) - every
   report's own content keeps rendering exactly as it always has, inside
   the SAME .page-shell/.card markup, just now sitting next to this rail
   instead of under the old topbar. See planning/BillsDemos_GUI_v2_Design_Doc.md.

   This page (and only this page, by design - see that doc's §3) commits
   to one visual world, navy + gold, regardless of the visitor's OS
   light/dark preference - every report's own pages keep following
   style.css's prefers-color-scheme handling untouched. */

:root {
  --nr-ink: #0d1930;
  --nr-surface: #142544;
  --nr-raised: #1b3058;
  --nr-raised2: #22396a;
  --nr-gold: #e3b23c;
  --nr-gold-hover: #edc563;
  --nr-text: #f1f4fa;
  --nr-dim: #93a4c7;
  --nr-line: #2c4470;
  --nr-good: #5cb176;
  --nr-critical: #d9654f;
}

/* ---------------------------------------------------------------------
   Shell: persistent rail + main content, sitewide
   --------------------------------------------------------------------- */
.nr-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; background: var(--page); }

.nr-rail {
  background: var(--nr-ink); border-right: 1px solid var(--nr-line); padding: 20px 16px;
  display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.nr-main { min-width: 0; }

.nr-logo { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--nr-line); text-decoration: none; }
/* .nr-logo-mark is now the real logo (app/static/img/logo-mark.svg) as a
   plain <img> - a self-contained navy+gold shield badge, not a glyph
   that needs a wrapping box/background behind it the way the placeholder
   and the domain icons do. */
.nr-logo-mark { width: 32px; height: 32px; flex: none; display: block; }
.nr-logo-word { font-family: "Fjalla One", system-ui, sans-serif; font-size: 1rem; letter-spacing: 0.01em; color: var(--nr-text); }
.nr-logo-word span { color: var(--nr-gold); }

.nr-group { display: flex; flex-direction: column; gap: 2px; }
.nr-group-label {
  display: flex; align-items: center; gap: 9px; font-size: 0.72rem; font-weight: 600; color: var(--nr-dim);
  text-transform: uppercase; letter-spacing: 0.07em; padding: 4px 8px;
}
.nr-group-icon { width: 16px; height: 16px; flex: none; color: var(--nr-gold); }
.nr-group-icon svg { width: 100%; height: 100%; display: block; }
.nr-group ul { list-style: none; margin: 0; padding: 0 0 6px 33px; display: flex; flex-direction: column; gap: 1px; }
.nr-group li { display: block; }
.nr-group a {
  display: block; font-size: 0.8rem; line-height: 1.3; color: var(--nr-text); text-decoration: none;
  padding: 6px 8px; border-radius: 6px; border-left: 2px solid transparent;
}
.nr-group a:hover { background: var(--nr-raised); border-left-color: var(--nr-gold); }
.nr-group a.is-current { background: var(--nr-raised); border-left-color: var(--nr-gold); font-weight: 600; }

/* Log out only ever renders here, and only while actually on an admin
   page (base.html: session.is_admin AND "/admin" in request.path) - no
   "About"/other links alongside it anymore, see the "About" .nr-group
   above instead, styled like every other rail group. */
.nr-rail-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--nr-line); }
.nr-rail-footer .link-btn { color: var(--nr-dim); font-size: 0.76rem; text-decoration: underline; }

/* ---------------------------------------------------------------------
   Mobile: collapsed off-canvas drawer (same pattern verified in the
   mockup, incl. the real bug it caught - .nr-backdrop MUST be
   display:none + position:fixed UNCONDITIONALLY, not just inside the
   media query, or this 2-column grid auto-places it as a real grid item
   at every width and scrambles the whole layout)
   --------------------------------------------------------------------- */
.nr-mobile-bar { display: none; }
.nr-backdrop { display: none; position: fixed; inset: 0; background: rgba(5, 8, 16, 0.55); z-index: 40; }

@media (max-width: 860px) {
  .nr-shell { grid-template-columns: 1fr; }
  .nr-mobile-bar {
    display: flex; align-items: center; gap: 12px; background: var(--nr-ink); border-bottom: 1px solid var(--nr-line);
    padding: 12px 16px; position: sticky; top: 0; z-index: 35;
  }
  .nr-menu-btn {
    width: 38px; height: 38px; flex: none; border-radius: 8px; border: 1px solid var(--nr-line); background: var(--nr-raised);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; padding: 0;
  }
  .nr-menu-btn span { display: block; width: 18px; height: 2px; background: var(--nr-text); border-radius: 1px; }
  .nr-rail {
    position: fixed; top: 0; bottom: 0; left: 0; width: 272px; max-width: 84vw; z-index: 45;
    transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: 4px 0 28px rgba(0, 0, 0, 0.4);
  }
  .nr-rail.is-open { transform: translateX(0); }
  .nr-backdrop.is-open { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .nr-rail { transition-duration: 0.001ms; }
}

/* ---------------------------------------------------------------------
   Home page only ("hp-" prefix) - full-bleed navy world, rendered via
   base.html's full_width_content block (ahead of the normal, narrower
   .page-shell every other page uses - see base.html)
   --------------------------------------------------------------------- */
.hp-dark { background: var(--nr-ink); color: var(--nr-text); font-family: "IBM Plex Sans", system-ui, sans-serif; }
/* The showcase chart SVGs (viewBox only, no width/height attributes -
   unlike the small icon SVGs, which set both explicitly) default to the
   UA's own intrinsic sizing with nothing constraining them otherwise -
   same bug class as the placeholder logo mark earlier, this time wide
   enough to force real horizontal overflow on a phone-width screen
   (found 2026-10-01 via screenshot verification at 400px). */
.hp-dark svg { max-width: 100%; height: auto; }
.hp-dark h1, .hp-dark h2, .hp-dark h3 { font-family: "Fjalla One", system-ui, sans-serif; font-weight: 400; letter-spacing: 0.01em; text-wrap: balance; }
.hp-mono { font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; }
.hp-dark a { color: var(--nr-gold); text-decoration: none; }

.hp-inner { max-width: 1240px; margin: 0 auto; padding: 40px 36px 56px; }
@media (max-width: 480px) { .hp-inner { padding: 28px 18px 40px; } }

.hp-hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: start; margin-bottom: 40px; }
@media (max-width: 860px) { .hp-hero { grid-template-columns: 1fr; } }
.hp-eyebrow { font-size: 0.78rem; color: var(--nr-gold); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; margin: 0 0 10px; }
.hp-hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.08; margin: 0 0 16px; }
.hp-lede { color: var(--nr-dim); font-size: 1.02rem; line-height: 1.6; max-width: 54ch; margin: 0 0 22px; }
.hp-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hp-btn { font-weight: 600; font-size: 0.9rem; padding: 11px 20px; border-radius: 8px; display: inline-block; transition: transform 0.15s ease, background 0.15s ease; }
/* .hp-dark a {color} above has specificity (0,1,1) - a bare .hp-btn-primary
   (0,1,0) loses to it and renders gold-on-gold, invisible (real bug found
   2026-10-01 via screenshot verification). Every override below is
   deliberately re-scoped under .hp-dark to beat that tie on specificity,
   not source order - the same fix applies to .hp-domain-card h3/p further
   down, which happened to win by source-order luck alone before this. */
.hp-dark .hp-btn-primary { background: var(--nr-gold); color: var(--nr-ink); }
.hp-dark .hp-btn-primary:hover { transform: translateY(-1px); background: var(--nr-gold-hover); }
.hp-dark .hp-btn-ghost { border: 1px solid var(--nr-line); color: var(--nr-text); }
.hp-dark .hp-btn-ghost:hover { border-color: var(--nr-gold); color: var(--nr-gold); }

.hp-ticker { background: var(--nr-surface); border: 1px solid var(--nr-line); border-radius: 12px; padding: 18px 20px; }
.hp-ticker-head { display: flex; align-items: center; gap: 8px; font-size: 0.72rem; color: var(--nr-dim); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; padding-bottom: 10px; border-bottom: 1px solid var(--nr-line); margin-bottom: 14px; }
.hp-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--nr-good); animation: hpPulse 2s ease-in-out infinite; }
@keyframes hpPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
/* 4 independent domains in one box read as unrelated unless the box
   itself says "these are 4 separate cells" - gold cross-dividers (one
   vertical, one horizontal line down the middle) turn the grid into 4
   explicit quadrants, same accent as the rest of the rail's interactive
   gold so it reads as a deliberate structure, not a stray rule. */
.hp-ticker-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.hp-ticker-grid::before, .hp-ticker-grid::after { content: ""; position: absolute; background: var(--nr-gold); opacity: 0.45; }
.hp-ticker-grid::before { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%); }
.hp-ticker-grid::after { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%); }
@media (max-width: 520px) {
  .hp-ticker-grid { grid-template-columns: 1fr; gap: 16px; }
  .hp-ticker-grid::before { display: none; }
  .hp-ticker-grid::after { display: none; }
  .hp-stat:not(:first-child) { padding-top: 14px; border-top: 1px solid var(--nr-line); }
}
/* Each quadrant links to the exact source report (and its #summary-stats
   section) that the number came from - home.html's _home_kpis() sets
   `url` per tile. Styled as a link (background tint + lift on hover,
   same restrained pattern as the showcase cards below) rather than a
   plain div, with the arrow after the domain name as the "this is
   clickable" affordance. */
a.hp-stat { display: block; text-decoration: none; color: inherit; border-radius: 8px; padding: 6px 8px; margin: -6px -8px; transition: background 0.15s ease, transform 0.15s ease; }
a.hp-stat:hover, a.hp-stat:focus-visible { background: rgba(227, 178, 60, 0.1); transform: translateY(-1px); }
.hp-stat-domain { font-size: 0.66rem; color: var(--nr-gold); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin: 0 0 6px; }
.hp-stat-arrow { opacity: 0; transition: opacity 0.15s ease; }
a.hp-stat:hover .hp-stat-arrow, a.hp-stat:focus-visible .hp-stat-arrow { opacity: 1; }
.hp-stat-label { font-size: 0.72rem; color: var(--nr-dim); margin: 0 0 4px; }
.hp-stat-value { font-size: 1.5rem; font-weight: 600; line-height: 1; }

.hp-showcase { background: var(--nr-surface); border: 1px solid var(--nr-line); border-radius: 14px; padding: 4px; margin-bottom: 40px; }
.hp-showcase-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; }
.hp-showcase-head h2 { font-size: 1.1rem; margin: 0; }
.hp-showcase-dots { display: flex; gap: 6px; }
.hp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--nr-line); border: none; padding: 0; cursor: pointer; }
.hp-dot[aria-pressed="true"] { background: var(--nr-gold); width: 18px; border-radius: 4px; transition: all 0.2s ease; }
.hp-showcase-body { padding: 6px 18px 22px; min-height: 230px; }
.hp-slide { display: none; }
.hp-slide.active { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 26px; align-items: center; }
@media (max-width: 700px) { .hp-slide.active { grid-template-columns: 1fr; } }
.hp-slide-caption { font-size: 0.86rem; color: var(--nr-dim); line-height: 1.55; }
.hp-slide-caption strong { color: var(--nr-text); display: block; font-size: 1rem; margin-bottom: 6px; font-weight: 600; }
/* Each showcase slide links to the real page/section the screenshot was
   taken from (home.html) - styled as a link (not just a div) so hovering
   it both pauses the auto-rotation (see home.html's inline script) and
   reveals a "go there" affordance, same gold accent as the rest of the
   nav rail's interactive states. */
a.hp-chart-card {
  display: block;
  position: relative;
  background: var(--nr-raised);
  border: 1px solid var(--nr-line);
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.hp-chart-card:hover, a.hp-chart-card:focus-visible { border-color: var(--nr-gold); transform: translateY(-2px); }
.hp-chart-card img { display: block; width: 100%; height: auto; border-radius: 6px; }
.hp-chart-card-cta {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  background: rgba(13, 25, 48, 0.9);
  color: var(--nr-gold);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
a.hp-chart-card:hover .hp-chart-card-cta, a.hp-chart-card:focus-visible .hp-chart-card-cta { opacity: 1; transform: translateY(0); }

.hp-domains { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 860px) { .hp-domains { grid-template-columns: repeat(2, 1fr); } }
.hp-domain-card { background: var(--nr-surface); border: 1px solid var(--nr-line); border-radius: 12px; padding: 18px 16px; text-decoration: none; display: block; transition: border-color 0.15s ease, transform 0.15s ease; }
.hp-domain-card:hover { border-color: var(--nr-gold); transform: translateY(-2px); }
.hp-domain-glyph { width: 36px; height: 36px; border-radius: 9px; background: var(--nr-raised2); border: 1px solid var(--nr-line); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; color: var(--nr-gold); }
.hp-domain-glyph svg { width: 20px; height: 20px; }
.hp-dark .hp-domain-card h3 { font-size: 0.98rem; margin: 0 0 4px; color: var(--nr-text); font-family: "Fjalla One", system-ui, sans-serif; font-weight: 400; }
.hp-dark .hp-domain-card p { font-size: 0.78rem; color: var(--nr-dim); margin: 0; line-height: 1.5; }

/* Personal-narrative section stays in the SITE'S NORMAL light theme
   (style.css's own .card/.page-shell), rendered via the regular
   {% block content %} below the full-bleed hero - a deliberate style
   break, not an oversight: the hero is the "product" pitch, everything
   below it is the same page language every other report in this app
   already uses. No hp- styling needed here at all. */

@keyframes hpRiseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.hp-rise { animation: hpRiseIn 0.55s ease backwards; }
.hp-rise-1 { animation-delay: 0.02s; } .hp-rise-2 { animation-delay: 0.10s; } .hp-rise-3 { animation-delay: 0.18s; }
.hp-rise-4 { animation-delay: 0.26s; } .hp-rise-5 { animation-delay: 0.34s; }
@media (prefers-reduced-motion: reduce) { .hp-rise { animation: none; } }
