/**
* Chronofield Technologies - Modern Theme
* Dark/Light Mode Support with GenAI Focus
* Brand Color: #643f97
*/

/*--------------------------------------------------------------
# CSS Variables - Theme System
--------------------------------------------------------------*/
:root {
  /* Brand Colors */
  --brand-primary: #643f97;
  --brand-primary-light: #8a5fc7;
  --brand-primary-dark: #4a2e71;
  --brand-gradient: linear-gradient(135deg, #643f97 0%, #8a5fc7 100%);
  --brand-gradient-hover: linear-gradient(135deg, #4a2e71 0%, #643f97 100%);

  /* Light Theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;
  --text-primary: #1a1a1a;
  --text-secondary: #6c757d;
  --text-tertiary: #adb5bd;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.20);

  /* Borders */
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-base: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;

  /* Fonts */
  --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;
  --text-primary: #f8f9fa;
  --text-secondary: #adb5bd;
  --text-tertiary: #6c757d;

  --glass-bg: rgba(0, 0, 0, 0.3);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.7);
}

/*--------------------------------------------------------------
# Global Reset & Base Styles
--------------------------------------------------------------*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
}

::selection {
  background-color: var(--brand-primary);
  color: white;
}

/*--------------------------------------------------------------
# Modern Navbar
--------------------------------------------------------------*/
.modern-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: all var(--transition-base);
}

.modern-navbar.scrolled {
  padding: 0.5rem 0;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .modern-navbar {
  background: rgba(10, 10, 10, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modern-navbar.scrolled {
  background: rgba(10, 10, 10, 0.95);
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
  width: 100%;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-display);
  transition: transform var(--transition-fast);
  margin-right: auto;
  position: relative;
}

.navbar-logo:hover {
  transform: translateY(-2px);
}

.logo-image {
  height: 50px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(100, 63, 151, 0.2));
  transition: filter var(--transition-base);
}

.logo-image:hover {
  filter: drop-shadow(0 4px 12px rgba(100, 63, 151, 0.4));
}

/* Dark theme - invert logo colors and adjust hue */
[data-theme="dark"] .logo-image {
  filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(168, 85, 247, 0.3));
}

[data-theme="dark"] .logo-image:hover {
  filter: brightness(0) invert(1) drop-shadow(0 4px 12px rgba(168, 85, 247, 0.5));
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  gap: 0;
  white-space: nowrap;
}

.logo-main {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--brand-primary);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  position: relative;
}

[data-theme="dark"] .logo-main {
  color: var(--text-primary);
}

.logo-sub {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-primary-light);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-top: -2px;
  margin-left: 2px;
}

[data-theme="dark"] .logo-main {
  color: var(--text-primary);
}

[data-theme="dark"] .logo-sub {
  color: var(--text-secondary);
}

.navbar-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

.navbar-menu li {
  display: flex;
  align-items: center;
}

.navbar-menu li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition-base);
  position: relative;
  padding: 1rem 2rem;
  display: inline-block;
  background: transparent;
  min-height: 50px;
  display: flex;
  align-items: center;
}

.navbar-menu li a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% + 20px);
  height: calc(100% + 10px);
  background: var(--brand-primary);
  opacity: 0;
  transition: all var(--transition-base);
  z-index: -1;
  border-radius: 50px;
}

.navbar-menu li a::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% + 20px);
  height: calc(100% + 10px);
  background: var(--brand-primary);
  opacity: 0;
  z-index: -2;
  border-radius: 50px;
  filter: blur(8px);
}

.navbar-menu li a:hover {
  color: var(--text-primary);
}

.navbar-menu li a:hover::before {
  opacity: 0.15;
}

.navbar-menu li a:hover::after {
  opacity: 0.2;
  animation: pulseGlow 2s ease-in-out infinite;
}

/* Active state with sci-fi glitch effect */
.navbar-menu li a.active {
  color: white;
  font-weight: 700;
  animation: textGlitch 3s infinite;
}

.navbar-menu li a.active::before {
  opacity: 1;
  animation: pillGlitch 3s infinite;
}

.navbar-menu li a.active::after {
  opacity: 0.6;
  animation: glowPulse 2s ease-in-out infinite;
}

/* Glitch Animations - STRONGER */
@keyframes pillGlitch {
  0%, 85%, 100% {
    transform: translate(-50%, -50%) skew(0deg);
    border-radius: 50px;
    opacity: 1;
  }
  86% {
    transform: translate(-45%, -50%) skew(-8deg) scaleX(1.1);
    border-radius: 30px 60px 40px 55px;
    opacity: 0.9;
  }
  87% {
    transform: translate(-55%, -48%) skew(10deg) scaleX(0.9);
    border-radius: 65px 35px 55px 40px;
    opacity: 0.95;
  }
  88% {
    transform: translate(-48%, -52%) skew(-6deg) scaleY(1.15);
    border-radius: 40px 50px 30px 60px;
    opacity: 0.85;
  }
  89% {
    transform: translate(-52%, -50%) skew(7deg) scaleX(1.05);
    border-radius: 55px 40px 60px 35px;
    opacity: 0.9;
  }
  90% {
    transform: translate(-50%, -48%) skew(-4deg);
    border-radius: 48px 52px 45px 55px;
    opacity: 0.95;
  }
  91% {
    transform: translate(-50%, -50%) skew(0deg);
    border-radius: 50px;
    opacity: 1;
  }
}

@keyframes glowPulse {
  0%, 100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(8px);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
    filter: blur(12px);
  }
}

@keyframes textGlitch {
  0%, 85%, 100% {
    text-shadow: 0 0 0 transparent;
    transform: translate(0, 0) skew(0deg);
  }
  86% {
    text-shadow: 5px 0 #ff00ff, -5px 0 #00ffff, 0 0 10px rgba(255, 0, 255, 0.5);
    transform: translate(-3px, 1px) skew(-3deg);
  }
  87% {
    text-shadow: -5px 0 #ff00ff, 5px 0 #00ffff, 0 0 15px rgba(0, 255, 255, 0.5);
    transform: translate(3px, -1px) skew(3deg);
  }
  88% {
    text-shadow: 3px 3px #ff00ff, -3px -3px #00ffff, 0 0 20px rgba(255, 0, 255, 0.7);
    transform: translate(-2px, 2px) skew(-2deg);
  }
  89% {
    text-shadow: -4px 2px #ff00ff, 4px -2px #00ffff, 0 0 10px rgba(0, 255, 255, 0.5);
    transform: translate(2px, -2px) skew(2deg);
  }
  90% {
    text-shadow: 2px -1px #ff00ff, -2px 1px #00ffff;
    transform: translate(-1px, 1px) skew(-1deg);
  }
  91% {
    text-shadow: 0 0 0 transparent;
    transform: translate(0, 0) skew(0deg);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.1;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

[data-theme="dark"] .navbar-menu li a.active {
  color: white;
}

[data-theme="dark"] .navbar-menu li a.active::before {
  background: var(--brand-primary);
}

/* Theme Toggle Button */
.theme-toggle {
  width: 44px;
  height: 44px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-base);
  margin-left: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  transform: scale(1.05);
}

.theme-toggle:hover .theme-icon {
  color: white;
}

.theme-icon {
  font-size: 1.2rem;
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
}

.theme-icon.sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-icon.moon {
  opacity: 0;
  transform: rotate(180deg) scale(0);
}

[data-theme="dark"] .theme-icon.sun {
  opacity: 0;
  transform: rotate(-180deg) scale(0);
}

[data-theme="dark"] .theme-icon.moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 968px) {
  .navbar-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-lg);
  }

  .navbar-menu.active {
    transform: translateX(0);
  }

  .mobile-menu-toggle {
    display: block;
  }

  .theme-toggle {
    margin-left: 0;
  }
}

/*--------------------------------------------------------------
# Hero Section - GenAI Focused
--------------------------------------------------------------*/
.hero-modern {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 8rem 2rem 4rem;
  background: var(--bg-primary);
}

/* Sci-Fi Canvas Background */
.scifi-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

[data-theme="dark"] .scifi-background {
  opacity: 1;
}

/* Animated Background Grid */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--glass-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.15;
  animation: gridMove 20s linear infinite;
}

[data-theme="dark"] .hero-bg-grid {
  opacity: 0.3;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

/* Gradient Orbs */
.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: float 20s ease-in-out infinite;
}

[data-theme="dark"] .gradient-orb {
  opacity: 0.4;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--brand-primary);
  top: -200px;
  left: -200px;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: #8a5fc7;
  bottom: -150px;
  right: -150px;
  animation-delay: -5s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Hexagon Grid Pattern */
.hexagon-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(30deg, var(--brand-primary) 12%, transparent 12.5%, transparent 87%, var(--brand-primary) 87.5%, var(--brand-primary)),
    linear-gradient(150deg, var(--brand-primary) 12%, transparent 12.5%, transparent 87%, var(--brand-primary) 87.5%, var(--brand-primary)),
    linear-gradient(30deg, var(--brand-primary) 12%, transparent 12.5%, transparent 87%, var(--brand-primary) 87.5%, var(--brand-primary)),
    linear-gradient(150deg, var(--brand-primary) 12%, transparent 12.5%, transparent 87%, var(--brand-primary) 87.5%, var(--brand-primary));
  background-size: 80px 140px;
  background-position: 0 0, 0 0, 40px 70px, 40px 70px;
  opacity: 0.05;
  z-index: 0;
  animation: hexagonMove 30s linear infinite;
}

[data-theme="dark"] .hexagon-grid {
  opacity: 0.03;
}

@keyframes hexagonMove {
  0% { transform: translateY(0); }
  100% { transform: translateY(-140px); }
}

/* Scanning Line Effect */
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    var(--brand-primary-light),
    var(--brand-primary),
    var(--brand-primary-light),
    transparent
  );
  box-shadow: 0 0 20px var(--brand-primary), 0 0 40px var(--brand-primary);
  opacity: 0.4;
  z-index: 1;
  animation: scan 8s ease-in-out infinite;
}

[data-theme="dark"] .scan-line {
  opacity: 0.5;
}

@keyframes scan {
  0%, 100% {
    transform: translateY(0);
    opacity: 0;
  }
  10% {
    opacity: 0.5;
  }
  50% {
    transform: translateY(100vh);
    opacity: 0.5;
  }
  90% {
    opacity: 0;
  }
}

.hero-content {
  max-width: 1200px;
  text-align: center;
  position: relative;
  z-index: 10;
  pointer-events: none;
}

.hero-content > * {
  pointer-events: auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  animation: slideDown 0.8s ease-out;
}

.hero-badge .badge-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  animation: slideUp 0.8s ease-out 0.2s both;
}

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

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

.hero-description {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 3rem;
  line-height: 1.8;
  animation: slideUp 0.8s ease-out 0.4s both;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: slideUp 0.8s ease-out 0.6s both;
}

.btn-primary {
  padding: 1rem 2.5rem;
  background: var(--brand-gradient);
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--brand-gradient-hover);
}

.btn-secondary {
  padding: 1rem 2.5rem;
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  display: inline-block;
}

.btn-secondary:hover {
  background: var(--glass-bg);
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/*--------------------------------------------------------------
# Modern Card Components
--------------------------------------------------------------*/
.card-modern {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

/* Equal height cards only in grid layouts (About section) */
#about .card-modern {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Contact form - reasonable sizing */
#contact .form-textarea {
  min-height: 150px;
  max-height: 300px;
}

.card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-gradient);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

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

.card-modern:hover::before {
  transform: scaleX(1);
}

.card-icon {
  width: 60px;
  height: 60px;
  background: var(--brand-gradient);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  margin-bottom: 1.5rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.card-description {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.card-link {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap var(--transition-fast);
}

.card-link:hover {
  gap: 1rem;
}

/*--------------------------------------------------------------
# Services Grid
--------------------------------------------------------------*/
.services-modern {
  padding: 6rem 2rem;
  background: var(--bg-secondary);
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 4rem;
}

.section-tag {
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  display: block;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.section-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.services-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/*--------------------------------------------------------------
# Contact Form with API Animation
--------------------------------------------------------------*/
.contact-modern {
  padding: 6rem 2rem;
  background: var(--bg-primary);
}

.contact-container {
  max-width: 800px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.form-input,
.form-textarea {
  width: 100%;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all var(--transition-base);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(100, 63, 151, 0.1);
}

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

/* API Request Animation */
.api-animation-container {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  display: none;
  max-height: 400px;
  overflow-y: auto;
}

.api-animation-container.active {
  display: block;
  animation: slideDown 0.3s ease-out;
}

.api-log-line {
  padding: 0.5rem;
  margin: 0.25rem 0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.api-log-line.info {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

.api-log-line.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.api-log-line.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.api-log-line .timestamp {
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

.api-log-line .spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-code {
  padding: 0.25rem 0.5rem;
  background: var(--brand-primary);
  color: white;
  border-radius: 4px;
  font-weight: 600;
}

.status-code.success {
  background: #10b981;
}

.status-code.error {
  background: #ef4444;
}

/*--------------------------------------------------------------
# Footer Modern
--------------------------------------------------------------*/
.footer-modern {
  background: var(--bg-secondary);
  border-top: 1px solid var(--glass-border);
  padding: 4rem 2rem 2rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.footer-section p,
.footer-section a {
  color: var(--text-secondary);
  text-decoration: none;
  line-height: 2;
  transition: color var(--transition-fast);
}

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

.footer-links {
  list-style: none;
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-link {
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-base);
}

.social-link:hover {
  background: var(--brand-gradient);
  color: white;
  transform: translateY(-3px);
}

/*--------------------------------------------------------------
# Utility Classes
--------------------------------------------------------------*/
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

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

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

/*--------------------------------------------------------------
# Responsive Design
--------------------------------------------------------------*/
@media (max-width: 768px) {
  .hero-modern {
    padding: 6rem 1rem 3rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

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

  .btn-primary,
  .btn-secondary {
    text-align: center;
  }
}

/*--------------------------------------------------------------
# Smooth Scroll & Performance
--------------------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--brand-primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-primary-dark);
}

/*--------------------------------------------------------------
# Markdown Editor
--------------------------------------------------------------*/
.markdown-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--glass-border);
  align-items: center;
}

.markdown-info {
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.markdown-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: -2px;
}

.markdown-tab:hover {
  color: var(--brand-primary);
  background: var(--glass-bg);
}

.markdown-tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.markdown-editor {
  position: relative;
}

.markdown-input {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  tab-size: 2;
}

.markdown-toolbar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border: 2px solid var(--glass-border);
  border-top: none;
  border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
  flex-wrap: wrap;
}

.md-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.md-btn:hover {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

.md-btn:active {
  transform: translateY(0);
}

.markdown-preview {
  min-height: 200px;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 2px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
}

.preview-content {
  font-family: var(--font-body);
  line-height: 1.8;
}

/* Markdown Preview Styling */
.preview-content h1,
.preview-content h2,
.preview-content h3,
.preview-content h4,
.preview-content h5,
.preview-content h6 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.preview-content h1 {
  font-size: 2rem;
  border-bottom: 2px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

.preview-content h2 {
  font-size: 1.75rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

.preview-content h3 { font-size: 1.5rem; }
.preview-content h4 { font-size: 1.25rem; }
.preview-content h5 { font-size: 1.1rem; }
.preview-content h6 { font-size: 1rem; }

.preview-content p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.preview-content a {
  color: var(--brand-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
}

.preview-content a:hover {
  border-bottom-color: var(--brand-primary);
}

.preview-content ul,
.preview-content ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
  color: var(--text-secondary);
}

.preview-content li {
  margin-bottom: 0.5rem;
}

.preview-content code {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--brand-primary);
}

.preview-content pre {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: var(--border-radius-md);
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--glass-border);
}

.preview-content pre code {
  background: transparent;
  padding: 0;
  color: var(--text-primary);
}

.preview-content blockquote {
  border-left: 4px solid var(--brand-primary);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.preview-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius-md);
  margin: 1rem 0;
}

.preview-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.preview-content th,
.preview-content td {
  padding: 0.75rem;
  border: 1px solid var(--glass-border);
  text-align: left;
}

.preview-content th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-primary);
}

.preview-content td {
  color: var(--text-secondary);
}

.preview-content hr {
  border: none;
  border-top: 2px solid var(--glass-border);
  margin: 2rem 0;
}

/* Empty state for preview */
.preview-content:empty::before {
  content: 'Nothing to preview yet. Start writing in markdown!';
  color: var(--text-tertiary);
  font-style: italic;
}
