:root {
  /* Core Colors */
  --bg-base: #0a0a0c;
  --bg-surface: #121216;
  --bg-surface-elevated: #1a1a20;
  --bg-glass: rgba(18, 18, 22, 0.6);
  --border-subtle: #2a2a32;
  --border-focus: #4b4b5c;

  /* Accents */
  --accent-primary: #00ffcc;
  --accent-secondary: #ff3366;
  --accent-tertiary: #cc00ff;
  --accent-glow: rgba(0, 255, 204, 0.2);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 1rem;
  --sp-4: 1.5rem;
  --sp-5: 2rem;
  --sp-6: 3rem;
  --sp-8: 4rem;
  --sp-12: 6rem;
  --sp-16: 8rem;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--sp-3);
  letter-spacing: -0.02em;
}

p {
  color: var(--text-secondary);
  margin-bottom: var(--sp-4);
  font-size: 1.125rem;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-primary);
}

ul {
  list-style: none;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.grid {
  display: grid;
  gap: var(--sp-6);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: var(--sp-2);
}

.mt-4 {
  margin-top: var(--sp-4);
}

.mt-8 {
  margin-top: var(--sp-8);
}

.mb-2 {
  margin-bottom: var(--sp-2);
}

.mb-4 {
  margin-bottom: var(--sp-4);
}

.mb-8 {
  margin-bottom: var(--sp-8);
}

.py-8 {
  padding-top: var(--sp-8);
  padding-bottom: var(--sp-8);
}

.py-16 {
  padding-top: var(--sp-16);
  padding-bottom: var(--sp-16);
}

/* Components: Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  display: flex;
  align-items: center;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand span {
  color: var(--accent-primary);
}

.nav-links {
  display: flex;
  gap: var(--sp-5);
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent-primary);
  transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Components: Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--bg-base);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 30px var(--accent-glow) inset;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 80px;
  /* offset for navbar */
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 50%);
  opacity: 0.5;
  z-index: -1;
  animation: pulse-glow 10s ease-in-out infinite alternate;
}

.hero-content {
  max-width: 800px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  background: linear-gradient(to right, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--sp-4);
}

.hero .lead {
  font-size: 1.25rem;
  max-width: 600px;
  margin-bottom: var(--sp-6);
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* Interactive 3D Spotlight Cards */
.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  perspective: 1200px;
}

.interactive-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: var(--sp-6);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  will-change: transform, box-shadow;
}

.interactive-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(0, 255, 153, 0.08), transparent 40%);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.interactive-card:hover::before {
  opacity: 1;
}

.interactive-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 255, 153, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  pointer-events: none;
  mask-image: radial-gradient(400px circle at var(--mouse-x, 0) var(--mouse-y, 0), black, transparent);
  -webkit-mask-image: radial-gradient(400px circle at var(--mouse-x, 0) var(--mouse-y, 0), black, transparent);
}

.interactive-card:hover::after {
  opacity: 1;
}

.interactive-card-content {
  position: relative;
  z-index: 1;
  transform: translateZ(30px);
  /* Lifts content up during 3D tilt */
}

/* Base Card (Legacy) */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: var(--sp-6);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--border-focus);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: var(--sp-3);
  color: var(--text-primary);
}

.card p {
  flex-grow: 1;
  font-size: 1rem;
}

.card-action {
  margin-top: var(--sp-4);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: gap var(--transition-fast);
}

.card:hover .card-action {
  gap: 0.75rem;
}

/* Animated SVG Icons */
.animated-svg-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 1rem;
  stroke: var(--accent-primary);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.interactive-card:hover .animated-svg-icon path {
  animation: drawSvg 1.5s ease-out forwards;
}

@keyframes drawSvg {
  0% {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    opacity: 0.3;
  }

  100% {
    stroke-dashoffset: 0;
    opacity: 1;
    stroke: #fff;
  }
}

/* Section specific styling */
.section-header {
  margin-bottom: var(--sp-8);
}

.section-title {
  font-size: 2.5rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--accent-primary);
}

/* Monospace Block */
.mono-block {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: var(--sp-4);
  border-radius: 6px;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  font-size: 0.85rem;
  overflow-x: auto;
  margin-bottom: var(--sp-4);
  white-space: pre;
}

/* Bento Grid System */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  width: 100%;
}

.bento-card {
  background: linear-gradient(135deg, rgba(30, 35, 45, 0.4) 0%, rgba(10, 15, 21, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s ease, box-shadow 0.3s ease;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.bento-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 255, 153, 0.3);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 15px 40px rgba(0, 255, 153, 0.15);
  z-index: 10;
}

.bento-card-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.col-span-12 {
  grid-column: span 12;
}

.col-span-8 {
  grid-column: span 8;
}

.col-span-7 {
  grid-column: span 7;
}

.col-span-6 {
  grid-column: span 6;
}

.col-span-5 {
  grid-column: span 5;
}

.col-span-4 {
  grid-column: span 4;
}

.col-span-3 {
  grid-column: span 3;
}

@media (max-width: 1024px) {
  .bento-grid {
    display: flex;
    flex-direction: column;
  }
}

/* Bento Animated Backgrounds */
.bento-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.15;
  transition: opacity 0.3s ease;
}

.bento-card:hover .bento-bg {
  opacity: 0.3;
}

/* Radar Sweep */
.bg-radar {
  background:
    linear-gradient(90deg, rgba(0, 255, 153, 0.1) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(rgba(0, 255, 153, 0.1) 1px, transparent 1px) 0 0 / 20px 20px;
}

.bg-radar::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent 70%, rgba(0, 255, 153, 0.8) 100%);
  transform-origin: center;
  animation: radarSpin 4s linear infinite;
  margin-top: -100%;
  margin-left: -100%;
  border-radius: 50%;
  mask-image: radial-gradient(circle at center, black 0%, transparent 50%);
  -webkit-mask-image: radial-gradient(circle at center, black 0%, transparent 50%);
}

@keyframes radarSpin {
  100% {
    transform: rotate(360deg);
  }
}

/* Data Stream */
.bg-data-stream {
  background-image: linear-gradient(0deg, transparent 50%, rgba(0, 204, 255, 0.15) 50%);
  background-size: 100% 4px;
  animation: scanlines 10s linear infinite;
}

@keyframes scanlines {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 0 1000px;
  }
}

/* Particles / Nodes */
.bg-nodes {
  background-image: radial-gradient(rgba(255, 51, 102, 0.5) 1.5px, transparent 1.5px);
  background-size: 30px 30px;
  animation: floatNodes 20s linear infinite;
}

@keyframes floatNodes {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: -300px -300px;
  }
}

/* Glowing Border Accent */
.bento-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-primary);
  box-shadow: 0 0 15px var(--accent-primary);
  opacity: 0.7;
}

.bento-accent.blue {
  background: #00ccff;
  box-shadow: 0 0 15px #00ccff;
}

.bento-accent.pink {
  background: #ff3366;
  box-shadow: 0 0 15px #ff3366;
}

/* Animations */
@keyframes pulse-glow {
  0% {
    transform: scale(1);
    opacity: 0.4;
  }

  100% {
    transform: scale(1.1);
    opacity: 0.6;
  }
}

/* Interactive Particle Canvas */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

/* Decipher Text Effect */
.crypto-text {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.crypto-text.deciphering {
  opacity: 1;
}

/* Interactive Terminal (Hero) */
.terminal-window {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-focus);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  width: 100%;
  max-width: 550px;
  position: relative;
  z-index: 2;
  backdrop-filter: blur(8px);
}

.terminal-header {
  background: var(--bg-surface);
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}

.terminal-title {
  flex: 1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  user-select: none;
}

.terminal-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-btn.close {
  background: #ff5f56;
}

.terminal-btn.min {
  background: #ffbd2e;
}

.terminal-btn.max {
  background: #27c93f;
}

.terminal-body {
  padding: 20px;
  height: 320px;
  overflow-y: hidden;
  color: var(--accent-primary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.term-line {
  min-height: 1.4em;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.term-cursor {
  display: inline-block;
  width: 10px;
  height: 1.2em;
  background: var(--accent-primary);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
  margin-left: 4px;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Telemetry Counters */
.telemetry-counter {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-weight: bold;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-8) 0;
  margin-top: var(--sp-12);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.footer-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
}

.footer-links {
  display: flex;
  gap: var(--sp-4);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    /* simple hidden for mobile initially */
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}