/* Modern CSS with Automatic Dark/Light Mode */

/* --- CSS Variables & Theme System --- */
:root {
  /* Light Mode Colors (Default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-heavy: rgba(255, 255, 255, 0.95);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-inverse: #ffffff;
  
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-secondary: #a78bfa;
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-gradient-gold: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  
  --border-color: rgba(148, 163, 184, 0.2);
  --shadow-color: rgba(0, 0, 0, 0.05);
  --shadow-color-heavy: rgba(0, 0, 0, 0.1);
  
  /* Hero overlay for light mode - darker for better contrast */
  --hero-overlay: rgba(255, 255, 255, 0.3);
  --hero-text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  
  /* Layout Variables */
  --header-height: 72px;
  --container-max: 1200px;
  --section-padding: clamp(4rem, 10vw, 8rem);
  --content-padding: clamp(1rem, 5vw, 2rem);
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Color scheme */
  color-scheme: light;
}

/* Dark Mode Colors - True Black */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #1a1a1a;
    --bg-glass: rgba(10, 10, 10, 0.85);
    --bg-glass-heavy: rgba(10, 10, 10, 0.95);
    
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-tertiary: #a3a3a3;
    --text-inverse: #000000;
    
    --accent-primary: #818cf8;
    --accent-primary-hover: #a78bfa;
    --accent-secondary: #c084fc;
    --accent-gradient: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    --accent-gradient-gold: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-color-heavy: rgba(0, 0, 0, 0.7);
    
    /* Hero overlay for dark mode - darker for better contrast */
    --hero-overlay: rgba(0, 0, 0, 0.3);
    --hero-text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
    
    /* Color scheme */
    color-scheme: dark;
  }
}

/* Force dark mode styles for Firefox compatibility */
@media (prefers-color-scheme: dark) {
  html {
    color-scheme: dark;
    background-color: #000000 !important;
  }
  
  body {
    background-color: #000000 !important;
    color: #ffffff !important;
  }
  
  /* Fix all Firefox white sections */
  main,
  section,
  .content-section,
  .content-section.light-bg,
  .hero,
  header,
  footer {
    background-color: inherit !important;
  }
  
  .content-section.light-bg {
    background-color: #000000 !important;
  }
  
  .content-section.alternate-bg {
    background-color: #0a0a0a !important;
  }
  
  .content-section.dark-bg {
    background-color: #1a1a1a !important;
  }
  
  /* Ensure all text is visible */
  p, h1, h2, h3, h4, h5, h6, span, div {
    color: inherit;
  }
  
  /* Fix any remaining white backgrounds */
  * {
    background-color: transparent;
  }
  
  body > * {
    background-color: inherit;
  }
}

/* --- Global Styles --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  /* Ensure proper color scheme */
  color-scheme: light dark;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-base), color var(--transition-base);
  position: relative;
}

/* Background Pattern - more subtle */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, var(--accent-primary) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, var(--accent-secondary) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, var(--accent-primary) 0%, transparent 50%);
  opacity: 0.02;
  pointer-events: none;
  z-index: -1;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  transition: color var(--transition-base);
}

h1 {
  font-family: var(--font-primary);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

/* Hero h1 styling without display font */
.hero h1 {
  font-family: var(--font-primary);
  font-weight: 600;
  animation: fadeInUp 0.8s ease-out;
  text-shadow: var(--hero-text-shadow);
  color: #ffffff;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 1rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

h3 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

a:hover {
  color: var(--accent-primary-hover);
}

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--content-padding);
}

/* --- Header --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all var(--transition-base);
}

/* Force dark header in dark mode for Firefox */
@media (prefers-color-scheme: dark) {
  header {
    background: rgba(0, 0, 0, 0.85) !important;
  }
}

header.scrolled {
  box-shadow: 0 4px 20px var(--shadow-color);
}

header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo as link */
.logo {
  font-family: var(--font-primary);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: transform var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

a.logo {
  color: var(--text-primary);
}

a.logo:hover {
  transform: scale(1.05);
  color: var(--text-primary);
}

/* --- Navigation --- */
nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0;
  position: relative;
  transition: color var(--transition-fast);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width var(--transition-base);
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

nav a:hover,
nav a.active {
  color: var(--text-primary);
}

/* --- Hero Section --- */
.hero {
  padding: calc(var(--header-height) + var(--section-padding)) 0 var(--section-padding);
  background-color: var(--bg-secondary);
  background-image: url('images/hero.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

/* Hero overlay for better text readability */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--hero-overlay);
  backdrop-filter: blur(1px);
  z-index: 1;
}

/* Gradient overlay for text contrast - lighter in dark mode */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.5) 100%
  );
  z-index: 2;
}

/* Lighter overlay in dark mode for better image visibility */
@media (prefers-color-scheme: dark) {
  .hero::after {
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.15) 0%,
      rgba(0, 0, 0, 0.05) 50%,
      rgba(0, 0, 0, 0.15) 100%
    );
  }
}

.hero .container {
  text-align: center;
  position: relative;
  z-index: 3;
}

/* Enhanced text visibility on hero */
.hero h1 {
  animation: fadeInUp 0.8s ease-out;
  text-shadow: var(--hero-text-shadow);
  color: #ffffff;
}

.hero .subtitle {
  font-size: 1.25rem;
  /* Force light text on hero */
  color: #ffffff;
  max-width: 700px;
  margin: 0 auto 2.5rem;
  animation: fadeInUp 0.8s ease-out 0.2s both;
  text-shadow: var(--hero-text-shadow);
  font-weight: 400;
}

/* Special hero styling for pages without background images */
.hero-dark {
  background-color: var(--bg-tertiary);
  background-image: none;
}

/* Strategy page hero with image */
.hero-strategy {
  background-image: url('images/hero_strategy.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Contact page hero with image */
.hero-contact {
  background-image: url('images/hero_contact.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Ensure text is readable on strategy and contact hero images */
.hero-strategy::before,
.hero-contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--hero-overlay);
  backdrop-filter: blur(1px);
  z-index: 1;
}

.hero-strategy::after,
.hero-contact::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
  z-index: 2;
}

/* Ensure hero text styling for pages with images */
.hero-strategy h1,
.hero-contact h1 {
  text-shadow: var(--hero-text-shadow);
  color: #ffffff;
}

.hero-strategy .subtitle,
.hero-contact .subtitle {
  color: #ffffff;
  text-shadow: var(--hero-text-shadow);
}

.hero-dark::after {
  display: none;
}

.hero-dark h1 {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

.hero-dark .subtitle {
  color: var(--text-secondary);
  text-shadow: none;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Content Sections --- */
.content-section {
  padding: var(--section-padding) 0;
  position: relative;
}

.content-section.light-bg {
  background-color: var(--bg-primary);
}

.content-section.alternate-bg {
  background-color: var(--bg-secondary);
}

.content-section.dark-bg {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  color: var(--text-secondary);
}

/* Bull Image Section */
.bull-section {
  background-image: url('images/bull.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  padding: calc(var(--section-padding) * 1.5) 0;
}

.bull-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
  backdrop-filter: blur(1px);
}

.bull-section .container {
  position: relative;
  z-index: 2;
}

.bull-section h2,
.bull-section p {
  color: #ffffff;
  text-shadow: var(--hero-text-shadow);
}

/* --- Glass Cards (Strategy Pillars) --- */
.pillar {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.pillar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
  transform: translateX(-100%);
  transition: transform var(--transition-base);
}

.pillar:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 40px var(--shadow-color-heavy);
}

.pillar:hover::before {
  transform: translateX(0);
}

.pillar h3 {
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

/* --- Contact Section --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  margin-top: 3rem;
}

.address-block {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
}

.address-block h3 {
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
}

.address-block p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.map-container {
  position: relative;
  width: 100%;
  padding-bottom: 75%; /* 4:3 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 4px 20px var(--shadow-color);
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px;
}

/* --- Buttons --- */
.button-primary {
  display: inline-block;
  padding: 0.875rem 2.5rem;
  background: var(--accent-gradient);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 50px;
  box-shadow: 0 4px 15px var(--shadow-color);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.button-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left var(--transition-base);
}

.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--shadow-color-heavy);
  color: white;
}

.button-primary:hover::before {
  left: 100%;
}

/* --- Footer --- */
footer {
  background: var(--bg-tertiary);
  padding: 3rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent-gradient);
}

footer p {
  color: var(--text-tertiary);
  margin: 0;
}

/* --- Animations --- */
.fade-in {
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Responsive Design --- */
@media (max-width: 968px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
    --section-padding: 3rem;
  }
  
  header .container {
    flex-direction: column;
    padding: 1rem var(--content-padding);
  }
  
  .logo {
    margin-bottom: 1rem;
  }
  
  nav ul {
    gap: 1.5rem;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  .hero {
    min-height: 60vh;
  }
  
  .pillar {
    padding: 1.5rem;
  }
  
  .bull-section {
    background-attachment: scroll;
  }
}

@media (max-width: 480px) {
  :root {
    --section-padding: 2.5rem;
  }
  
  nav ul {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  nav a {
    font-size: 0.875rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  .button-primary {
    width: 100%;
    text-align: center;
  }
  
  .address-block {
    padding: 1.5rem;
  }
  
  .map-container {
    padding-bottom: 100%; /* Square on mobile */
  }
}

/* --- Scroll Animations --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Loading Animation --- */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.loading {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}