/* ═══════════════════════════════════════════════════════════════
   ABELL, LLC — belyaev.cc
   Global Design System
   Hyper-minimalist deep-tech aesthetic — ALIVE edition
   ═══════════════════════════════════════════════════════════════ */

/* ─── FONTS ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

@font-face {
  font-family: 'Geist';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/fonts/geist-sans/Geist-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/fonts/geist-sans/Geist-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/fonts/geist-sans/Geist-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/fonts/geist-sans/Geist-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/fonts/geist-mono/GeistMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ─── CSS CUSTOM PROPERTIES ─────────────────────────────────── */
:root {
  /* Color tokens */
  --bg-base: #0B0C0F;
  --bg-surface: #101113;
  --bg-elevated: #16181B;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text-primary: #F4F4F5;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --accent: #2D7FF9;
  --accent-soft: rgba(45, 127, 249, 0.14);
  --accent-2: #7C6CFF;
  --signal: #5EEAFF;
  --signal-glow: rgba(94, 234, 255, 0.55);

  /* Typography */
  --font-ui: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', 'Fira Code', monospace;

  /* Type scale (desktop) */
  --fs-display: clamp(40px, 5vw, 72px);
  --fs-h1: clamp(32px, 3.5vw, 48px);
  --fs-h2: clamp(24px, 2.5vw, 32px);
  --fs-h3: clamp(17px, 1.5vw, 20px);
  --fs-body: clamp(16px, 1.2vw, 18px);
  --fs-small: clamp(14px, 1vw, 15px);
  --fs-mono-label: clamp(11px, 0.9vw, 13px);

  /* Spacing (8px grid) */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --space-4xl: 160px;

  /* Layout */
  --max-width: 1120px;
  --max-prose: 680px;

  /* Nav */
  --nav-height: 64px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg-base);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Radial vignette overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 50% at 50% 20%, rgba(124, 108, 255, 0.04) 0%, transparent 60%),
              radial-gradient(ellipse 80% 60% at 50% 0%, rgba(45, 127, 249, 0.03) 0%, transparent 50%);
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--text-primary);
}

/* Focus states */
:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* ─── BREATHING MESH GRADIENT (3 blobs, visible) ─────────────── */
.mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.mesh::before,
.mesh::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
}

/* Blob 1: azure (upper-right) */
.mesh::before {
  width: 700px;
  height: 700px;
  top: -15%;
  right: -10%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.16;
  animation: meshDrift1 24s ease-in-out infinite;
}

/* Blob 2: cyan (lower-left) */
.mesh::after {
  width: 600px;
  height: 600px;
  bottom: -10%;
  left: -8%;
  background: radial-gradient(circle, var(--signal) 0%, transparent 70%);
  opacity: 0.14;
  animation: meshDrift2 20s ease-in-out infinite;
}

/* Blob 3: indigo (center) — extra element via box-shadow trick on .mesh itself */
.mesh-blob3 {
  position: fixed;
  width: 550px;
  height: 550px;
  top: 30%;
  left: 25%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
  opacity: 0.12;
  filter: blur(140px);
  pointer-events: none;
  z-index: -1;
  animation: meshDrift3 28s ease-in-out infinite;
}

@keyframes meshDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-3%, 4%) scale(1.05); }
  66% { transform: translate(2%, -2%) scale(0.97); }
}

@keyframes meshDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(4%, -3%) scale(1.08); }
  70% { transform: translate(-2%, 2%) scale(0.95); }
}

@keyframes meshDrift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-3%, -4%) scale(1.06); }
}

/* Hero aura — brighter glow behind hero headline */
.hero-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(45, 127, 249, 0.12) 0%, rgba(124, 108, 255, 0.06) 40%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
}

/* ─── ANIMATED DOT-GRID OVERLAY (command-center texture) ─────── */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  background-image: radial-gradient(circle, var(--text-muted) 1px, transparent 1px);
  background-size: 32px 32px;
  animation: gridDrift 60s linear infinite;
}

@keyframes gridDrift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(32px, 32px); }
}

/* ─── PARTICLE CANVAS ──────────────────────────────────────────── */
#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
}

/* ─── GLASS NAV BAR ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  background: rgba(11, 12, 15, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
}

.nav__wordmark {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  text-transform: uppercase;
  text-decoration: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav__link {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav__link:hover {
  color: var(--text-primary);
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 12px rgba(45, 127, 249, 0.3), 0 0 4px rgba(45, 127, 249, 0.2);
  animation: ctaPulse 3s ease-in-out infinite;
}

.nav__cta:hover {
  background: #1a6fe8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(45, 127, 249, 0.5), 0 0 8px rgba(45, 127, 249, 0.3);
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(45, 127, 249, 0.3), 0 0 4px rgba(45, 127, 249, 0.2); }
  50% { box-shadow: 0 0 20px rgba(45, 127, 249, 0.5), 0 0 8px rgba(45, 127, 249, 0.35); }
}

/* Mobile menu toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.nav__toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Mobile nav sheet */
.nav__sheet {
  display: none;
}

@media (max-width: 768px) {
  .nav__links {
    display: none;
  }

  .nav__toggle {
    display: block;
  }

  .nav__sheet {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 12, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-xl);
    z-index: 999;
    flex-direction: column;
    gap: var(--space-lg);
  }

  .nav__sheet.active {
    display: flex;
  }

  .nav__sheet a {
    font-size: var(--fs-h3);
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav__sheet a:hover {
    color: var(--text-primary);
  }

  .nav__toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav__toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .nav__toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}

/* ─── LAYOUT UTILITIES ──────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
}

@media (max-width: 768px) {
  .section {
    padding: var(--space-3xl) 0;
  }
}

.prose {
  max-width: var(--max-prose);
  margin: 0 auto;
}

/* ─── TYPOGRAPHY UTILITIES ──────────────────────────────────── */
.display {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1, .h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h2, .h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

h3, .h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.mono-label {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.4;
}

.subhead {
  font-size: var(--fs-body);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: var(--max-prose);
}

/* ─── GLASSMORPHIC CARD (with floating animation) ─────────────── */
.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  position: relative;
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease, box-shadow 0.3s ease;
  animation: cardFloat var(--float-duration, 7s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--signal), var(--accent-2) 50%, transparent 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.glass:hover::before {
  opacity: 1;
}

.glass:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 0 24px rgba(94, 234, 255, 0.08), 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ─── BUTTONS ───────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 14px 28px;
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-small);
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 14px rgba(45, 127, 249, 0.3), 0 0 4px rgba(45, 127, 249, 0.2);
  animation: ctaPulse 3s ease-in-out infinite;
}

.btn-primary:hover {
  background: #1a6fe8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(45, 127, 249, 0.55), 0 0 8px rgba(45, 127, 249, 0.35);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 14px 28px;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--fs-small);
  font-weight: 400;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

/* ─── KINETIC TERMINAL HEADER (Typewriter) ──────────────────── */
@keyframes caret {
  50% { opacity: 0; }
}

.typewriter {
  display: inline;
}

.caret {
  display: inline-block;
  width: 0.6ch;
  height: 1.05em;
  background: var(--signal);
  vertical-align: text-bottom;
  animation: caret 1s step-end infinite;
  margin-left: 2px;
}

/* ─── CLOSING CTA BAND ─────────────────────────────────────── */
.cta-band {
  text-align: center;
  padding: var(--space-4xl) 0;
  border-top: 1px solid var(--border-subtle);
}

.cta-band__heading {
  font-size: var(--fs-h2);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

/* ─── GLOBAL FOOTER ─────────────────────────────────────────── */
.footer {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.footer__wordmark {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.footer__credential {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-label);
  letter-spacing: 0.04em;
  color: var(--text-muted);
  max-width: var(--max-prose);
}

.footer__links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}

.footer__links a {
  font-size: var(--fs-small);
  color: var(--text-secondary);
}

.footer__copy {
  font-size: var(--fs-mono-label);
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ─── VIDEO FRAME (case studies) ───────────────────────────────── */
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  animation: none; /* disable float for video frames */
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ─── SCROLL REVEAL ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

/* ─── PARALLAX LAYERS ──────────────────────────────────────────── */
.parallax-layer {
  will-change: transform;
}

/* ─── REDUCED MOTION ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mesh::before,
  .mesh::after,
  .mesh-blob3 {
    animation: none !important;
  }

  .grid-overlay {
    animation: none !important;
  }

  #particles-canvas {
    display: none !important;
  }

  .glass {
    animation: none !important;
  }

  .nav__cta,
  .btn-primary {
    animation: none !important;
    box-shadow: 0 0 8px rgba(45, 127, 249, 0.2);
  }

  .caret {
    animation: none;
    opacity: 1;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .glass:hover {
    transform: none;
  }

  .parallax-layer {
    transform: none !important;
  }
}

/* ─── SPACER ────────────────────────────────────────────────── */
.spacer-nav {
  height: var(--nav-height);
}
