/* Legit Circuits. Same dark neon system as legitsauce.com (tokens, fonts,
   gradient), tuned for hardware: a copper accent and solder-mask green. */
:root {
  --bg: #0a0a16;
  --bg-elev: #12122a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5ff;
  --text-muted: #b5b5d4;
  --text-dim: #7a7a99;
  --cyan: #00e5ff;
  --violet: #7c5cff;
  --lime: #a3ff3c;
  --gold: #ffd166;
  --copper: #ff9f43;
  --mask: #123524;
  --grad: linear-gradient(135deg, #00e5ff 0%, #7c5cff 55%, #a3ff3c 100%);
  --grad-copper: linear-gradient(135deg, #ffd166 0%, #ff9f43 60%, #ff6b6b 100%);
  --render-bg: #f8f8f8;
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 60px rgba(124, 92, 255, 0.35);
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --max-w: 1200px;
  --nav-h: 72px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(0, 229, 255, 0.07), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 10%, rgba(163, 255, 60, 0.06), transparent 60%),
    radial-gradient(ellipse 70% 60% at 50% 90%, rgba(124, 92, 255, 0.08), transparent 60%);
}

/* Faint PCB grid behind everything. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(163, 255, 60, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(163, 255, 60, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 80%);
}

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

a { color: var(--cyan); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--lime); }

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1em; color: var(--text-muted); }

.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.copper-text {
  background: var(--grad-copper);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------------------------------------------------------- nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(10, 10, 22, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 24px; }
.nav-logo { height: 36px; width: auto; }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-cta-wrap { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  width: 42px;
  height: 42px;
  padding: 9px;
  cursor: pointer;
}
.nav-toggle svg { width: 100%; height: 100%; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 10, 22, 0.97);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links li a { display: block; padding: 16px 24px; }
  .nav-cta-wrap .btn { display: none; }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn-lg { padding: 15px 28px; font-size: 1.02rem; }
.btn-primary { background: var(--grad); color: #0a0a16; box-shadow: 0 10px 30px -10px rgba(0, 229, 255, 0.6); }
.btn-primary:hover { color: #0a0a16; transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(163, 255, 60, 0.7); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--text); background: var(--surface-strong); transform: translateY(-2px); }
.btn-soon { background: transparent; color: var(--copper); border-color: rgba(255, 159, 67, 0.45); cursor: default; }
.btn-soon:hover { color: var(--copper); }

/* ---------------------------------------------------------------- sections */
section { padding: 96px 0; position: relative; }
.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-head p { font-size: 1.08rem; }
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--lime);
  margin-bottom: 14px;
}
.section-label::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--lime);
  box-shadow: 0 0 12px var(--lime);
}

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 72px 0 96px; overflow: hidden; }
.hero-traces {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.55;
}
.hero-traces .trace { fill: none; stroke: rgba(163, 255, 60, 0.16); stroke-width: 2; }
.hero-traces .pulse {
  fill: none;
  stroke: url(#traceGlow);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 60 900;
  animation: current 6s linear infinite;
}
.hero-traces .pulse:nth-of-type(2n) { animation-duration: 8s; animation-delay: -2s; }
.hero-traces .pulse:nth-of-type(3n) { animation-duration: 7s; animation-delay: -4s; }
.hero-traces .via { fill: var(--bg); stroke: rgba(163, 255, 60, 0.35); stroke-width: 2; }
@keyframes current { from { stroke-dashoffset: 960; } to { stroke-dashoffset: 0; } }

.hero-grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 24px;
}
.eyebrow .led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(163, 255, 60, 0.15), 0 0 14px var(--lime);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.hero h1 { margin-bottom: 22px; }
.hero-lede { font-size: 1.18rem; max-width: 34em; margin-bottom: 32px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.chip-row li {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(18, 53, 36, 0.55);
  border: 1px solid rgba(163, 255, 60, 0.25);
  color: #d7ffb0;
}

.hero-visual { position: relative; perspective: 1200px; }
.board-frame {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 10px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.5), rgba(124, 92, 255, 0.35), rgba(163, 255, 60, 0.5));
  box-shadow: var(--shadow-lg), 0 0 120px -20px rgba(0, 229, 255, 0.45);
  transform: rotateX(var(--tilt-x, 8deg)) rotateY(var(--tilt-y, -10deg));
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out;
}
.board-frame img { border-radius: calc(var(--radius-lg) - 8px); width: 100%; height: auto; }
.board-frame::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: calc(var(--radius-lg) - 8px);
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: sheen 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen { 0%, 100% { background-position: 120% 0; } 50% { background-position: -20% 0; } }

.callout {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(10, 10, 22, 0.86);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.7);
  animation: float 5s ease-in-out infinite;
}
.callout b { color: var(--lime); font-family: 'Space Grotesk', sans-serif; }
.callout::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.callout-a { top: 6%; left: -6%; }
.callout-b { top: 40%; right: -7%; animation-delay: -1.6s; }
.callout-c { bottom: 4%; left: 8%; animation-delay: -3.2s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .callout-a { left: 2%; }
  .callout-b { right: 2%; }
}

/* ---------------------------------------------------------------- marquee */
.marquee {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(18, 53, 36, 0.25);
  overflow: hidden;
  padding: 18px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 38s linear infinite; }
.marquee-track span {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 48px;
}
.marquee-track span::after { content: '◆'; color: var(--lime); font-size: 0.7rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------------- spotlight */
.spotlight { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.render-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, var(--render-bg) 70%);
  padding: 28px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  overflow: hidden;
}
.render-card img { width: 100%; height: auto; }
.render-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 5px 10px;
  border-radius: 6px;
  background: #0a0a16;
  color: var(--lime);
  font-family: 'Space Grotesk', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.spec-list { list-style: none; padding: 0; margin: 28px 0 32px; display: grid; gap: 14px; }
.spec-list li { display: flex; gap: 14px; align-items: flex-start; color: var(--text-muted); }
.spec-list li strong { color: var(--text); }
.spec-list .dot {
  flex: none;
  margin-top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 2px solid var(--copper);
  box-shadow: 0 0 10px rgba(255, 159, 67, 0.6);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 159, 67, 0.12);
  border: 1px solid rgba(255, 159, 67, 0.4);
  color: var(--copper);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 18px;
}
@media (max-width: 960px) { .spotlight { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- gallery */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 200px;
  gap: 18px;
}
.tile {
  position: relative;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.tile:hover { transform: translateY(-4px); border-color: rgba(163, 255, 60, 0.4); box-shadow: 0 20px 50px -20px rgba(163, 255, 60, 0.35); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.tile:hover img { transform: scale(1.04); }
.tile.is-render { background: radial-gradient(circle at 50% 40%, #ffffff, var(--render-bg) 75%); }
.tile.is-render img { object-fit: contain; padding: 18px; }
.tile figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 36px 16px 14px;
  background: linear-gradient(transparent, rgba(10, 10, 22, 0.92));
  font-size: 0.88rem;
  color: var(--text);
}
.tile figcaption small { display: block; color: var(--lime); font-family: 'Space Grotesk', monospace; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; }
.tile figure { margin: 0; height: 100%; }
.t-wide { grid-column: span 4; grid-row: span 2; }
.t-tall { grid-column: span 2; grid-row: span 2; }
.t-mid { grid-column: span 2; grid-row: span 1; }
.t-half { grid-column: span 3; grid-row: span 2; }
@media (max-width: 860px) {
  .bento { grid-template-columns: 1fr 1fr; grid-auto-rows: 180px; }
  .t-wide, .t-half { grid-column: span 2; grid-row: span 2; }
  .t-tall { grid-column: span 1; grid-row: span 2; }
  .t-mid { grid-column: span 1; }
}

/* ---------------------------------------------------------------- parts */
.parts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.part {
  position: relative;
  padding: 26px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
}
.part:hover { border-color: rgba(0, 229, 255, 0.4); transform: translateY(-3px); }
.part svg { width: 100%; height: 150px; margin-bottom: 18px; }
.part h3 { margin-bottom: 4px; }
.part .role { font-family: 'Space Grotesk', monospace; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--copper); margin-bottom: 12px; display: block; }
.part p { font-size: 0.95rem; margin: 0; }
@media (max-width: 960px) { .parts-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .parts-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- latest post */
.latest {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  box-shadow: var(--shadow-lg);
}
.latest-cover { background: var(--render-bg); min-height: 280px; }
.latest-cover img { width: 100%; height: 100%; object-fit: cover; }
.latest-body { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.latest-body h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.latest-body h3 a { color: var(--text); }
.latest-body h3 a:hover { color: var(--lime); }
.latest-meta { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 14px; }
.latest-body .btn { align-self: flex-start; margin-top: 10px; }
@media (max-width: 860px) { .latest { grid-template-columns: 1fr; } .latest-body { padding: 28px; } }

/* ---------------------------------------------------------------- shop teaser */
.shop {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 64px 48px;
  text-align: center;
  overflow: hidden;
  border: 1px solid rgba(255, 159, 67, 0.35);
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(255, 159, 67, 0.18), transparent 70%),
    var(--bg-elev);
}
.shop h2 { max-width: 16em; margin-left: auto; margin-right: auto; }
.shop p { max-width: 38em; margin: 0 auto 28px; font-size: 1.08rem; }
.shop-items { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 0 0 32px; }
.shop-items li { padding: 8px 16px; border-radius: 999px; border: 1px dashed rgba(255, 159, 67, 0.5); color: var(--gold); font-weight: 600; font-size: 0.9rem; }

/* ---------------------------------------------------------------- prose (blog/about) */
.prose { max-width: 760px; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 1.8em; }
.prose h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.prose p, .prose li { color: var(--text-muted); font-size: 1.06rem; }
.prose li { margin-bottom: 0.5em; }
.prose strong { color: var(--text); }
.prose code { font-size: 0.92em; padding: 2px 6px; border-radius: 6px; background: var(--surface-strong); color: #d7ffb0; }
.prose pre { padding: 16px; border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px solid var(--border); overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose .section-head { margin-left: 0; margin-bottom: 32px; }
.byline { color: var(--text-muted); }
.byline-small { margin: 4px 0 0; color: var(--text-muted); font-size: 0.95rem; }
.signoff { margin-top: 32px; }
.signoff span { color: var(--text-muted); font-size: 0.95rem; }
.prose-actions { margin-top: 40px; display: flex; gap: 12px; flex-wrap: wrap; }
.blog-figure { margin: 32px 0; }
.blog-figure img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; border-radius: var(--radius); background: var(--render-bg); }
.blog-figure figcaption { margin-top: 10px; color: var(--text-dim); font-size: 0.92rem; text-align: center; }

.post-list { display: grid; gap: 28px; }
.post-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: center;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.3s, transform 0.3s;
}
.post-card:hover { border-color: rgba(163, 255, 60, 0.4); transform: translateY(-2px); }
.post-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--render-bg); }
.post-card h2 { margin: 0 0 6px; font-size: 1.45rem; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--lime); }
.post-card .meta { margin: 0 0 8px; color: var(--text-dim); font-size: 0.9rem; }
.post-card p { margin: 0 0 8px; }
@media (max-width: 640px) { .post-card { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- footer */
footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; color: var(--text-dim); font-size: 0.9rem; }
.footer-links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); }

@media (max-width: 600px) {
  section { padding: 72px 0; }
  .container { padding: 0 16px; }
  .shop { padding: 44px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .board-frame { transform: none; }
}
