/* CSS Variables for theming - Based on Material Design & WCAG Guidelines */
:root {
  /* Light Mode - Clean & Clear */
  --color-bg: #ffffff;
  --color-bg-alt: #f5f7f9;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #4a5568;
  --color-text-tertiary: #718096;
  --color-border: #e2e8f0;
  --color-green: #4a6b4f;
  --color-green-hover: #3d5a41;
  --floating-opacity: 0.06;
  --header-bg: rgba(255, 255, 255, 0.95);
  --mobile-menu-bg: rgba(255, 255, 255, 0.98);
}

[data-theme="dark"] {
  /* Dark Mode - Material Design Elevation System */
  /* Base: #121212 with elevation overlays */
  --color-bg: #121212;           /* 0dp elevation */
  --color-bg-alt: #1e1e1e;       /* 1dp elevation - sections */
  --color-surface: #242424;       /* 3dp elevation - cards */
  --color-text: #e0e0e0;         /* High emphasis (87% white) */
  --color-text-secondary: #b0b0b0; /* Medium emphasis (60% white) */
  --color-text-tertiary: #8a8a8a;  /* Low emphasis (38% white) */
  --color-border: #2e2e2e;       /* Subtle separation */
  --color-green: #81c784;        /* Desaturated green for dark bg */
  --color-green-hover: #a5d6a7;  /* Lighter on hover */
  --floating-opacity: 0.04;
  --header-bg: rgba(39, 39, 39, 0.98); /* 4dp elevation - header */
  --mobile-menu-bg: rgba(39, 39, 39, 0.98);
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Smooth color transitions */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Dark mode toggle button */
.theme-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--color-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-green);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--color-text);
  transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
  transform: rotate(20deg) scale(1.1);
}

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #4a6b4f;
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 100;
}
.skip-to-content:focus {
  top: 0;
}

/* Glitch Suite - Truly Unexpected */

/* Main glitch with displacement */
@keyframes glitch-1 {
  0%, 85%, 100% {
    transform: translate(0);
    clip-path: none;
  }
  86% {
    transform: translate(-5px, 2px);
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  }
  87% {
    transform: translate(3px, -3px);
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  }
  88% {
    transform: translate(-2px, 1px);
    clip-path: polygon(0 20%, 100% 20%, 100% 80%, 0 80%);
  }
}

/* RGB split effect */
@keyframes glitch-rgb {
  0%, 90%, 100% {
    text-shadow: none;
  }
  91% {
    text-shadow: -3px 0 red, 3px 0 cyan;
  }
  92% {
    text-shadow: 3px 0 red, -3px 0 cyan;
  }
  93% {
    text-shadow: -2px 0 blue, 2px 0 yellow;
  }
  94% {
    text-shadow: 2px 0 magenta, -2px 0 lime;
  }
}

/* Scan lines effect */
@keyframes glitch-scan {
  0%, 95%, 100% {
    background: none;
  }
  96% {
    background: repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.1) 0px,
      transparent 2px,
      transparent 4px
    );
  }
  97% {
    background: repeating-linear-gradient(
      90deg,
      rgba(74, 107, 79, 0.15) 0px,
      transparent 3px,
      transparent 6px
    );
  }
}

/* Skew/distortion */
@keyframes glitch-skew {
  0%, 92%, 100% {
    transform: skew(0deg);
  }
  93% {
    transform: skew(-3deg);
  }
  94% {
    transform: skew(2deg);
  }
  95% {
    transform: skew(-1deg);
  }
}

/* Blur pulse */
@keyframes glitch-blur {
  0%, 88%, 100% {
    filter: blur(0px);
  }
  89% {
    filter: blur(2px);
  }
  90% {
    filter: blur(0px);
  }
  91% {
    filter: blur(3px);
  }
}

/* Opacity flicker */
@keyframes glitch-flicker {
  0%, 83%, 100% {
    opacity: 1;
  }
  84% {
    opacity: 0.3;
  }
  84.5% {
    opacity: 0.8;
  }
  85% {
    opacity: 0.5;
  }
  85.5% {
    opacity: 1;
  }
}

.hero-title {
  position: relative;
  animation:
    glitch-1 7s infinite,
    glitch-rgb 11s infinite,
    glitch-skew 13s infinite,
    glitch-blur 17s infinite,
    glitch-flicker 19s infinite;
  animation-timing-function: steps(2, end);
}

/* Pseudo-element for layered glitch */
.hero-title::before,
.hero-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.hero-title::before {
  animation: glitch-before 5s infinite;
  color: #ff00ff;
  z-index: -1;
}

.hero-title::after {
  animation: glitch-after 7s infinite;
  color: #00ffff;
  z-index: -1;
}

@keyframes glitch-before {
  0%, 93%, 100% {
    opacity: 0;
    transform: translate(0);
  }
  94% {
    opacity: 0.7;
    transform: translate(-3px, 2px);
  }
  95% {
    opacity: 0.5;
    transform: translate(2px, -2px);
  }
}

@keyframes glitch-after {
  0%, 91%, 100% {
    opacity: 0;
    transform: translate(0);
  }
  92% {
    opacity: 0.8;
    transform: translate(3px, -2px);
  }
  93% {
    opacity: 0.6;
    transform: translate(-2px, 2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title,
  .hero-title::before,
  .hero-title::after {
    animation: none;
  }
}

/* Ripple effect container */
.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(74, 107, 79, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease-out, height 0.6s ease-out;
}

.ripple-container:hover::before {
  width: 300%;
  height: 300%;
}

@media (prefers-reduced-motion: reduce) {
  .ripple-container::before {
    transition: none;
  }
  .ripple-container:hover::before {
    width: 0;
    height: 0;
  }
}

/* Floating elements - subtle background animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px) translateX(0px) scale(1);
  }
  33% {
    transform: translateY(-60px) translateX(40px) scale(1.1);
  }
  66% {
    transform: translateY(40px) translateX(-50px) scale(0.95);
  }
}

@keyframes floatReverse {
  0%, 100% {
    transform: translateY(0px) translateX(0px) scale(1);
  }
  33% {
    transform: translateY(50px) translateX(-40px) scale(1.05);
  }
  66% {
    transform: translateY(-30px) translateX(30px) scale(0.9);
  }
}

.floating-bg {
  position: absolute;
  border-radius: 50%;
  opacity: var(--floating-opacity);
  pointer-events: none;
  z-index: 0;
}

.floating-bg-1 {
  width: 500px;
  height: 500px;
  background: #4a6b4f;
  top: -10%;
  left: -5%;
  animation: float 15s ease-in-out infinite;
}

.floating-bg-2 {
  width: 400px;
  height: 400px;
  background: #4a6b4f;
  bottom: -10%;
  right: -5%;
  animation: floatReverse 18s ease-in-out infinite;
}

.floating-bg-3 {
  width: 600px;
  height: 600px;
  background: #1a1a1a;
  top: 30%;
  right: -10%;
  animation: float 22s ease-in-out infinite;
  animation-delay: 3s;
}

@media (prefers-reduced-motion: reduce) {
  .floating-bg {
    animation: none;
  }
}

/* Card hover effects */
.card-hover {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}
@media (prefers-reduced-motion: reduce) {
  .card-hover:hover {
    transform: none;
  }
}

/* Navigation link underline effect */
.nav-link {
  position: relative;
  color: var(--color-text-secondary) !important;
}
.nav-link:hover {
  color: var(--color-text) !important;
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-green);
  transition: width 0.2s ease;
}
.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 100%;
}

/* Logo wordmark */
.logo-text {
  color: var(--color-text) !important;
}

/* Mobile menu links */
.mobile-menu-link {
  color: var(--color-text) !important;
}
.mobile-menu-link:hover {
  color: var(--color-green) !important;
}

/* Headings */
h1, h2, h3 {
  color: var(--color-text);
}

/* Hero subtitle */
.hero-subtitle {
  color: var(--color-text-secondary);
}

/* Section text */
.section-text {
  color: var(--color-text-secondary);
}

/* Blockquote */
blockquote {
  color: var(--color-text-secondary);
  border-color: var(--color-green);
}

/* Button styles */
.btn-primary {
  background-color: var(--color-green);
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}
.btn-primary:hover {
  background-color: var(--color-green-hover);
}
.btn-primary:active {
  transform: scale(0.98);
}
@media (prefers-reduced-motion: reduce) {
  .btn-primary:active {
    transform: none;
  }
}

.btn-ghost {
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
.btn-ghost:hover {
  background-color: #f5f5f5;
  color: #1a1a1a;
}

/* Mobile menu - full-screen overlay */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--mobile-menu-bg);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}
.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}
@media (prefers-reduced-motion: reduce) {
  .mobile-menu {
    transition: none;
  }
}

.mobile-menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.mobile-menu nav a {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  padding: 1rem 0;
  transition: color 0.2s ease;
}
.mobile-menu nav a:hover {
  color: var(--color-green);
}

/* Section backgrounds */
.section-alt {
  background-color: var(--color-bg-alt);
}

/* Card styles for dark mode */
.card-dark {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

.card-dark h3 {
  color: var(--color-text);
}

.card-dark p {
  color: var(--color-text-secondary);
}

/* Card SVG icons */
.card-dark svg {
  color: var(--color-green);
}

/* Footer styles */
.footer-dark {
  border-color: var(--color-border);
}

.footer-dark p,
.footer-dark a {
  color: var(--color-text-tertiary);
}

.footer-dark a:hover {
  color: var(--color-green);
}

/* Form inputs for dark mode */
input, textarea, label {
  color: var(--color-text);
}

input, textarea {
  background-color: var(--color-surface);
  border-color: var(--color-border);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-tertiary);
}

input:focus,
textarea:focus {
  border-color: var(--color-green);
}

/* Dark mode overrides for Tailwind utility classes */
[data-theme="dark"] .text-uh-black {
  color: var(--color-text) !important;
}

[data-theme="dark"] .text-gray-700 {
  color: var(--color-text-secondary) !important;
}

[data-theme="dark"] .text-gray-600 {
  color: var(--color-text-secondary) !important;
}

[data-theme="dark"] .text-gray-500 {
  color: var(--color-text-tertiary) !important;
}

[data-theme="dark"] .border-gray-300 {
  border-color: var(--color-border) !important;
}

[data-theme="dark"] .bg-white {
  background-color: var(--color-surface) !important;
}

[data-theme="dark"] .btn-ghost {
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}

[data-theme="dark"] .btn-ghost:hover {
  background-color: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-color: var(--color-green) !important;
}

/* ============================================ */
/* INDUSTRIAL TYPOGRAPHY & MOTION ENHANCEMENTS */
/* ============================================ */

/* Apply Inter font globally with industrial weights */
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  letter-spacing: -0.01em; /* Tighter tracking for clarity */
}

/* Hero title enhanced tracking for weight */
.hero-title {
  letter-spacing: 0.03em; /* Deliberate spacing for gravity */
  font-weight: 600;
}

/* Hero tagline with enhanced tracking */
.hero-tagline {
  letter-spacing: 0.02em;
  font-weight: 500;
}

/* Textured background for hero section */
.hero-section {
  position: relative;
  background-color: var(--color-bg);
}

/* Subtle grain texture overlay */
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  pointer-events: none;
  z-index: 1;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(26, 26, 26, 0.03) 2px,
      rgba(26, 26, 26, 0.03) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(26, 26, 26, 0.03) 2px,
      rgba(26, 26, 26, 0.03) 4px
    );
  background-size: 100px 100px;
}

[data-theme="dark"] .hero-section::before {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.02) 2px,
      rgba(255, 255, 255, 0.02) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.02) 2px,
      rgba(255, 255, 255, 0.02) 4px
    );
}

/* Sequential fade-in animation for hero lines */
.hero-line {
  display: inline-block;
  opacity: 0;
  animation: fadeInUp 1s ease-out forwards;
  animation-delay: var(--delay);
}

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

@media (prefers-reduced-motion: reduce) {
  .hero-line {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

