:root {
  --bg: #f7f5f0;
  --bg-elev: #ffffff;
  --bg-dark: #0a0a0a;
  --fg: #0a0a0a;
  --fg-soft: #3f3f46;
  --muted: #6b7280;
  --muted-2: #a3a3a3;
  --line: #e7e5e0;
  --line-soft: #efece6;
  --accent: #ea580c;
  --accent-2: #c2410c;
  --accent-soft: #fff1e6;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --blue: #1d4ed8;
  --blue-soft: #dbeafe;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
  --dot: rgba(10, 10, 10, 0.06);
  --radius: 12px;
  --radius-sm: 6px;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --max-w: 1100px;
}

[data-theme="dark"] {
  --bg: #0d0d10;
  --bg-elev: #17171b;
  --bg-dark: #06060a;
  --fg: #f4f4f5;
  --fg-soft: #d4d4d8;
  --muted: #9ca3af;
  --muted-2: #6b7280;
  --line: #2a2a30;
  --line-soft: #1f1f24;
  --accent: #fb923c;
  --accent-2: #f97316;
  --accent-soft: #3a1f0d;
  --green: #4ade80;
  --green-soft: #14321f;
  --blue: #60a5fa;
  --blue-soft: #14213a;
  --purple: #a78bfa;
  --purple-soft: #221733;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
  --dot: rgba(244, 244, 245, 0.05);
  --nav-bg: rgba(13, 13, 16, 0.82);
}

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

/* dot-grid backdrop */
body {
  margin: 0;
  background:
    radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0)
      0 0 / 22px 22px,
    var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.18s ease, color 0.18s ease;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--fg); color: var(--bg); }

/* ---------- page layout (single long doc, all sections visible) ---------- */
.page { display: block; }
.page + .page {
  margin-top: 24px;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--nav-bg, rgba(247, 245, 240, 0.82));
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-brand {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.15s ease;
}

.nav-brand:hover { opacity: 0.7; }

.nav-brand .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 28px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.nav-links a:hover { color: var(--fg); }

/* ---------- shared layout ---------- */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--muted-2);
}

.accent { color: var(--accent); }

/* section headers with chapter numbers */
.section {
  padding: 120px 0 40px;
}

.section-head {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 28px;
  align-items: end;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}

.section-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.section-head h2 {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1;
}

.section-head .right {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  margin-left: auto;
}

/* ---------- hero ---------- */
.hero {
  padding: 96px 0 88px;
  position: relative;
  display: grid;
  grid-template-columns: 1.5fr auto 1fr;
  gap: 64px;
  align-items: center;
}

.hero-photo {
  display: flex;
  justify-content: center;
}

.hero-photo img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid var(--accent);
}

.hero-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--fg-soft);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 28px;
}

.hero-status .pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.hero h1 {
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin: 0 0 32px;
  max-width: 800px;
}

.hero h1 .accent { color: var(--accent); }

.hero-tagline {
  font-size: 19px;
  color: var(--fg-soft);
  max-width: 520px;
  margin: 0 0 36px;
  line-height: 1.5;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}

.btn-primary:hover { background: var(--fg-soft); }

.btn-ghost {
  border-color: var(--line);
  background: var(--bg-elev);
}

.btn-ghost:hover { border-color: var(--fg); }

/* spec card on the right of the hero */
.spec-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  font-family: var(--mono);
  font-size: 12.5px;
  position: relative;
}

.spec-card::before {
  content: "$ whoami";
  display: block;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.spec-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding: 6px 0;
  align-items: baseline;
}

.spec-row .k {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10.5px;
}

.spec-row .v { color: var(--fg); }

.spec-card .stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.spec-card .stack span {
  background: var(--line-soft);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--fg-soft);
}

/* ---------- project tiles (landing grid) ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.tile {
  display: block;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}

/* currently building section */
.wip-section {
  margin-bottom: 36px;
}

.wip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.wip-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 11px;
}

.tile--wip {
  border-color: var(--accent);
  max-width: 400px;
}

.tile--wip:hover {
  border-color: var(--accent-2);
  box-shadow: 0 4px 24px rgba(234, 88, 12, 0.12);
}

/* tile image / placeholder */
.tile-img {
  height: 168px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--line-soft);
}

.tile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.tile:hover .tile-img img {
  transform: scale(1.04);
}

.tile-img-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--line-soft);
}

.tile-img-ph svg {
  width: 44px;
  height: 44px;
  color: var(--muted-2);
  opacity: 0.55;
}

.tile:hover {
  transform: translateY(-3px);
  border-color: var(--fg);
  box-shadow: var(--shadow);
}

.tile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--line-soft);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
}

.tile-head .lights {
  display: inline-flex;
  gap: 5px;
  flex: 0 0 auto;
}

.tile-head .lights span {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: block;
  background: #d4d4d8;
}

.tile-head .lights span:nth-child(1) { background: #ef4444; }
.tile-head .lights span:nth-child(2) { background: #f59e0b; }
.tile-head .lights span:nth-child(3) { background: #22c55e; }

.tile-head .path {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tile-body h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.015em;
  color: var(--fg);
}

.tile-body p {
  font-size: 14.5px;
  color: var(--fg-soft);
  margin: 0;
  line-height: 1.55;
}

.tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tile-tags span,
.project-meta-row .tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 9px;
  background: var(--line-soft);
  color: var(--muted);
  border-radius: 999px;
  letter-spacing: 0.005em;
}

/* color-coded language tags */
.tile-tags span:first-child,
.project-meta-row .tag.code {
  background: var(--fg);
  color: var(--bg);
}

/* ---------- about ---------- */
.prose {
  font-size: 19px;
  color: var(--fg-soft);
  max-width: 640px;
}

.prose p { margin: 0 0 16px; }
.prose p:last-child { margin: 0; }

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.contact-card {
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.contact-card:hover {
  border-color: var(--fg);
  transform: translateY(-2px);
}

.contact-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}

.contact-value {
  font-family: var(--mono);
  font-size: 14px;
}

/* ---------- footer ---------- */
.footer {
  padding: 64px 32px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 96px;
}

/* ---------- table of contents (auto-generated by toc.js) ---------- */
.toc {
  margin: 0 0 48px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  position: relative;
}

.toc::before {
  content: "// contents";
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.toc li {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.toc-num {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  flex: 0 0 20px;
  user-select: none;
}

.toc a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-soft);
  transition: color 0.15s ease;
}

.toc a:hover { color: var(--accent); }

/* keep anchored headings from disappearing under the sticky nav */
.project-body h2 { scroll-margin-top: 88px; }

/* ---------- project page (project detail) ---------- */
.project-page {
  padding: 96px 0 32px;
  position: relative;
}

.project-page::before {
  content: "";
  position: absolute;
  top: 56px;
  left: 0;
  width: 60px;
  height: 1px;
  background: var(--accent);
}

.project-page .eyebrow { margin: 0 0 16px; }

.project-page h1 {
  font-size: clamp(36px, 5.5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin: 0 0 20px;
  max-width: 760px;
}

.project-page .tagline {
  font-size: 20px;
  color: var(--fg-soft);
  max-width: 640px;
  margin: 0 0 32px;
  line-height: 1.5;
}

.project-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 36px;
}

.project-body {
  border-top: 1px solid var(--line);
  padding: 40px 0;
}

.project-body h2 {
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 40px 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.project-body h2::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.project-body h2:first-child { margin-top: 0; }

.project-body h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
  margin: 24px 0 10px;
  letter-spacing: -0.005em;
  max-width: 720px;
}

.project-body p {
  font-size: 17px;
  color: var(--fg-soft);
  margin: 0 0 18px;
  max-width: 720px;
  line-height: 1.7;
}

.project-body code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--line-soft);
  padding: 1.5px 7px;
  border-radius: 4px;
  color: var(--fg);
}

.project-body ul {
  font-size: 17px;
  color: var(--fg-soft);
  margin: 0 0 18px;
  padding-left: 24px;
  max-width: 720px;
  line-height: 1.7;
}

.project-body li { margin-bottom: 8px; }

/* dl specs block */
.specs {
  margin: 36px 0;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px 36px;
  position: relative;
}

.specs::before {
  content: "spec sheet";
  position: absolute;
  top: -10px;
  left: 24px;
  background: var(--bg);
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.specs div { display: flex; flex-direction: column; gap: 4px; }

.specs dt {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.specs dd {
  margin: 0;
  font-size: 14.5px;
  color: var(--fg);
}

/* parts-list block — bill of materials, grouped */
.parts-list {
  margin: 28px 0 36px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px 36px;
  position: relative;
}

.parts-list::before {
  content: "bill of materials";
  position: absolute;
  top: -10px;
  left: 24px;
  background: var(--bg);
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.parts-group h3 {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 10px;
  font-weight: 500;
}

.parts-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.parts-group li {
  display: flex;
  gap: 12px;
  font-size: 13.5px;
  color: var(--fg);
  line-height: 1.55;
  margin-bottom: 4px;
}

.parts-group .qty {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  flex: 0 0 36px;
  text-align: right;
}

.parts-group .part { flex: 1; }

.parts-note {
  margin: 0 0 36px;
  font-size: 13.5px;
  color: var(--muted);
  max-width: 720px;
}

/* register / data tables inside project bodies */
.project-body table.reg-table {
  margin: 8px 0 28px;
  border-collapse: collapse;
  font-size: 14px;
  max-width: 720px;
  width: 100%;
  color: var(--fg);
}

.project-body table.reg-table caption {
  caption-side: top;
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
}

.project-body table.reg-table th,
.project-body table.reg-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.project-body table.reg-table th {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}

.project-body table.reg-table td code {
  background: transparent;
  padding: 0;
  font-size: 13px;
}

/* ---------- Notion-style code block ---------- */
.code-block {
  margin: 28px 0;
  background: #0d0d0d;
  border-radius: var(--radius);
  border: 1px solid #1f1f1f;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  box-shadow: var(--shadow);
}

.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid #1f1f1f;
  background: #151515;
  font-size: 11.5px;
}

.code-head .code-file {
  color: #d4d4d8;
  font-weight: 500;
  font-size: 12px;
}

.code-head .code-lang {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10.5px;
  padding: 2px 8px;
  background: rgba(234, 88, 12, 0.12);
  border-radius: 999px;
}

.code-block pre {
  margin: 0;
  padding: 18px 22px;
  overflow-x: auto;
  color: #e7e5e0;
}

.code-block code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 13px;
  white-space: pre;
  font-family: inherit;
}

.code-block .tok-comment { color: #6b7280; font-style: italic; }
.code-block .tok-string  { color: #86efac; }
.code-block .tok-pp      { color: #fcd34d; }
.code-block .tok-kw      { color: #c4b5fd; }
.code-block .tok-num     { color: #fdba74; }
.code-block .tok-fn      { color: #93c5fd; }

/* file tree pseudo-block */
.tree {
  background: var(--bg-dark);
  color: #e7e5e0;
  border-radius: var(--radius-sm);
  padding: 24px 28px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  max-width: 560px;
  margin: 24px 0;
  overflow-x: auto;
}

.tree .dir { color: var(--accent); }
.tree .dim { color: #6b7280; }
.tree .file { color: #f7f5f0; }

/* repo link */
.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-elev);
  transition: border-color 0.15s ease, transform 0.15s ease;
  margin: 8px 0 36px;
}

.repo-link:hover {
  border-color: var(--fg);
  transform: translateY(-1px);
}

.repo-link .gh { color: var(--accent); font-weight: 600; }

/* "code coming soon" pill — used on projects without a public repo yet */
.coming-soon {
  display: inline-block;
  margin: 8px 0 36px;
  padding: 8px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-elev);
  letter-spacing: 0.02em;
}

/* figures */
figure {
  margin: 32px 0;
  padding: 0;
}

figure img {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  max-width: 100%;
  height: auto;
}

figure.module-shot img {
  max-width: 280px;
  background: #fff;
  padding: 12px;
}

figure.team-shot img { max-width: 560px; }

figure.hero-shot {
  margin: 0 0 36px;
}
figure.hero-shot img {
  width: 100%;
  max-width: 880px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
}

figure.video-short {
  margin: 32px 0;
  display: flex;
  justify-content: center;
}
figure.video-short iframe {
  width: 315px;
  height: 560px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

figure.device-shot,
figure.booth-shot {
  margin: 32px 0;
}
figure.device-shot img,
figure.booth-shot img {
  width: 100%;
  max-width: 720px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  display: block;
}

.title-sub {
  display: block;
  font-size: 0.5em;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: -0.01em;
  margin-top: 8px;
}

figcaption {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.55;
}

/* inspiration / attribution callout */
.inspiration-credit {
  margin: 24px 0 32px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent, #e8b341);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
}
.inspiration-credit p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.inspiration-credit strong {
  color: var(--fg);
  font-weight: 600;
}
.inspiration-credit a {
  color: var(--fg);
  border-bottom: 1px dashed var(--line);
}
.inspiration-credit a:hover {
  color: var(--accent, #e8b341);
}

/* back-to-projects bottom link */
.page-end {
  margin: 72px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.page-end a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  transition: color 0.15s ease;
}

.page-end a:hover { color: var(--fg); }

/* ---------- mobile ---------- */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 56px 0 64px;
  }
  .hero-photo img { width: 140px; height: 140px; }
  .spec-card { max-width: 360px; }
  .section-head { grid-template-columns: 1fr; gap: 12px; }
  .section-head .right { display: none; }
}

@media (max-width: 640px) {
  .nav { padding: 14px 20px; }
  main { padding: 0 20px; }
  .nav-links { gap: 18px; }
  .section { padding: 80px 0 24px; }
  .section-head h2 { font-size: 30px; }
  .tile-grid { grid-template-columns: 1fr; }
  .project-page { padding: 64px 0 16px; }
}


/* ---------- theme toggle ---------- */
.nav-right {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--fg);
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
  display: block;
}

.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (max-width: 640px) {
  .nav-right { gap: 14px; }
}


/* ---------- stack section (boards & languages) ---------- */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

.stack-col-title {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin: 0 0 22px;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.stack-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stack-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stack-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.stack-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.stack-uses {
  font-size: 13.5px;
  color: var(--fg-soft);
  line-height: 1.6;
  margin-top: 4px;
}

.stack-uses a {
  color: var(--accent);
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.stack-uses a:hover {
  border-bottom-color: var(--accent);
}

@media (max-width: 880px) {
  .stack-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- spec-card stack blocks (boards/mcus + languages) ---------- */
.spec-card .stack-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.spec-card .stack-block-label {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10.5px;
  margin-bottom: 6px;
}

.spec-card .stack-block .stack {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
