/* Luca site: instruction-manual look.
   Paper, ink, primary-colour bricks, numbered steps, parts boxes. */

:root {
  --paper: #f4efe4;
  --paper-2: #ebe4d4;
  --card: #fbf8f1;
  --ink: #1a1815;
  --muted: #645d52;
  --rule: #1a1815;
  --parts: #dde6ec;
  --parts-ink: #22313d;
  --red: #d7301f;
  --blue: #1d5fc4;
  --yellow: #f2b705;
  --green: #1f8a52;
  --orange: #ee7a1a;
  --purple: #7a4bc4;
  --teal: #138a8a;
  --pink: #d94e8f;
  --slate: #5a6675;
  --grey: #9aa1a8;
  --white-brick: #f7f7f2;
  --black-brick: #2b2b2e;
  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: "Archivo Black", "Archivo", "Helvetica Neue", Helvetica, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
  --max: 1160px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171512;
    --paper-2: #211e19;
    --card: #1e1b17;
    --ink: #f1ebdd;
    --muted: #b1a895;
    --rule: #f1ebdd;
    --parts: #24303a;
    --parts-ink: #d9e6ef;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
code, pre, .mono { font-family: var(--mono); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } body { font-size: 17px; } }

/* ---------- top bar ---------- */
.bar {
  border-bottom: 2px solid var(--rule);
  background: var(--paper);
  position: sticky; top: 0; z-index: 10;
}
.bar .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 22px; letter-spacing: -0.02em; }
.logo svg { width: 30px; height: 30px; }
.bar nav { display: flex; gap: 22px; margin-left: auto; font-weight: 600; font-size: 15px; }
.bar nav a { text-decoration: none; padding: 4px 0; border-bottom: 3px solid transparent; }
.bar nav a:hover, .bar nav a[aria-current="page"] { border-color: var(--red); }
@media (max-width: 640px) { .bar nav { gap: 14px; font-size: 14px; } .logo span { display: none; } }

/* ---------- cover (hero) ---------- */
.cover { border-bottom: 2px solid var(--rule); position: relative; overflow: hidden; }
.cover .wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 32px; align-items: center; padding-top: 56px; padding-bottom: 56px; }
@media (max-width: 900px) { .cover .wrap { grid-template-columns: 1fr; padding-top: 36px; } }

.set-tag { display: inline-flex; align-items: stretch; border: 2px solid var(--rule); font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 22px; }
.set-tag span { padding: 5px 10px; }
.set-tag span + span { border-left: 2px solid var(--rule); }
.set-tag .num { background: var(--red); color: #fff; font-weight: 700; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.025em; line-height: 1.02; margin: 0; font-weight: 400; }
h1 { font-size: clamp(44px, 7vw, 88px); }
h2 { font-size: clamp(32px, 4.6vw, 56px); }
h3 { font-size: 24px; letter-spacing: -0.015em; line-height: 1.15; }
.lede { font-size: clamp(19px, 2vw, 23px); color: var(--muted); max-width: 34ch; margin: 22px 0 28px; }
.lede strong { color: var(--ink); }

.box-facts { display: flex; flex-wrap: wrap; gap: 0; margin-top: 28px; border: 2px solid var(--rule); width: fit-content; max-width: 100%; }
.box-facts div { padding: 10px 16px; font-family: var(--mono); font-size: 13px; line-height: 1.3; }
.box-facts div + div { border-left: 2px solid var(--rule); }
.box-facts b { display: block; font-family: var(--display); font-size: 26px; font-weight: 400; }
@media (max-width: 520px) { .box-facts div { padding: 8px 10px; } .box-facts b { font-size: 21px; } }

.scene { width: 100%; height: auto; overflow: visible; }
.scene text { font-family: var(--mono); font-size: 12px; fill: var(--ink); }
.scene .lead { stroke: var(--ink); stroke-width: 1; fill: none; }
.scene .drop { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 4; fill: none; opacity: .55; }
.scene .piece { transition: transform .9s cubic-bezier(.3,1.4,.5,1); }
.scene.snapped .drop, .scene.snapped .arrow { opacity: 0; transition: opacity .3s; }
.scene .arrow { fill: var(--ink); opacity: .7; }
@media (prefers-reduced-motion: reduce) { .scene .piece { transition: none; } }

.snap-btn { margin-top: 6px; }

/* ---------- install / buttons ---------- */
.cmd { display: flex; align-items: center; border: 2px solid var(--rule); background: var(--card); max-width: 100%; width: fit-content; }
.cmd code { padding: 12px 14px; font-size: 14px; white-space: nowrap; overflow-x: auto; }
.cmd code::before { content: "$ "; color: var(--muted); }
.cmd button, .btn { font: 600 14px var(--sans); background: var(--ink); color: var(--paper); border: 0; padding: 0 16px; align-self: stretch; cursor: pointer; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; text-decoration: none; border: 2px solid var(--rule); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn:hover, .cmd button:hover { background: var(--red); color: #fff; border-color: var(--red); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
@media (max-width: 520px) { .cmd { width: 100%; } .cmd code { flex: 1; min-width: 0; font-size: 12.5px; } }

/* ---------- steps ---------- */
.step { border-bottom: 2px solid var(--rule); padding: 80px 0; }
.step.alt { background: var(--paper-2); }
.step-head { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; margin-bottom: 36px; }
.step-no { font-family: var(--display); font-size: 64px; line-height: .9; min-width: 84px; height: 84px; border: 3px solid var(--rule); display: grid; place-items: center; background: var(--card); }
.step-kicker { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.step-body { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.step-body.wide-art { grid-template-columns: .9fr 1.1fr; }
.step-body p { margin: 0 0 18px; max-width: 54ch; }
.step-body p.big { font-size: 22px; line-height: 1.45; }
@media (max-width: 900px) {
  .step { padding: 56px 0; }
  .step-body, .step-body.wide-art { grid-template-columns: 1fr; gap: 28px; }
  .step-no { font-size: 44px; min-width: 60px; height: 60px; }
  .step-head { gap: 16px; }
}

/* parts box: the "parts needed" panel found on every manual page */
.parts { background: var(--parts); color: var(--parts-ink); border-radius: 14px; padding: 16px 18px 14px; border: 2px solid var(--rule); }
.parts-title { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; display: flex; justify-content: space-between; }
.parts ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 18px; }
.parts li { display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--mono); font-size: 12px; }
.parts li svg { width: 58px; height: 44px; overflow: visible; }
.parts li .qty { font-weight: 700; }

.callout { border: 2px solid var(--rule); background: var(--card); padding: 18px 20px; position: relative; }
.callout::before { content: "!"; position: absolute; top: -16px; left: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--yellow); color: #1a1815; border: 2px solid var(--rule); display: grid; place-items: center; font-family: var(--display); font-size: 16px; }
.callout p { margin: 0; }

.quote { font-family: var(--display); font-size: clamp(26px, 3.2vw, 38px); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 22px; }

/* ---------- bins grid ---------- */
.bins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 2px solid var(--rule); }
.bin { padding: 18px 16px; border-right: 2px solid var(--rule); border-bottom: 2px solid var(--rule); background: var(--card); text-decoration: none; display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.bin:nth-child(4n) { border-right: 0; }
.bin:nth-last-child(-n+4) { border-bottom: 0; }
.bin .count { font-family: var(--display); font-size: 34px; line-height: 1; }
.bin .name { font-weight: 700; }
.bin .eg { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bin .strip { display: flex; gap: 3px; margin-top: auto; }
.bin .strip i { width: 16px; height: 10px; border: 1.5px solid var(--rule); }
a.bin:hover { background: var(--parts); }
@media (max-width: 900px) {
  .bins { grid-template-columns: repeat(2, 1fr); }
  .bin:nth-child(4n) { border-right: 2px solid var(--rule); }
  .bin:nth-child(2n) { border-right: 0; }
  .bin:nth-last-child(-n+4) { border-bottom: 2px solid var(--rule); }
  .bin:nth-last-child(-n+2) { border-bottom: 0; }
}

/* ---------- suite cards ---------- */
.suite { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 0; border: 2px solid var(--rule); }
.suite a { padding: 28px 24px; text-decoration: none; border-right: 2px solid var(--rule); background: var(--card); display: flex; flex-direction: column; gap: 12px; }
.suite a:last-child { border-right: 0; }
.suite a:hover { background: var(--parts); }
.suite .tag { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border: 2px solid var(--rule); width: fit-content; }
.suite .tag.need { background: var(--red); color: #fff; border-color: var(--red); }
.suite p { margin: 0; color: var(--muted); }
.suite .go { margin-top: auto; font-weight: 700; }
@media (max-width: 900px) { .suite { grid-template-columns: 1fr; } .suite a { border-right: 0; border-bottom: 2px solid var(--rule); } .suite a:last-child { border-bottom: 0; } }

/* ---------- code ---------- */
pre.code { margin: 0; background: var(--ink); color: var(--paper); padding: 18px 20px; font-size: 13.5px; line-height: 1.6; overflow-x: auto; border: 2px solid var(--rule); }
pre.code .c { opacity: .55; }
pre.code .k { color: #ffb4a8; }
pre.code .s { color: #f6d77a; }
.file-tab { display: inline-block; font-family: var(--mono); font-size: 12px; padding: 4px 10px; background: var(--ink); color: var(--paper); border: 2px solid var(--rule); border-bottom: 0; }

/* ---------- catalog (sdk) ---------- */
.cat-section { border-bottom: 2px solid var(--rule); padding: 48px 0; }
.cat-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.cat-head .sw { width: 22px; height: 22px; border: 2px solid var(--rule); align-self: center; }
.cat-head .n { font-family: var(--mono); color: var(--muted); font-size: 14px; }
.bricks { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.brick-card { border: 2px solid var(--rule); background: var(--card); padding: 14px 14px 12px; display: grid; grid-template-columns: 52px 1fr; gap: 4px 12px; }
.brick-card svg { grid-row: span 3; width: 52px; height: 44px; overflow: visible; }
.brick-card .id { font-family: var(--mono); font-weight: 600; font-size: 14px; }
.brick-card .kind { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.brick-card .kind b { font-weight: 600; }
.brick-card .kind .exp { color: var(--orange); }
.brick-card p { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); grid-column: 1 / -1; }
.filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
.filter input { font: 16px var(--mono); padding: 10px 12px; border: 2px solid var(--rule); background: var(--card); color: var(--ink); width: min(360px, 100%); }

/* ---------- screenshots (desktop) ---------- */
.shot { border: 2px solid var(--rule); background: #000; box-shadow: 8px 8px 0 var(--rule); }
.shot img { width: 100%; height: auto; }
figure { margin: 0; }
figcaption { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 14px; }

/* ---------- footer ---------- */
.closing { padding: 96px 0; text-align: center; border-bottom: 2px solid var(--rule); }
.closing h2 { font-size: clamp(40px, 6vw, 76px); margin-bottom: 18px; }
.closing p { color: var(--muted); max-width: 44ch; margin: 0 auto 28px; }
.closing .cmd { margin: 0 auto; }
footer.foot { padding: 28px 0 48px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
footer.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }

.muted { color: var(--muted); }
.mt { margin-top: 28px; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Grid children default to min-width:auto, so long code lines push the page sideways on phones. */
.cover .wrap > *, .step-body > *, .step-head > :last-child { min-width: 0; }
.actions { max-width: 100%; }

/* Quality checklist: tick boxes like the inspection stamp on a parts sheet. */
.parts ul.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.parts ul.checks li { flex-direction: row; align-items: flex-start; gap: 8px; font-family: var(--sans); font-size: 15px; line-height: 1.35; }
.parts ul.checks li::before { content: "✓"; flex: none; width: 18px; height: 18px; border: 2px solid currentColor; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--card); color: var(--green); border-color: var(--parts-ink); }
@media (max-width: 520px) { .parts ul.checks { grid-template-columns: 1fr; } }

/* Six nav links do not fit a phone; GitHub is still in the footer. */
@media (max-width: 480px) { .bar nav { gap: 11px; font-size: 13px; } .bar nav a[href^="https://github"] { display: none; } }
