:root {
  --ink: #0b2545;
  --ink-2: #14315a;
  --paper: #f0f7ff;
  --paper-2: #dceaf7;
  --paper-3: #c5d9ee;
  --rule: #b9d0e8;
  --rule-dark: #1f3a66;
  --muted: #506a87;
  --muted-dark: #9bb2cb;
  --accent: #ff5a1f;
  --max: 1280px;
  --pad: 32px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  margin: 0 0 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}
h1 { font-size: clamp(2.4rem, 5.2vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }

p { margin: 0 0 16px; color: inherit; }

.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 18px;
}
.kicker.center { text-align: center; }
.center { text-align: center; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(240,247,255,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-text { font-size: 1.05rem; }

.topnav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  justify-content: space-between;
  margin-left: 32px;
}
.topnav-group { display: flex; gap: 24px; }
.topnav-actions { display: flex; align-items: center; gap: 16px; }
.topnav a {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 500;
  position: relative;
}
.topnav a:hover { color: var(--accent); }
.link-muted { color: var(--muted) !important; }

.pill {
  padding: 7px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.88rem;
  transition: background 0.18s, color 0.18s;
}
.pill:hover { background: var(--ink); color: var(--paper) !important; }

.burger {
  display: none;
  background: none;
  border: 0;
  width: 36px; height: 36px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.burger span { display: block; width: 22px; height: 2px; background: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.18s, color 0.18s, border-color 0.18s;
}
.btn:hover { transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--ink-2); }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: var(--paper-2); }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-link {
  padding: 13px 4px;
  background: transparent;
  color: var(--ink);
  border: 0;
}
.btn-link.light { color: var(--paper); }
.btn-link:hover { color: var(--accent); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 8px;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px var(--pad) 56px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-inner { max-width: 620px; }
.hero-inner .kicker {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: -0.01em;
  text-transform: none;
  font-weight: 700;
  margin-bottom: 22px;
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 18px 0 28px;
  max-width: 52ch;
}

.hero-art-frame {
  position: relative;
  height: 460px;
  border-radius: 24px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.hero-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
}
.s1 { width: 240px; height: 240px; background: var(--accent); top: 10%; left: 10%; }
.s2 { width: 280px; height: 280px; background: var(--ink); bottom: 8%; right: 6%; opacity: 0.18; }
.s3 { width: 160px; height: 160px; background: #7fb1e0; top: 45%; left: 50%; }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 80%);
}

/* ---------- Product line sections ---------- */
.line {
  padding: 96px 0;
  border-top: 1px solid var(--rule);
}
.line-light { background: var(--paper-2); border-color: var(--rule); }
.line-dark { background: var(--ink); color: var(--paper); border-color: var(--rule-dark); }

.line-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
.line-inner.reverse { direction: rtl; }
.line-inner.reverse > * { direction: ltr; }

.line-copy { max-width: 560px; }
.line-copy p { color: var(--muted); font-size: 1.05rem; max-width: 52ch; }
.line-dark .line-copy p { color: var(--muted-dark); }

.bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: grid;
  gap: 10px;
}
.bullets li {
  position: relative;
  padding-left: 24px;
  font-size: 0.98rem;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Generated artwork ---------- */
.art {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.art-board {
  background: linear-gradient(135deg, #1d3a2c 0%, #16291f 100%);
  border: 1px solid #0e1c14;
}

.board-gpio {
  top: 3%;
  left: 6%;
  width: 69%;
  height: 13%;
}

.board-trace {
  position: absolute;
  background: #ffb84d;
  opacity: 0.85;
  border-radius: 2px;
}
.board-chip {
  position: absolute;
  background: #0a0a0a;
  border: 1px solid #2c2c2c;
  border-radius: 4px;
  box-shadow: inset 0 0 0 4px #1a1a1a;
}

.board-chip-silver {
  position: absolute;
  background: #e5dece;
  border: 1px solid #615b4e;
  border-radius: 4px;
  box-shadow: inset 0 0 0 4px #b6b3ac;
}

.c1 { width: 15%; height: 18%; top: 32%; right: 27%; }
.c2 { width: 18%; height: 16%; top: 25%; left: 22%; }
.c3 { width: 9%; height: 12%; top: 53%; right: 23.5%; transform: rotate(45deg); }
.c4 { width: 18%; height: 23%; top: 45%; left: 22%; }
.c5 { width: 13%; height: 23%; top: 16%; left: 5%; }

.board-port {
  position: absolute;
  background: #c0c4c8;
  border-radius: 3px;
  box-shadow: inset 0 -3px 0 #888c90;
}

.bp1 { width: 22%; height: 23%; right: 0%; bottom: 5%; }
.bp2 { width: 20%; height: 23%; right: 0%; bottom: 39%; }
.bp3 { width: 20%; height: 23%; right: 0%; top: 5%; }

.art-terminal {
  background: #0e0e0e;
  border: 1px solid #2a2a2a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
}
.term-bar {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  background: #181818;
  border-bottom: 1px solid #2a2a2a;
}
.term-bar span {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #3a3a3a;
}
.term-bar span:nth-child(1) { background: #ff5a52; }
.term-bar span:nth-child(2) { background: #e6c029; }
.term-bar span:nth-child(3) { background: #54c22b; }
.term-body { padding: 22px 22px; color: #e6e6e6; }
.term-body p { margin: 0 0 8px; }
.term-body .prompt { color: var(--accent); margin-right: 8px; }
.term-body .dim { color: #888; }
.term-body .ok { color: #54c22b; }

.art-phone {
  background: linear-gradient(135deg, #dceaf7 0%, #b9d0e8 100%);
  display: grid;
  place-items: center;
}
.phone {
  width: 36%;
  aspect-ratio: 9 / 19;
  background: #0a0a0a;
  border-radius: 28px;
  padding: 8px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.18);
}
.phone-notch {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 30%; height: 14px;
  background: #0a0a0a;
  border-radius: 999px;
  z-index: 2;
}
.phone-screen {
  width: 100%; height: 100%;
  border-radius: 22px;
  background: linear-gradient(180deg, #f5f3ee 0%, #ffffff 100%);
  padding: 28px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.app-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.app-row span {
  aspect-ratio: 1;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffb98a, #ff5a1f);
}
.app-row:nth-child(2) span { background: linear-gradient(135deg, #d4d0c4, #8c8676); }
.app-row:nth-child(3) span { background: linear-gradient(135deg, #1a1a1a, #444444); }
.app-dock {
  margin-top: auto;
  height: 36px;
  border-radius: 10px;
  background: rgba(0,0,0,0.06);
}

/* ---------- Mission ---------- */
.mission {
  padding: 120px 0;
  background: var(--paper);
  border-top: 1px solid var(--rule);
}
.mission-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--pad);
}
.mission-lede {
  max-width: 680px;
  margin: 0 auto 56px;
  text-align: center;
  font-size: 1.15rem;
  color: var(--muted);
}
.mission-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px;
  border-top: 1px solid var(--rule);
  padding-top: 48px;
}
.mission-grid > div h3 { color: var(--accent); margin-bottom: 10px; }
.mission-grid > div p { color: var(--muted); font-size: 0.97rem; margin: 0; }

/* ---------- Signup ---------- */
.signup {
  background: var(--ink);
  color: var(--paper);
  padding: 96px 0;
}
.signup-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--pad);
  text-align: center;
}
.signup p { color: var(--muted-dark); font-size: 1.05rem; margin: 0 0 28px; }
.signup-form {
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}
.signup-form input {
  flex: 1;
  padding: 14px 18px;
  font: inherit;
  border-radius: 999px;
  border: 1px solid #333;
  background: #141414;
  color: var(--paper);
}
.signup-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,90,31,0.25);
}
.signup-form .btn-dark {
  background: var(--accent);
}
.signup-form .btn-dark:hover { background: #ff7a45; }
.form-status { min-height: 1.2em; margin-top: 14px; color: var(--accent); font-size: 0.92rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  padding: 64px 0 24px;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: 1.4fr 3fr;
  gap: 56px;
  margin-bottom: 48px;
}
.footer-brand p { color: var(--muted); max-width: 32ch; margin-top: 14px; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.footer-cols h5 {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 14px;
}
.footer-cols a {
  display: block;
  color: var(--muted);
  font-size: 0.93rem;
  padding: 4px 0;
}
.footer-cols a:hover { color: var(--ink); }

.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--pad) 0;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

/* ---------- Legal pages ---------- */
.legal {
  padding: 64px 0 96px;
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
}
.legal-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--pad);
}
.legal-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 36px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.legal-inner h2 {
  font-size: 1.3rem;
  margin-top: 36px;
  margin-bottom: 12px;
}
.legal-inner h2:first-of-type { margin-top: 0; }
.legal-inner p,
.legal-inner ul {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}
.legal-inner ul {
  padding-left: 22px;
  margin: 0 0 16px;
}
.legal-inner li { margin-bottom: 6px; }
.legal-inner a {
  color: var(--accent);
  font-weight: 600;
}
.legal-inner a:hover { text-decoration: underline; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .topnav { display: none; }
  .burger { display: inline-flex; }
  .topnav.open {
    display: flex;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 60;
    flex: none;
    margin: 0;
    flex-direction: column;
    gap: 0;
    padding: 12px var(--pad) 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 12px 24px rgba(11,37,69,0.08);
  }
  .topnav.open .topnav-group,
  .topnav.open .topnav-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }
  .topnav.open a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--rule); }
  .topnav.open a:last-child { border-bottom: 0; }

  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 56px; }
  .hero-art-frame { height: 320px; }

  .line { padding: 72px 0; }
  .line-inner { grid-template-columns: 1fr; gap: 40px; }
  .line-inner.reverse { direction: ltr; }

  .mission { padding: 80px 0; }
  .mission-grid { grid-template-columns: 1fr 1fr; gap: 28px; }

  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .signup-form { flex-direction: column; }
  .mission-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 6px; }
  h1 { font-size: 2.4rem; }
}
