/* ============================
   CSS Variables & Base Styles
   ============================ */

:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --fg: #e8e8ed;
  --muted: #6b6b7a;
  --accent: #00ff88;
  --accent-dim: #00cc6a;
  --card: #16161f;
  --border: #2a2a3a;
  --glow: rgba(0, 255, 136, 0.15);
  --font-main: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --fg: #1a1a2e;
  --muted: #6b6b7a;
  --accent: #00a855;
  --accent-dim: #008844;
  --card: #ffffff;
  --border: #e0e0e5;
  --glow: rgba(0, 168, 85, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  line-height: 1.6;
}

.font-mono {
  font-family: var(--font-mono);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ============================
   Canvas & Background
   ============================ */

#network-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.4;
}

[data-theme="light"] #network-canvas {
  opacity: 0.2;
}

.gradient-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 30% 20%, var(--glow) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 80%, rgba(0, 100, 255, 0.05) 0%, transparent 40%);
  z-index: 1;
  pointer-events: none;
}

.content-wrapper {
  position: relative;
  z-index: 10;
}

/* ============================
   Layout Utilities
   ============================ */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 720px;
}

/* ============================
   Navigation
   ============================ */

.fixed-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(10, 10, 15, 0.8);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .fixed-nav {
  background: rgba(245, 245, 247, 0.9);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.logo-prefix {
  color: var(--muted);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 32px;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--fg);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.lang-toggle:hover {
  border-color: var(--accent);
  background: var(--glow);
}

.theme-toggle {
  width: 48px;
  height: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform 0.3s ease;
}

[data-theme="light"] .theme-toggle::after {
  transform: translateX(20px);
}

.btn-nav {
  display: none;
}

@media (min-width: 640px) {
  .btn-nav {
    display: inline-flex;
  }
}

/* ============================
   Buttons
   ============================ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 15px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-family: var(--font-main);
}

.btn-primary:hover {
  background: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px var(--accent);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  background: transparent;
  color: var(--fg);
  font-weight: 600;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-family: var(--font-main);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-full {
  width: 100%;
}

/* ============================
   Hero Section
   ============================ */

.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 100px;
  padding-bottom: 60px;
}

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
}

.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  background: var(--glow);
  color: var(--accent);
  margin-bottom: 24px;
}

.availability-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
}

.text-accent {
  color: var(--accent);
}

.hero-description {
  font-size: 18px;
  color: var(--muted);
  max-width: 540px;
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  gap: 48px;
}

.stat-value {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* ============================
   Terminal
   ============================ */

.terminal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.terminal-header {
  background: var(--bg-elevated);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27ca40; }

.terminal-filename {
  font-size: 13px;
  color: var(--muted);
  margin-left: 12px;
}

.terminal-body {
  padding: 20px;
  min-height: 180px;
  font-size: 14px;
}

.terminal-line {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.terminal-prompt {
  color: var(--accent);
  font-weight: 600;
}

.terminal-cursor {
  display: inline-block;
  width: 10px;
  height: 18px;
  background: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

#terminal-output {
  color: var(--muted);
  margin-top: 16px;
  line-height: 1.8;
}

#terminal-output div {
  margin: 4px 0;
}

.float-element {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* ============================
   Sections Common
   ============================ */

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 18px;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ============================
   Services Section
   ============================ */

.services-section {
  padding: 96px 0;
}

.services-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px var(--glow);
}

.service-number {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  margin-bottom: 16px;
  transition: color 0.3s ease;
}

.service-card:hover .service-number {
  color: var(--accent);
}

.service-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.service-description {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 15px;
}

.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  transition: all 0.3s ease;
}

.tech-pill:hover {
  border-color: var(--accent);
  background: var(--glow);
}

/* ============================
   Process Section
   ============================ */

.process-section {
  padding: 96px 0;
  background: var(--bg-elevated);
}

.process-grid {
  display: grid;
  gap: 64px;
  align-items: center;
}

@media (min-width: 1024px) {
  .process-grid {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
  }
}

.process-intro {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 48px;
}

.process-steps {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.process-step {
  position: relative;
  padding-left: 48px;
}

.process-step::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: -32px;
  width: 2px;
  background: var(--border);
}

.process-step:last-child::before {
  display: none;
}

.process-number {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.process-step-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.process-step-desc {
  color: var(--muted);
  font-size: 15px;
}

/* Code Block */
.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  overflow-x: auto;
  font-size: 13px;
}

.code-comment {
  color: var(--muted);
  margin-bottom: 16px;
}

.code-content {
  line-height: 1.8;
  color: var(--fg);
}

.code-key {
  color: var(--accent);
}

.code-string {
  color: #f9a825;
}

.code-caption {
  font-size: 14px;
  color: var(--muted);
  margin-top: 16px;
}

/* ============================
   Stack Section
   ============================ */

.stack-section {
  padding: 96px 0;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 480px) {
  .stack-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .stack-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .stack-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.tech-item {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 20px 16px;
}

.tech-icon {
  margin-bottom: 8px;
  color: var(--accent);
}

/* ============================
   Contact Section
   ============================ */

.contact-section {
  padding: 96px 0;
  background: var(--bg-elevated);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-row {
  display: grid;
  gap: 24px;
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-main);
  font-size: 15px;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.form-input::placeholder {
  color: var(--muted);
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6b7a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.contact-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
  text-align: center;
}

.contact-info-value {
  font-size: 18px;
  color: var(--accent);
}

.contact-info-label {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* ============================
   Footer
   ============================ */

.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

@media (min-width: 640px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-brand {
  font-size: 14px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

/* ============================
   Reveal Animations
   ============================ */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================
   Focus States
   ============================ */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================
   Reduced Motion
   ============================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
  
  .reveal {
    opacity: 1;
    transform: none;
  }
  
  .float-element {
    animation: none;
  }
  
  .terminal-cursor {
    animation: none;
    opacity: 1;
  }
}