:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: #1c1d21;
  --muted: #5d6170;
  --border: #e4e4e0;
  --accent: #128a4c;
  --accent-soft: #e2f6ea;
  --brand-pink: #d81b6a;
  --pattern: #128a4c;
  --pattern-pink: #d81b6a;
  --pattern-strength: 0.09;
  --code-bg: #f2f2ef;
  --max: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --surface: #1a1c20;
    --text: #e8e8e6;
    --muted: #a0a3ad;
    --border: #2b2e34;
    --accent: #73f59a;
    --accent-soft: #173323;
    --brand-pink: #f5428a;
    --pattern: #73f59a;
    --pattern-pink: #f5428a;
    --pattern-strength: 0.08;
    --code-bg: #1f2126;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Anchors land below the sticky header. */
.hero, section { scroll-margin-top: 64px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Header */
header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: -0.01em; }
.logo img { display: block; }
.logo em { font-style: normal; color: var(--brand-pink); }
nav a { color: var(--muted); margin-left: 24px; font-size: 0.95rem; }
nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 88px 0 72px; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  max-width: 24ch;
}
.hero h1 .arrow { color: var(--accent); font-weight: 400; }
.hero h1 .one-tool { color: var(--muted); }
.hero p.slogan {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 600;
  font-style: italic;
  color: var(--brand-pink);
  margin: 0 0 20px;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 60ch; margin: 0 0 32px; }
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
}
.button:hover { text-decoration: none; opacity: 0.9; }
.button.secondary { background: none; color: var(--accent); border: 1px solid var(--accent); padding: 11px 21px; }

/* Sections */
section { padding: 64px 0; border-top: 1px solid var(--border); }
section h2 { font-size: 1.7rem; letter-spacing: -0.01em; margin: 0 0 12px; }
section > .wrap > p { color: var(--muted); max-width: 64ch; margin: 0 0 32px; }

/* Flow */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 24px; }
.flow-group-name {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.flow-list { display: flex; flex-wrap: wrap; gap: 8px; }
.step {
  font: 0.9rem ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--text);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}
.step:hover, .step:focus-visible { border-color: var(--accent); outline: none; }
.step.has-shot { background: var(--accent-soft); border-color: transparent; }
.step.has-shot:hover, .step.has-shot:focus-visible { border-color: var(--accent); }
.step.planned { color: var(--muted); border-style: dashed; }
#flow .flow-note { color: var(--muted); font-size: 0.9rem; margin: 32px 0 0; }

/* Step panel */
.scrim { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0, 0, 0, 0.35); z-index: 20; }
.panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(720px, 100%);
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.2);
  z-index: 30;
  display: flex;
  flex-direction: column;
  animation: slide-in 0.2s ease-out;
}
.panel[hidden], .scrim[hidden] { display: none; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .panel { animation: none; } }
body.panel-open { overflow: hidden; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-group { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.panel-head h2 { margin: 4px 0 0; font: 700 1.6rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.panel-body { padding: 24px; overflow-y: auto; flex: 1; }
.panel-body > p { margin: 0 0 16px; font-size: 1.05rem; }
.panel-command { color: var(--muted); font-size: 0.9rem !important; }
.panel-command code { background: var(--code-bg); padding: 2px 8px; border-radius: 6px; color: var(--text); }
.panel-body .shot { margin-top: 8px; }
.panel-body .shot img { box-shadow: none; }
.panel-foot { display: flex; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border); }
.icon-button, .nav-button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.icon-button { width: 40px; height: 40px; font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.nav-button { padding: 8px 14px; font-size: 0.9rem; }
.nav-button span { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
#panel-next { margin-left: auto; }
.icon-button:hover, .nav-button:hover { border-color: var(--accent); }
.nav-button[hidden] { display: none; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Devices */
.stat { font-size: 3rem; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 8px; }
.vendors { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 32px; }
.vendors ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.95rem; }

/* Session */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
}

footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 600px) {
  nav a { margin-left: 14px; }
  nav a.optional { display: none; }
  .hero { padding: 56px 0 48px; }
}

/* Screenshots */
.shot { margin: 0; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.shot figcaption { color: var(--muted); font-size: 0.95rem; margin-top: 12px; }
.hero-shot { margin-top: 56px; }

/* Boards */
.tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

/* Feature sections */
.eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-pink);
  margin-bottom: 8px;
}
section p.lead { font-size: 1.1rem; color: var(--muted); max-width: 64ch; margin: 0 0 24px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 40px; align-items: center; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 28px; color: var(--muted); }
.checks li strong { color: var(--text); }
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 14px;
  height: 8px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
#design .checks { margin-top: 8px; }
.shot figcaption code, .checks code { font-size: 0.88em; }

/* Remote diagram: laptop, link, Pi, link, boards; a column on narrow screens */
.remote {
  display: grid;
  grid-template-columns: 1fr minmax(150px, 0.8fr) 1fr minmax(130px, 0.7fr) 1fr;
  align-items: center;
  gap: 8px;
  margin: 40px 0;
}
.node {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.node.pi { border-color: var(--brand-pink); }
.node h3 { margin: 8px 0 6px; font-size: 1.05rem; }
.node p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.node-icon { width: 44px; height: 44px; fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.node.pi .node-icon { stroke: var(--brand-pink); }
.link { display: flex; flex-direction: column; gap: 6px; text-align: center; }
.medium { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.wire { font-size: 0.8rem; color: var(--text); }
.wire svg { display: block; width: 100%; height: 12px; overflow: visible; }
.wire svg path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 4; animation: flow 1.2s linear infinite; }
.wire svg path.head { fill: var(--accent); stroke: none; animation: none; }
.wire.in svg path { stroke: var(--brand-pink); animation-direction: reverse; }
.wire.in svg path.head { fill: var(--brand-pink); }
.wire.in span { color: var(--brand-pink); }
.wire.both svg path { animation: none; }
@keyframes flow { to { stroke-dashoffset: -20; } }
@media (prefers-reduced-motion: reduce) { .wire svg path { animation: none; } }
.remote-detail { align-items: start; }

@media (max-width: 860px) {
  .remote { grid-template-columns: 1fr; gap: 16px; }
  .link { flex-direction: row; justify-content: center; align-items: center; gap: 16px; }
  .wire { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1 1 0; min-width: 0; max-width: 140px; }
  .medium { flex: 0 1 auto; min-width: 0; }
  .wire svg { width: 12px; height: 44px; transform: rotate(90deg); width: 44px; height: 12px; margin: 16px 0; }
  .medium { order: 0; }
  .wire.out { order: -1; }
}

/* Section backgrounds: a tile per section (electronics, logic, FPGA, ASIC),
   drawn in the theme's color through a mask, faded where the text is. */
.hero, section { position: relative; isolation: isolate; }
@supports ((mask-image: none) or (-webkit-mask-image: none)) {
.hero::before, section::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--pattern);
  opacity: var(--pattern-strength);
  -webkit-mask: var(--tile) repeat, var(--fade, linear-gradient(#000, #000));
  -webkit-mask-composite: source-in;
  mask: var(--tile) repeat, var(--fade, linear-gradient(#000, #000));
  mask-composite: intersect;
}
.hero { --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 40H70l20 20h60l20-20h70'/%3E%3Cpath d='M0 120h40l30 30h50'/%3E%3Cpath d='M120 150h30l20-20h70'/%3E%3Cpath d='M40 0v20l20 20'/%3E%3Cpath d='M200 0v60l-20 20H120'/%3E%3Cpath d='M0 200h90l20 20v20'/%3E%3Cpath d='M150 240v-30l30-30h60'/%3E%3Cpath d='M90 60v40l-20 20'/%3E%3Cpath d='M210 120v40'/%3E%3Ccircle cx='120' cy='80' r='5'/%3E%3Ccircle cx='70' cy='120' r='5'/%3E%3Ccircle cx='120' cy='150' r='5'/%3E%3Ccircle cx='210' cy='160' r='5'/%3E%3Ccircle cx='60' cy='40' r='4'/%3E%3Ccircle cx='110' cy='220' r='4'/%3E%3Crect x='20' y='226' width='16' height='10' rx='2'/%3E%3Crect x='214' y='200' width='16' height='10' rx='2'/%3E%3C/svg%3E"); --fade: linear-gradient(100deg, transparent 15%, #000 70%); }
.hero::before { opacity: calc(var(--pattern-strength) * 1.6); }
#design { --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='200' viewBox='0 0 260 200' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 20h20a20 20 0 0 1 0 40H20z'/%3E%3Cpath d='M5 30h15M5 50h15M60 40h25'/%3E%3Cpath d='M120 110q10 20 0 40q30 0 45-20q-15-20-45-20z'/%3E%3Cpath d='M100 120h22M100 140h22'/%3E%3Cpath d='M165 130h15'/%3E%3Cpath d='M180 118v24l20-12z'/%3E%3Ccircle cx='204' cy='130' r='4'/%3E%3Cpath d='M208 130h30'/%3E%3Cpath d='M150 20q10 20 0 40q30 0 45-20q-15-20-45-20z'/%3E%3Cpath d='M142 20q10 20 0 40'/%3E%3Cpath d='M130 30h16M130 50h16M195 40h25'/%3E%3Cpath d='M20 150h20a20 20 0 0 1 0 40H20z'/%3E%3Ccircle cx='64' cy='170' r='4'/%3E%3Cpath d='M5 160h15M5 180h15M68 170h20'/%3E%3Cpath d='M85 40v90h15'/%3E%3Cpath d='M88 170h10v-30h2'/%3E%3Cpath d='M220 40v40h-120v40'/%3E%3Ccircle cx='85' cy='40' r='3' fill='%23000'/%3E%3Ccircle cx='220' cy='80' r='3' fill='%23000'/%3E%3C/svg%3E"); --fade: linear-gradient(90deg, transparent 10%, #000 60%); }
#remote { --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='160' viewBox='0 0 320 160' fill='none' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M0 30h10v-16h20v16h20v-16h20v16h20v-16h20v16h20v-16h20v16h20v-16h20v16h20v-16h20v16h20v-16h20v16h20v-16h20v16h10'/%3E%3Cpath d='M0 64h40v-16h80v16h40v-16h120v16h40'/%3E%3Cpath d='M0 90h20l6-8h48l6 8l-6 8H26zM80 90l6-8h68l6 8l-6 8H86zM160 90l6-8h48l6 8l-6 8h-48zM220 90l6-8h68l6 8l-6 8h-68zM300 90h20'/%3E%3Cpath d='M0 116h30v16h20v-16h40v16h20v-16h20v16h60v-16h40v16h20v-16h70' /%3E%3Ccircle cx='300' cy='150' r='2' fill='%23000'/%3E%3Ccircle cx='20' cy='150' r='2' fill='%23000'/%3E%3C/svg%3E"); --fade: linear-gradient(180deg, #000, transparent 45%, transparent 75%, #000); }
#remote::before { background: var(--pattern-pink); opacity: calc(var(--pattern-strength) * 1.4); }
#flow { --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Crect x='18' y='18' width='44' height='44' rx='3' stroke-width='2'/%3E%3Cpath d='M28 30h24M28 40h24M28 50h14' stroke-width='1'/%3E%3Crect x='80' y='80' width='20' height='20' stroke-width='1.5'/%3E%3Cpath d='M80 80l20 20M100 80l-20 20' stroke-width='1'/%3E%3Cpath d='M0 74h120M0 106h120M74 0v120M106 0v120' stroke-dasharray='2 4'/%3E%3Cpath d='M62 30h12M62 50h12M30 62v12M50 62v12'/%3E%3Ccircle cx='74' cy='30' r='2.5' fill='%23000'/%3E%3Ccircle cx='74' cy='50' r='2.5' fill='%23000'/%3E%3Ccircle cx='30' cy='74' r='2.5' fill='%23000'/%3E%3Ccircle cx='50' cy='74' r='2.5' fill='%23000'/%3E%3C/svg%3E"); --fade: radial-gradient(ellipse at 85% 20%, #000, transparent 70%); }
#features { --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='96' viewBox='0 0 240 96' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M0 2h240M0 48h240M0 94h240' stroke-width='3'/%3E%3Crect x='4' y='8' width='30' height='34'/%3E%3Crect x='38' y='8' width='18' height='34'/%3E%3Crect x='60' y='8' width='46' height='34'/%3E%3Crect x='110' y='8' width='24' height='34'/%3E%3Crect x='138' y='8' width='58' height='34'/%3E%3Crect x='200' y='8' width='36' height='34'/%3E%3Crect x='4' y='54' width='52' height='34'/%3E%3Crect x='60' y='54' width='22' height='34'/%3E%3Crect x='86' y='54' width='38' height='34'/%3E%3Crect x='128' y='54' width='16' height='34'/%3E%3Crect x='148' y='54' width='44' height='34'/%3E%3Crect x='196' y='54' width='40' height='34'/%3E%3Cpath d='M12 16v18M20 16v18M70 16v18M88 16v18M150 16v18M170 16v18M16 62v18M40 62v18M100 62v18M160 62v18M210 62v18' stroke-width='1'/%3E%3C/svg%3E"); --fade: linear-gradient(180deg, #000, transparent 70%); }
#boards { --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96' fill='%23000'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Ccircle cx='36' cy='12' r='4'/%3E%3Ccircle cx='60' cy='12' r='4'/%3E%3Ccircle cx='84' cy='12' r='4'/%3E%3Ccircle cx='12' cy='36' r='4'/%3E%3Ccircle cx='36' cy='36' r='4' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3Ccircle cx='60' cy='36' r='4'/%3E%3Ccircle cx='84' cy='36' r='4'/%3E%3Ccircle cx='12' cy='60' r='4'/%3E%3Ccircle cx='36' cy='60' r='4'/%3E%3Ccircle cx='60' cy='60' r='4'/%3E%3Ccircle cx='84' cy='60' r='4' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3Ccircle cx='12' cy='84' r='4'/%3E%3Ccircle cx='36' cy='84' r='4'/%3E%3Ccircle cx='60' cy='84' r='4'/%3E%3Ccircle cx='84' cy='84' r='4'/%3E%3C/svg%3E"); --fade: linear-gradient(90deg, transparent 30%, #000); }
#devices { --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Crect x='6' y='6' width='60' height='60' rx='1'/%3E%3Crect x='22' y='22' width='28' height='28' stroke-width='1'/%3E%3Cpath d='M14 12v4M22 12v4M30 12v4M38 12v4M46 12v4M54 12v4M14 56v4M22 56v4M30 56v4M38 56v4M46 56v4M54 56v4M12 22h4M12 30h4M12 38h4M12 46h4M56 22h4M56 30h4M56 38h4M56 46h4' stroke-width='2'/%3E%3C/svg%3E"); --fade: radial-gradient(circle at 90% 30%, #000, transparent 65%); }
#session { --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100' fill='none' stroke='%23000'%3E%3Cpath d='M0 0.5h100M0.5 0v100' stroke-width='1.5'/%3E%3Cpath d='M0 20.5h100M0 40.5h100M0 60.5h100M0 80.5h100M20.5 0v100M40.5 0v100M60.5 0v100M80.5 0v100' stroke-width='0.6'/%3E%3C/svg%3E"); }
#session::before { opacity: calc(var(--pattern-strength) * 0.8); }
}

/* Touch screens: larger targets. */
@media (pointer: coarse) {
  .step { padding: 9px 14px; }
  nav a { padding: 8px 0; }
}
