@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin-ext.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #34c286;
  --bg-grid: rgba(11, 14, 19, 0.07);
  --panel: #2bb279;
  --panel-hover: #27a871;
  --border: rgba(11, 14, 19, 0.25);
  --text: #0f231a;
  --text-strong: #0b0e13;
  --muted: rgba(11, 14, 19, 0.72);
  --dim: rgba(11, 14, 19, 0.55);
  --accent: #0b0e13;
  --accent-dim: rgba(11, 14, 19, 0.5);
  --trace: rgba(11, 14, 19, 0.3);
  --trace-strong: rgba(11, 14, 19, 0.46);
  --term-bg: #0b0e13;
  --term-panel: #141a22;
  --term-border: #232b36;
  --term-text: #e6edf3;
  --term-muted: #94a1b2;
  --term-dim: #67707c;
  --term-accent: #3ddc97;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", system-ui, sans-serif;
}


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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(52, 194, 134, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo-sep { color: var(--dim); }

.header-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav {
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: 13px;
}
.site-nav a { color: var(--muted); }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
}
.lang-toggle button {
  background: none;
  border: none;
  padding: 2px 4px;
  font: inherit;
  color: var(--dim);
  cursor: pointer;
}
.lang-toggle button:hover { color: var(--muted); }
.lang-toggle button.active { color: var(--accent); }

/* ---------- layout ---------- */

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 64px 0 56px;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 26px 26px;
}

.hero-inner { position: relative; z-index: 1; max-width: 490px; }

.hero-kicker {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.hero-sub {
  color: var(--muted);
  font-size: 17px;
  margin-bottom: 22px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin-bottom: 28px;
}

.chips li {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  padding: 4px 12px;
}

/* ---------- terminal ---------- */

.terminal {
  max-width: 460px;
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  border-radius: 8px;
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--term-panel);
  border-bottom: 1px solid var(--term-border);
}
.term-bar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--term-border);
}
.term-bar .dot:first-child { background: #46323a; }
.term-bar .dot:nth-child(2) { background: #453f2c; }
.term-bar .dot:nth-child(3) { background: #2b4238; }
.term-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--term-dim);
}

.term-body {
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--term-text);
}
.term-body .prompt { color: var(--term-accent); }
.term-body .term-out { color: var(--term-muted); }
.term-body .term-ok { color: var(--term-accent); }

.cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--term-accent);
  vertical-align: -2px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- hero PCB traces ---------- */

.hero-traces {
  position: absolute;
  right: -20px;
  top: 36px;
  width: 440px;
  height: 325px;
}

.hero-traces .traces path,
.hero-traces .pins path {
  stroke: var(--trace);
  stroke-width: 2;
}
.hero-traces .pins path { stroke: var(--trace-strong); }

.hero-traces .chip-body {
  fill: var(--panel);
  stroke: var(--trace-strong);
  stroke-width: 1.5;
}
.hero-traces .chip-dot { fill: var(--dim); }
.hero-traces .chip-label {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 2px;
  fill: var(--dim);
  text-anchor: middle;
}

.hero-traces .vias circle {
  fill: var(--bg);
  stroke: var(--trace-strong);
  stroke-width: 3;
}
.hero-traces .node rect {
  fill: var(--panel);
  stroke: var(--accent-dim);
  stroke-width: 1;
  transition: fill 0.15s;
}
.hero-traces .node text {
  font-family: var(--mono);
  font-size: 12px;
  fill: var(--accent);
  text-anchor: middle;
  transition: fill 0.15s;
}
.hero-traces .node.lit rect { fill: var(--accent); stroke: var(--accent); }
.hero-traces .node.lit text { fill: var(--bg); }
.hero-traces .signal { fill: var(--accent); }

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

.section { padding: 56px 0; border-top: 1px solid var(--border); }

.section h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 24px;
}
.section h2 .num { color: var(--accent); }
.section h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border) 60%, transparent);
}

.section-note {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  margin: -14px 0 24px;
}

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.cards-featured { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.card:hover {
  text-decoration: none;
  background: var(--panel-hover);
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.card h3 {
  font-family: var(--display);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text-strong);
}

.card p { font-size: 14px; color: var(--muted); }

.card .icon { width: 16px; height: 16px; color: var(--dim); flex-shrink: 0; }
.card:hover .icon { color: var(--accent); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin-top: 14px;
}
.tags li {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 8px;
}

/* ---------- repo groups ---------- */

.repo-group { margin-bottom: 36px; }
.repo-group:last-child { margin-bottom: 0; }

.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 4px;
}
.group-title .icon { width: 17px; height: 17px; }

.group-sub {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 14px;
}

.repo-card h3 {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
}

.repo-meta {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}
.repo-meta .icon { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }

.repo-status {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  padding: 8px 0;
}

/* ---------- contact ---------- */

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

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 16px;
  transition: border-color 0.15s;
}
.contact-links a:hover { border-color: var(--accent-dim); text-decoration: none; }
.contact-links .icon { width: 17px; height: 17px; color: var(--accent); }

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--dim);
}

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

@media (max-width: 900px) {
  .hero { flex-direction: column; padding: 48px 0 40px; }
  .hero-traces {
    position: static;
    width: 100%;
    max-width: 460px;
    height: auto;
    margin: 32px auto 0;
  }
}

@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; }
  .site-nav { gap: 14px; }
  .header-right { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
  body:not(.force-motion) .cursor { animation: none; }
  body:not(.force-motion) .hero-traces .signal { display: none; }
}
