/* Roboteer v2. White canvas, one accent (the cutting-mat green), one display face.
   Spacing ladder: tight 8 < stack 16 < gutter 24 < card pad 32 < page 48 < section 96 */
:root {
  --bg: #FFFFFF; --ink: #111111; --muted: #5E5E5E; --faint: #A6A6A6; --tile: #F2F2F2; --line: #E6E6E6;
  --green: #1F4A3B; --green-ink: #1E6A47;
  --s-tight: 8px; --s-stack: 16px; --s-gutter: 24px; --s-pad: 32px; --s-page: 48px; --s-section: 96px;
  --r-tile: 16px; --r-inner: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 17px/1.55 "Atkinson Hyperlegible Next", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: var(--s-page); padding-right: var(--s-page); }

h1, h2, h3, .mark { font-family: "Fraunces", Georgia, serif; font-variation-settings: "SOFT" 100, "opsz" 144; font-weight: 900; letter-spacing: -.015em; }
h1 { font-size: clamp(48px, 8vw, 104px); line-height: .95; }
h2 { font-size: 40px; line-height: 1.05; }
h3 { font-size: 24px; line-height: 1.15; }
.kicker, .num { font-size: 14px; font-weight: 600; color: var(--muted); }

/* top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-stack); padding-top: var(--s-gutter); padding-bottom: var(--s-gutter); }
.mark { font-size: 26px; text-decoration: none; }
.crumb { font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--ink); }

main > section:not(.hero) { margin-top: var(--s-section); }

/* home */
.hero { padding-top: var(--s-section); }
.lede { margin-top: var(--s-pad); max-width: 640px; font-size: 21px; line-height: 1.5; color: var(--muted); }
.builds { margin-top: var(--s-section); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-page) var(--s-gutter); }

.build { display: flex; flex-direction: column; text-decoration: none; }
.build .art { position: relative; aspect-ratio: 1; border-radius: var(--r-tile); overflow: hidden; background: var(--tile); }
.build .art img { position: absolute; inset: var(--s-pad); width: calc(100% - 2 * var(--s-pad)); height: calc(100% - 2 * var(--s-pad)); object-fit: contain; }
.build .info { padding-top: var(--s-stack); display: flex; flex-direction: column; gap: var(--s-tight); }

.build p { font-size: 16px; line-height: 1.45; color: var(--muted); }
.build .by { font-size: 13px; color: var(--faint); }
.build .go { margin-top: 4px; font-size: 15px; font-weight: 700; color: var(--green-ink); }
.build .go::after { content: " \2192"; transition: margin .2s ease; }

.build.open .art { background: var(--green) url(img/mat.webp) center / 460px; }
.build.open .art img { inset: var(--s-stack); width: calc(100% - 2 * var(--s-stack)); height: calc(100% - 2 * var(--s-stack)); filter: drop-shadow(0 14px 18px rgba(0,0,0,.45)); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.build.open:hover .art img { transform: translateY(-6px) rotate(-1.5deg); }
.build.open:hover .go::after { margin-left: 4px; }

.build.locked { cursor: default; }
.build.locked .art img { filter: grayscale(1); opacity: .5; }
.build.locked .when { position: absolute; left: var(--s-stack); top: var(--s-stack); font-size: 13px; font-weight: 700; color: var(--muted);
  background: var(--bg); padding: 4px 12px; border-radius: 999px; }
.build.locked .num, .build.locked h3, .build.locked p { color: var(--faint); }
.build.locked .by { color: #C2C2C2; }

.foot { margin-top: var(--s-section); padding-top: var(--s-pad); padding-bottom: var(--s-page); border-top: 1px solid var(--line); }
.foot p { max-width: 640px; font-size: 15px; color: var(--muted); }

/* project page */
.phero { position: relative; overflow: hidden; border-radius: 24px; background: var(--green) url(img/mat.webp) center / 640px; min-height: 480px;
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: center; gap: var(--s-pad); padding: var(--s-page); }
.phero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 100% at 50% 40%, transparent 50%, rgba(0,0,0,.4)); }
.phero .card { position: relative; z-index: 1; background: var(--bg); border-radius: var(--r-tile); padding: var(--s-pad); max-width: 560px; }
.phero .card h1 { font-size: clamp(40px, 5.5vw, 64px); margin-top: var(--s-tight); }
.phero .card p { margin-top: var(--s-stack); color: var(--muted); font-size: 18px; }
.phero .chip { position: relative; z-index: 1; display: inline-block; margin-bottom: var(--s-stack); background: var(--bg); border-radius: 999px; padding: 8px 16px; font-size: 15px; font-weight: 700; }
.phero .chip b { color: var(--green-ink); }
.phero .duck { position: relative; z-index: 1; justify-self: center; height: 420px; width: auto; filter: drop-shadow(0 24px 28px rgba(0,0,0,.5)); }
.phero .credit { position: absolute; right: var(--s-gutter); bottom: var(--s-stack); z-index: 1; font-size: 12px; color: rgba(255,255,255,.7); }

.toc { display: flex; gap: var(--s-tight); flex-wrap: wrap; margin-top: var(--s-gutter); }
.toc a { font-size: 15px; font-weight: 600; text-decoration: none; padding: 8px 16px; border-radius: 999px; background: var(--tile); color: var(--muted); }
.toc a:hover { color: var(--ink); }

section > .kicker + h2 { margin-top: var(--s-tight); }
.prose { max-width: 680px; margin-top: var(--s-gutter); }
.prose p { font-size: 18px; }
.prose p + p { margin-top: var(--s-stack); }
.facts { margin-top: var(--s-pad); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-stack); }
.fact { background: var(--tile); border-radius: var(--r-tile); padding: var(--s-gutter); }
.fact b { display: block; font: 900 36px/1 "Fraunces", serif; font-variation-settings: "SOFT" 100, "opsz" 144; }
.fact span { display: block; margin-top: var(--s-tight); font-size: 15px; color: var(--muted); }

.tools { margin-top: var(--s-stack); max-width: 680px; color: var(--muted); }
.tools b { color: var(--ink); }
.parts { margin-top: var(--s-pad); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-gutter); }
.group { background: var(--tile); border-radius: var(--r-tile); padding: var(--s-tight) 0; }
.group h3 { font-size: 22px; padding: var(--s-stack) var(--s-gutter) var(--s-tight); }
.group table { width: 100%; border-collapse: collapse; }
.group td { padding: 12px var(--s-gutter); border-top: 1px solid var(--line); font-size: 15px; vertical-align: top; }
.group tr:first-child td { border-top: 0; }
.group td.q { width: 80px; white-space: nowrap; font-weight: 700; color: var(--muted); }
.group td.price { text-align: right; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.group td small { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.buybar { margin-top: var(--s-gutter); display: flex; justify-content: space-between; align-items: center; gap: var(--s-gutter); flex-wrap: wrap;
  border: 1px dashed #CFCFCF; border-radius: var(--r-tile); padding: var(--s-pad); }
.buybar p { color: var(--muted); max-width: 560px; }
.btn { display: inline-block; background: var(--ink); color: #fff; text-decoration: none; font-size: 16px; font-weight: 700; line-height: 1; padding: 16px 24px; border-radius: 999px; }
.btn:hover { background: #000; }
.btn.ghost { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); cursor: not-allowed; }

.modules { margin-top: var(--s-pad); list-style: none; display: grid; gap: 12px; }
.mod { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: var(--s-gutter);
  background: var(--tile); border-radius: var(--r-tile); padding: 20px var(--s-gutter); text-decoration: none; }
.mod .n { font: 900 40px/1 "Fraunces", serif; font-variation-settings: "SOFT" 100, "opsz" 144; }
.mod h3 { font-size: 22px; }
.mod p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.mod .tag { font-size: 14px; font-weight: 700; padding: 8px 16px; border-radius: 999px; white-space: nowrap; }
.mod.live { background: var(--green); color: #fff; }
.mod.live p { color: rgba(255,255,255,.75); }
.mod.live .tag { background: #fff; color: var(--green); }
.mod.live:hover { background: #193F32; }
.mod.locked .n, .mod.locked h3, .mod.locked p { color: var(--faint); }
.mod.locked .tag { color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }

@media (max-width: 1100px) {
  .builds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  :root { --s-pad: 24px; --s-page: 20px; --s-section: 64px; }
  .phero { grid-template-columns: minmax(0, 1fr); padding: var(--s-page); min-height: 0; }
  .phero .duck { height: 300px; order: -1; }
  .phero .credit { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parts { grid-template-columns: minmax(0, 1fr); }
  .mod { grid-template-columns: 40px minmax(0, 1fr); }
  .mod .n { font-size: 32px; }
  .mod .tag { grid-column: 2; justify-self: start; }
}
@media (max-width: 560px) {
  .builds { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .lede { font-size: 19px; }
  h2 { font-size: 32px; }
}
