/**
 * AstroPrecise — Nebula Observatory brand (ap-v730)
 * Decorative field only on backgrounds — honesty law on LIVE labels unchanged.
 * Load LAST on every page via ap-page-boot.js.
 */

html.ap-brand-nebula {
  --ap-nebula-violet: #6b4fd4;
  --ap-nebula-cyan: #3dd6ff;
  --ap-nebula-magenta: #c45bff;
  --ap-glass: rgba(8, 10, 18, 0.72);
  --ap-glass-border: rgba(200, 205, 214, 0.14);
  --ap-glass-glow: rgba(61, 214, 255, 0.12);
  --ap-radius-lg: 20px;
  --ap-radius-pill: 999px;
  --ap-shadow-elevated: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ── Atmospheric void (decorative) ── */
html.ap-brand-nebula,
html.ap-brand-nebula body {
  background-color: #000 !important;
  color: var(--ap-text-primary, #e8ebf0);
}

html.ap-brand-nebula body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 12% -8%, rgba(107, 79, 212, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 88% 8%, rgba(61, 214, 255, 0.14) 0%, transparent 50%),
    radial-gradient(ellipse 55% 45% at 50% 100%, rgba(196, 91, 255, 0.1) 0%, transparent 45%),
    radial-gradient(ellipse 120% 80% at 50% 40%, rgba(16, 16, 24, 0.9) 0%, #000 70%);
}

html.ap-brand-nebula body > * {
  position: relative;
  z-index: 1;
}

/* Subtle star dust */
html.ap-brand-nebula body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 80%, rgba(255, 255, 255, 0.35) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 70% 30%, rgba(255, 255, 255, 0.45) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 60%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
}

/* ── Masthead — floating glass observatory bar ── */
html.ap-brand-nebula .masthead {
  position: fixed !important;
  top: 12px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  width: min(960px, calc(100% - 24px)) !important;
  height: 52px !important;
  padding: 0 14px !important;
  border-radius: var(--ap-radius-pill) !important;
  background: var(--ap-glass) !important;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--ap-glass-border) !important;
  box-shadow: var(--ap-shadow-elevated), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  z-index: 100 !important;
}

html.ap-brand-nebula .masthead .page-wrap {
  max-width: none !important;
}

html.ap-brand-nebula .contents-nav a {
  font-size: 0.68rem !important;
  letter-spacing: 0.14em !important;
  color: var(--ap-silver-dim, #8b919c) !important;
  border-radius: var(--ap-radius-pill);
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

html.ap-brand-nebula .contents-nav a:hover,
html.ap-brand-nebula .contents-nav a:focus-visible {
  color: var(--ap-aurora-bright, #a8dcf2) !important;
  background: var(--ap-glass-glow);
}

html.ap-brand-nebula .wordmark-astro {
  color: var(--ap-silver-bright) !important;
  letter-spacing: 0.18em !important;
}

html.ap-brand-nebula .wordmark-precise {
  background: linear-gradient(135deg, #a8dcf2 0%, #7ec8e8 50%, #c45bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  font-style: normal !important;
  font-weight: 500 !important;
}

/* ── Hero copy — glass cast panel ── */
html.ap-brand-nebula.ap-observatory-home .hero-copy,
html.ap-brand-nebula body.ap-observatory-home #castDock {
  background: linear-gradient(165deg, rgba(12, 14, 22, 0.88) 0%, rgba(6, 8, 14, 0.72) 100%) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--ap-glass-border) !important;
  border-radius: var(--ap-radius-lg) !important;
  box-shadow: var(--ap-shadow-elevated), 0 0 40px var(--ap-glass-glow) !important;
  padding: clamp(16px, 3vw, 28px) !important;
}

html.ap-brand-nebula .eyebrow-rose,
html.ap-brand-nebula .hero-copy .eyebrow-rose {
  color: var(--ap-aurora, #7ec8e8) !important;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace) !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase !important;
}

html.ap-brand-nebula .display {
  font-size: clamp(2rem, 5.5vw, 3.35rem) !important;
  line-height: 1.05 !important;
  letter-spacing: -0.02em !important;
  font-weight: 500 !important;
}

html.ap-brand-nebula .display-accent {
  background: linear-gradient(120deg, #e8f4ff 0%, #7ec8e8 40%, #c45bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

html.ap-brand-nebula .standfirst,
html.ap-brand-nebula .hero-why-lead {
  font-size: clamp(1rem, 2.2vw, 1.15rem) !important;
  line-height: 1.55 !important;
  color: var(--ap-silver, #c8cdd6) !important;
  max-width: 42ch;
}

/* ── Unified CTA — aurora pill (kills brass gradient everywhere) ── */
html.ap-brand-nebula .btn-press,
html.ap-brand-nebula button.btn-press,
html.ap-brand-nebula input[type="submit"].btn-press,
html.ap-brand-nebula a.btn-press,
html.ap-brand-nebula body.ap-observatory-home #heroChapter .hero-form-row .btn-press,
html.ap-brand-nebula body.ap-observatory-home #heroChapter .hero-form-row button[type="submit"] {
  background: linear-gradient(135deg, #2ee6ff 0%, #7a5cff 55%, #ff4fd8 120%) !important;
  color: #04060c !important;
  border: none !important;
  border-radius: var(--ap-radius-pill) !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  font-size: 0.78rem !important;
  padding: 0.85rem 1.35rem !important;
  box-shadow: 0 0 28px rgba(46, 230, 255, 0.45), 0 12px 40px rgba(122, 92, 255, 0.35) !important;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s !important;
}

html.ap-brand-nebula .btn-press:hover,
html.ap-brand-nebula .btn-press:focus-visible {
  filter: brightness(1.08);
  box-shadow: 0 12px 36px rgba(61, 214, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
  transform: translateY(-1px);
}

html.ap-brand-nebula .btn-quiet {
  border-color: var(--ap-glass-border) !important;
  border-radius: var(--ap-radius-pill) !important;
  color: var(--ap-silver-bright) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

html.ap-brand-nebula .hero-form input[type="date"] {
  border-radius: 12px !important;
  border: 1px solid var(--ap-glass-border) !important;
  background: rgba(0, 0, 0, 0.45) !important;
  color: var(--ap-silver-bright) !important;
  padding: 0.75rem 1rem !important;
}

/* ── Model stage — cinematic vignette ── */
html.ap-brand-nebula body.ap-observatory-home #heroChapter .hero-solar-stage {
  background:
    radial-gradient(ellipse 85% 70% at 50% 42%, rgba(61, 214, 255, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 100% 100% at 50% 50%, #0a0a10 0%, #000 72%) !important;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.65) !important;
}

html.ap-brand-nebula body.ap-observatory-home #heroChapter .hero-solar-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(ellipse 75% 65% at 50% 48%, transparent 42%, rgba(0, 0, 0, 0.55) 100%);
}

/* ── Plinth tray — instrument deck ── */
html.ap-brand-nebula body.ap-observatory-home #orrery-lite-deck {
  background: linear-gradient(180deg, rgba(8, 10, 16, 0.95) 0%, rgba(4, 4, 8, 0.98) 100%) !important;
  border-top: 1px solid var(--ap-glass-border) !important;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.45) !important;
}

html.ap-brand-nebula .ap-explore-toggle {
  border-radius: var(--ap-radius-pill) !important;
  border: 1px solid rgba(61, 214, 255, 0.35) !important;
  background: rgba(61, 214, 255, 0.08) !important;
  color: var(--ap-aurora-bright) !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  font-size: 0.72rem !important;
}

/* ── Bottom nav — glass dock ── */
html.ap-brand-nebula .bottom-nav {
  background: rgba(6, 8, 14, 0.82) !important;
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  border-top: 1px solid var(--ap-glass-border) !important;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5) !important;
}

html.ap-brand-nebula .bottom-nav__item {
  color: var(--ap-silver-dim) !important;
  border-radius: 14px !important;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

html.ap-brand-nebula .bottom-nav__item.is-active {
  color: var(--ap-aurora-bright) !important;
  background: rgba(61, 214, 255, 0.1) !important;
  box-shadow: 0 0 20px rgba(61, 214, 255, 0.15), inset 0 0 0 1px rgba(61, 214, 255, 0.2) !important;
}

html.ap-brand-nebula .bottom-nav__item.is-active .bottom-nav__icon {
  filter: drop-shadow(0 0 6px rgba(61, 214, 255, 0.5));
}

/* ── Cards / plates sitewide ── */
html.ap-brand-nebula .card,
html.ap-brand-nebula .glass-card,
html.ap-brand-nebula .plate,
html.ap-brand-nebula .dept-list-item {
  background: var(--ap-glass) !important;
  border: 1px solid var(--ap-glass-border) !important;
  border-radius: var(--ap-radius-lg) !important;
  box-shadow: var(--ap-shadow-elevated) !important;
}

html.ap-brand-nebula .dept-list-item:hover {
  border-color: rgba(61, 214, 255, 0.28) !important;
  box-shadow: var(--ap-shadow-elevated), 0 0 32px var(--ap-glass-glow) !important;
}

/* ── Live pill ── */
html.ap-brand-nebula .hero-live-pill,
html.ap-brand-nebula .ap-live-dot,
html.ap-brand-nebula .ap-mw-live {
  border-color: rgba(61, 214, 255, 0.35) !important;
  background: rgba(61, 214, 255, 0.08) !important;
  color: var(--ap-aurora-bright) !important;
}

html.ap-brand-nebula .hero-live-pill__dot {
  background: var(--ap-aurora) !important;
  box-shadow: 0 0 12px rgba(61, 214, 255, 0.65) !important;
}

/* ── Standard site-header (chart / explore / horoscope) ── */
html.ap-brand-nebula .site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ap-glass) !important;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--ap-glass-border) !important;
  box-shadow: var(--ap-shadow-elevated);
}

html.ap-brand-nebula .navbar__link.is-active,
html.ap-brand-nebula .navbar__link[aria-current="page"] {
  color: var(--ap-aurora-bright) !important;
}

html.ap-brand-nebula .logo-text__precise {
  background: linear-gradient(135deg, #a8dcf2 0%, #7ec8e8 50%, #c45bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

/* ── Explore / chart page chrome ── */
html.ap-brand-nebula body.page-explore .masthead,
html.ap-brand-nebula body.page-chart .masthead {
  position: fixed !important;
}

html.ap-brand-nebula .ap-page-hero,
html.ap-brand-nebula .chart-hero,
html.ap-brand-nebula .explore-hero {
  padding-top: 72px !important;
}

/* ── Footer ── */
html.ap-brand-nebula .night-watch,
html.ap-brand-nebula footer {
  background: rgba(4, 4, 8, 0.92) !important;
  border-top: 1px solid var(--ap-glass-border) !important;
}

/* ── ap-v750 PRODUCT RESET — hide educational clutter on first paint ── */
html.ap-brand-nebula #explore-legend[data-collapsed="true"] .explore-legend__body {
  display: none !important;
}
html.ap-brand-nebula #explore-legend[data-collapsed="false"] .explore-legend__body {
  display: block !important;
}
html.ap-brand-nebula #explore-legend {
  top: 72px !important;
  right: 16px !important;
  max-width: 220px !important;
  background: rgba(6, 10, 18, 0.55) !important;
  border: 1px solid rgba(46, 230, 255, 0.2) !important;
  border-radius: 14px !important;
  backdrop-filter: blur(14px);
}
html.ap-brand-nebula #explore-legend .explore-legend__toggle {
  font-size: 0.68rem !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: #7ee9ff !important;
}
/* Full-bleed stage — model owns the viewport */
html.ap-brand-nebula.ap-observatory-home #heroChapter .hero-solar-stage {
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(46, 230, 255, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 100% 80% at 50% 100%, rgba(122, 92, 255, 0.18) 0%, transparent 50%),
    #000 !important;
}
html.ap-brand-nebula.ap-observatory-home .display {
  font-size: clamp(2.15rem, 6vw, 3.6rem) !important;
}
html.ap-brand-nebula.ap-observatory-home .display-accent {
  background: linear-gradient(120deg, #ffffff 0%, #2ee6ff 40%, #ff4fd8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

@media (max-width: 640px) {
  html.ap-brand-nebula .masthead {
    top: 8px !important;
    height: 48px !important;
  }

  html.ap-brand-nebula.ap-observatory-home .hero-copy {
    margin: 8px !important;
    border-radius: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.ap-brand-nebula .hero-live-pill__dot {
    animation: none !important;
  }
  html.ap-brand-nebula .btn-press:hover {
    transform: none !important;
  }
}
