[data-theme="dark"],
:root {
  color-scheme: dark;
  --bg: #050812;
  --surface: #0c1020;
  --surface-2: #111827;
  --border: rgba(0, 245, 255, 0.12);
  --border-strong: rgba(0, 245, 255, 0.28);
  --text: #eef4ff;
  --dim: #8b9cb8;
  --cyan: #00f5ff;
  --magenta: #ff2d95;
  --glow-cyan: rgba(0, 245, 255, 0.3);
  --glow-magenta: rgba(255, 45, 149, 0.25);
  --nav-bg: rgba(5, 8, 18, 0.82);
  --nav-mobile-bg: rgba(5, 8, 18, 0.98);
  --kicker-bg: rgba(0, 245, 255, 0.03);
  --lane-bg: rgba(255, 255, 255, 0.02);
  --table-head-bg: rgba(0, 0, 0, 0.2);
  --row-hover: rgba(0, 245, 255, 0.04);
  --focus-live-border: rgba(0, 245, 255, 0.3);
  --focus-live-shadow: rgba(0, 245, 255, 0.06);
  --contact-hover: rgba(0, 245, 255, 0.06);
  --scanline-color: rgba(255, 255, 255, 0.04);
  --scanline-opacity: 0.025;
  --orb-opacity: 1;
  --radius: 14px;
  --nav-h: 68px;
  --max: 920px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f0f3fa;
  --surface: #ffffff;
  --surface-2: #e8edf6;
  --border: rgba(0, 120, 140, 0.14);
  --border-strong: rgba(0, 120, 140, 0.32);
  --text: #0f1729;
  --dim: #5a6478;
  --cyan: #007a8a;
  --magenta: #c4006a;
  --glow-cyan: rgba(0, 180, 200, 0.12);
  --glow-magenta: rgba(200, 0, 100, 0.08);
  --nav-bg: rgba(240, 243, 250, 0.88);
  --nav-mobile-bg: rgba(240, 243, 250, 0.98);
  --kicker-bg: rgba(0, 180, 200, 0.06);
  --lane-bg: rgba(0, 80, 100, 0.03);
  --table-head-bg: rgba(0, 50, 70, 0.05);
  --row-hover: rgba(0, 180, 200, 0.06);
  --focus-live-border: rgba(0, 140, 160, 0.35);
  --focus-live-shadow: rgba(0, 140, 160, 0.08);
  --contact-hover: rgba(0, 180, 200, 0.08);
  --scanline-color: rgba(0, 0, 0, 0.04);
  --scanline-opacity: 0;
  --orb-opacity: 0.35;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: var(--orb-opacity);
  transition: opacity 0.3s;
}
.glow-orb--cyan {
  width: 480px; height: 480px;
  top: -100px; right: -60px;
  background: radial-gradient(circle, var(--glow-cyan), transparent 70%);
  animation: drift 16s ease-in-out infinite;
}
.glow-orb--magenta {
  width: 400px; height: 400px;
  bottom: 5%; left: -80px;
  background: radial-gradient(circle, var(--glow-magenta), transparent 70%);
  animation: drift 20s ease-in-out infinite reverse;
}

.scanlines {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: var(--scanline-opacity);
  transition: opacity 0.3s;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    var(--scanline-color) 2px, var(--scanline-color) 4px
  );
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(24px, 16px); }
}

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

.neon {
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center;
  height: var(--nav-h);
  padding: 0 clamp(1.25rem, 4vw, 2rem);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.logo {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem 1.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--dim);
  text-transform: lowercase;
}
.nav-links a:hover { color: var(--cyan); }
.nav-muted { opacity: 0.45; }
.nav-muted:hover { opacity: 1; }

.nav-toggle {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 4px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--cyan);
}
.theme-icon { display: block; }
[data-theme="dark"] .theme-icon--sun { display: none; }
[data-theme="light"] .theme-icon--moon { display: none; }

.lang-toggle {
  display: grid;
  place-items: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.lang-toggle:hover {
  border-color: var(--border-strong);
  color: var(--cyan);
}
html[lang="ru"] .lang-label--en { display: none; }
html[lang="en"] .lang-label--ru { display: none; }

.nav-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* main */
main {
  position: relative; z-index: 2;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem) 4rem;
}

/* hero */
.hero {
  padding: clamp(2.5rem, 8vw, 4.5rem) 0 3rem;
}

.kicker {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--dim);
  text-transform: lowercase;
  margin-bottom: 1.25rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--kicker-bg);
}

.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}

.hero-lead {
  color: var(--dim);
  font-size: 1.05rem;
  max-width: 42ch;
  margin-bottom: 2rem;
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.hud-cell {
  padding: 1rem 0.75rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.hud-cell:last-child { border-right: none; }
.hud-cell--accent .hud-val { color: var(--magenta); }

.hud-val {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--cyan);
  line-height: 1;
}
.hud-key {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.35rem;
}

/* sections */
.section {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.section-head { margin-bottom: 1.5rem; }

.section-tag {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

.section-head h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-note {
  color: var(--dim);
  font-size: 0.88rem;
  margin: -0.75rem 0 1.25rem;
}

/* focus */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.focus {
  padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.focus--live {
  border-color: var(--focus-live-border);
  box-shadow: 0 0 40px var(--focus-live-shadow);
}

.focus-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.focus-id {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--dim);
  opacity: 0.6;
}

.focus h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.focus p {
  font-size: 0.88rem;
  color: var(--dim);
  margin-bottom: 0.75rem;
}

.focus-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--cyan);
}
.focus-link:hover { color: var(--magenta); }

.status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--dim);
}
.status--live {
  color: var(--cyan);
  border-color: rgba(0, 245, 255, 0.4);
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.15);
}
.status--dim { opacity: 0.6; }

/* about */
.about-box {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.about-box p {
  color: var(--dim);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}
.about-box p:last-child { margin-bottom: 0; }

.mono-accent {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--cyan);
  font-weight: 500;
}

.lanes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.lane {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 1rem;
  background: var(--lane-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.lane-icon {
  color: var(--magenta);
  font-size: 0.75rem;
  margin-top: 0.2rem;
}
.lane strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}
.lane p {
  font-size: 0.78rem;
  color: var(--dim);
}

/* table */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.proj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.proj-table th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--table-head-bg);
}

.proj-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.proj-table tr:last-child td { border-bottom: none; }

.proj-row--link:hover { background: var(--row-hover); }
.proj-table a:hover { color: var(--cyan); }

.dim { color: var(--dim); font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; }
.arrow { text-align: right; color: var(--dim); width: 2rem; }
.arrow a:hover { color: var(--cyan); }

/* stack */
.stack-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.stack-grid span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--dim);
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.stack-grid span:hover {
  color: var(--cyan);
  border-color: var(--border-strong);
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.1);
}

/* mode */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.mode {
  display: flex; gap: 0.85rem; align-items: flex-start;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.mode > span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--magenta);
  opacity: 0.7;
  flex-shrink: 0;
}
.mode p {
  font-size: 0.88rem;
  color: var(--dim);
}
.mode strong { color: var(--text); }

/* contact */
.contact-note {
  color: var(--dim);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.contact-btn {
  display: inline-flex;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--cyan);
  transition: background 0.15s, box-shadow 0.15s;
}
.contact-btn:hover {
  background: var(--contact-hover);
  box-shadow: 0 0 24px var(--focus-live-shadow);
}

/* footer */
.footer {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem;
  padding: 1.5rem clamp(1.25rem, 4vw, 2rem);
  border-top: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--dim);
}
.footer-brand { color: var(--text); font-weight: 500; }
.footer-links { display: flex; gap: 1.25rem; }
.footer a:hover { color: var(--cyan); }

@media (max-width: 720px) {
  .hud { grid-template-columns: repeat(2, 1fr); }
  .hud-cell:nth-child(2) { border-right: none; }
  .hud-cell:nth-child(1),
  .hud-cell:nth-child(2) { border-bottom: 1px solid var(--border); }
  .focus-grid,
  .lanes,
  .mode-grid { grid-template-columns: 1fr; }

  .table-wrap { overflow-x: auto; }
  .proj-table { min-width: 520px; }

  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    padding: 1rem clamp(1.25rem, 4vw, 2rem);
    background: var(--nav-mobile-bg);
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s, opacity 0.25s;
  }
  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}
