/* ==========================================================================
   CSS Variables for Light & Dark Themes
   ========================================================================== */

:root {
  /* Colors */
  --primary-color: #ff6f21;
  --primary-hover: #e65c15;
  --secondary-color: #fcbd57;

  /* Backgrounds */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.9);
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;

  /* Text Colors */
  --text-main: #333333;
  --text-muted: #737373;
  /* Derived from logo */

  /* Borders & Shadows */
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 15px rgba(255, 111, 33, 0.3);

  /* Others */
  --transition-speed: 0.3s;
  --border-radius: 12px;
}

[data-theme='dark'] {
  /* Colors */
  --primary-color: #ff8c42;
  /* Lighter orange for dark mode */
  --primary-hover: #ff6f21;
  --secondary-color: #fcd086;

  /* Backgrounds */
  --bg-body: #1a1a1a;
  --bg-surface: #262626;
  --bg-header: rgba(26, 26, 26, 0.9);
  --bg-card: #262626;
  --bg-card-hover: #333333;

  /* Text Colors */
  --text-main: #f5f5f5;
  --text-muted: #a3a3a3;

  /* Borders & Shadows */
  --border-color: #404040;
  --shadow-glow: 0 0 15px rgba(255, 140, 66, 0.2);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color var(--transition-speed);
}

ul {
  list-style: none;
}

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

/* ==========================================================================
   Layout Components
   ========================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Nav */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--bg-header);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-speed);
}

.header.scrolled {
  box-shadow: var(--shadow-sm);
}

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

.logo img {
  height: 40px;
  width: auto;
  transition: opacity 0.3s ease;
}

.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-links a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--primary-color);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 8px;
  border-radius: 50%;
  transition: background-color var(--transition-speed);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background-color: var(--bg-card-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-speed);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

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

.btn-secondary {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  transform: translateY(-2px);
}

/* Main Main container */
main {
  margin-top: 80px;
  min-height: calc(100vh - 80px - 300px);
  /* rough calc, adjust based on footer */
}

/* Hero Section (Home) */
.hero {
  padding: 160px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-body);
}

/* Page Hero (Other Pages) */
.page-hero {
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-body);
  border-bottom: 1px solid var(--border-color);
}

/* High Tech Background Animations & Grids */
.hero-bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(var(--border-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center center;
  z-index: 0;
  opacity: 0.6;
  mask-image: radial-gradient(ellipse at center, black 10%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 10%, transparent 80%);
}

.hero-bg-gradient {
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100vw;
  /* Use a visible gradient mix scaled by theme context */
  background: radial-gradient(circle, rgba(255, 111, 33, 0.08) 0%, rgba(252, 189, 87, 0.03) 40%, transparent 70%);
  z-index: 0;
  filter: blur(60px);
  animation: pulseGlow 8s infinite alternate;
}

[data-theme='dark'] .hero-bg-gradient {
  background: radial-gradient(circle, rgba(255, 111, 33, 0.15) 0%, rgba(252, 189, 87, 0.05) 40%, transparent 70%);
}

@keyframes pulseGlow {
  0% {
    transform: translateX(-50%) scale(1);
    opacity: 0.8;
  }

  100% {
    transform: translateX(-50%) scale(1.1);
    opacity: 1;
  }
}

.hero .container,
.page-hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.page-hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-main), var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p,
.page-hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* Sections General */
.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 50px;
}

/* Card Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 30px;
  transition: all var(--transition-speed);
  position: relative;
  overflow: hidden;
}

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

.card-icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  display: inline-block;
  padding: 15px;
  background-color: var(--bg-body);
  border-radius: 12px;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.card-text {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* Footer */
.footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 30px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 15px;
}

.footer-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.footer-links li {
  margin-bottom: 10px;
}

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

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

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.mobile-only-btn {
  display: none;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 8px;
  align-items: center;
  justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .desktop-only-btn {
    display: none;
  }

  .mobile-only-btn {
    display: inline-flex;
    margin-top: 10px;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: var(--bg-header);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    gap: 15px;
    align-items: center;
  }
  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    font-size: 1.1rem;
    padding: 10px;
    width: 100%;
    text-align: center;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .section-title {
    font-size: 2rem;
  }
}
