:root {
  --bg: #050505;
  --bg-2: #0a0a0a;
  --surface: #0f0f0f;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --text: #e8e8e6;
  --muted: #6b6b67;
  --dim: #3a3a38;
  --accent: #e8e8e6;
  --accent-warm: #d4a853;
  --accent-live: #4ade80;
  --accent-patent: #818cf8;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 5px;
  --max-w: 1160px;
  --font-sans: "DM Sans", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --font-display: "Syne", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  letter-spacing: 0.01em;
}

a { color: inherit; text-decoration: none; }

/* VIDEO */
.site-video {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #050505;
  overflow: hidden;
}

.site-video__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: brightness(0.45) saturate(0.8);
}

.site-video__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(0,0,0,0.55) 0%,
      rgba(0,0,0,0.2) 35%,
      rgba(0,0,0,0.45) 70%,
      rgba(0,0,0,0.82) 100%);
}

.site-video__fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, var(--bg) 100%);
}

/* ENGINEERING GRID — sparse, precise, Rams */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black 30%, transparent 100%);
}

/* TOPBAR */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: transparent;
  transition: background 300ms ease, border-color 300ms ease;
}

.topbar.scrolled {
  border-bottom: 1px solid var(--border);
  background: rgba(5,5,5,0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo { width: 32px; height: 32px; border-radius: 7px; display: block; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--text);
}

.brand-name em {
  display: block;
  font-style: normal;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.topnav {
  display: flex;
  gap: 36px;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.38);
}

.topnav a { transition: color 200ms ease; }
.topnav a:hover { color: var(--text); }

/* MOBILE NAV TOGGLE */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 60;
}

.nav-toggle span {
  display: block;
  height: 1px;
  background: rgba(255,255,255,0.6);
  transition: transform 240ms ease, opacity 240ms ease, width 240ms ease;
  transform-origin: center;
}

.nav-toggle span:first-child { width: 20px; }
.nav-toggle span:last-child  { width: 14px; }

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3px) rotate(45deg);
  width: 18px;
}
.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3px) rotate(-45deg);
  width: 18px;
}

/* MOBILE NAV OVERLAY */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(5,5,5,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.nav-overlay.open { display: flex; }

.nav-overlay a {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: rgba(255,255,255,0.4);
  transition: color 180ms ease;
}
.nav-overlay a:hover { color: var(--text); }

/* BUTTONS */
.btn-primary {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #050505;
  font-weight: 500;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  transition: opacity 180ms ease;
}
.btn-primary:hover { opacity: 0.82; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.5);
  transition: border-color 180ms ease, color 180ms ease;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.22); color: var(--text); }

/* HERO — fullscreen cinematic */
.hero {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: visible;
}

.hero::before {
  content: '';
  flex: 1;
  max-height: 22%;
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  padding: 0 40px;
  flex-shrink: 0;
}

.hero-content {
  padding-bottom: 28px;
  max-width: 620px;
}

.hero-location {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.05em;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.92);
}

.hero-title span {
  color: rgba(255,255,255,0.38);
  display: block;
}

.hero-sub {
  font-size: 0.9rem;
  font-weight: 300;
  color: rgba(255,255,255,0.42);
  line-height: 1.7;
  max-width: 44ch;
  margin-bottom: 22px;
}

.hero-actions {
  display: flex;
  gap: 10px;
}

.hero-domains {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 28px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  font-family: var(--font-mono);
}

.hero-domains .sep { color: rgba(255,255,255,0.08); }

/* SECTION BASE */
.section {
  position: relative;
  z-index: 1;
  padding: 112px 0;
}

.section-dark {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 14px;
}

.section-header { margin-bottom: 48px; }

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: rgba(255,255,255,0.88);
}

/* WORK LIST */
.work-list {
  display: flex;
  flex-direction: column;
}

.work-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  cursor: default;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.work-item::before {
  content: '';
  position: absolute;
  left: -40px;
  right: -40px;
  top: 0;
  bottom: 0;
  background: transparent;
  transition: background 240ms ease;
}

.work-item:last-child { border-bottom: 1px solid var(--border); }

.work-item:hover::before { background: rgba(255,255,255,0.018); }
.work-item:hover .work-num { color: rgba(255,255,255,0.55); }
.work-item:hover .work-left h3 { color: rgba(255,255,255,0.96); }

.work-left {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  flex: 1;
}

.work-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--dim);
  padding-top: 4px;
  flex-shrink: 0;
  width: 24px;
  transition: color 160ms;
}

.work-left h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 7px;
  color: rgba(255,255,255,0.82);
  transition: color 200ms ease;
}

.work-left p {
  font-size: 0.85rem;
  font-weight: 300;
  color: rgba(255,255,255,0.35);
  line-height: 1.7;
  max-width: 52ch;
}

.work-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 3px;
}

.work-tech {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--dim);
  letter-spacing: 0.04em;
}

.work-status {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.71rem;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
}

.work-status-live {
  background: rgba(74, 222, 128, 0.08);
  color: var(--accent-live);
  border: 1px solid rgba(74, 222, 128, 0.15);
}

.work-status-patent {
  background: rgba(129, 140, 248, 0.08);
  color: var(--accent-patent);
  border: 1px solid rgba(129, 140, 248, 0.15);
}

/* LAB */
.lab-body { display: flex; flex-direction: column; gap: 24px; }

.lab-desc {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 72ch;
}

.lab-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lab-chips span {
  padding: 4px 11px;
  border-radius: 5px;
  border: 1px solid var(--border);
  font-size: 0.76rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--muted);
}

/* TERMINAL */
.terminal {
  border-radius: var(--radius-md);
  background: #090909;
  border: 1px solid var(--border);
  overflow: hidden;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 16px;
  background: #0f0f0f;
  border-bottom: 1px solid var(--border);
}

.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.terminal-title {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 6px;
}

.terminal-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.t-line { line-height: 1.7; white-space: pre; }
.t-blank { height: 8px; }
.t-green { color: #a3e635; }
.t-cyan { color: var(--accent-2); }
.t-dim { color: rgba(255,255,255,0.35); }
.t-muted { color: var(--muted); }

/* RESEARCH */
.research-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 14px;
}

.research-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 220ms ease;
}

.research-card:hover { border-color: rgba(255,255,255,0.1); }

.research-main {
  background: var(--surface);
  border-color: rgba(129,140,248,0.14);
}

.research-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.research-main .research-tag { color: var(--accent-3); }

.research-card h3 {
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 12px;
}

.research-card p {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.65;
}

.research-footer {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--dim);
}

/* CONTACT */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: end;
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.contact-left h2 {
  font-family: "Syne", sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 12px 0 16px;
}

.contact-left p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 40ch;
}

.contact-email {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: rgba(255,255,255,0.75);
  margin-bottom: 22px;
  transition: color 220ms ease;
}

.contact-email:hover { color: rgba(255,255,255,0.96); }

.contact-links {
  display: flex;
  gap: 20px;
}

.contact-links a {
  font-size: 0.85rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 130ms, border-color 130ms;
}

.contact-links a:hover { color: var(--text); border-color: var(--text); }

/* FOOTER */
.footer {
  position: relative;
  z-index: 1;
  padding: 22px 0;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--dim);
}

/* REVEAL */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 540ms ease, transform 540ms ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .research-grid { grid-template-columns: 1fr 1fr; }
  .research-main { grid-column: span 2; }
  .contact-wrap { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 640px) {
  .hero { padding: 0 20px; }
  .hero-title { font-size: clamp(3.2rem, 14vw, 5rem); }
  .section-inner { padding: 0 20px; }
  .section { padding: 72px 0; }
  .topbar-inner { padding: 0 20px; }
  .topnav { display: none; }
  .nav-toggle { display: flex; }
  .work-item { flex-direction: column; gap: 12px; }
  .work-item::before { display: none; }
  .work-right { align-items: flex-start; }
  .research-grid { grid-template-columns: 1fr; }
  .research-main { grid-column: auto; }
  .hero-domains { display: none; }
  .contact-wrap { grid-template-columns: 1fr; gap: 40px; padding: 48px 0; }
  .t-line { white-space: normal; font-size: 0.72rem; }
}
