:root {
  --bg: #010503;
  --bg-soft: #06160f;
  --panel: rgba(13, 24, 42, 0.72);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef6ff;
  --muted: #9eb3cc;
  --accent: #73ff92;
  --accent-2: #2dff76;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(circle at 15% 20%, #072014 0%, var(--bg) 45%, #000201 100%);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.5;
}

#matrixBg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.52;
  filter: contrast(1.08) saturate(1.15);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5vw;
  background: rgba(5, 9, 19, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
}

.brand-terminal {
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.9rem;
  font-weight: 500;
  width: min(560px, 58vw);
}

.terminal-window {
  --row-height: 1.55rem;
  height: calc(var(--row-height) + 0.7rem);
  overflow: hidden;
  border: 1px solid rgba(120, 255, 170, 0.25);
  border-radius: 10px;
  background: rgba(0, 8, 0, 0.45);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45), 0 0 18px rgba(90, 255, 140, 0.08);
  padding: 0.35rem 0.7rem;
}

.terminal-track {
  --shift: 0;
  transform: translateY(calc(var(--shift) * -1 * var(--row-height)));
  transition: none;
}

.terminal-line {
  height: var(--row-height);
  line-height: var(--row-height);
  display: flex;
  align-items: center;
  white-space: nowrap;
  color: #95ffc4;
  font-family: "IBM Plex Mono", monospace;
  text-shadow: 0 0 8px rgba(120, 255, 175, 0.25);
}

.terminal-text {
  min-height: 1em;
}

.terminal-cursor {
  width: 0.56rem;
  height: 1.05rem;
  margin-left: 0.16rem;
  background: #d8ffe6;
  box-shadow: 0 0 8px rgba(190, 255, 220, 0.6);
  opacity: 0;
}

.terminal-cursor.active {
  opacity: 1;
  animation: blink 1s steps(1) infinite;
}

.nav {
  display: flex;
  gap: 1.25rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

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

.section {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 5.5rem 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 2rem;
  align-items: center;
  min-height: 88vh;
}

.hero-content h1 {
  margin: 0.2rem 0 1.2rem;
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  line-height: 1.1;
  max-width: 16ch;
}

.hero-kicker,
.section-kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--accent-2);
  text-transform: uppercase;
  margin: 0;
}

.hero-subline {
  color: var(--muted);
  max-width: 56ch;
  margin-bottom: 2rem;
}

.typed-wrap {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(76, 201, 240, 0.45);
  display: inline-flex;
  align-items: center;
  min-height: 1.2em;
}

.cursor {
  width: 0.12em;
  height: 1em;
  margin-left: 0.08em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

.hero-glow {
  position: absolute;
  width: min(50vw, 520px);
  height: min(50vw, 520px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(76, 201, 240, 0.2), rgba(76, 201, 240, 0));
  filter: blur(6px);
  transform: translate(-15%, -10%);
  z-index: -1;
}

.hero-side {
  display: grid;
  place-items: center;
}

.perf-section {
  padding-top: 3rem;
}

.perf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
}

.perf-desc {
  color: var(--muted);
  max-width: 50ch;
  margin: 0 0 1.4rem;
}

.tech-stack-panel {
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.stack-item {
  position: relative;
  display: flex;
  gap: 1rem;
  padding: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.3s ease;
}

.stack-item:last-child {
  border-bottom: 0;
}

.stack-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.item-glow-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #3b82f6;
  opacity: 0;
  box-shadow: 2px 0 15px rgba(59, 130, 246, 0.6);
  transition: opacity 0.3s ease;
}

.stack-item:hover .item-glow-bar {
  opacity: 1;
}

.item-icon {
  min-width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.item-icon svg {
  width: 20px;
  height: 20px;
}

.stack-item:hover .item-icon {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.item-content h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  color: #e2e8f0;
}

.item-content p {
  margin: 0;
  color: #8fa4bd;
  font-size: 0.92rem;
}

.editor-column {
  position: relative;
}

.editor-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 60%);
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}

.code-editor-window {
  position: relative;
  z-index: 1;
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  min-height: 380px;
}

.window-header {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
}

.traffic-lights {
  display: flex;
  gap: 0.45rem;
  margin-right: auto;
}

.light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.window-title {
  color: #94a3b8;
  font-size: 0.8rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  letter-spacing: 0.06em;
  font-family: "IBM Plex Mono", monospace;
}

.window-body {
  padding: 1.2rem 0;
  display: flex;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1rem;
}

.line-numbers {
  padding: 0 0.8rem;
  color: #475569;
  text-align: right;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.code-area {
  padding-left: 1rem;
  color: #e2e8f0;
  line-height: 1.6;
  min-height: 280px;
}

.yaml-key { color: #38bdf8; }
.yaml-val-plus { color: #4ade80; text-shadow: 0 0 10px rgba(74, 222, 128, 0.3); }
.yaml-val-minus { color: #f87171; }
.yaml-string { color: #fbbf24; }
.yaml-comment { color: #64748b; font-style: italic; }

.hud-card {
  width: min(360px, 100%);
  background: linear-gradient(140deg, rgba(8, 17, 33, 0.8), rgba(15, 34, 63, 0.7));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
  padding: 1.3rem;
}

.hud-card h2 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
}

.hud-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.8rem;
}

.hud-card li {
  display: flex;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
}

.btn-primary {
  border: 0;
  background: linear-gradient(135deg, #2463ff 0%, #0f46b7 70%, #08307e 100%);
  box-shadow: 0 12px 28px rgba(36, 99, 255, 0.35);
}

.section-head h2 {
  margin: 0.25rem 0 1.3rem;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
}

.reveal-grid {
  display: grid;
  grid-template-columns: 1fr 0.65fr;
  gap: 1.6rem;
  align-items: center;
}

.canvas-shell {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #02050e;
  box-shadow: 0 26px 48px rgba(0, 0, 0, 0.4);
}

#revealCanvas {
  width: 100%;
  height: auto;
  display: block;
}

.status-pill {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  background: rgba(4, 8, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--accent);
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
}

.reveal-copy h3 {
  margin-top: 0;
}

.reveal-copy p {
  color: var(--muted);
}

.flow-section {
  padding-top: 3rem;
}

.flow-stage {
  position: relative;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(8, 16, 29, 0.9), rgba(8, 19, 41, 0.72));
  overflow: hidden;
}

#flowSvg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#flowSvg path {
  fill: none;
  stroke: rgba(76, 201, 240, 0.28);
  stroke-width: 2;
}

.signal {
  fill: #00f5d4;
  filter: drop-shadow(0 0 6px #00f5d4);
}

.flow-node {
  position: absolute;
  width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.flow-node h3 {
  margin: 0;
  font-size: 1rem;
}

.flow-node p {
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.flow-node small {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
}

.flow-node.active {
  border-color: rgba(76, 201, 240, 0.65);
  box-shadow: 0 0 35px rgba(76, 201, 240, 0.22), 0 14px 34px rgba(0, 0, 0, 0.35);
  animation: pulse 2.8s infinite;
}

.node-a { left: 7%; top: 39%; }
.node-core { left: 39%; top: 36%; }
.node-b { left: 71%; top: 14%; }
.node-c { left: 71%; top: 62%; }

.contact-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem;
  background: linear-gradient(160deg, rgba(9, 19, 33, 0.88), rgba(13, 30, 54, 0.7));
}

.contact-card p {
  color: var(--muted);
}

form {
  display: grid;
  gap: 0.75rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(5, 9, 19, 0.82);
  color: var(--text);
  border-radius: 10px;
  padding: 0.78rem;
  font: inherit;
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes pulse {
  50% { transform: translateY(-2px); }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 3rem;
  }

  .perf-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .reveal-grid {
    grid-template-columns: 1fr;
  }

  .flow-stage {
    min-height: 780px;
  }

  .node-a { left: 50%; top: 7%; transform: translateX(-50%); }
  .node-core { left: 50%; top: 35%; transform: translateX(-50%); }
  .node-b { left: 14%; top: 67%; }
  .node-c { left: 56%; top: 67%; }
}

@media (max-width: 700px) {
  .site-header {
    flex-direction: column;
    gap: 0.6rem;
  }

  .brand-terminal {
    width: min(100%, 92vw);
  }

  .nav {
    gap: 0.9rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .flow-node {
    width: min(260px, 42vw);
  }

  .node-a,
  .node-core,
  .node-b,
  .node-c {
    transform: none;
  }

  .node-a { left: 50%; margin-left: -21vw; top: 5%; }
  .node-core { left: 50%; margin-left: -21vw; top: 30%; }
  .node-b { left: 7%; top: 60%; }
  .node-c { left: 51%; top: 60%; }
}
