:root {
  --bg: #050a07;
  --bg-2: #07140e;
  --surface: #0a1610;
  --surface-2: #0c1f14;
  --accent: #00ff41;
  --accent-2: #39ff14;
  --accent-dim: #22c55e;
  --forest: #14532d;
  --text: #c8ffd4;
  --muted: #86c9a0;
  --border: rgba(0, 255, 65, 0.16);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --nav-h: 4.25rem;
  --radius: 16px;
  --max: 1120px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: var(--safe-bottom);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
button { font-family: inherit; }

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--accent); color: #04110a; padding: 0.5rem 0.85rem;
  border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: calc(var(--safe-top) + 0.6rem); }

.glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(0, 255, 65, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(34, 197, 94, 0.1), transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(20, 83, 45, 0.35), transparent 55%);
}

.site-nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  min-height: var(--nav-h);
  padding: calc(0.55rem + var(--safe-top)) 1.25rem 0.55rem;
  background: rgba(5, 10, 7, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
.site-nav.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
.brand {
  display: flex; flex-direction: column; text-decoration: none; color: var(--text);
  min-width: 0;
}
.brand strong {
  font-size: 1.05rem; letter-spacing: -0.03em;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(0, 255, 65, 0.25);
}
.brand span { font-size: 0.72rem; color: var(--muted); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  border-radius: 10px;
  cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-toggle-bars {
  display: block; width: 18px; height: 2px; background: currentColor; position: relative;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor;
  transition: transform 0.15s ease, top 0.15s ease;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  top: 0; transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  top: 0; transform: rotate(-45deg);
}

.nav-menu {
  display: flex; align-items: center; gap: 0.15rem 1.15rem; flex-wrap: wrap;
}
.nav-menu a {
  color: var(--muted); text-decoration: none; font-size: 0.92rem; font-weight: 500;
  padding: 0.35rem 0;
}
.nav-menu a:hover, .nav-menu a:focus-visible { color: var(--accent); }
.nav-cta {
  display: inline-flex; align-items: center;
  margin-left: 0.35rem;
  padding: 0.45rem 0.95rem !important;
  border-radius: 999px;
  background: var(--accent);
  color: #04110a !important;
  font-weight: 700 !important;
}
.nav-cta:hover { background: var(--accent-2); color: #04110a !important; }

.wrap {
  position: relative; z-index: 1;
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.hero {
  position: relative; z-index: 1;
  padding: 3.2rem 0 3.6rem;
  min-height: min(86dvh, 820px);
  display: flex; align-items: center;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
  gap: 2.2rem;
  align-items: center;
}
.eyebrow {
  margin: 0 0 0.7rem;
  text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 0.72rem; color: var(--accent-dim); font-weight: 600;
}
.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 6vw, 4.1rem);
  line-height: 1.05; letter-spacing: -0.04em;
}
.lead {
  margin: 0 0 1.6rem;
  max-width: 38rem;
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  color: #b7e8c8;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.65rem 1.2rem;
  border-radius: 999px; text-decoration: none; font-weight: 650; font-size: 0.95rem;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #04110a; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost {
  background: rgba(0, 255, 65, 0.05);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.35rem 1.4rem 1.2rem;
  box-shadow: var(--shadow), 0 0 40px rgba(0, 255, 65, 0.06);
}
.hero-card .now {
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 0.55rem;
}
.hero-card h2 { margin: 0 0 0.25rem; font-size: 1.2rem; }
.hero-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.stat-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem; margin-top: 1.15rem;
}
.stat {
  background: rgba(5, 10, 7, 0.45);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 0.7rem 0.6rem;
}
.stat b { display: block; color: var(--accent); font-size: 0.92rem; }
.stat span { display: block; color: var(--muted); font-size: 0.72rem; }

.section {
  position: relative; z-index: 1;
  padding: 4.2rem 0;
}
.section-alt {
  background: rgba(10, 22, 16, 0.55);
  border-block: 1px solid var(--border);
}
.section-head { max-width: 40rem; margin-bottom: 1.8rem; }
.kicker {
  margin: 0 0 0.4rem;
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-dim); font-weight: 700;
}
.section h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  letter-spacing: -0.03em;
}
.section-head p { margin: 0; color: var(--muted); }

.work-grid, .pillar-grid, .demo-grid, .lab-grid {
  display: grid; gap: 1rem;
}
.work-grid { grid-template-columns: repeat(3, 1fr); }
.pillar-grid { grid-template-columns: repeat(4, 1fr); }
.demo-grid { grid-template-columns: repeat(4, 1fr); }
.lab-grid { grid-template-columns: repeat(3, 1fr); }

.card {
  display: flex; flex-direction: column; gap: 0.45rem;
  text-decoration: none; color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1.2rem;
  min-height: 100%;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
a.card:hover, a.card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(0, 255, 65, 0.45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28), 0 0 24px rgba(0, 255, 65, 0.08);
  outline: none;
}
.tag {
  align-self: flex-start;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.18rem 0.5rem; border-radius: 999px;
  background: rgba(0, 255, 65, 0.12); color: var(--accent);
}
.tag-live { background: rgba(56, 189, 248, 0.14); color: #7dd3fc; }
.tag-research { background: rgba(167, 139, 250, 0.16); color: #ddd6fe; }
.tag-igm { background: rgba(227, 6, 19, 0.16); color: #fca5a5; }
.tag-private { background: rgba(248, 113, 113, 0.12); color: #fca5a5; }
.card h3 { margin: 0.15rem 0 0; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; flex: 1; }
.card-link {
  margin-top: 0.35rem; font-size: 0.82rem; font-weight: 650; color: var(--accent);
}

.pillar { padding: 1.2rem 1.15rem; }
.pillar h3 { margin: 0 0 0.4rem; font-size: 1.02rem; }
.more-row { margin-top: 1.25rem; }

.contact {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.8rem 1.7rem;
}
.contact h2 { margin: 0 0 0.5rem; }
.contact p { margin: 0 0 1rem; color: var(--muted); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }

.site-footer {
  position: relative; z-index: 1;
  padding: 2.2rem 0 calc(2.4rem + var(--safe-bottom));
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.88rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 1.4rem;
}
.site-footer h3 {
  margin: 0 0 0.55rem; color: var(--text); font-size: 0.78rem;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.28rem 0; }
.fine { margin: 1.4rem 0 0; font-size: 0.78rem; opacity: 0.8; }

body.nav-open { overflow: hidden; }

@media (max-width: 980px) {
  .hero-grid, .contact, .footer-grid { grid-template-columns: 1fr; }
  .work-grid, .demo-grid { grid-template-columns: repeat(2, 1fr); }
  .pillar-grid, .lab-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { min-height: 0; padding: 2.2rem 0 2.8rem; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    display: none;
    position: fixed;
    top: calc(var(--nav-h) + var(--safe-top));
    left: 0; right: 0; bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.6rem 1.1rem 2rem;
    background: rgba(5, 10, 7, 0.96);
    overflow: auto;
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu a {
    padding: 0.95rem 0.2rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
  }
  .nav-cta {
    margin: 1rem 0 0; justify-content: center;
    border-bottom: 0 !important;
  }
}

@media (max-width: 620px) {
  .wrap { width: min(var(--max), calc(100% - 1.4rem)); }
  .work-grid, .pillar-grid, .demo-grid, .lab-grid, .stat-row {
    grid-template-columns: 1fr;
  }
  .section { padding: 2.8rem 0; }
  .hero-actions, .contact-actions { flex-direction: column; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a.card { transition: none; }
}
