:root,
[data-theme="dark"] {
  --brand-primary: #0959C8;
  --brand-hover: #0747A3;
  --surface-dark: #0A0E17;
  --surface-darker: #060910;
  --text-primary: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.55);
  --text-soft: rgba(255, 255, 255, 0.75);
  --text-faint: rgba(255, 255, 255, 0.4);
  --brand-text: #5694E4;
  --brand-text-soft: #5694E4;
  --text-on-brand: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --nav-glass: #060910;
  --nav-border: rgba(255, 255, 255, 0.08);
  --aurora-opacity: 0;
  --gradient-text-start: #ffffff;
  --section-tint: rgba(255, 255, 255, 0.02);
  --section-tint-hover: rgba(255, 255, 255, 0.06);
  --ghost-bg: rgba(255, 255, 255, 0.04);
  --ghost-border: rgba(255, 255, 255, 0.08);
  --ghost-text: rgba(255, 255, 255, 0.9);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 255, 255, 0.08);
  --shadow-glass: none;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --nav-height: 4.5rem;
  --mobile-nav-height: 4rem;
  --transition-smooth: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="light"] {
  --brand-primary: #0959C8;
  --brand-hover: #0747A3;
  --surface-dark: #f1f5f9;
  --surface-darker: #f8fafc;
  --text-primary: #0f172a;
  --text-muted: rgba(15, 23, 42, 0.62);
  --text-faint: rgba(15, 23, 42, 0.48);
  --text-soft: rgba(15, 23, 42, 0.78);
  --text-on-brand: #ffffff;
  --brand-text: #0747A3;
  --brand-text-soft: #0959C8;
  --glass-bg: rgba(15, 23, 42, 0.02);
  --glass-border: rgba(15, 23, 42, 0.08);
  --nav-glass: #f8fafc;
  --nav-border: rgba(15, 23, 42, 0.08);
  --aurora-opacity: 0;
  --gradient-text-start: #0f172a;
  --section-tint: rgba(9, 89, 200, 0.03);
  --section-tint-hover: rgba(9, 89, 200, 0.06);
  --ghost-bg: rgba(15, 23, 42, 0.03);
  --ghost-border: rgba(15, 23, 42, 0.08);
  --ghost-text: #0f172a;
  --input-bg: rgba(255, 255, 255, 0.95);
  --input-border: rgba(15, 23, 42, 0.08);
  --shadow-glass: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-family: 'Poppins', 'Inter', system-ui, -apple-system, sans-serif;
}

body, button, input, textarea, select {
  font-family: 'Poppins', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--surface-darker);
  color: var(--text-primary);
}

/* Semantic theme colors - work in dark & light without Tailwind text-white */
.text-theme {
  color: var(--text-primary);
}

.text-theme-muted {
  color: var(--text-muted);
}

.text-theme-soft {
  color: var(--text-soft);
}

.text-theme-faint {
  color: var(--text-faint);
}



.border-theme {
  border-color: var(--glass-border);
}

.bg-section-tint {
  background-color: var(--section-tint);
}

.hover\:text-theme:hover {
  color: var(--text-primary);
}

.hover\:bg-section-tint:hover {
  background-color: var(--section-tint-hover);
}

#main-content,
footer {
  color: var(--text-primary);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  background: var(--brand-primary);
  color: white;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--transition-smooth);
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Glass */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: none;
  transition: background-color 0.2s, border-color 0.2s;
}

.glass-nav {
  background: var(--nav-glass);
  border-bottom: 1px solid var(--nav-border);
  transition: background-color 0.2s, border-color 0.2s;
}

/* Theme toggle */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 9999px;
  background: var(--glass-bg);
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--brand-primary);
  background-color: var(--section-tint-hover);
}

.theme-toggle:focus-visible {
  outline: 2px solid #5694E4;
  outline-offset: 2px;
}

.theme-toggle__track,
.theme-toggle__thumb {
  display: none;
}

.theme-toggle__icon {
  position: absolute;
  width: 1.125rem;
  height: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.theme-toggle__icon svg {
  width: 100%;
  height: 100%;
}

.theme-toggle__icon--sun {
  opacity: 0;
  transform: scale(0.9);
}

.theme-toggle__icon--moon {
  opacity: 1;
  transform: scale(1);
}

.theme-toggle.is-light .theme-toggle__icon--sun {
  opacity: 1;
  transform: scale(1);
}

.theme-toggle.is-light .theme-toggle__icon--moon {
  opacity: 0;
  transform: scale(0.9);
}

.nav-link {
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text-primary);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-on-brand);
  background: var(--brand-primary);
  border: 1px solid transparent;
  border-radius: 9999px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s;
  box-shadow: none;
}

.btn-primary:hover {
  background-color: var(--brand-hover);
}

.btn-primary:focus-visible {
  outline: 2px solid #5694E4;
  outline-offset: 3px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--ghost-text);
  background: var(--ghost-bg);
  border: 1px solid var(--ghost-border);
  border-radius: 9999px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn-ghost:hover {
  background: var(--section-tint-hover);
  border-color: var(--glass-border);
  color: var(--text-primary);
}

/* Cards */
.card-3d {
  transition: background-color 0.2s, border-color 0.2s;
}
}

.section-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand-text-soft, #5694E4);
}

.section-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
}

.gradient-text {
  color: var(--brand-text);
}

/* Loader */
.loader-ring {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--transition-smooth), transform 0.7s var(--transition-smooth);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  .aurora-blob,
  .reveal,
  .loader-ring {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Focus */
:focus-visible {
  outline: 2px solid #5694E4;
  outline-offset: 2px;
}

/* Form */
.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 0.75rem;
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.35s;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  outline: none;
  border-color: rgba(9, 89, 200, 0.6);
  box-shadow: 0 0 0 3px rgba(9, 89, 200, 0.15);
}

/* Mobile bottom nav safe area */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Light theme extras */
[data-theme="light"] {
  --ghost-bg: rgba(15, 23, 42, 0.04);
  --ghost-border: rgba(15, 23, 42, 0.12);
  --ghost-bg-hover: rgba(15, 23, 42, 0.08);
  --ghost-border-hover: rgba(15, 23, 42, 0.2);
}

[data-theme="light"] body,
[data-theme="light"] .bg-surface-darker {
  background-color: var(--surface-darker) !important;
  color: var(--text-primary) !important;
}

/* Fallback: any legacy Tailwind white utilities */
[data-theme="light"] [class*="text-white/"] {
  color: var(--text-muted) !important;
}

[data-theme="light"] .text-white {
  color: var(--text-primary) !important;
}

[data-theme="light"] .text-white\/80 {
  color: var(--text-soft) !important;
}

[data-theme="light"] .text-white\/40,
[data-theme="light"] .text-white\/45 {
  color: var(--text-faint) !important;
}

[data-theme="light"] [class*="border-white"] {
  border-color: var(--glass-border) !important;
}

[data-theme="light"] [class*="bg-white"] {
  background-color: var(--section-tint) !important;
}

[data-theme="light"] [class*="hover:text-white"]:hover,
[data-theme="light"] .hover\:text-white:hover {
  color: var(--text-primary) !important;
}

[data-theme="light"] .text-brand-200 {
  color: #2475D9 !important;
}

[data-theme="light"] .text-brand-300 {
  color: var(--brand-text) !important;
}

[data-theme="light"] .group:hover .group-hover\:text-brand-200 {
  color: #0959C8 !important;
}

[data-theme="light"] #app-loader {
  background-color: var(--surface-darker) !important;
}

[data-theme="light"] #app-loader .text-theme-muted,
[data-theme="light"] #app-loader [class*="text-white"] {
  color: var(--text-muted) !important;
}

[data-theme="light"] .mobile-bottom-nav {
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] #mobile-drawer .absolute.inset-0 {
  background: rgba(15, 23, 42, 0.35) !important;
}

[data-theme="light"] .loader-ring {
  border-color: rgba(15, 23, 42, 0.1);
  border-top-color: var(--brand-primary);
}

[data-theme="light"] .mobile-nav-link {
  color: var(--text-soft) !important;
}

[data-theme="light"] .bottom-nav-item {
  color: var(--text-faint) !important;
}

[data-theme="light"] .bottom-nav-item:hover {
  color: var(--brand-text) !important;
}

[data-theme="light"] .glass-panel h3,
[data-theme="light"] .glass-panel p,
[data-theme="light"] .glass-panel cite,
[data-theme="light"] .glass-panel span:not(.text-brand-300):not(.section-label) {
  color: inherit;
}

[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-primary:hover {
  color: var(--text-on-brand) !important;
}

/* Marquee */
.marquee-container::before,
.marquee-container::after {
  content: "";
  position: absolute;
  top: 0;
  width: 100px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.marquee-container::before {
  left: 0;
  background: linear-gradient(to right, var(--surface-darker), transparent);
}

.marquee-container::after {
  right: 0;
  background: linear-gradient(to left, var(--surface-darker), transparent);
}

.animate-marquee-left {
  animation: marquee-left 40s linear infinite;
}

.marquee-container:hover .animate-marquee-left {
  animation-play-state: paused;
}

/* Theme-aware Logo visibility */
[data-theme="dark"] .theme-show-light {
  display: none !important;
}

[data-theme="dark"] .theme-show-dark {
  display: block !important;
}

[data-theme="light"] .theme-show-light {
  display: block !important;
}

[data-theme="light"] .theme-show-dark {
  display: none !important;
}

@keyframes marquee-left {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(-50% - 0.5rem));
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Custom Hero Transitions */
/* Branded Logo Overlay */
.logo-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.logo-overlay img {
  width: 280px;
  max-width: 80%;
  transform: scale(0.8);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.logo-overlay.active img {
  transform: scale(1);
  opacity: 1;
}

@keyframes mouse-wheel {
  0% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 15px); }
}

.animate-mouse-wheel {
  animation: mouse-wheel 1.6s cubic-bezier(0.7, 0, 0.3, 1) infinite;
}

@keyframes slide-zoom-in-left {
  0% { transform: translateX(-60px) scale(0.9); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes slide-zoom-out-left {
  0% { transform: translateX(0) scale(1); opacity: 1; }
  100% { transform: translateX(-60px) scale(0.9); opacity: 0; }
}

.animate-slide-zoom-in-left {
  animation: slide-zoom-in-left 1.2s var(--transition-smooth) forwards;
}

.animate-slide-zoom-out-left {
  animation: slide-zoom-out-left 1s var(--transition-smooth) forwards;
}

@keyframes slide-in-right {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.animate-slide-in-right {
  animation: slide-in-right 0.5s ease-out forwards;
}

/* Hide scrollbars globally on preview showcases */
.scrollbar-none::-webkit-scrollbar {
  display: none !important;
}
.scrollbar-none {
  -ms-overflow-style: none !important;  /* IE and Edge */
  scrollbar-width: none !important;  /* Firefox */
}

/* Animation and Transition delay helpers to eliminate inline styles */
.delay-30ms { transition-delay: 0.03s; }
.delay-50ms { transition-delay: 0.05s; }
.delay-60ms { transition-delay: 0.06s; }
.delay-80ms { transition-delay: 0.08s; }
.delay-90ms { transition-delay: 0.09s; }
.delay-120ms { transition-delay: 0.12s; }
.delay-150ms { transition-delay: 0.15s; }
.delay-160ms { transition-delay: 0.16s; }
.delay-180ms { transition-delay: 0.18s; }
.delay-240ms { transition-delay: 0.24s; }
.delay-800ms { transition-delay: 0.8s; }
.anim-delay-100ms { animation-delay: 0.1s; animation-fill-mode: forwards; }

/* Theme-aware logo toggling */
.html-logo-light {
  display: block;
}
.html-logo-dark {
  display: none;
}
:root[data-theme="light"] .html-logo-light,
.light .html-logo-light {
  display: none;
}
:root[data-theme="light"] .html-logo-dark,
.light .html-logo-dark {
  display: block;
}