:root {
  --bg: #060b14;
  --bg-elevated: #0c1524;
  --bg-card: #101b2e;
  --line: rgba(120, 170, 255, 0.14);
  --text: #e8eef9;
  --muted: #93a4c3;
  --accent: #3dffb5;
  --accent-2: #5aa7ff;
  --warn: #ff5d6c;
  --yellow: #f5c542;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: "Outfit", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

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

code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--accent);
  background: rgba(61, 255, 181, 0.08);
  border: 1px solid rgba(61, 255, 181, 0.18);
  border-radius: 6px;
  padding: 0.1em 0.35em;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(90, 167, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 167, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  pointer-events: none;
  z-index: -2;
}

.bg-glow {
  position: fixed;
  width: 55vw;
  height: 55vw;
  top: -18vw;
  right: -12vw;
  background: radial-gradient(circle, rgba(61, 255, 181, 0.16), transparent 65%);
  filter: blur(8px);
  pointer-events: none;
  z-index: -1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  backdrop-filter: blur(16px);
  background: rgba(6, 11, 20, 0.72);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.logo-mark {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(61, 255, 181, 0.18), 0 0 18px rgba(61, 255, 181, 0.55);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  background: rgba(61, 255, 181, 0.12);
  border-color: rgba(61, 255, 181, 0.28);
  color: var(--accent);
}

.btn-primary {
  background: linear-gradient(135deg, #3dffb5, #2ad0ff);
  color: #041018;
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.hero {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 4.5rem 0 3rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(61, 255, 181, 0.55);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 12px rgba(61, 255, 181, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 255, 181, 0); }
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 1.1rem;
  font-weight: 800;
}

.accent {
  color: var(--accent);
  text-shadow: 0 0 40px rgba(61, 255, 181, 0.25);
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 36rem;
  margin: 0 0 1.6rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.hero-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0;
  margin: 0;
}

.hero-stats li {
  background: rgba(16, 27, 46, 0.8);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  display: grid;
  gap: 0.2rem;
}

.hero-stats strong {
  font-size: 1.05rem;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-panel {
  background: linear-gradient(180deg, rgba(16, 27, 46, 0.95), rgba(10, 16, 28, 0.95));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.panel-title {
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.viewport {
  position: relative;
  min-height: 320px;
  margin: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(90, 167, 255, 0.2);
  background:
    radial-gradient(circle at 30% 40%, rgba(90, 167, 255, 0.12), transparent 35%),
    radial-gradient(circle at 70% 60%, rgba(61, 255, 181, 0.1), transparent 30%),
    linear-gradient(160deg, #0a1220, #121f35 55%, #0b1422);
  overflow: hidden;
}

.center-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(90, 220, 255, 0.55);
  transform: translateX(-50%);
}

.bbox {
  position: absolute;
  width: 42%;
  height: 48%;
  top: 26%;
  left: 34%;
  border: 2px solid rgba(61, 255, 181, 0.85);
  border-radius: 4px;
  animation: track 4.5s ease-in-out infinite;
}

.corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
}

.corner.tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.corner.tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }
.corner.br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

.target-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(255, 93, 108, 0.8);
}

@keyframes track {
  0%, 100% { transform: translateX(-8%); }
  50% { transform: translateX(18%); }
}

.hud {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--accent);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hud p {
  margin: 0 0 0.25rem;
}

.hud em {
  font-style: normal;
  color: #fff;
}

.status-ok {
  color: var(--accent) !important;
  font-weight: 600;
}

.led-row {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  gap: 0.5rem;
}

.led {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #7f8aa3;
  background: rgba(0, 0, 0, 0.25);
}

.led.green.on {
  color: #041018;
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 0 18px rgba(61, 255, 181, 0.45);
}

.led.red {
  opacity: 0.55;
}

.panel-caption {
  margin: 0;
  padding: 0 1rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--mono);
}

.section {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 4rem 0;
}

.section-alt {
  width: 100%;
  padding-left: max(1rem, calc((100% - var(--max)) / 2));
  padding-right: max(1rem, calc((100% - var(--max)) / 2));
  background: linear-gradient(180deg, rgba(16, 27, 46, 0.35), rgba(16, 27, 46, 0.08));
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 42rem;
  margin-bottom: 2rem;
}

.section-head h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: rgba(61, 255, 181, 0.35);
  transform: translateY(-2px);
}

.card-icon {
  font-family: var(--mono);
  color: var(--accent-2);
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.12rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.steps {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  background: rgba(6, 11, 20, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  position: relative;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.8rem;
  margin-bottom: 0.55rem;
}

.steps h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  justify-content: center;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(90, 167, 255, 0.28);
  background: rgba(6, 11, 20, 0.4);
}

.flow-node {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
}

.flow-node.accent {
  border-color: rgba(61, 255, 181, 0.4);
  color: var(--accent);
}

.flow-node.group {
  display: flex;
  gap: 0.45rem;
}

.flow-node.group span {
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.flow-arrow {
  color: var(--muted);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.stack-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
}

.stack-card h3 {
  margin: 0 0 0.9rem;
}

.stack-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.stack-card li + li {
  margin-top: 0.45rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(6, 11, 20, 0.45);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th,
td {
  text-align: left;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

th {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

.pinout {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pinout > div {
  background: rgba(6, 11, 20, 0.45);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}

.pinout h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.pins {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  color: var(--muted);
}

.use-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.use-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 1.25rem;
}

.use-grid h3 {
  margin: 0 0 0.45rem;
}

.use-grid p {
  margin: 0;
  color: var(--muted);
}

.cta {
  padding-bottom: 5rem;
}

.cta-card {
  border-radius: 28px;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border: 1px solid rgba(61, 255, 181, 0.28);
  background:
    radial-gradient(circle at top right, rgba(61, 255, 181, 0.16), transparent 40%),
    radial-gradient(circle at bottom left, rgba(90, 167, 255, 0.14), transparent 35%),
    linear-gradient(160deg, #0d182a, #0a1320);
  box-shadow: var(--shadow);
}

.cta-card h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.cta-card > p {
  max-width: 40rem;
  color: var(--muted);
  margin: 0 0 1.4rem;
}

.site-footer {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer strong {
  color: var(--text);
  margin-right: 0.5rem;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
}

.footer-meta a {
  color: var(--accent-2);
}

@media (max-width: 960px) {
  .hero,
  .card-grid,
  .steps,
  .stack-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 720px) {
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    right: 1rem;
    left: 1rem;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(10, 16, 28, 0.96);
    box-shadow: var(--shadow);
  }

  .nav.open {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero-stats,
  .card-grid,
  .steps,
  .stack-grid,
  .use-grid,
  .pinout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 2.5rem;
  }
}
