/* ==========================================================================
   SUN RISE BIO ENERGY - DUAL THEME LUXURY DESIGN SYSTEM
   Palette: Pure Jet Onyx Black, Warm Alabaster (#FAF9F5), Solar Gold & Amber (#C88A2E, #F59E0B, #FBBF24)
   High Contrast & Large Legible Typography for Light and Dark Modes
   ========================================================================== */

:root {
  /* Common Fonts */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Default Dark Mode Palette */
  --bg-page: #000000;
  --bg-surface: #09090B;
  --bg-card: #121214;
  --bg-bento: #09090B;
  --border-color: #27272A;
  --text-primary: #FFFFFF;
  --text-secondary: #D4D4D8;
  --text-muted: #A1A1AA;
  
  --color-gold: #C88A2E;
  --color-gold-bright: #D4AF37;
  --color-amber: #D97706;
  --color-yellow: #F59E0B;
  --color-yellow-bright: #FBBF24;
}

/* Light Theme Variables & High Contrast Overrides */
html.light {
  --bg-page: #FAF9F5;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-bento: #09090B;
  --border-color: #D1D5DB;
  --text-primary: #000000;
  --text-secondary: #1E293B;
  --text-muted: #334155;
  background-color: #FAF9F5;
  color: #000000;
}

html.dark {
  --bg-page: #000000;
  --bg-surface: #09090B;
  --bg-card: #121214;
  --bg-bento: #09090B;
  --border-color: #27272A;
  --text-primary: #FFFFFF;
  --text-secondary: #D4D4D8;
  --text-muted: #A1A1AA;
  background-color: #000000;
  color: #FFFFFF;
}

/* Base resets & typography */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
  font-size: 16px;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

::selection {
  background-color: #000000;
  color: #FBBF24;
}

html.light ::selection {
  background-color: #C88A2E;
  color: #FFFFFF;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #18181B;
}
html.light ::-webkit-scrollbar-track {
  background: #F3F4F6;
}
::-webkit-scrollbar-thumb {
  background: #3F3F46;
  border-radius: 3px;
}
html.light ::-webkit-scrollbar-thumb {
  background: #CBD5E1;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold);
}

/* Typography styles */
.font-display { font-family: var(--font-display); }
.font-body { font-family: var(--font-body); }
.font-mono { font-family: var(--font-mono); }

/* Editorial Headings */
.editorial-title {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* Text Justification Rules */
.text-justify {
  text-align: justify !important;
  text-justify: inter-word !important;
  hyphens: auto;
}

p.text-justify, .content-justify p {
  text-align: justify;
  text-justify: inter-word;
}

/* Shimmer and Gradient Text */
.text-yellow-gradient {
  background: linear-gradient(135deg, #FEF08A 0%, #FBBF24 50%, #F59E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.light .text-yellow-gradient {
  background: linear-gradient(135deg, #92400E 0%, #B45309 50%, #D97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gold-gradient {
  background: linear-gradient(135deg, #FFFBEB 0%, #FBBF24 50%, #D4AF37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Eyebrow Pill and Tag Styling */
.eyebrow-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #C88A2E;
}

html.light .eyebrow-tag {
  color: #B45309 !important;
}

html.dark .eyebrow-tag {
  color: #FBBF24;
}

/* ==========================================================================
   LIGHT MODE HIGH CONTRAST & LEGIBILITY ENHANCEMENTS (FOR LIGHT SECTIONS)
   ========================================================================= */
html.light section:not(.bento-dark-forest):not(.bento-dark-gold):not(.bg-black) p,
html.light section:not(.bento-dark-forest):not(.bento-dark-gold):not(.bg-black) .text-justify {
  color: #1E293B;
  font-weight: 450;
  line-height: 1.7;
}

html.light h1,
html.light h2,
html.light h3,
html.light h4,
html.light h5,
html.light h6 {
  color: #000000;
  font-weight: 700;
}

html.light .text-gray-600,
html.light .text-gray-500,
html.light .text-zinc-600,
html.light .text-zinc-500 {
  color: #334155 !important;
}

html.light .text-gray-900,
html.light .text-gray-950 {
  color: #000000 !important;
}

/* Specific Header Navigation styles in Light Mode */
html.light header nav a {
  color: #000000 !important;
  font-weight: 700;
}

html.light header nav a:hover {
  color: #B45309 !important;
}

html.light footer {
  background-color: #FAF9F5 !important;
  border-top-color: #E2E8F0 !important;
}

html.light footer p,
html.light footer a,
html.light footer span {
  color: #334155 !important;
  font-weight: 500;
}

html.light footer a:hover {
  color: #B45309 !important;
}

html.light footer h4 {
  color: #000000 !important;
  font-weight: 700;
}

/* ==========================================================================
   NAVBAR CTA BUTTON (PREMIUM SOLAR GOLD PILL)
   ========================================================================= */
.btn-navbar-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 50%, #D97706 100%) !important;
  color: #000000 !important;
  padding: 0.6rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  border-radius: 4px;
  border: 1px solid #FCD34D !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: all 0.25s ease;
  white-space: nowrap;
  text-decoration: none !important;
}

.btn-navbar-cta span,
html.light .btn-navbar-cta span,
html.dark .btn-navbar-cta span {
  color: #000000 !important;
  font-weight: 800 !important;
}

.btn-navbar-cta:hover {
  background: linear-gradient(135deg, #FBBF24 0%, #FDE047 50%, #F59E0B 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.5);
  color: #000000 !important;
}

/* ==========================================================================
   CRITICAL: ENSURE DARK / BENTO CONTAINERS ALWAYS HAVE LUMINOUS CRISP WHITE & GOLD TEXT
   ========================================================================= */
.bento-dark-gold,
.bento-dark-forest,
.bento-inner-card,
#hero-3d-overlay-container,
#preloader {
  color: #FFFFFF !important;
}

.bento-dark-gold h1, .bento-dark-gold h2, .bento-dark-gold h3, .bento-dark-gold h4,
.bento-dark-forest h1, .bento-dark-forest h2, .bento-dark-forest h3, .bento-dark-forest h4,
.bento-inner-card h1, .bento-inner-card h2, .bento-inner-card h3, .bento-inner-card h4 {
  color: #FFFFFF !important;
  font-weight: 700 !important;
}

.bento-dark-gold p,
.bento-dark-forest p,
.bento-inner-card p,
.bento-dark-gold .text-zinc-300,
.bento-dark-forest .text-zinc-300,
.bento-inner-card .text-zinc-300,
html.light .bento-dark-gold p,
html.light .bento-dark-forest p,
html.light .bento-inner-card p,
html.light .bento-dark-gold .text-zinc-300,
html.light .bento-dark-forest .text-zinc-300,
html.light .bento-inner-card .text-zinc-300 {
  color: #E2E8F0 !important; /* Luminous crisp off-white for 100% readability */
  font-weight: 400 !important;
  line-height: 1.6 !important;
}

.bento-dark-gold .eyebrow-tag,
.bento-dark-forest .eyebrow-tag,
.bento-dark-gold .text-yellow-400,
.bento-dark-forest .text-yellow-400,
.bento-inner-card .text-yellow-400,
html.light .bento-dark-gold .text-yellow-400,
html.light .bento-dark-forest .text-yellow-400,
html.light .bento-inner-card .text-yellow-400 {
  color: #FBBF24 !important;
  font-weight: 700 !important;
}

.bento-dark-gold,
.bento-dark-forest {
  background: radial-gradient(circle at top right, #1C1917 0%, #09090B 60%, #000000 100%) !important;
  border: 1px solid #3F3F46 !important;
  border-radius: 8px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7) !important;
  color: #FFFFFF !important;
}

.bento-inner-card {
  background: rgba(18, 18, 20, 0.95) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  border-radius: 6px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-inner-card:hover {
  border-color: #FBBF24 !important;
  background: rgba(28, 28, 32, 0.98) !important;
  transform: translateY(-3px);
  box-shadow: 0 16px 36px -5px rgba(245, 158, 11, 0.3) !important;
}

/* ==========================================================================
   BUTTONS (Deep Onyx Black, Warm Gold & Outlined Variants)
   ========================================================================= */
.btn-dark-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  background-color: #000000;
  color: #FFFFFF !important;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 4px;
  border: 1.5px solid #000000;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-dark-pill:hover, .btn-dark-pill:active {
  background-color: #18181B;
  border-color: #F59E0B;
  color: #FBBF24 !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

html.dark .btn-dark-pill {
  background-color: #121214;
  border-color: #3F3F46;
  color: #FFFFFF !important;
}

html.dark .btn-dark-pill:hover {
  background-color: #18181B;
  border-color: #F59E0B;
  color: #FBBF24 !important;
}

.btn-outline-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  background-color: transparent;
  color: #000000 !important;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 4px;
  border: 1.5px solid #000000;
  transition: all 0.25s ease;
}

.btn-outline-pill:hover, .btn-outline-pill:active {
  background-color: #000000;
  border-color: #000000;
  color: #FFFFFF !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

html.dark .btn-outline-pill {
  color: #FFFFFF !important;
  border-color: #3F3F46;
}

html.dark .btn-outline-pill:hover {
  background-color: #18181B;
  border-color: #F59E0B;
  color: #FBBF24 !important;
}

.shimmer-btn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 50%, #EAB308 100%);
  color: #000000 !important;
  font-weight: 800;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  border-radius: 4px;
  border: 1.5px solid #FCD34D;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  transition: all 0.3s ease;
  min-height: 44px;
}

.shimmer-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 150%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-20deg);
  transition: left 0.75s ease;
}

.shimmer-btn:hover::before {
  left: 150%;
}

.shimmer-btn:hover, .shimmer-btn:active {
  background: linear-gradient(135deg, #FBBF24 0%, #FCD34D 50%, #F59E0B 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -2px rgba(245, 158, 11, 0.5);
}

/* ==========================================================================
   CARDS & SPOTLIGHT STYLES
   ========================================================================= */
.card-clean-white {
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.04);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-clean-white:hover {
  border-color: #C88A2E;
  box-shadow: 0 14px 30px -6px rgba(200, 138, 46, 0.15);
  transform: translateY(-3px);
}

html.dark .card-clean-white {
  background-color: #121214;
  border-color: #27272A;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

html.dark .card-clean-white:hover {
  border-color: #F59E0B;
  box-shadow: 0 16px 32px -8px rgba(245, 158, 11, 0.2);
}

/* ==========================================================================
   UNIVERSAL FORM CONTROLS DUAL-THEME TYPOGRAPHY & CONTRAST
   ========================================================================= */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="password"],
textarea,
select {
  background-color: #FFFFFF !important;
  color: #000000 !important;
  border: 1px solid #CBD5E1 !important;
  font-weight: 500 !important;
  transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: #F59E0B !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25) !important;
  outline: none !important;
}

html.dark input[type="text"],
html.dark input[type="email"],
html.dark input[type="tel"],
html.dark input[type="number"],
html.dark input[type="search"],
html.dark input[type="password"],
html.dark textarea,
html.dark select {
  background-color: #09090B !important;
  color: #FFFFFF !important;
  border-color: #3F3F46 !important;
}

html.dark input[type="text"]:focus,
html.dark input[type="email"]:focus,
html.dark input[type="tel"]:focus,
html.dark input[type="number"]:focus,
html.dark textarea:focus,
html.dark select:focus {
  background-color: #121214 !important;
  border-color: #FBBF24 !important;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.25) !important;
  color: #FFFFFF !important;
}

html.light input::placeholder,
html.light textarea::placeholder {
  color: #94A3B8 !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #71717A !important;
}

/* Step Node Connectors (Timeline) */
.timeline-dot-step {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: #FFFFFF;
  border: 2.5px solid #CBD5E1;
  padding: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.timeline-dot-step:hover {
  border-color: #C88A2E;
  transform: scale(1.08);
}

html.dark .timeline-dot-step {
  background-color: #121214;
  border-color: #3F3F46;
}

html.dark .timeline-dot-step:hover {
  border-color: #F59E0B;
}

/* Mobile Range Sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #27272A;
  border-radius: 4px;
  outline: none;
}

html.light input[type="range"] {
  background: #CBD5E1;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #C88A2E;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 8px rgba(200, 138, 46, 0.7);
  cursor: pointer;
  transition: transform 0.15s ease;
}

html.dark input[type="range"]::-webkit-slider-thumb {
  background: #F59E0B;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

/* Mobile Action Bar */
.mobile-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(200, 138, 46, 0.3);
  padding: 0.75rem 1rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.08);
}

html.dark .mobile-action-bar {
  background: rgba(9, 9, 11, 0.98);
  border-top-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
}

/* Touch Canvases */
#three-hero-container,
#three-product-lab-canvas,
#three-boiler-canvas,
#three-map-canvas,
#modal-boiler-canvas,
#modal-radar-canvas {
  touch-action: pan-y;
  width: 100%;
  height: 100%;
}

/* Preloader styles - Consistently Obsidian with Radiant Gold in Light & Dark modes */
#preloader,
html.light #preloader,
html.dark #preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background-color: #050505 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

#preloader .preloader-content {
  position: relative;
  z-index: 2;
}

/* Ensure Preloader text is always radiant gold */
#preloader h2,
html.light #preloader h2,
html.dark #preloader h2 {
  background: linear-gradient(135deg, #FEF08A 0%, #FBBF24 50%, #F59E0B 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  filter: drop-shadow(0 2px 15px rgba(245, 158, 11, 0.6));
}

#preloader p,
html.light #preloader p,
html.dark #preloader p {
  color: #FBBF24 !important;
}

#preloader #preloader-counter,
html.light #preloader #preloader-counter,
html.dark #preloader #preloader-counter {
  color: #FDE047 !important;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.8));
}

#preloader #preloader-stage,
html.light #preloader #preloader-stage,
html.dark #preloader #preloader-stage {
  color: #FBBF24 !important;
}

@keyframes energyPulse {
  0%, 100% {
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.35), inset 0 0 15px rgba(245, 158, 11, 0.2);
  }
  50% {
    box-shadow: 0 0 45px rgba(245, 158, 11, 0.6), inset 0 0 25px rgba(245, 158, 11, 0.4);
  }
}

.energy-indicator-pulse {
  animation: energyPulse 3s ease-in-out infinite;
}

@keyframes fadeInModal {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fadeIn {
  animation: fadeInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #preloader {
    display: none !important;
  }
}
