/* Jefferson House — brand asset hookups (JH-only).
   Self-hosted fonts. font-display:swap so the page paints first.

   Hub typography note: the marketing-site script face (Fraunces wonky italic)
   is intentionally NOT used for the hub's working chrome. This is a dense,
   view-only back-office surface, so Inter carries the UI and the numbers
   (tabular lining figures), Sansita is reserved for structural section
   labels, and a single upright Fraunces line survives on the login splash as
   the one brand moment. See git history for the marketing-site treatment. */

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/Fraunces-Variable.ttf') format('truetype-variations');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/Fraunces-Italic-Variable.ttf') format('truetype-variations');
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Sansita';
  src: url('/fonts/Sansita-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Sansita';
  src: url('/fonts/Sansita-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Variable.ttf') format('truetype-variations');
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* ── BRAND FONT STACKS ──
   Centralized so every rule shares one set of metric-friendly fallbacks.
   The serif fallbacks lead with high-x-height oldstyle faces so the pre-swap
   paint sits close to Fraunces/Sansita and layout barely shifts on load. */
:root[data-theme="jefferson-house"],
:root[data-theme^="jh-"] {
  --jh-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --jh-display: 'Fraunces', 'Hoefler Text', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --jh-label: 'Sansita', 'Hoefler Text', 'Iowan Old Style', Georgia, serif;
}

/* ── BRAND TYPOGRAPHY: applied across jefferson-house + every jh-* variant ──
   Inter carries the working UI and the numbers; Sansita is held back for
   structural section labels + the splash eyebrow; the only serif "moment" is
   the upright splash tagline. The marketing script italic stays off the hub. */
:root[data-theme="jefferson-house"] body,
:root[data-theme^="jh-"] body {
  font-family: var(--jh-sans);
  /* Crisp text on the dark hub: antialias the variable faces, size them
     optically, and stay on the real weights/italics we ship (no faux bold). */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  font-synthesis: none;
  font-kerning: normal;
  font-feature-settings: 'cv05' 1, 'calt' 1;
}

/* Light theme (jh-sand): grayscale smoothing thins type on a pale ground,
   so defer to the OS rather than forcing the dark-UI antialiasing. */
:root[data-theme="jh-sand"] body {
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

/* Tabular lining figures + slashed zero wherever a number carries meaning,
   so columns align and 0 never reads as O on a financial surface. */
:root[data-theme="jefferson-house"] .sw-value,
:root[data-theme^="jh-"] .sw-value,
:root[data-theme="jefferson-house"] .gs-value,
:root[data-theme^="jh-"] .gs-value {
  font-variant-numeric: tabular-nums lining-nums slashed-zero;
}

:root[data-theme="jefferson-house"] .brand-display,
:root[data-theme^="jh-"] .brand-display,
:root[data-theme="jefferson-house"] .hub-abs-title,
:root[data-theme^="jh-"] .hub-abs-title,
:root[data-theme="jefferson-house"] h1.brand,
:root[data-theme^="jh-"] h1.brand,
:root[data-theme="jefferson-house"] h2.brand,
:root[data-theme^="jh-"] h2.brand {
  /* Hub headings are clean Inter, not the marketing site's script italic —
     this is a dense, view-only back-office surface, so legibility wins. */
  font-family: var(--jh-sans);
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* ── LIVE LOCKUP: cowboy bird PNG + wordmark-with-rays SVG ── */
.jh-lockup {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  line-height: 1;
}
.jh-lockup .jh-bird-mark {
  width: 70px;
  height: auto;
  display: block;
}
.jh-lockup .jh-wordmark-img {
  width: 200px;
  height: auto;
  display: block;
}
/* Header lockup — bird+wordmark combined SVG, sized for header height */
.jh-lockup-header { gap: 8px; }
.jh-lockup-header .jh-bird-mark { width: 80px; }
.jh-lockup-header .jh-wordmark-img { width: 150px; }
@media (max-width: 768px) {
  .jh-lockup-header .jh-bird-mark { width: 64px; }
  .jh-lockup-header .jh-wordmark-img { width: 120px; }
}
/* Splash lockup — hero scale (bird+wordmark combined SVG, taller aspect) */
.jh-lockup-splash { gap: 14px; }
.jh-lockup-splash .jh-bird-mark { width: 140px; }
.jh-lockup-splash .jh-wordmark-img { width: 300px; max-width: 70vw; }
@media (max-width: 768px) {
  .jh-lockup-splash .jh-bird-mark { width: 110px; }
  .jh-lockup-splash .jh-wordmark-img { width: 220px; }
}

/* ── HEADER LAYOUT: lockup centered, narrow gap to tiles ── */
:root[data-theme="jefferson-house"] .header-row,
:root[data-theme^="jh-"] .header-row {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  position: relative;
}
:root[data-theme="jefferson-house"] .header-text,
:root[data-theme^="jh-"] .header-text {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
:root[data-theme="jefferson-house"] .auth-area,
:root[data-theme^="jh-"] .auth-area {
  position: absolute; top: 0; right: 0;
}
@media (max-width: 768px) {
  :root[data-theme="jefferson-house"] .auth-area,
  :root[data-theme^="jh-"] .auth-area {
    position: static;
    margin-top: 4px;
  }
}

/* ── SPLASH DECORATION: bird, large + faint, slow rotation ── */
.jh-splash-stage {
  position: relative;
  width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
}
.jh-splash-bg {
  position: absolute;
  top: 50%; left: 50%;
  width: auto;
  height: 90vh;
  max-height: 760px;
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
  transform-origin: 50% 50%;
  animation: jh-splash-rot 180s linear infinite;
}
@media (max-width: 768px) {
  .jh-splash-bg { height: 70vh; max-height: 500px; opacity: 0.08; }
}
@media (prefers-reduced-motion: reduce) {
  .jh-splash-bg { animation: none; transform: translate(-50%, -50%); }
}
@keyframes jh-splash-rot {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
.jh-splash-stage > *:not(.jh-splash-bg) {
  position: relative; z-index: 2;
}

/* ── MAGAZINE-COVER SPLASH HERO ── */
.jh-splash-hero {
  text-align: center;
  position: relative;
  padding: 32px 16px 48px;
  max-width: 760px;
  margin: 0 auto;
}
.jh-splash-hero .jh-phx {
  font-family: var(--jh-label);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 12px;
  margin: 18px 0 22px;
  opacity: 0.9;
}
.jh-splash-hero .jh-tagline {
  /* The login splash keeps one brand serif moment, but upright + de-wonked
     rather than the marketing site's full script italic. */
  font-family: var(--jh-display);
  font-style: normal;
  font-variation-settings: 'SOFT' 0, 'WONK' 0, 'opsz' 96, 'wght' 600;
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 28px 0 16px;
}
@media (max-width: 768px) {
  .jh-splash-hero .jh-tagline { font-size: 28px; }
}
.jh-splash-hero .jh-tagline-sub {
  font-family: var(--jh-label);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  color: var(--accent);
  opacity: 0.85;
  margin: 8px 0 0;
}
.jh-splash-hero .jh-marquee-btn {
  margin-top: 36px;
  display: inline-block;
  padding: 14px 36px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: var(--jh-sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 13px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}
.jh-splash-hero .jh-marquee-btn:hover {
  background: var(--accent-dim);
}
.jh-splash-hero .jh-marquee-btn:active { transform: translateY(1px); }

/* ── ACCENT POPS: hover + active states ── */
:root[data-theme="jefferson-house"] .card:hover,
:root[data-theme^="jh-"] .card:hover,
:root[data-theme="jefferson-house"] .stat-card:hover,
:root[data-theme^="jh-"] .stat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 6px 22px rgba(0,0,0,0.18);
}
:root[data-theme="jefferson-house"] .theme-btn.active,
:root[data-theme^="jh-"] .theme-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}
:root[data-theme="jefferson-house"] .glance-bar .gs-value,
:root[data-theme^="jh-"] .glance-bar .gs-value,
:root[data-theme="jefferson-house"] .stat-card .sw-value,
:root[data-theme^="jh-"] .stat-card .sw-value {
  color: var(--accent);
}

/* ── DASHBOARD TYPOGRAPHY: Inter on the dense working UI, Sansita reserved
   for the structural section labels (upright display, never the script). ── */
:root[data-theme="jefferson-house"] .card-title,
:root[data-theme^="jh-"] .card-title {
  font-family: var(--jh-sans);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 13px;
  white-space: normal;
}
:root[data-theme="jefferson-house"] .card-desc,
:root[data-theme^="jh-"] .card-desc {
  color: var(--text-muted);
  font-family: var(--jh-sans);
  letter-spacing: 0;
}
:root[data-theme="jefferson-house"] .section-label,
:root[data-theme^="jh-"] .section-label {
  font-family: var(--jh-label);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.16em;
  font-size: 13px;
  border-bottom-color: var(--border);
  padding-bottom: 8px;
  position: relative;
  padding-left: 22px;
}
:root[data-theme="jefferson-house"] .section-label::before,
:root[data-theme^="jh-"] .section-label::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  background-image: url('/brand/jh-bird-cowboy-white.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.7;
}
:root[data-theme="jefferson-house"] .subtitle,
:root[data-theme^="jh-"] .subtitle {
  /* Was the big Fraunces script italic — now a quiet, tracked Inter eyebrow
     that reads as a back-office label, not a magazine deck. */
  font-family: var(--jh-sans);
  font-style: normal;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 13px;
  opacity: 0.9;
  margin-top: 6px;
}
@media (max-width: 768px) {
  :root[data-theme="jefferson-house"] .subtitle,
  :root[data-theme^="jh-"] .subtitle {
    font-size: 12px;
  }
}

/* ── AUTH LABEL READABILITY ── */
:root[data-theme="jefferson-house"] .auth-label,
:root[data-theme^="jh-"] .auth-label {
  color: var(--text-muted);
  font-family: var(--jh-sans);
}

/* ── TOP-OF-PAGE LAYOUT: stats → AI → utilities → tiles, all symmetric ── */
:root[data-theme="jefferson-house"] .stats-row,
:root[data-theme^="jh-"] .stats-row {
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 1024px) {
  :root[data-theme="jefferson-house"] .stats-row,
  :root[data-theme^="jh-"] .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  :root[data-theme="jefferson-house"] .stats-row,
  :root[data-theme^="jh-"] .stats-row {
    grid-template-columns: 1fr;
  }
}

:root[data-theme="jefferson-house"] .stat-widget,
:root[data-theme^="jh-"] .stat-widget {
  min-height: 96px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
:root[data-theme="jefferson-house"] .stat-widget .sw-label,
:root[data-theme^="jh-"] .stat-widget .sw-label {
  font-family: var(--jh-sans);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
}
:root[data-theme="jefferson-house"] .stat-widget .sw-value,
:root[data-theme^="jh-"] .stat-widget .sw-value {
  /* Metrics are clean Inter, not script — tabular lining figures (set above)
     keep the digits aligned and instantly scannable. */
  font-family: var(--jh-sans);
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.01em;
}
:root[data-theme="jefferson-house"] .stat-widget .sw-sub,
:root[data-theme^="jh-"] .stat-widget .sw-sub {
  font-family: var(--jh-sans);
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0;
}

/* Glance bar: centered, single tight row */
:root[data-theme="jefferson-house"] .glance-bar,
:root[data-theme^="jh-"] .glance-bar {
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
:root[data-theme="jefferson-house"] .glance-btn,
:root[data-theme^="jh-"] .glance-btn {
  font-family: var(--jh-sans);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
  padding: 6px 14px;
}

/* Controls/toolbar row: centered + compact */
:root[data-theme="jefferson-house"] .controls-row,
:root[data-theme^="jh-"] .controls-row {
  justify-content: center;
  margin-bottom: 12px;
}
:root[data-theme="jefferson-house"] .toolbar,
:root[data-theme^="jh-"] .toolbar {
  gap: 8px;
}
:root[data-theme="jefferson-house"] .tool-btn,
:root[data-theme^="jh-"] .tool-btn {
  font-family: var(--jh-sans);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* AI bar: full-width with brand surface */
:root[data-theme="jefferson-house"] .ai-bar,
:root[data-theme^="jh-"] .ai-bar {
  margin-bottom: 14px;
}
:root[data-theme="jefferson-house"] .ai-bar-inner,
:root[data-theme^="jh-"] .ai-bar-inner {
  padding: 10px 14px;
}
:root[data-theme="jefferson-house"] .ai-input,
:root[data-theme^="jh-"] .ai-input {
  font-family: var(--jh-sans);
  font-size: 13px;
}
:root[data-theme="jefferson-house"] .ai-submit,
:root[data-theme^="jh-"] .ai-submit {
  font-family: var(--jh-sans);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  padding: 6px 14px;
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

:root[data-theme="jefferson-house"] .health-bar,
:root[data-theme^="jh-"] .health-bar {
  margin-bottom: 10px;
}

:root[data-theme="jefferson-house"] .quick-actions:empty,
:root[data-theme^="jh-"] .quick-actions:empty {
  display: none;
}
