/* ==========================================================================
   GLERC — Core Design System
   Green Line Equipment Rental & Contracting Ltd.
   ========================================================================== */

/* ---------- CSS Custom Properties (Theme) ---------- */
:root {
  /* Backgrounds */
  --bg: #0a0f0d;
  --bg-secondary: #111a16;
  --bg-tertiary: #0d1410;

  /* Cards & Surfaces */
  --card: rgba(17, 26, 22, 0.7);
  --card-hover: rgba(22, 34, 28, 0.85);
  --card-border: rgba(0, 200, 83, 0.12);

  /* Primary Colors */
  --primary: #00c853;
  --primary-dark: #009624;
  --primary-light: #5efc82;
  --secondary: #00e676;

  /* Accent */
  --accent: #d4a843;
  --accent-light: #e6c570;
  --accent-dark: #b8892e;

  /* Text */
  --text: #e8ece9;
  --text-secondary: #8a9b91;
  --text-muted: #5a6b61;

  /* Borders */
  --border: rgba(0, 200, 83, 0.15);
  --border-light: rgba(255, 255, 255, 0.06);

  /* Status */
  --success: #00c853;
  --warning: #d4a843;
  --danger: #ff5252;

  /* Glass */
  --glass-bg: rgba(10, 15, 13, 0.65);
  --glass-border: rgba(0, 200, 83, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #00c853 0%, #00e676 100%);
  --gradient-accent: linear-gradient(135deg, #d4a843 0%, #e6c570 100%);
  --gradient-dark: linear-gradient(180deg, #0a0f0d 0%, #111a16 100%);
  --gradient-hero: linear-gradient(180deg, rgba(10, 15, 13, 0.3) 0%, rgba(10, 15, 13, 0.85) 60%, #0a0f0d 100%);
  --gradient-card: linear-gradient(145deg, rgba(0, 200, 83, 0.05) 0%, rgba(0, 0, 0, 0) 100%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(0, 200, 83, 0.15);

  /* Spacing (8px grid) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-7: 56px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
  --space-15: 100px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-slower: 0.8s ease;

  /* Container */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;
  --container-2xl: 1400px;

  /* Z-Index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-navbar: 500;
  --z-modal: 1000;
  --z-toast: 1100;
}

/* ---------- CSS Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.25rem, 5vw + 1rem, 4.5rem);
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 3rem);
  line-height: 1.12;
}

h3 {
  font-size: clamp(1.25rem, 2vw + 0.25rem, 1.75rem);
  line-height: 1.2;
}

h4 {
  font-size: clamp(1.1rem, 1.5vw + 0.2rem, 1.375rem);
  line-height: 1.25;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

p {
  font-size: clamp(0.9375rem, 0.5vw + 0.8rem, 1.0625rem);
  line-height: 1.7;
  color: var(--text-secondary);
}

.lead {
  font-size: clamp(1.0625rem, 0.8vw + 0.85rem, 1.25rem);
  line-height: 1.65;
  color: var(--text-secondary);
}

small,
.small {
  font-size: 0.875rem;
}

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

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

.text-muted {
  color: var(--text-muted);
}

.text-white {
  color: var(--text);
}

.text-center {
  text-align: center;
}

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- Section Tag (Label) ---------- */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--primary);
  background: rgba(0, 200, 83, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}

.section-tag i {
  font-size: 0.625rem;
}

/* ---------- Section Header ---------- */
.section-header {
  max-width: 720px;
  margin-bottom: var(--space-8);
}

.section-header.centered {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-header h2 {
  margin-bottom: var(--space-3);
}

.section-header p {
  max-width: 600px;
}

.section-header.centered p {
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Highlight Text ---------- */
.highlight {
  color: var(--primary);
}

.highlight-accent {
  color: var(--accent);
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Layout: Container ---------- */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

.container-lg {
  max-width: var(--container-2xl);
}

.container-sm {
  max-width: var(--container-md);
}

/* ---------- Sections ---------- */
section {
  padding: var(--space-12) 0;
  position: relative;
}

section.section-lg {
  padding: var(--space-15) 0;
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ---------- Flex Utilities ---------- */
.flex {
  display: flex;
}

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

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

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-1 {
  gap: var(--space-1);
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-5 {
  gap: var(--space-5);
}

.gap-6 {
  gap: var(--space-6);
}

/* ---------- Glass Effect ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

.glass-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.glass-card:hover {
  background: var(--card-hover);
  border-color: rgba(0, 200, 83, 0.25);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px);
}

/* ---------- Dividers ---------- */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-light);
  border: none;
}

.divider-gradient {
  height: 1px;
  border: none;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.3;
}

/* ---------- Visibility Helpers ---------- */
.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;
}

/* ---------- Selection ---------- */
::selection {
  background: rgba(0, 200, 83, 0.3);
  color: var(--text);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 200, 83, 0.2);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 200, 83, 0.35);
}

/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Skip to Content ---------- */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: var(--space-2);
  z-index: var(--z-toast);
  padding: var(--space-1) var(--space-3);
  background: var(--primary);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-to-content:focus {
  top: 0;
}

/* ---------- Background Textures ---------- */
.bg-noise {
  position: relative;
}

.bg-noise::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.bg-noise>* {
  position: relative;
  z-index: 1;
}

/* ---------- Ambient Glow ---------- */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  opacity: 0.12;
}

.glow-green {
  background: var(--primary);
}

.glow-gold {
  background: var(--accent);
}

/* ---------- Light Theme ---------- */
[data-theme="light"] {
  --bg: #f4f7f5;
  --bg-secondary: #e8ede9;
  --bg-tertiary: #ffffff;

  --card: rgba(255, 255, 255, 0.85);
  --card-hover: rgba(255, 255, 255, 0.95);
  --card-border: rgba(0, 100, 40, 0.1);

  --primary: #00a844;
  --primary-dark: #007a30;
  --primary-light: #00c853;
  --secondary: #00b84d;

  --accent: #b8892e;
  --accent-light: #d4a843;
  --accent-dark: #9a7020;

  --text: #12261a;
  --text-secondary: #3e5a48;
  --text-muted: #6a8575;

  --border: rgba(0, 100, 40, 0.12);
  --border-light: rgba(0, 0, 0, 0.07);

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 100, 40, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);

  --gradient-dark: linear-gradient(180deg, #f4f7f5 0%, #e8ede9 100%);
  --gradient-hero: linear-gradient(180deg, rgba(244, 247, 245, 0.15) 0%, rgba(244, 247, 245, 0.82) 55%, #f4f7f5 100%);
  --gradient-card: linear-gradient(145deg, rgba(0, 168, 68, 0.04) 0%, rgba(0, 0, 0, 0) 100%);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.09);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 24px rgba(0, 168, 68, 0.12);
}

/* Smooth transition for theme switch */
body {
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* Light theme hero image should be brighter */
[data-theme="light"] .hero-slide img {
  opacity: 0.65;
}

/* Light theme scrollbar */
[data-theme="light"] ::-webkit-scrollbar-track {
  background: var(--bg);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 168, 68, 0.22);
}

/* Light theme navbar scrolled */
[data-theme="light"] .navbar.scrolled {
  background: rgba(244, 247, 245, 0.92);
}

/* Light theme marquee fade */
[data-theme="light"] .marquee::before {
  background: linear-gradient(90deg, var(--bg-secondary), transparent);
}

[data-theme="light"] .marquee::after {
  background: linear-gradient(270deg, var(--bg-secondary), transparent);
}

/* Light theme map */
[data-theme="light"] .map-container iframe {
  filter: none;
}