/* ==========================================================================
   LogicLab — design tokens
   Schematic / datasheet aesthetic: paper + ink + one signal color.
   ========================================================================== */

:root {
  --ink: #16233d;
  --ink-soft: #4b5a72;
  --paper: #edf0e6;
  --panel: #ffffff;
  --grid: #c9d2c2;
  --board: #10161f;
  --board-line: #2a3547;
  --signal: #ff6b35;
  --signal-soft: #ffe1d1;
  --low: #2b8c7e;
  --low-soft: #d9ede9;

  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;

  --radius: 3px;
  --border: 1px solid var(--ink);
  --border-soft: 1px solid var(--grid);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- utility text ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--signal);
  display: inline-block;
  border-radius: 1px;
}

h1, h2, h3 {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

p { margin: 0; }

.mono { font-family: var(--mono); }

/* ---------- nav ---------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(237, 240, 230, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: var(--border-soft);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
}

.logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
}
.logo img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: block;
}

.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
  font-family: var(--mono);
  font-size: 13px;
}

.nav-links a {
  text-decoration: none;
  padding: 8px 14px;
  color: var(--ink-soft);
  border-radius: var(--radius);
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--panel); }
.nav-links a.active {
  color: var(--ink);
  background: var(--panel);
  border: var(--border-soft);
}

.nav-links a.cta {
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
}
.nav-links a.cta:hover { background: var(--signal); border-color: var(--signal); color: var(--ink); }

/* ---------- buttons ---------- */

.btn {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid currentColor;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--board);
}
.btn-primary:hover { background: #ff8459; }

.btn-ghost {
  color: var(--paper);
  border-color: var(--board-line);
}
.btn-ghost:hover { border-color: var(--paper); }

.btn-outline {
  color: var(--ink);
  border-color: var(--ink);
  background: transparent;
}
.btn-outline:hover { background: var(--ink); color: var(--paper); }

/* ---------- hero (board) ---------- */

.hero {
  background: var(--board);
  color: var(--paper);
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(var(--board-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--board-line) 1px, transparent 1px);
  background-size: 28px 28px;
}

.hero .wrap {
  padding: 90px 28px 70px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero .eyebrow { color: #93a2ba; }
.hero .eyebrow::before { box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.25); }

.hero h1 {
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.06;
  margin-top: 14px;
  text-transform: uppercase;
}
.hero h1 span { color: var(--signal); }

.hero .lede {
  font-family: var(--sans);
  font-size: 17px;
  color: #c3ccdb;
  max-width: 46ch;
  margin-top: 18px;
}

.hero .actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 26px;
  margin-top: 40px;
  font-family: var(--mono);
}
.hero-stats div { border-left: 2px solid var(--board-line); padding-left: 12px; }
.hero-stats b { display: block; font-size: 20px; color: var(--paper); }
.hero-stats span { font-size: 11px; color: #7e8ba3; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- circuit demo (signature element) ---------- */

.circuit-panel {
  background: #0b0f17;
  border: 1px solid var(--board-line);
  border-radius: 4px;
  padding: 20px;
}
.circuit-panel .panel-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: #7e8ba3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.circuit-panel .panel-head b { color: var(--signal); font-weight: 500; }

#circuit-demo { width: 100%; height: auto; cursor: default; user-select: none; }

.app-shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  border: 1px solid var(--board-line);
}
.app-shot img.zoomable {
  cursor: zoom-in;
  transition: filter 0.15s ease;
}
.app-shot img.zoomable:hover { filter: brightness(1.06); }
.app-shot img.zoomable:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  background: rgba(16, 22, 31, 0.92);
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--board-line);
  background: #0b0f17;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.lightbox-close:hover { border-color: var(--signal); color: var(--signal); }
.node-toggle { cursor: pointer; }
.wire { stroke: #33415a; stroke-width: 2; fill: none; transition: stroke 0.25s ease; }
.wire.live { stroke: var(--signal); }
.gate-body { fill: #131a26; stroke: #33415a; stroke-width: 1.5; transition: stroke 0.25s ease; }
.gate-body.live { stroke: var(--signal); }
.gate-label { font-family: var(--mono); font-size: 11px; fill: #8b97ad; letter-spacing: 0.04em; }
.pin { fill: #33415a; transition: fill 0.25s ease; }
.pin.live { fill: var(--signal); }
.led-ring { fill: none; stroke: #33415a; stroke-width: 2; transition: stroke 0.25s ease; }
.led-ring.live { stroke: var(--signal); filter: drop-shadow(0 0 6px rgba(255,107,53,0.75)); }
.led-core { fill: #1a2231; transition: fill 0.25s ease; }
.led-core.live { fill: var(--signal); }
.switch-track { fill: #131a26; stroke: #33415a; stroke-width: 1.5; }
.switch-knob { fill: #33415a; transition: transform 0.18s ease, fill 0.18s ease; }
.switch-knob.live { fill: var(--signal); }
.circuit-caption {
  font-family: var(--mono);
  font-size: 11px;
  color: #647089;
  margin-top: 12px;
  text-align: center;
}

/* ---------- sections ---------- */

section { padding: 76px 0; }
section.tight { padding: 56px 0; }

.section-head { max-width: 60ch; margin-bottom: 40px; }
.section-head h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  margin-top: 10px;
  text-transform: uppercase;
}
.section-head p {
  font-family: var(--sans);
  color: var(--ink-soft);
  margin-top: 12px;
  font-size: 16px;
}

/* feature datasheet cards, tagged like schematic reference designators */

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--ink); border: var(--border); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--ink); border: var(--border); }

.card {
  background: var(--panel);
  padding: 26px 22px;
}
.card .tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--signal);
  letter-spacing: 0.06em;
}
.card h3 {
  font-size: 15px;
  margin-top: 10px;
  text-transform: none;
}
.card p {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 8px;
}

/* gate library strip */

.gate-strip {
  display: flex;
  gap: 1px;
  background: var(--ink);
  border: var(--border);
  overflow-x: auto;
}
.gate-chip {
  background: var(--panel);
  min-width: 108px;
  padding: 18px 10px;
  text-align: center;
  flex: 1;
}
.gate-chip svg { margin: 0 auto 10px; }
.gate-chip span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
}

/* how it works */

.steps {
  border: var(--border);
  background: var(--ink);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, 1fr);
}
.step { background: var(--panel); padding: 26px 22px; }
.step .step-index {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
}
.step h3 { font-size: 16px; margin-top: 8px; text-transform: none; }
.step p { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); margin-top: 8px; }

/* callout / CTA band */

.callout {
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  padding: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.callout h2 { text-transform: uppercase; font-size: clamp(20px, 2.4vw, 27px); }
.callout p { font-family: var(--sans); color: #c3ccdb; margin-top: 10px; max-width: 42ch; }

/* footer */

footer.site {
  background: var(--board);
  color: #7e8ba3;
  padding: 44px 0 30px;
}
footer.site .foot-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--board-line);
}
footer.site .logo { color: var(--paper); }
footer.site nav { display: flex; gap: 18px; font-family: var(--mono); font-size: 13px; }
footer.site nav a { text-decoration: none; color: #9aa6bb; }
footer.site nav a:hover { color: var(--paper); }
footer.site .foot-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  font-family: var(--mono);
  font-size: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- download page specifics ---------- */

.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--ink);
  border: var(--border);
}
.platform-card {
  background: var(--panel);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.platform-card .plat-head { display: flex; align-items: center; gap: 12px; }
.platform-card .plat-icon {
  width: 34px; height: 34px;
  border: 1.5px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px;
}
.platform-card h3 { font-size: 16px; text-transform: none; }
.platform-card .meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.platform-card .meta b { color: var(--ink); font-weight: 500; }

table.specs {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 13.5px;
}
table.specs tr { border-bottom: var(--border-soft); }
table.specs tr:first-child { border-top: var(--border); }
table.specs td { padding: 13px 4px; }
table.specs td:first-child { color: var(--ink-soft); width: 40%; }

.changelog-entry {
  border-left: 2px solid var(--grid);
  padding: 4px 0 4px 20px;
  margin-bottom: 22px;
  position: relative;
}
.changelog-entry::before {
  content: "";
  position: absolute;
  left: -5px; top: 6px;
  width: 8px; height: 8px;
  background: var(--signal);
  border-radius: 50%;
}
.changelog-entry .v {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}
.changelog-entry .v span { color: var(--ink-soft); font-weight: 400; margin-left: 8px; }
.changelog-entry ul { margin: 8px 0 0; padding-left: 18px; font-family: var(--sans); font-size: 14px; color: var(--ink-soft); }
.changelog-entry li { margin-bottom: 4px; }

.note-strip {
  border: var(--border-soft);
  background: var(--panel);
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  gap: 10px;
}
.note-strip b { color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 60px; }
  .grid-4, .grid-3, .steps, .platform-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .callout { flex-direction: column; align-items: flex-start; }
  .gate-strip { flex-wrap: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
