/* Better Days — brand asset hookups (BD-only).
   Self-hosted fonts. font-display:swap so the page paints first. */

@font-face {
  font-family: 'Bantley';
  src: url('/fonts/Bantley.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Birdie';
  src: url('/fonts/Birdie.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Cutive Mono';
  src: url('/fonts/CutiveMono-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ── BRAND TYPOGRAPHY: applied across better-days + every bd-* variant ── */
:root[data-theme="better-days"] body,
:root[data-theme^="bd-"] body {
  font-family: 'Cutive Mono', ui-monospace, 'Courier New', monospace;
}

:root[data-theme="better-days"] .brand-display,
:root[data-theme^="bd-"] .brand-display,
:root[data-theme="better-days"] .hub-abs-title,
:root[data-theme^="bd-"] .hub-abs-title,
:root[data-theme="better-days"] h1.brand,
:root[data-theme^="bd-"] h1.brand,
:root[data-theme="better-days"] h2.brand,
:root[data-theme^="bd-"] h2.brand {
  font-family: 'Birdie', Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── LIVE LOCKUP: sunburst PNG + Bantley wordmark text (no slide-baked SVG) ── */
.bd-lockup {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1;
}
.bd-lockup .bd-sunburst-mark {
  width: 80px;
  height: auto;
  display: block;
  margin-bottom: -22px;
}
.bd-lockup .bd-wordmark-text {
  font-family: 'Bantley', 'Snell Roundhand', cursive;
  color: var(--accent);
  font-size: 64px;
  line-height: 0.95;
  letter-spacing: 0;
  white-space: nowrap;
}
/* Header lockup — 2.5x scale */
.bd-lockup-header .bd-sunburst-mark { width: 110px; margin-bottom: -28px; }
.bd-lockup-header .bd-wordmark-text { font-size: 90px; }
@media (max-width: 768px) {
  .bd-lockup-header .bd-sunburst-mark { width: 90px; margin-bottom: -24px; }
  .bd-lockup-header .bd-wordmark-text { font-size: 72px; }
}
/* Splash lockup — hero scale */
.bd-lockup-splash .bd-sunburst-mark { width: 160px; margin-bottom: -34px; }
.bd-lockup-splash .bd-wordmark-text { font-size: 128px; }
@media (max-width: 768px) {
  .bd-lockup-splash .bd-sunburst-mark { width: 120px; margin-bottom: -28px; }
  .bd-lockup-splash .bd-wordmark-text { font-size: 84px; }
}

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

/* ── SPLASH DECORATION SUNBURST: large, faint, slow rotate ── */
.bd-splash-stage {
  position: relative;
  width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
}
/* PIN wall: stage fills the fixed overlay so the rotating sunburst clips at the
   viewport edge (intentional bleed), not mid-screen at the content-height stage box. */
.hub-auth-blocking-screen .bd-splash-stage { flex: 1; }
.bd-sunburst-bg {
  position: absolute;
  top: 50%; left: 50%;
  width: 760px;
  max-width: 110vw;
  height: auto;
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
  transform-origin: 50% 50%;
  animation: bd-sunburst-rot 140s linear infinite;
}
@media (max-width: 768px) {
  .bd-sunburst-bg { width: 540px; opacity: 0.20; }
}
@media (prefers-reduced-motion: reduce) {
  .bd-sunburst-bg { animation: none; transform: translate(-50%, -50%); }
}
@keyframes bd-sunburst-rot {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
.bd-splash-stage > *:not(.bd-sunburst-bg) {
  position: relative; z-index: 2;
}

/* ── MAGAZINE-COVER SPLASH HERO (no neon glow) ── */
.bd-splash-hero {
  text-align: center;
  position: relative;
  padding: 32px 16px 48px;
  max-width: 720px;
  margin: 0 auto;
}
.bd-splash-hero .bd-phx {
  font-family: 'Cutive Mono', monospace;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 12px;
  margin: 14px 0 22px;
  opacity: 0.9;
}
.bd-splash-hero .bd-tagline {
  font-family: 'Birdie', Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  color: var(--text);
  opacity: 0.78;
  margin: 28px 0 0;
}
.bd-splash-hero .bd-tagline em {
  font-style: normal;
  display: block;
  opacity: 0.6;
  margin-top: 6px;
}
.bd-splash-hero .bd-marquee-btn {
  margin-top: 36px;
  display: inline-block;
  padding: 14px 36px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: 'Cutive Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 13px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}
.bd-splash-hero .bd-marquee-btn:hover {
  background: var(--accent-dim);
}
.bd-splash-hero .bd-marquee-btn:active { transform: translateY(1px); }

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

/* ── DASHBOARD TYPOGRAPHY: Birdie on tile titles + section labels + subtitle ── */
:root[data-theme="better-days"] .card-title,
:root[data-theme^="bd-"] .card-title {
  font-family: 'Birdie', Georgia, serif;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 13px;
  white-space: normal;
}
:root[data-theme="better-days"] .card-desc,
:root[data-theme^="bd-"] .card-desc {
  color: var(--text-muted);
  font-family: 'Cutive Mono', ui-monospace, monospace;
  letter-spacing: 0.02em;
}
:root[data-theme="better-days"] .section-label,
:root[data-theme^="bd-"] .section-label {
  font-family: 'Birdie', Georgia, serif;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.18em;
  font-size: 13px;
  border-bottom-color: var(--border);
  padding-bottom: 8px;
  position: relative;
  padding-left: 22px;
}
:root[data-theme="better-days"] .section-label::before,
:root[data-theme^="bd-"] .section-label::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  background-image: url('/brand/better-days-sunburst.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.7;
}
:root[data-theme="better-days"] .subtitle,
:root[data-theme^="bd-"] .subtitle {
  font-family: 'Birdie', Georgia, serif;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.3em;
  font-size: 22px;
  opacity: 0.85;
  margin-top: 6px;
}
@media (max-width: 768px) {
  :root[data-theme="better-days"] .subtitle,
  :root[data-theme^="bd-"] .subtitle {
    font-size: 18px;
    letter-spacing: 0.24em;
  }
}

/* ── AUTH LABEL READABILITY ── */
:root[data-theme="better-days"] .auth-label,
:root[data-theme^="bd-"] .auth-label {
  color: var(--text-muted);
  font-family: 'Cutive Mono', ui-monospace, monospace;
}

/* ── TOP-OF-PAGE LAYOUT: stats → AI → utilities → tiles, all symmetric ── */

/* Stats row: 3 equal columns (was 1fr 1fr → asymmetric with 3 widgets) */
:root[data-theme="better-days"] .stats-row,
:root[data-theme^="bd-"] .stats-row {
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 1024px) {
  :root[data-theme="better-days"] .stats-row,
  :root[data-theme^="bd-"] .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  :root[data-theme="better-days"] .stats-row,
  :root[data-theme^="bd-"] .stats-row {
    grid-template-columns: 1fr;
  }
}

/* Stat widget styling under brand: equal height, Birdie label, citron value */
:root[data-theme="better-days"] .stat-widget,
:root[data-theme^="bd-"] .stat-widget {
  min-height: 96px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
:root[data-theme="better-days"] .stat-widget .sw-label,
:root[data-theme^="bd-"] .stat-widget .sw-label {
  font-family: 'Birdie', Georgia, serif;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
}
:root[data-theme="better-days"] .stat-widget .sw-value,
:root[data-theme^="bd-"] .stat-widget .sw-value {
  font-family: 'Birdie', Georgia, serif;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.02em;
}
:root[data-theme="better-days"] .stat-widget .sw-sub,
:root[data-theme^="bd-"] .stat-widget .sw-sub {
  font-family: 'Cutive Mono', monospace;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* Glance bar: centered, single tight row */
:root[data-theme="better-days"] .glance-bar,
:root[data-theme^="bd-"] .glance-bar {
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
:root[data-theme="better-days"] .glance-btn,
:root[data-theme^="bd-"] .glance-btn {
  font-family: 'Cutive Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
  padding: 6px 14px;
}

/* Controls/toolbar row: centered + compact */
:root[data-theme="better-days"] .controls-row,
:root[data-theme^="bd-"] .controls-row {
  justify-content: center;
  margin-bottom: 12px;
}
:root[data-theme="better-days"] .toolbar,
:root[data-theme^="bd-"] .toolbar {
  gap: 8px;
}
:root[data-theme="better-days"] .tool-btn,
:root[data-theme^="bd-"] .tool-btn {
  font-family: 'Cutive Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* AI bar: full-width with brand surface, consistent 14px margin to next block */
:root[data-theme="better-days"] .ai-bar,
:root[data-theme^="bd-"] .ai-bar {
  margin-bottom: 14px;
}
:root[data-theme="better-days"] .ai-bar-inner,
:root[data-theme^="bd-"] .ai-bar-inner {
  padding: 10px 14px;
}
:root[data-theme="better-days"] .ai-input,
:root[data-theme^="bd-"] .ai-input {
  font-family: 'Cutive Mono', monospace;
  font-size: 13px;
}
:root[data-theme="better-days"] .ai-submit,
:root[data-theme^="bd-"] .ai-submit {
  font-family: 'Cutive Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  padding: 6px 14px;
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

/* Health bar: tight margin if present (BD usually has no integrations) */
:root[data-theme="better-days"] .health-bar,
:root[data-theme^="bd-"] .health-bar {
  margin-bottom: 10px;
}

/* Quick actions row: hide on BD if empty (often is) */
:root[data-theme="better-days"] .quick-actions:empty,
:root[data-theme^="bd-"] .quick-actions:empty {
  display: none;
}
