/* ============================================================================
   NAPSA Design System - "Deep Atlantic Scientific"
   A distinctive geological-scientific aesthetic for petroleum research
   ============================================================================ */

/* Typography - Distinctive fonts that avoid AI slop */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,800;1,9..144,400&family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&display=swap');

/* ============================================================================
   DESIGN TOKENS - Deep Atlantic Scientific Palette
   ============================================================================ */
:root {
  /* Primary: Deep Ocean depths */
  --atlantic-abyss: #0a1628;
  --atlantic-deep: #12243d;
  --atlantic-mid: #1e3a5f;
  --atlantic-surface: #2d5a87;

  /* Accent: Petroleum & Earth tones */
  --petroleum-copper: #b87333;
  --petroleum-amber: #cd8b4a;
  --petroleum-gold: #d4a653;
  --sediment-rust: #8b4513;

  /* Neutral: Geological strata */
  --strata-cream: #f7f5f0;
  --strata-sand: #ebe7df;
  --strata-stone: #d4cfc4;
  --strata-slate: #6b7280;
  --strata-shale: #4b5563;
  --strata-basalt: #1f2937;

  /* Semantic mappings */
  --bg-primary: var(--strata-cream);
  --bg-secondary: var(--strata-sand);
  --bg-elevated: #ffffff;
  --bg-inverse: var(--atlantic-abyss);

  --text-primary: var(--atlantic-abyss);
  --text-secondary: var(--strata-shale);
  --text-muted: var(--strata-slate);
  --text-inverse: var(--strata-cream);

  --border-light: var(--strata-stone);
  --border-medium: var(--strata-slate);

  --accent-primary: var(--petroleum-copper);
  --accent-secondary: var(--atlantic-surface);
  --accent-highlight: var(--petroleum-gold);

  /* Semantic colors */
  --success: #2d6a4f;
  --warning: #b87333;
  --error: #9c2d2d;
  --info: var(--atlantic-mid);

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', monospace;

  /* Type scale - refined for scientific documents */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.5rem;
  --text-6xl: 4.5rem;

  /* Spacing - generous scientific layout */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Shadows - layered depth like sedimentary strata */
  --shadow-sm: 0 1px 2px rgba(10, 22, 40, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(10, 22, 40, 0.07), 0 2px 4px -1px rgba(10, 22, 40, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(10, 22, 40, 0.08), 0 4px 6px -2px rgba(10, 22, 40, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(10, 22, 40, 0.1), 0 10px 10px -5px rgba(10, 22, 40, 0.04);
  --shadow-inner: inset 0 2px 4px 0 rgba(10, 22, 40, 0.05);
  --shadow-copper: 0 10px 40px -10px rgba(184, 115, 51, 0.3);
  --shadow-ocean: 0 10px 40px -10px rgba(30, 58, 95, 0.4);

  /* Border radius - subtle, refined */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.6, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;

  /* Z-index scale */
  --z-base: 0;
  --z-elevated: 10;
  --z-sticky: 100;
  --z-header: 200;
  --z-modal: 1000;
  --z-toast: 1100;
}

/* Dark mode - Deep Ocean at night */
[data-theme="dark"] {
  --bg-primary: var(--atlantic-abyss);
  --bg-secondary: var(--atlantic-deep);
  --bg-elevated: var(--atlantic-mid);
  --bg-inverse: var(--strata-cream);

  --text-primary: var(--strata-cream);
  --text-secondary: var(--strata-stone);
  --text-muted: var(--strata-slate);
  --text-inverse: var(--atlantic-abyss);

  --border-light: var(--atlantic-mid);
  --border-medium: var(--atlantic-surface);

  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   BASE RESET & TYPOGRAPHY
   ============================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--duration-slow) var(--ease-out),
              color var(--duration-slow) var(--ease-out);
}

/* Refined headings with Fraunces display font */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-5xl); font-weight: 600; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); font-weight: 600; }
h6 { font-size: var(--text-base); font-weight: 600; }

p {
  margin-bottom: var(--space-4);
  max-width: 70ch;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--petroleum-amber);
}

/* Focus states - copper glow for accessibility */
*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--atlantic-abyss);
  color: var(--strata-cream);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: var(--text-sm);
  z-index: var(--z-toast);
  transition: top var(--duration-base) var(--ease-out);
  box-shadow: var(--shadow-xl);
}

.skip-link:focus {
  top: var(--space-4);
  color: var(--strata-cream);
}

/* ============================================================================
   LAYOUT
   ============================================================================ */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Ensure main content has header offset */
#main-content {
  padding-top: var(--space-32);
  padding-bottom: var(--space-16);
  min-height: calc(100vh - 200px);
}

/* ============================================================================
   THEME TOGGLE
   ============================================================================ */
.theme-toggle {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-header);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  box-shadow: var(--shadow-lg);
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent-primary);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
  transition: color var(--duration-fast);
}

.theme-toggle:hover svg {
  color: var(--accent-primary);
}

/* ============================================================================
   HEADER - Geological Stratum Effect
   ============================================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: linear-gradient(
    180deg,
    rgba(10, 22, 40, 0.97) 0%,
    rgba(18, 36, 61, 0.95) 100%
  );
  backdrop-filter: blur(12px) saturate(150%);
  border-bottom: 1px solid rgba(184, 115, 51, 0.2);
  transition: all var(--duration-base) var(--ease-out);
}

.site-header.scrolled {
  box-shadow: var(--shadow-ocean);
  border-bottom-color: rgba(184, 115, 51, 0.4);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
}

/* Logo - Serif elegance */
.logo a {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--strata-cream) !important;
  text-decoration: none;
  letter-spacing: -0.02em;
  position: relative;
  padding: var(--space-2) 0;
}

.logo a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--petroleum-copper), var(--petroleum-gold));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-base) var(--ease-out);
}

.logo a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Navigation */
.main-nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-2);
  align-items: center;
}

.main-nav a {
  color: var(--strata-cream);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.main-nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(184, 115, 51, 0.15);
  border-radius: var(--radius-md);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--petroleum-gold);
}

.main-nav a:hover::before,
.main-nav a[aria-current="page"]::before {
  opacity: 1;
}

/* Mobile navigation toggle */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(247, 245, 240, 0.3);
  border-radius: var(--radius-md);
  width: 44px;
  height: 44px;
  color: var(--strata-cream);
  font-size: var(--text-xl);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.mobile-nav-toggle:hover {
  background: rgba(184, 115, 51, 0.2);
  border-color: var(--petroleum-copper);
}

/* ============================================================================
   HERO SECTION - Deep Ocean Gradient
   ============================================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Oceanic depth gradient with topographic overlay */
  background:
    linear-gradient(
      180deg,
      rgba(10, 22, 40, 0.92) 0%,
      rgba(18, 36, 61, 0.88) 30%,
      rgba(30, 58, 95, 0.85) 60%,
      rgba(45, 90, 135, 0.90) 100%
    );
}

/* Topographic contour pattern overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 50 Q 25 30, 50 50 T 100 50' fill='none' stroke='rgba(184,115,51,0.08)' stroke-width='0.5'/%3E%3Cpath d='M0 60 Q 25 40, 50 60 T 100 60' fill='none' stroke='rgba(184,115,51,0.06)' stroke-width='0.5'/%3E%3Cpath d='M0 40 Q 25 20, 50 40 T 100 40' fill='none' stroke='rgba(184,115,51,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 70 Q 25 50, 50 70 T 100 70' fill='none' stroke='rgba(184,115,51,0.05)' stroke-width='0.5'/%3E%3Cpath d='M0 30 Q 25 10, 50 30 T 100 30' fill='none' stroke='rgba(184,115,51,0.03)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 1;
  animation: contourDrift 30s linear infinite;
}

@keyframes contourDrift {
  from { background-position: 0 0; }
  to { background-position: 200px 100px; }
}

/* Floating geological elements */
.floating-elements {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-element {
  position: absolute;
  background: linear-gradient(
    135deg,
    rgba(184, 115, 51, 0.1) 0%,
    rgba(184, 115, 51, 0.03) 100%
  );
  border: 1px solid rgba(184, 115, 51, 0.15);
  border-radius: var(--radius-2xl);
  animation: floatGeological 20s ease-in-out infinite;
}

.floating-element:nth-child(1) {
  width: 120px;
  height: 120px;
  top: 15%;
  left: 8%;
  animation-delay: 0s;
}

.floating-element:nth-child(2) {
  width: 180px;
  height: 180px;
  top: 55%;
  right: 10%;
  animation-delay: 5s;
}

.floating-element:nth-child(3) {
  width: 80px;
  height: 80px;
  bottom: 25%;
  left: 15%;
  animation-delay: 10s;
}

@keyframes floatGeological {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.4;
  }
  50% {
    transform: translate(20px, -20px) rotate(5deg);
    opacity: 0.7;
  }
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: var(--z-elevated);
  text-align: center;
  max-width: 900px;
  padding: var(--space-12);
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(var(--text-4xl), 7vw, var(--text-6xl));
  font-weight: 700;
  color: var(--strata-cream);
  line-height: 1.1;
  margin-bottom: var(--space-6);
  letter-spacing: -0.03em;
  animation: heroFadeUp 1s var(--ease-out) 0.2s both;
}

.hero-content p {
  font-size: clamp(var(--text-lg), 2.5vw, var(--text-xl));
  color: var(--strata-cream);
  margin-bottom: var(--space-10);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  animation: heroFadeUp 1s var(--ease-out) 0.4s both;
}

.hero-cta {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
  animation: heroFadeUp 1s var(--ease-out) 0.6s both;
}

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

/* ============================================================================
   BUTTONS - Refined Scientific Style
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--petroleum-copper), var(--petroleum-amber));
  color: var(--strata-cream);
  box-shadow: var(--shadow-copper);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -10px rgba(184, 115, 51, 0.5);
  color: var(--strata-cream);
}

.btn-secondary {
  background: transparent;
  color: var(--strata-cream);
  border: 2px solid rgba(247, 245, 240, 0.4);
}

.btn-secondary:hover {
  background: rgba(247, 245, 240, 0.1);
  border-color: var(--strata-cream);
  transform: translateY(-2px);
  color: var(--strata-cream);
}

/* ============================================================================
   CONTENT SECTIONS - Sedimentary Layers
   ============================================================================ */
.content-section {
  background: var(--bg-elevated);
  margin: var(--space-16) 0;
  padding: var(--space-16);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-out);
}

/* Geological stratum accent line */
.content-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--petroleum-copper) 0%,
    var(--petroleum-gold) 50%,
    var(--petroleum-copper) 100%
  );
}

.content-section:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--petroleum-copper), var(--petroleum-gold));
  border-radius: var(--radius-full);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: var(--space-6) auto 0;
}

/* Text sections with icons */
.text-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  border-left: 4px solid var(--accent-primary);
  transition: all var(--duration-base) var(--ease-out);
}

.text-section:hover {
  border-left-color: var(--petroleum-gold);
  box-shadow: var(--shadow-md);
}

.text-section h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.text-section h3 svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

/* ============================================================================
   CARDS - Layered Strata Effect
   ============================================================================ */
.projects-grid,
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-8);
  margin: var(--space-10) 0;
}

.project-card,
.resource-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}

/* Subtle stratum line animation on hover */
.project-card::after,
.resource-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--petroleum-copper), var(--petroleum-gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-slow) var(--ease-out);
}

.project-card:hover,
.resource-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent-primary);
}

.project-card:hover::after,
.resource-card:hover::after {
  transform: scaleX(1);
}

.project-card.featured,
.resource-card.featured {
  background: linear-gradient(
    135deg,
    var(--atlantic-abyss) 0%,
    var(--atlantic-deep) 100%
  );
  color: var(--text-inverse);
  border: none;
  box-shadow: var(--shadow-ocean);
}

.project-card.featured .project-title,
.project-card.featured .project-description,
.resource-card.featured h4 a {
  color: var(--strata-cream);
}

.project-title,
.resource-header h4 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  margin-bottom: var(--space-3);
}

.resource-header h4 a {
  color: var(--text-primary);
  transition: color var(--duration-fast);
}

.resource-header h4 a:hover {
  color: var(--accent-primary);
}

.project-meta,
.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.project-tag,
.category,
.members-only,
.featured-badge {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category {
  background: var(--strata-sand);
  color: var(--strata-shale);
}

.members-only {
  background: var(--atlantic-mid);
  color: var(--strata-cream);
}

.featured-badge {
  background: var(--petroleum-copper);
  color: var(--strata-cream);
}

.project-description,
.resource-description {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-6);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--accent-primary);
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all var(--duration-fast);
}

.project-link:hover {
  color: var(--petroleum-gold);
  gap: var(--space-3);
}

.resource-footer {
  font-size: var(--text-sm);
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
}

.resource-footer span {
  display: block;
  margin-bottom: var(--space-1);
}

.file-info {
  color: var(--atlantic-surface);
  font-weight: 600;
}

.downloads {
  color: var(--success);
}

/* ============================================================================
   FOOTER - Deep Ocean Floor
   ============================================================================ */
.site-footer {
  background: linear-gradient(
    180deg,
    var(--atlantic-deep) 0%,
    var(--atlantic-abyss) 100%
  );
  color: var(--strata-cream);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: var(--space-24);
  position: relative;
  overflow: hidden;
}

/* Copper stratum line at top */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--petroleum-copper),
    var(--petroleum-gold),
    var(--petroleum-copper),
    transparent
  );
}

.site-footer p {
  text-align: center;
  font-size: var(--text-sm);
  opacity: 0.8;
  margin: 0;
}

/* ============================================================================
   FORMS & INPUTS
   ============================================================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
input[type="tel"],
textarea,
select {
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: var(--space-4);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text-primary);
  width: 100%;
  transition: all var(--duration-fast) var(--ease-out);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.15);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

/* ============================================================================
   ALERTS & MESSAGES
   ============================================================================ */
.messages {
  margin-bottom: var(--space-6);
}

.alert {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  font-weight: 500;
  border-left: 4px solid;
  cursor: pointer;
}

.alert-success {
  background: rgba(45, 106, 79, 0.15);
  border-color: var(--success);
  color: #1a5c3a;
}

.alert-info {
  background: rgba(30, 58, 95, 0.15);
  border-color: var(--info);
  color: #1e3a5f;
}

.alert-warning {
  background: rgba(184, 115, 51, 0.15);
  border-color: var(--warning);
  color: #8b4513;
}

.alert-error,
.alert-danger {
  background: rgba(156, 45, 45, 0.15);
  border-color: var(--error);
  color: #8b1a1a;
}

/* ============================================================================
   SEARCH
   ============================================================================ */
.nav-search {
  margin-left: var(--space-4);
}

.search-form {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.search-input {
  padding: var(--space-2) var(--space-4);
  border: 1px solid rgba(247, 245, 240, 0.4);
  border-radius: var(--radius-md);
  background: rgba(247, 245, 240, 0.2);
  color: var(--strata-cream);
  font-size: var(--text-sm);
  width: 160px;
  transition: all var(--duration-fast);
}

.search-input::placeholder {
  color: rgba(247, 245, 240, 0.7);
}

.search-input:focus {
  outline: none;
  border-color: var(--petroleum-copper);
  background: rgba(247, 245, 240, 0.25);
  width: 200px;
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  border: none;
  border-radius: var(--radius-md);
  background: var(--petroleum-copper);
  color: var(--strata-cream);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.search-btn:hover {
  background: var(--petroleum-gold);
  transform: scale(1.05);
}

/* ============================================================================
   BREADCRUMBS
   ============================================================================ */
.breadcrumbs {
  padding: var(--space-4) 0;
  margin-bottom: var(--space-6);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.breadcrumb-item a {
  color: var(--text-secondary);
}

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

.breadcrumb-item:not(:last-child)::after {
  content: "/";
  margin-left: var(--space-2);
  color: var(--text-muted);
}

.breadcrumb-item.active span {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================================================
   PAGINATION
   ============================================================================ */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-8) 0;
  margin-top: var(--space-10);
}

.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}

.pagination-link,
.pagination-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: all var(--duration-fast);
}

.pagination-link {
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
}

.pagination-link:hover:not(.disabled) {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
}

.pagination-link.active {
  color: var(--strata-cream);
  background: var(--petroleum-copper);
  border-color: var(--petroleum-copper);
}

.pagination-link.disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.5;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
  :root {
    --text-5xl: 2.5rem;
    --text-6xl: 3rem;
  }

  .theme-toggle {
    top: var(--space-4);
    right: var(--space-4);
    width: 40px;
    height: 40px;
  }

  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 22, 40, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
    padding: var(--space-6);
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-base) var(--ease-out);
    border-top: 1px solid rgba(184, 115, 51, 0.2);
  }

  .main-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .main-nav ul {
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
  }

  .main-nav a {
    display: block;
    text-align: center;
    padding: var(--space-4);
    width: 100%;
  }

  .hero-content {
    padding: var(--space-8);
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 300px;
  }

  .content-section {
    margin: var(--space-8) 0;
    padding: var(--space-8);
  }

  .projects-grid,
  .resources-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .nav-search {
    width: 100%;
    margin-top: var(--space-4);
    margin-left: 0;
  }

  .search-form {
    width: 100%;
  }

  .search-input,
  .search-input:focus {
    width: 100%;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: high) {
  :root {
    --border-light: var(--strata-shale);
    --text-secondary: var(--text-primary);
  }
}

/* ============================================================================
   PRINT
   ============================================================================ */
@media print {
  .theme-toggle,
  .mobile-nav-toggle,
  .floating-elements,
  .site-header,
  .site-footer,
  .hero::before {
    display: none !important;
  }

  .hero {
    min-height: auto;
    background: none !important;
    color: black !important;
  }

  .content-section {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  body {
    background: white;
    color: black;
  }
}
