:root {
  --bg: #0b0d10;
  --surface: #12161b;
  --line: #222a33;
  --text: #e6ebf0;
  --muted: #8b97a5;
  --accent: #3ad6e8;
  --accent-soft: rgba(58, 214, 232, 0.12);
  --radius: 14px;
  --max: 1080px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --line: #dde2e8;
    --text: #12161b;
    --muted: #5b6673;
    --accent: #0a8fa0;
    --accent-soft: rgba(10, 143, 160, 0.1);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

/* Header */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.site-head nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.site-head nav a:hover { color: var(--text); }

/* Home */
.intro { padding: 56px 0 32px; }
.intro h1 { font-size: clamp(32px, 6vw, 52px); line-height: 1.1; margin: 0 0 12px; letter-spacing: -0.02em; }
.intro p { color: var(--muted); margin: 0; max-width: 60ch; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding-bottom: 64px; }
.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.card .body { padding: 16px 18px 18px; }
.card h2 { margin: 0 0 4px; font-size: 20px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* Build page */
.hero { position: relative; margin-top: 24px; border-radius: var(--radius); overflow: hidden; background: #000; }
.hero img { width: 100%; max-height: 72vh; object-fit: cover; object-position: 50% 45%; }
.title { padding: 28px 0 8px; }
.title h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.05; margin: 0 0 10px; letter-spacing: -0.02em; }
.meta { color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 8px; padding: 0; list-style: none; }
.chips li {
  font: 13px/1 var(--mono); padding: 8px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid transparent;
}

section { padding: 36px 0 8px; }
section > h2 { font-size: 24px; margin: 0 0 16px; letter-spacing: -0.01em; }
.prose { max-width: 68ch; }
.prose p { margin: 0 0 1em; }
.prose h3 { font-size: 18px; margin: 1.6em 0 .5em; }
.prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }

/* Parts */
.parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px 10px; }
.group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; }
.group dl { margin: 0; }
.group .row { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.group .row:first-child { border-top: 0; }
.group dt { color: var(--muted); font-size: 14px; }
.group dd { margin: 0; font-size: 15px; }
.group dd small { display: block; color: var(--muted); font-size: 13px; }

/* Gallery */
.gallery { columns: 3 260px; column-gap: 12px; }
.gallery button {
  all: unset; cursor: zoom-in; display: block; width: 100%; margin: 0 0 12px; break-inside: avoid;
  border-radius: 10px; overflow: hidden; background: var(--surface);
}
.gallery button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gallery img { width: 100%; height: auto; transition: transform .25s; }
.gallery button:hover img { transform: scale(1.02); }

dialog.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; color: #fff;
}
dialog.lightbox::backdrop { background: rgba(0, 0, 0, .92); }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; border-radius: 6px; }
.lightbox figcaption { margin-top: 12px; font-size: 15px; color: #c9d1d9; text-align: center; max-width: 70ch; }
.lightbox .nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255, 255, 255, .1); color: #fff; border: 0; border-radius: 999px;
  width: 44px; height: 44px; font-size: 22px; cursor: pointer;
}
.lightbox .nav:hover { background: rgba(255, 255, 255, .2); }
.lightbox .prev { left: 12px; }
.lightbox .next { right: 12px; }
.lightbox .close { position: fixed; top: 12px; right: 12px; transform: none; }


/* Link to another version of the same build */
.series {
  display: flex; align-items: center; gap: 16px; max-width: 560px; padding: 12px;
  text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s;
}
.series:hover { border-color: var(--accent); }
.series img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; flex: none; }
.series strong { display: block; font-size: 18px; }
.series small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }

.site-foot { border-top: 1px solid var(--line); margin-top: 56px; }
.site-foot .wrap { padding: 20px 16px 28px; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .group .row { grid-template-columns: 92px 1fr; }
  .gallery { columns: 2 140px; column-gap: 8px; }
  .gallery button { margin-bottom: 8px; }
  .lightbox .nav:not(.close) { top: auto; bottom: 16px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
