/* The Churchill — brand asset hookups (CH-only).
   Self-hosted fonts. font-display:swap so the page paints first. */

@font-face {
  font-family: 'Gabriela Stencil';
  src: url('/fonts/GabrielaStencil-Black.woff2') format('woff2'),
       url('/fonts/GabrielaStencil-Black.ttf') format('truetype');
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Univers LT Std';
  src: url('/fonts/UniversLTStd-Ex.otf') format('opentype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Univers LT Std';
  src: url('/fonts/UniversLTStd-Light.otf') format('opentype');
  font-weight: 300; font-style: normal; font-display: swap;
}

/* ── BRAND TYPOGRAPHY: applied across churchill + every ch-* variant ── */
:root[data-theme="churchill"] body,
:root[data-theme^="ch-"] body {
  font-family: 'Univers LT Std', -apple-system, system-ui, sans-serif;
  font-weight: 300;
}

:root[data-theme="churchill"] .brand-display,
:root[data-theme^="ch-"] .brand-display,
:root[data-theme="churchill"] .hub-abs-title,
:root[data-theme^="ch-"] .hub-abs-title,
:root[data-theme="churchill"] h1.brand,
:root[data-theme^="ch-"] h1.brand,
:root[data-theme="churchill"] h2.brand,
:root[data-theme^="ch-"] h2.brand {
  font-family: 'Gabriela Stencil', Georgia, serif;
  font-weight: 900;
  letter-spacing: 0.02em;
}

/* ── LIVE LOCKUP: roadrunner PNG + wordmark PNG ── */
.ch-lockup {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
}
.ch-lockup .ch-roadrunner-mark {
  width: 70px;
  height: auto;
  display: block;
}
.ch-lockup .ch-wordmark-img {
  width: 180px;
  height: auto;
  display: block;
}
/* Header lockup */
.ch-lockup-header .ch-roadrunner-mark { width: 90px; }
.ch-lockup-header .ch-wordmark-img { width: 200px; }
@media (max-width: 768px) {
  .ch-lockup-header .ch-roadrunner-mark { width: 72px; }
  .ch-lockup-header .ch-wordmark-img { width: 160px; }
}
/* Splash lockup — hero scale */
.ch-lockup-splash .ch-roadrunner-mark { width: 140px; }
.ch-lockup-splash .ch-wordmark-img { width: 320px; }
@media (max-width: 768px) {
  .ch-lockup-splash .ch-roadrunner-mark { width: 110px; }
  .ch-lockup-splash .ch-wordmark-img { width: 240px; }
}

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

/* ── SPLASH DECORATION: roadrunner, large + faint, slow rotation ── */
.ch-splash-stage {
  position: relative;
  width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
}
.ch-splash-bg {
  position: absolute;
  top: 50%; left: 50%;
  /* Sized by vmin so the crest's full rotation stays on-screen. The old
     680px / 110vw gave it a ~940px spinning diagonal that exceeded the
     viewport, clipping the crest top & bottom as it turned. */
  width: min(660px, 66vmin);
  height: auto;
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
  transform-origin: 50% 50%;
  animation: ch-splash-rot 180s linear infinite;
}
@media (max-width: 768px) {
  /* Stop the infinite rotation on phones: an animating large PNG layer is a
     continuous GPU/compositing cost (Jefferson House uses a vector SVG here and
     does not crash). Combined with shrinking the brand PNGs, this cuts the
     mobile GPU memory that was tipping iOS WebKit into an OOM renderer crash. */
  .ch-splash-bg { opacity: 0.12; animation: none; transform: translate(-50%, -50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ch-splash-bg { animation: none; transform: translate(-50%, -50%); }
}
@keyframes ch-splash-rot {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
.ch-splash-stage > *:not(.ch-splash-bg) {
  position: relative; z-index: 2;
}

/* ── DESERT-SUNSET SPLASH HERO ── */
.ch-splash-hero {
  text-align: center;
  position: relative;
  padding: 32px 16px 48px;
  max-width: 760px;
  margin: 0 auto;
}
.ch-splash-hero .ch-phx {
  font-family: 'Univers LT Std', sans-serif;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 12px;
  margin: 18px 0 22px;
  opacity: 0.9;
}
.ch-splash-hero .ch-tagline {
  font-family: 'Gabriela Stencil', Georgia, serif;
  font-weight: 900;
  font-size: 42px;
  line-height: 1.05;
  color: var(--text);
  letter-spacing: 0.01em;
  margin: 28px 0 16px;
  text-transform: uppercase;
}
@media (max-width: 768px) {
  .ch-splash-hero .ch-tagline { font-size: 30px; }
}
.ch-splash-hero .ch-tagline-sub {
  font-family: 'Univers LT Std', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 11px;
  color: var(--accent);
  opacity: 0.85;
  margin: 8px 0 0;
}
.ch-splash-hero .ch-marquee-btn {
  margin-top: 36px;
  display: inline-block;
  padding: 14px 36px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: 'Univers LT Std', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 13px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}
.ch-splash-hero .ch-marquee-btn:hover {
  background: var(--accent-dim);
}
.ch-splash-hero .ch-marquee-btn:active { transform: translateY(1px); }

/* ── ACCENT POPS: hover + active states ── */
:root[data-theme="churchill"] .card:hover,
:root[data-theme^="ch-"] .card:hover,
:root[data-theme="churchill"] .stat-card:hover,
:root[data-theme^="ch-"] .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="churchill"] .theme-btn.active,
:root[data-theme^="ch-"] .theme-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}
:root[data-theme="churchill"] .glance-bar .gs-value,
:root[data-theme^="ch-"] .glance-bar .gs-value,
:root[data-theme="churchill"] .stat-card .sw-value,
:root[data-theme^="ch-"] .stat-card .sw-value {
  color: var(--accent);
}

/* ── DASHBOARD TYPOGRAPHY: Gabriela Stencil on tile titles + section labels ── */
:root[data-theme="churchill"] .card-title,
:root[data-theme^="ch-"] .card-title {
  font-family: 'Gabriela Stencil', Georgia, serif;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 14px;
  white-space: normal;
}
:root[data-theme="churchill"] .card-desc,
:root[data-theme^="ch-"] .card-desc {
  color: var(--text-muted);
  font-family: 'Univers LT Std', sans-serif;
  font-weight: 300;
  letter-spacing: 0;
}
:root[data-theme="churchill"] .section-label,
:root[data-theme^="ch-"] .section-label {
  font-family: 'Gabriela Stencil', Georgia, serif;
  font-weight: 900;
  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="churchill"] .section-label::before,
:root[data-theme^="ch-"] .section-label::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  background-image: url('/brand/ch-roadrunner-white.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.7;
}
:root[data-theme="churchill"] .subtitle,
:root[data-theme^="ch-"] .subtitle {
  font-family: 'Gabriela Stencil', Georgia, serif;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.12em;
  font-size: 22px;
  opacity: 0.85;
  margin-top: 6px;
  text-transform: uppercase;
}
@media (max-width: 768px) {
  :root[data-theme="churchill"] .subtitle,
  :root[data-theme^="ch-"] .subtitle {
    font-size: 18px;
    letter-spacing: 0.10em;
  }
}

/* ── AUTH LABEL READABILITY ── */
:root[data-theme="churchill"] .auth-label,
:root[data-theme^="ch-"] .auth-label {
  color: var(--text-muted);
  font-family: 'Univers LT Std', sans-serif;
  font-weight: 300;
}

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

:root[data-theme="churchill"] .stat-widget,
:root[data-theme^="ch-"] .stat-widget {
  min-height: 96px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
:root[data-theme="churchill"] .stat-widget .sw-label,
:root[data-theme^="ch-"] .stat-widget .sw-label {
  font-family: 'Univers LT Std', sans-serif;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
}
:root[data-theme="churchill"] .stat-widget .sw-value,
:root[data-theme^="ch-"] .stat-widget .sw-value {
  font-family: 'Gabriela Stencil', Georgia, serif;
  font-weight: 900;
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.02em;
}
:root[data-theme="churchill"] .stat-widget .sw-sub,
:root[data-theme^="ch-"] .stat-widget .sw-sub {
  font-family: 'Univers LT Std', sans-serif;
  font-weight: 300;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0;
}

/* Glance bar */
:root[data-theme="churchill"] .glance-bar,
:root[data-theme^="ch-"] .glance-bar {
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
:root[data-theme="churchill"] .glance-btn,
:root[data-theme^="ch-"] .glance-btn {
  font-family: 'Univers LT Std', sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
  padding: 6px 14px;
}

/* Controls/toolbar */
:root[data-theme="churchill"] .controls-row,
:root[data-theme^="ch-"] .controls-row {
  justify-content: center;
  margin-bottom: 12px;
}
:root[data-theme="churchill"] .toolbar,
:root[data-theme^="ch-"] .toolbar {
  gap: 8px;
}
:root[data-theme="churchill"] .tool-btn,
:root[data-theme^="ch-"] .tool-btn {
  font-family: 'Univers LT Std', sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* AI bar */
:root[data-theme="churchill"] .ai-bar,
:root[data-theme^="ch-"] .ai-bar {
  margin-bottom: 14px;
}
:root[data-theme="churchill"] .ai-bar-inner,
:root[data-theme^="ch-"] .ai-bar-inner {
  padding: 10px 14px;
}
:root[data-theme="churchill"] .ai-input,
:root[data-theme^="ch-"] .ai-input {
  font-family: 'Univers LT Std', sans-serif;
  font-weight: 300;
  font-size: 13px;
}
:root[data-theme="churchill"] .ai-submit,
:root[data-theme^="ch-"] .ai-submit {
  font-family: 'Univers LT Std', sans-serif;
  font-weight: 700;
  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="churchill"] .health-bar,
:root[data-theme^="ch-"] .health-bar {
  margin-bottom: 10px;
}

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