/* Kickstand Studios. Parts-catalogue plate look: printed sheet, blue-black ink, red callouts. */

@font-face { font-family: "Barlow"; src: url("fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #e9ece7;      /* the catalogue page */
  --sheet: #f7f8f4;      /* the drawing plate */
  --ink: #16202b;        /* blue-black print */
  --graphite: #4f5a65;   /* secondary text, hidden lines */
  --rule: #bfc7c5;       /* table and plate rules */
  --callout: #b01f2e;    /* parts-diagram red */
  --callout-wash: #f3dfe0;

  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 76rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.55 var(--body);
  font-feature-settings: "kern", "liga";
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--callout); }
:focus-visible { outline: 3px solid var(--callout); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: var(--sheet); padding: 0.5rem 0.9rem; z-index: 10; }
.skip:focus { left: 0.5rem; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.5rem; flex-wrap: wrap; }
.mark { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font: 700 1.6rem/1 var(--cond); letter-spacing: 0.005em; }
.mark svg { width: 1.9rem; height: 1.9rem; flex: none; }
.site-nav ul { list-style: none; display: flex; gap: clamp(1rem, 2.5vw, 2rem); margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a { text-decoration: none; font: 500 1.15rem/1 var(--cond); padding: 0.4rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--callout); }

/* ---------- Hero / plate ---------- */
.hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }

h1, h2, h3 { font-family: var(--cond); font-weight: 700; line-height: 1.02; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.9rem, 6.2vw, 5rem); letter-spacing: -0.012em; }
h2 { font-size: clamp(2rem, 3.6vw, 2.75rem); font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }

.lede { font-size: 1.25rem; line-height: 1.5; max-width: 34ch; margin: 1.4rem 0 2rem; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; }
.btn {
  display: inline-block; text-decoration: none; font: 600 1.2rem/1 var(--cond);
  padding: 0.85rem 1.3rem; background: var(--ink); color: var(--sheet); border: 2px solid var(--ink);
}
.btn:hover { background: var(--callout); border-color: var(--callout); color: #fff; }
.textlink { font: 600 1.2rem/1 var(--cond); }

.plate { margin: 0; background: var(--sheet); border: 1.5px solid var(--ink); position: relative; }
.plate svg { display: block; width: 100%; height: auto; }
.plate figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* drawing strokes */
.dw { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.dw-thin { fill: none; stroke: var(--ink); stroke-width: 1; }
.dw-hidden { fill: none; stroke: var(--graphite); stroke-width: 1; stroke-dasharray: 4 3; }
.centre { fill: none; stroke: var(--graphite); stroke-width: 0.9; stroke-dasharray: 18 4 3 4; }
.part { transition: stroke 0.15s; }
.part.lit .dw, .part.lit .dw-thin { stroke: var(--callout); }
.part.lit .dw { fill: var(--callout-wash); }

.callout circle { fill: var(--sheet); stroke: var(--callout); stroke-width: 1.6; }
.callout text { font: 700 17px var(--cond); fill: var(--callout); text-anchor: middle; dominant-baseline: central; }
.callout line { stroke: var(--callout); stroke-width: 1; }
.callout:hover circle, .callout:focus-visible circle, .callout.lit circle { fill: var(--callout); }
.callout:hover text, .callout:focus-visible text, .callout.lit text { fill: #fff; }
.callout:focus-visible { outline: none; }
.callout:focus-visible circle { stroke-width: 3; }

.titleblock rect { fill: none; stroke: var(--ink); stroke-width: 1; }
.titleblock line { stroke: var(--ink); stroke-width: 1; }
.titleblock text { font: 500 11px var(--body); fill: var(--graphite); }
.titleblock .tb-big { font: 700 15px var(--cond); fill: var(--ink); }

/* one moment of motion: the assembly comes apart on load */
@media (prefers-reduced-motion: no-preference) {
  .js .explode { transition: transform 1.1s cubic-bezier(.2,.7,.15,1); }
  .js .plate:not(.open) .explode { transform: var(--from); }
  .js .callouts { transition: opacity 0.4s 0.9s; }
  .js .plate:not(.open) .callouts { opacity: 0; }
}

/* ---------- Sections ---------- */
section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--rule); }
.sec-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.5rem, 5vw, 4.5rem); align-items: end; margin-bottom: 2.25rem; }
.sec-head p { margin: 0; max-width: 46ch; color: var(--graphite); }

/* parts list table */
.parts { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1.5px solid var(--ink); }
.parts caption { text-align: left; }
.parts th, .parts td { text-align: left; vertical-align: top; padding: 1.05rem 1.1rem; border-bottom: 1px solid var(--rule); }
.parts thead th { font: 600 1.05rem/1.2 var(--cond); color: var(--graphite); border-bottom: 1.5px solid var(--ink); padding-top: 0.8rem; padding-bottom: 0.8rem; }
.parts tbody tr:last-child td, .parts tbody tr:last-child th { border-bottom: 0; }
.parts tbody tr { transition: background-color 0.15s; scroll-margin-top: 1.5rem; }
.parts tbody tr.lit, .parts tbody tr:target { background: var(--callout-wash); }
.ref { width: 4.5rem; }
.ref span {
  display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  border: 1.6px solid var(--callout); color: var(--callout); font: 700 1.1rem/1 var(--cond);
}
tr.lit .ref span, tr:target .ref span { background: var(--callout); color: #fff; }
.pname { font: 700 1.6rem/1.05 var(--cond); width: 13rem; }
.pname small { display: block; font: 500 1rem/1.3 var(--body); color: var(--graphite); margin-top: 0.3rem; }
.pdesc { max-width: 52ch; }
.pdesc p { margin: 0; }
.status { width: 14rem; font: 500 1.1rem/1.3 var(--cond); }
.status i { font-style: normal; display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.45rem; border: 1.5px solid var(--ink); vertical-align: 0.02em; }
.status .live { background: var(--ink); }
.status .half { background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); }
.parts .spare td, .parts .spare th { color: var(--graphite); }
.parts .spare .pname { color: var(--graphite); }

/* about */
.about .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.5rem, 5vw, 4.5rem); }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.1rem; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 { margin: 2.5rem 0 0.9rem; font-size: 1.9rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.8rem 0 0.6rem; }
.prose ul { padding-left: 1.2rem; margin: 0 0 1.1rem; }
.prose li { margin-bottom: 0.4rem; }

/* contact */
.contact .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.5rem, 5vw, 4.5rem); }
.addresses { border: 1.5px solid var(--ink); background: var(--sheet); }
.addresses div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto; gap: 0.3rem 1.5rem; align-items: baseline; padding: 1.15rem 1.4rem; border-bottom: 1px solid var(--rule); }
.addresses div:last-child { border-bottom: 0; }
.addresses h3 { font-size: 1.35rem; }
.addresses p { margin: 0; color: var(--graphite); font-size: 1.05rem; }
.addresses a { font-weight: 600; justify-self: end; }

/* inner pages */
.page-head { padding: clamp(2.5rem, 6vw, 4rem) 0 2rem; }
.page-head p { color: var(--graphite); margin: 0.9rem 0 0; max-width: 52ch; }
.page-body { padding: 2.5rem 0 4.5rem; border-top: 1px solid var(--rule); }
.page-body .wrap { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.5rem, 5vw, 4.5rem); }
.toc { font: 500 1.1rem/1.5 var(--cond); }
.toc ol { margin: 0; padding-left: 1.3rem; position: sticky; top: 1.5rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.updated { color: var(--graphite); font-size: 1rem; }

/* placeholders Arron still has to fill: visible on purpose */
.tbc { background: #fff0b3; outline: 1px dashed #8a6d00; padding: 0 0.25em; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1.5px solid var(--ink); padding: 2.25rem 0 2.75rem; font-size: 1rem; color: var(--graphite); }
.site-foot .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1.5rem 3rem; }
.site-foot p { margin: 0 0 0.5rem; max-width: 60ch; }
.site-foot strong { color: var(--ink); font-weight: 600; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: flex-end; align-content: start; }

/* ---------- Narrow screens ---------- */
@media (max-width: 860px) {
  .hero .wrap, .sec-head, .about .wrap, .contact .wrap, .page-body .wrap, .site-foot .wrap { grid-template-columns: 1fr; }
  .site-foot ul { justify-content: flex-start; }
  .toc ol { position: static; }
  .lede { max-width: 40ch; }

  .parts thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .parts, .parts tbody, .parts tr, .parts th, .parts td { display: block; width: auto; }
  .parts tr { display: grid; grid-template-columns: 3rem 1fr; padding: 1rem 0.9rem; border-bottom: 1px solid var(--rule); column-gap: 0.75rem; }
  .parts tbody tr:last-child { border-bottom: 0; }
  .parts th, .parts td { border: 0; padding: 0.15rem 0; }
  .parts .ref { grid-row: span 3; }
  .parts .status { margin-top: 0.4rem; }
  .addresses div { grid-template-columns: 1fr; }
  .addresses a { justify-self: start; word-break: break-word; }
}
