/* ============================================================
   NBTen OÜ — Design System
   Acid Lime → Cyan on Obsidian
   ============================================================ */

/* --- RESET --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- DESIGN TOKENS --- */
:root {
  /* Ground Colors (obsidian canvas) */
  --color-ground-900: #030303;
  --color-ground-800: #0a0c0a;
  --color-ground-700: #0f1a12;
  --color-ground-600: #1a2a1e;
  --color-ground-500: #243028;

  /* Signal Colors (acid lime energy) */
  --color-signal-600: #65a30d;
  --color-signal-500: #a3e635;
  --color-signal-400: #bef264;
  --color-signal-300: #d9f99d;
  --color-signal-highlight: #ecfccb;
  --color-signal-cyan: #06b6d4;
  --color-signal-cyan-deep: #0891b2;

  /* Text Colors */
  --color-text-primary: #f0f0f0;
  --color-text-secondary: #94a3b8;
  --color-text-tertiary: #4b5563;

  /* Semantic */
  --color-surface: var(--color-ground-700);
  --color-border: var(--color-ground-600);

  /* Typography */
  --font-primary: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'Space Mono', monospace;

  --type-display: clamp(2.8rem, 4.5vw + 1rem, 5rem);
  --type-h1: clamp(2rem, 3vw + 0.5rem, 3.5rem);
  --type-h2: clamp(1.4rem, 2vw + 0.5rem, 2rem);
  --type-body-lg: 1.2rem;
  --type-body: 1rem;
  --type-caption: 0.8125rem;
  --type-mono: 0.8125rem;

  /* Layout */
  --grid-max-width: 1200px;
  --section-pad-y: clamp(5rem, 10vh, 9rem);
  --section-pad-x: clamp(1.5rem, 4vw, 3rem);

  /* Conductor */
  --conductor-left: clamp(2rem, 5vw, 4rem);
}

/* --- BASE --- */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--type-body);
  line-height: 1.7;
  color: var(--color-text-primary);
  background: var(--color-ground-900);
  overflow-x: hidden;
}

::selection {
  background: rgba(163, 230, 53, 0.25);
  color: var(--color-text-primary);
}

/* --- SKIP LINK --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-signal-500);
  color: var(--color-ground-900);
  font-weight: 600;
  font-size: var(--type-caption);
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 100;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid var(--color-signal-500);
  outline-offset: 2px;
}

/* --- FOCUS STYLES --- */
:focus-visible {
  outline: 2px solid var(--color-signal-500);
  outline-offset: 2px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-ground-900);
  overflow: hidden;
}

/* Subtle radial glow behind hero content */
.hero::before {
  content: '';
  position: absolute;
  top: 45%;
  left: 50%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(163, 230, 53, 0.05) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: hero-glow-pulse 8s ease-in-out infinite alternate;
}
.hero::after {
  content: '';
  position: absolute;
  top: 35%;
  left: 40%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.04) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: hero-glow-pulse-reverse 10s ease-in-out infinite alternate;
}

@keyframes hero-glow-pulse {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

@keyframes hero-glow-pulse-reverse {
  0% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
}

/* Particle network canvas */
#hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.5rem var(--section-pad-x);
  z-index: 50;
  background: linear-gradient(180deg, var(--color-ground-900) 0%, transparent 100%);
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo-svg {
  height: 36px;
  width: auto;
}

.logo-svg--small {
  height: 18px;
}

/* Hero Content */
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 var(--section-pad-x);
  max-width: 900px;
}

.hero-statement {
  font-size: var(--type-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--color-text-primary);
  margin-bottom: 2.5rem;
  text-shadow: 0 4px 24px rgba(0,0,0,0.5); /* Enhances readability over particles */
}

/* The Current Line */
.hero-line {
  width: min(500px, 70vw);
  height: 3px;
  display: block;
  margin: 0 auto;
}

.hero-line-path {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: current-draw 2s cubic-bezier(0.65, 0, 0.35, 1) 0.5s forwards;
}

@keyframes current-draw {
  to { stroke-dashoffset: 0; }
}

/* Scroll Indicator */
.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-signal-500);
  opacity: 0.6;
  animation: scroll-pulse 3s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(4px); }
}

/* ============================================================
   MAIN / CONDUCTOR
   ============================================================ */
main {
  position: relative;
}

.conductor-line {
  display: none;
}

@media (min-width: 64em) {
  .conductor-line {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--conductor-left);
    width: 1px;
    z-index: 1;
    pointer-events: none;
  }
  .conductor-wire {
    width: 1px;
    height: 100%;
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(163, 230, 53, 0.15) 5%,
      rgba(163, 230, 53, 0.15) 95%,
      transparent 100%
    );
  }
  .conductor-node {
    position: absolute;
    top: 0;
    left: var(--conductor-left);
    width: 7px;
    height: 7px;
    background: var(--color-signal-500);
    border-radius: 50%;
    transform: translate(-3px, 0);
    opacity: 0.5;
    z-index: 2;
  }
}

/* ============================================================
   SECTIONS — SHARED
   ============================================================ */
.section {
  position: relative;
  padding: var(--section-pad-y) var(--section-pad-x);
}

.section-inner {
  max-width: var(--grid-max-width);
  margin: 0 auto;
}

.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-signal-500);
  margin-bottom: 2rem;
}

.body-lg {
  font-size: var(--type-body-lg);
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 640px;
}

.body-lg + .body-lg {
  margin-top: 1.25rem;
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.section--about {
  background: var(--color-ground-800);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 64em) {
  .about-grid {
    grid-template-columns: 7fr 5fr;
    gap: 4rem;
    align-items: start;
  }
}

.about-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.circuit-svg {
  width: 100%;
  max-width: 240px;
  height: auto;
  opacity: 0.7;
}

/* ============================================================
   VOLTBOARD SHOWCASE
   ============================================================ */
.section--voltboard {
  background: var(--color-ground-700);
  position: relative;
}

/* Subtle ambient glow behind voltboard section */
.section--voltboard::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(163, 230, 53, 0.04) 0%, transparent 70%);
  transform: translateX(-50%);
  pointer-events: none;
}

.voltboard-inner {
  max-width: 800px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.voltboard-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 2rem;
}

.voltboard-name {
  font-family: var(--font-primary);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.5px;
}

.voltboard-ai {
  color: var(--color-signal-500);
  font-weight: 400;
}

.voltboard-desc {
  text-align: center;
  margin-bottom: 2.5rem;
  max-width: 640px;
}

/* CTA Button */
.cta {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--color-signal-500);
  color: var(--color-ground-900);
  font-family: var(--font-primary);
  font-size: var(--type-body);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  letter-spacing: 0.01em;
  transition: background 200ms ease, transform 200ms ease;
  margin-bottom: 2.5rem;
}

.cta:hover {
  background: var(--color-signal-400);
  transform: scale(1.02);
}

.cta:active {
  background: var(--color-signal-600);
}

/* Signal Tags */
.voltboard-signals {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.signal-tag {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.signal-tag::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--color-signal-500);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  opacity: 0.6;
}

/* ============================================================
   FUTURE INITIATIVES
   ============================================================ */
.section--future {
  background: var(--color-ground-800);
}

.future-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.future-item {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--color-ground-600);
}

.future-name {
  font-family: var(--font-primary);
  font-weight: 600;
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

.future-desc {
  font-size: var(--type-body);
  color: var(--color-text-tertiary);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--color-ground-600);
  padding: 3rem var(--section-pad-x) 2rem;
  background: var(--color-ground-900);
}

.footer-inner {
  max-width: var(--grid-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 48em) {
  .footer-inner {
    grid-template-columns: auto 1fr auto;
    gap: 3rem;
  }
}

.footer-legal {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mono-detail {
  font-family: var(--font-mono);
  font-size: var(--type-mono);
  color: var(--color-text-tertiary);
  line-height: 1.6;
}

.footer-email {
  font-family: var(--font-mono);
  font-size: var(--type-mono);
  color: var(--color-signal-500);
  text-decoration: none;
  transition: color 200ms ease;
}

.footer-email:hover {
  color: var(--color-signal-400);
}

.footer-copyright {
  max-width: var(--grid-max-width);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
}

/* ============================================================
   ANIMATIONS — SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-line-path {
    stroke-dashoffset: 0;
    animation: none;
  }
  .hero-scroll {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
  #hero-particles {
    display: none;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 47.999em) {
  .cta {
    width: 100%;
    text-align: center;
  }
  .voltboard-signals {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .future-item {
    flex-direction: column;
    gap: 0.5rem;
  }
  .about-visual {
    order: -1;
  }
}
