/* ══════════════════════════════════════════════════════════════════════
   YEGET · DESIGN SYSTEM
   ══════════════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────────────── */
:root {
  /* Palette */
  --bg:           #020508;
  --bg-2:         #050d1a;
  --bg-card:      rgba(5, 13, 26, 0.82);
  --blue:         #38bdf8;
  --cyan:         #22d3ee;
  --indigo:       #818cf8;
  --violet:       #a78bfa;
  --green:        #22c55e;

  --blue-muted:   rgba(56, 189, 248, 0.55);
  --blue-glow:    rgba(56, 189, 248, 0.14);
  --indigo-glow:  rgba(129, 140, 248, 0.08);

  /* Text */
  --t1: #eef2ff;
  --t2: #94a3b8;
  --t3: #475569;
  --t4: #2d3f55;

  /* Borders */
  --border:       rgba(148, 163, 184, 0.07);
  --border-hi:    rgba(56, 189, 248, 0.2);

  /* Typography */
  --f-display: 'Space Grotesk', system-ui, sans-serif;
  --f-body:    'Inter', system-ui, sans-serif;
  --f-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Radii & transitions */
  --r:  12px;
  --r-sm: 6px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 220ms;
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--t1);
  font-family: var(--f-body);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, figure { display: block; max-width: 100%; }
a    { color: inherit; text-decoration: none; }
sub, sup { font-size: 0.65em; }

/* ── Global grid texture (fixed, behind everything) ─────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.028) 1px, transparent 1px);
  background-size: 68px 68px;
  pointer-events: none;
  z-index: 0;
}

/* ── Container ──────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ══════════════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════════════ */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.header.is-scrolled {
  background: rgba(2, 5, 8, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.3rem;
  padding-bottom: 1.3rem;
}

/* Logo */
.logo {
  font-family: var(--f-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--t1);
  transition: opacity var(--dur) var(--ease);
}
.logo:hover { opacity: 0.75; }
.logo-y { color: var(--blue); }
.logo-sm { font-size: 1.1rem; }

/* Nav */
.nav { display: flex; gap: 2.5rem; }
.nav-link {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t2);
  transition: color var(--dur) var(--ease);
}
.nav-link:hover { color: var(--t1); }

/* System status indicator */
.sys-status { display: flex; align-items: center; gap: 0.45rem; }
.sys-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: dot-pulse 2.2s ease-in-out infinite;
}
.sys-label {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--green);
  opacity: 0.85;
}

/* ══════════════════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Canvas fills the hero */
.cosmos-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Depth gradient layer */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 65% at 50% 38%, rgba(56, 189, 248, 0.055) 0%, transparent 60%),
    radial-gradient(ellipse 60% 55% at 78% 82%, rgba(129, 140, 248, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 45% 40% at 18% 72%, rgba(167, 139, 250, 0.045) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
  animation: hero-breathe 14s ease-in-out infinite alternate;
}

/* CRT scanlines */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.035) 3px,
    rgba(0, 0, 0, 0.035) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* ── HUD corners ────────────────────────────────────────────────────── */
.hud {
  position: absolute;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  animation: hud-in 0.6s 1.4s both;
}

.hud-bracket {
  width: 18px;
  height: 18px;
  border-color: rgba(56, 189, 248, 0.3);
  border-style: solid;
  border-width: 0;
}

.hud-readout {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: rgba(56, 189, 248, 0.4);
  text-transform: uppercase;
}
.hud-val { color: rgba(56, 189, 248, 0.7); }

.hud-tl { top: 5.5rem; left: 2rem; }
.hud-tr { top: 5.5rem; right: 2rem; align-items: flex-end; }
.hud-bl { bottom: 4.5rem; left: 2rem; }
.hud-br { bottom: 4.5rem; right: 2rem; align-items: flex-end; }

.hud-tl .hud-bracket { border-top-width: 1px; border-left-width: 1px; }
.hud-tr .hud-bracket { border-top-width: 1px; border-right-width: 1px; }
.hud-bl .hud-bracket { border-bottom-width: 1px; border-left-width: 1px; }
.hud-br .hud-bracket { border-bottom-width: 1px; border-right-width: 1px; }

/* ── Hero content ───────────────────────────────────────────────────── */
.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 860px;
  padding: 0 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--blue-muted);
  border: 1px solid var(--border-hi);
  background: rgba(56, 189, 248, 0.04);
  padding: 0.45rem 1.1rem;
  border-radius: 100px;
  margin-bottom: 2.5rem;
  animation: fade-rise 0.8s 0.1s both;
}
.badge-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue);
  animation: dot-pulse 1.8s ease-in-out infinite;
}

.hero-headline {
  font-family: var(--f-display);
  font-size: clamp(2.8rem, 7vw, 6.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--t1);
  margin-bottom: 1.8rem;
  animation: fade-rise 0.8s 0.22s both;
}
.headline-em {
  font-style: normal;
  background: linear-gradient(135deg, var(--blue) 0%, var(--indigo) 55%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  color: var(--t2);
  line-height: 1.75;
  max-width: 580px;
  margin: 0 auto 2.75rem;
  animation: fade-rise 0.8s 0.35s both;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fade-rise 0.8s 0.48s both;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.9rem;
  border-radius: var(--r-sm);
  font-family: var(--f-body);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2fb5ef 0%, var(--indigo) 100%);
  color: #fff;
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.22), 0 4px 18px rgba(0,0,0,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 55px rgba(56, 189, 248, 0.38), 0 6px 28px rgba(0,0,0,0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--t1);
  border-color: var(--border-hi);
  background: rgba(56, 189, 248, 0.05);
}

/* ── Scroll cue ─────────────────────────────────────────────────────── */
.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: var(--t4);
  animation: fade-rise 1s 1.2s both;
}

.scroll-track {
  width: 1px;
  height: 48px;
  background: var(--t4);
  overflow: hidden;
  position: relative;
}
.scroll-runner {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--blue-muted), transparent);
  animation: scroll-run 2s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════════════════════════
   FEATURES
   ══════════════════════════════════════════════════════════════════════ */
.features {
  position: relative;
  z-index: 1;
  padding: 9rem 0 8rem;
}

.section-header {
  text-align: center;
  margin-bottom: 5rem;
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--blue-muted);
  margin-bottom: 1.3rem;
}

.section-title {
  font-family: var(--f-display);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.022em;
  color: var(--t1);
  margin-bottom: 1.3rem;
}
.title-grad {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--indigo) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-desc {
  font-size: 1.03rem;
  color: var(--t2);
  line-height: 1.75;
  max-width: 540px;
  margin: 0 auto;
}

/* ── Cards grid ─────────────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.2rem;
}

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 2rem 1.85rem 1.75rem;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.55s var(--ease),
    transform 0.55s var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.card.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.card:hover {
  border-color: var(--border-hi);
  box-shadow:
    0 0 42px rgba(56, 189, 248, 0.07),
    0 12px 36px rgba(0, 0, 0, 0.35);
  transform: translateY(-5px);
}

/* Glowing top edge on hover */
.card-glow-line {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--blue) 50%, transparent 100%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.card:hover .card-glow-line { opacity: 1; }

/* Corner shimmer */
.card::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.06) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.card:hover::after { opacity: 1; }

.card-icon {
  width: 46px;
  height: 46px;
  color: var(--blue);
  margin-bottom: 1.4rem;
  opacity: 0.85;
  transition: opacity var(--dur) var(--ease);
}
.card:hover .card-icon { opacity: 1; }

.card-cat {
  font-family: var(--f-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  color: var(--blue-muted);
  margin-bottom: 0.65rem;
}

.card-title {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--t1);
  margin-bottom: 0.7rem;
}

.card-text {
  font-size: 0.875rem;
  color: var(--t2);
  line-height: 1.68;
  flex: 1;
}

.card-eq {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--t3);
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  letter-spacing: 0.03em;
  transition: color var(--dur) var(--ease);
}
.card:hover .card-eq { color: var(--t2); }

/* ══════════════════════════════════════════════════════════════════════
   METRICS
   ══════════════════════════════════════════════════════════════════════ */
.metrics {
  position: relative;
  z-index: 1;
  padding: 8rem 0 9rem;
  overflow: hidden;
}

/* Ambient glow behind the section */
.metrics::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 70% at 50% 50%, rgba(129, 140, 248, 0.055) 0%, transparent 65%);
  pointer-events: none;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.metric {
  padding: 3rem 2.25rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease),
    background var(--dur) var(--ease);
}
.metric:last-child { border-right: none; }
.metric:hover { background: rgba(56, 189, 248, 0.025); }
.metric.is-visible { opacity: 1; transform: translateY(0); }

.metric-num {
  font-family: var(--f-mono);
  font-size: clamp(1.9rem, 3vw, 2.85rem);
  font-weight: 400;
  color: var(--blue);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.2rem;
}

.metric-name {
  font-family: var(--f-display);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--t1);
}

.metric-sub {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--t3);
}

/* ══════════════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════════════ */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 4rem;
  padding-top: 5rem;
  padding-bottom: 4rem;
  flex-wrap: wrap;
}

.footer-brand { display: flex; flex-direction: column; gap: 0.7rem; }
.footer-tagline {
  font-size: 0.88rem;
  color: var(--t2);
  max-width: 240px;
  line-height: 1.6;
}
.footer-math {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  color: var(--t4);
  letter-spacing: 0.06em;
}

.footer-nav { display: flex; gap: 4rem; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 0.8rem; }
.footer-col-title {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: var(--blue-muted);
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}
.footer-link {
  font-size: 0.85rem;
  color: var(--t2);
  transition: color var(--dur) var(--ease);
}
.footer-link:hover { color: var(--t1); }

.footer-bottom { border-top: 1px solid var(--border); }
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  font-size: 0.77rem;
  color: var(--t3);
}
.footer-eq {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  opacity: 0.55;
}

/* ══════════════════════════════════════════════════════════════════════
   KEYFRAMES
   ══════════════════════════════════════════════════════════════════════ */
@keyframes fade-rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes hud-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes hero-breathe {
  0%   { opacity: 1; }
  100% { opacity: 0.55; }
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

@keyframes scroll-run {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(200%);  }
}

/* ══════════════════════════════════════════════════════════════════════
   PREFERS-REDUCED-MOTION
   ══════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration:       0.01ms !important;
    animation-iteration-count: 1     !important;
    transition-duration:      0.01ms !important;
  }

  /* Ensure initially hidden elements are immediately visible */
  .hero-badge,
  .hero-headline,
  .hero-sub,
  .hero-ctas,
  .scroll-cue,
  .hud,
  .card,
  .metric {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */

/* Tablet / medium */
@media (max-width: 900px) {
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metric:nth-child(2) { border-right: none; }
  .metric:nth-child(3) {
    border-right: 1px solid var(--border);
    border-top:   1px solid var(--border);
  }
  .metric:nth-child(4) {
    border-right: none;
    border-top:   1px solid var(--border);
  }
}

/* Mobile */
@media (max-width: 680px) {
  .nav    { display: none; }
  .hud    { display: none; }

  .hero-headline { letter-spacing: -0.018em; }

  .features { padding: 6rem 0 5rem; }
  .metrics  { padding: 5rem 0 6rem; }

  .cards {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    border-radius: var(--r);
  }
  .metric { border-right: none !important; }
  .metric:not(:first-child) { border-top: 1px solid var(--border); }

  .footer-inner { flex-direction: column; gap: 2.5rem; }
  .footer-nav   { gap: 2rem; }
  .footer-bottom-inner { flex-direction: column; gap: 0.4rem; text-align: center; }
}

@media (max-width: 400px) {
  .hero-headline { font-size: 2.4rem; }
  .btn { padding: 0.8rem 1.4rem; font-size: 0.85rem; }
}
