@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Inter:wght@300;400;500;600&display=swap');

/* 
   Tailwind CSS is loaded via CDN in the HTML files.
   This stylesheet provides the custom design system and component-specific styling.
*/

:root {
  /* Colors - Derived from technical.plan.md */
  --color-primary: #1A2238;
  --color-secondary: #F8F9FA;
  --color-accent: #C5A059;
  --color-accent-dark: #A68545;
  --color-text: #1a1a1a;
  --color-text-light: #4b5563; /* Improved contrast from #6b7280 */
  --color-bg: #ffffff;
  --color-bg-alt: #f9fafb;
  --color-white: #ffffff;
  --color-black: #000000;
  --color-accent-contrast: #8a6d3b; /* Darker accent for text on light backgrounds */
  
  /* Typography */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;
  
  /* Spacing Scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-gold: 0 10px 20px rgba(138, 109, 59, 0.2);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
}

/* Base Styles & Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: var(--line-height-base);
  background-color: var(--color-bg);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

p {
  margin-bottom: var(--space-md);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-base);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

ul {
  list-style: none;
}

/* Component Styles */

/* Containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
  cursor: pointer;
  border: 2px solid transparent;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.875rem;
  min-height: 44px; /* Ensure touch target height */
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: #2a3554;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-primary);
}

.btn-accent:hover {
  background-color: var(--color-accent-contrast);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

/* Cards */
.card {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
  border: 1px solid rgba(0,0,0,0.05);
  height: 100%; /* Ensure consistent height in grids */
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-blueprint {
  border-left: 4px solid var(--color-accent);
  position: relative;
}

.card-blueprint::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 50px;
  background-image: linear-gradient(135deg, transparent 50%, var(--color-accent) 50%);
  opacity: 0.1;
}

/* Form Styles */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-primary);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
  font-family: var(--font-body);
  font-size: 1rem; /* Better for mobile input */
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.2);
}

/* Navigation */
.nav-header {
  background-color: var(--color-white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: var(--space-sm) 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-menu {
  display: none;
}

@media (min-width: 768px) {
  .nav-menu {
    display: flex;
    gap: var(--space-lg);
  }
}

.nav-link {
  font-weight: 500;
  color: var(--color-text);
  position: relative;
  padding: 0.5rem 0; /* Increase touch area */
}

.nav-link:hover, .nav-link.active {
  color: var(--color-accent-contrast); /* Better contrast on white */
}

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

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

/* Mobile Menu */
.mobile-menu-btn {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-primary);
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background-color: var(--color-primary);
  color: var(--color-white);
  z-index: 2000;
  padding: var(--space-2xl) var(--space-lg);
  transition: var(--transition-base);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.mobile-drawer.active {
  right: 0;
}

.mobile-drawer .nav-link {
  color: var(--color-white);
  font-size: 1.25rem;
}

.mobile-drawer .nav-link:hover, .mobile-drawer .nav-link.active {
  color: var(--color-accent);
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 1500;
  display: none;
}

.mobile-overlay.active {
  display: block;
}

/* Hero Section */
.hero {
  position: relative;
  padding: var(--space-3xl) 0;
  background-color: var(--color-primary);
  color: var(--color-white);
  overflow: hidden;
}

.hero-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-split {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-content h1 {
  color: var(--color-white);
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

@media (min-width: 768px) {
  .hero-content h1 {
    font-size: 4rem;
  }
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: var(--space-xl);
  opacity: 0.95; /* Increased opacity for better contrast */
}

.hero-image {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 3/2;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Footer */
.footer {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-3xl) 0 var(--space-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: var(--space-md);
  color: var(--color-accent);
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  color: var(--color-white);
}

.footer-links li {
  margin-bottom: var(--space-xs);
}

.footer-links a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.85; /* Increased opacity for better contrast */
}

/* Accessibility Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Text Contrast Utilities */
.text-on-dark {
  color: var(--color-white);
}

.text-on-light {
  color: var(--color-text);
}

.text-accent-safe {
  color: var(--color-accent-contrast);
}

/* Stats Section */
.stats-bar {
  background-color: var(--color-accent);
  color: var(--color-primary);
  padding: var(--space-xl) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  text-align: center;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 900;
  display: block;
}

.stat-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Section Dividers */
.gold-divider {
  width: 100px;
  height: 2px;
  background-color: var(--color-accent);
  margin: var(--space-md) 0;
}

/* Cookie Consent */
#cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-white);
  box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
  padding: var(--space-md) var(--space-lg);
  display: none;
  align-items: center;
  justify-content: space-between;
  z-index: 5000;
  flex-wrap: wrap;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  #cookie-consent {
    flex-wrap: nowrap;
  }
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
