/* Moonstack Labs shop, in the logo kit's look: near-black surfaces, bone text, one amber, and the printed crescent.
   Space Grotesk for headings and buttons, Inter for reading, JetBrains Mono for prices and dates. Dark only. */
:root {
  --bg: #0D0F13; --surface: #161A21; --raised: #1E232C; --ring: #2A303B;
  --ink: #ECE8DF; --soft: #B4BCC8; --muted: #A4ACB8; --amber: #F2B04A; --on-amber: #0D0F13; --bad: #FF8A7A;
  --display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--body);
       padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 3rem); }
a { color: var(--ink); text-decoration-color: var(--amber); text-underline-offset: .2em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
.test-banner { background: var(--amber); color: var(--on-amber); font: 600 .95rem/1.4 var(--display); text-align: center; padding: .55rem 1rem; }

/* Header: the crescent and the wordmark, as in the logo kit's lockup */
header.top { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 0; gap: 1rem; border-bottom: 1px solid var(--raised); }
header.top .mark { display: flex; align-items: center; gap: .65rem; text-decoration: none; font: 700 1.2rem/1 var(--display); letter-spacing: -.01em; }
header.top .mark .labs { font-weight: 500; color: var(--soft); }
header.top nav { display: flex; gap: 1.4rem; align-items: center; font: 500 .98rem/1 var(--display); }
header.top nav a { text-decoration: none; color: var(--soft); }
header.top nav a:hover { color: var(--ink); }
.cart-btn { font: 600 .95rem/1 var(--display); color: var(--ink); background: var(--surface); border: 1px solid var(--ring); border-radius: 999px; padding: .55rem .95rem; cursor: pointer; }
.cart-btn b { color: var(--amber); font-family: var(--mono); font-weight: 500; margin-left: .25rem; }

/* Hero: the one moment on the page. The crescent prints itself, a layer at a time, bottom to top. */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; padding: clamp(2.5rem, 7vw, 5.5rem) 0; }
.hero-mark { width: 100%; height: auto; max-width: 22rem; justify-self: center; }
.hero-mark rect { transform-box: fill-box; transform-origin: left center; }
@media (prefers-reduced-motion: no-preference) {
  .hero-mark rect { animation: lay .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 70ms + 150ms); }
  @keyframes lay { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}
h1, h2, h3 { font-family: var(--display); color: var(--ink); }
h1 { font-weight: 700; font-size: clamp(2.6rem, 6.4vw, 4.4rem); line-height: 1.02; letter-spacing: -.03em; margin: 0 0 1.25rem; max-width: 15ch; text-wrap: balance; }
h2 { font-weight: 600; font-size: clamp(1.7rem, 3.6vw, 2.3rem); letter-spacing: -.02em; margin: 0 0 .6rem; line-height: 1.12; }
.lede { font-size: clamp(1.1rem, 2.2vw, 1.3rem); line-height: 1.5; margin: 0 0 1.75rem; max-width: 34ch; color: var(--soft); }
p { max-width: 60ch; color: var(--muted); margin: 0 0 1rem; }
.hero .actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; font: 600 1rem/1 var(--display); color: var(--on-amber); background: var(--amber);
       border: 0; border-radius: 10px; padding: .85rem 1.25rem; cursor: pointer; text-decoration: none; }
.btn:hover { color: var(--on-amber); background: #F5BE62; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.quiet { background: transparent; color: var(--ink); border: 1px solid var(--ring); }
.btn.quiet:hover { border-color: var(--soft); color: var(--ink); background: transparent; }
.mono, .price, .lead-date { font-family: var(--mono); }

section.block { padding: clamp(2.75rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--raised); }
#leadLine { color: var(--soft); }

/* Ready-made pieces */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.1rem; margin-top: 1.75rem; }
.item { background: var(--surface); border: 1px solid var(--raised); border-radius: 14px; padding: .9rem .9rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; }
.item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--raised); margin-bottom: .45rem; }
.item h3 { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }
.item .meta { color: var(--muted); font-size: .94rem; }
.item .row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: auto; padding-top: .75rem; }
.item .price { font-weight: 500; font-size: 1.1rem; color: var(--ink); }
.item .btn { padding: .65rem 1rem; font-size: .95rem; }
.empty { color: var(--soft); background: var(--surface); border: 1px dashed var(--ring); border-radius: 14px; padding: 1.5rem; margin-top: 1.75rem; max-width: none; }

/* When the shop is full */
.full-box { background: var(--surface); border: 1px solid var(--amber); border-radius: 14px; padding: 1.2rem; margin-top: 1.5rem; max-width: 46rem; }
.full-box p { max-width: none; color: var(--ink); }
form.waitlist { display: flex; gap: .6rem; flex-wrap: wrap; }
form.waitlist input { flex: 1 1 14rem; width: auto; }

/* A custom print */
form.custom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.1rem; margin-top: 1.75rem; max-width: 48rem; }
form.custom label { display: flex; flex-direction: column; gap: .35rem; font: 500 .92rem/1.3 var(--display); color: var(--soft); }
form.custom .wide { grid-column: 1 / -1; }
input, textarea, select { font: 400 1rem/1.4 var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; padding: .7rem .8rem; width: 100%; }
input:focus, textarea:focus, select:focus { border-color: var(--amber); outline: none; }
textarea { min-height: 7.5rem; resize: vertical; }
.material-note { max-width: none; margin: 0; color: var(--ink); background: var(--surface); border-left: 3px solid var(--amber); padding: .7rem .9rem; border-radius: 4px 10px 10px 4px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.note { margin-top: .75rem; font: 600 .98rem/1.4 var(--display); color: var(--ink); }
.note.bad { color: var(--bad); }

/* A custom print's quote */
.quote-box { background: var(--surface); border: 1px solid var(--raised); border-radius: 14px; padding: 1.2rem; margin: 0 0 1.5rem; max-width: 32rem; display: flex; flex-direction: column; gap: .4rem; }
.quote-box > div { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); }
.quote-box .total { color: var(--ink); font-weight: 600; font-size: 1.1rem; border-top: 1px solid var(--raised); padding-top: .5rem; margin-top: .2rem; }
.quote-box p { margin: .5rem 0; color: var(--soft); }
.quote-box .btn { align-self: flex-start; }

/* Cart */
dialog.cart { width: min(30rem, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; border: 0; padding: 0;
              background: var(--surface); color: var(--ink); border-left: 1px solid var(--ring); }
dialog.cart::backdrop { background: rgba(5, 6, 9, .6); }
.cart-inner { display: flex; flex-direction: column; height: 100%; padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px)); gap: 1rem; }
.cart-lines { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: .75rem; }
.line { display: flex; justify-content: space-between; gap: .75rem; align-items: center; border-bottom: 1px solid var(--raised); padding-bottom: .75rem; }
.qty { display: flex; align-items: center; gap: .45rem; font-family: var(--mono); }
.qty button { font: 500 1rem/1 var(--mono); width: 2.1rem; height: 2.1rem; border-radius: 8px; border: 1px solid var(--ring); background: var(--raised); color: var(--ink); cursor: pointer; }
.sums div { display: flex; justify-content: space-between; color: var(--muted); }
.sums div span:last-child { font-family: var(--mono); }
.sums .total { color: var(--ink); font-weight: 600; font-size: 1.1rem; margin-top: .3rem; }

footer { padding: 2.5rem 0 3rem; border-top: 1px solid var(--raised); color: var(--muted); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; }
footer p { max-width: none; margin: 0 0 .4rem; }
footer nav { display: flex; gap: 1.2rem; flex-wrap: wrap; font: 500 .95rem/1.4 var(--display); }
footer nav a { color: var(--soft); text-decoration: none; }
footer nav a:hover { color: var(--ink); }

@media (max-width: 46rem) {
  .hero { grid-template-columns: 1fr; padding-top: 2rem; }
  .hero-mark { order: -1; max-width: 9.5rem; justify-self: start; }
  header.top nav a.hide-sm { display: none; }
  form.custom { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; }
}
