/* Propyard: dark "inspection table" look. Props are judged under light, so the page stays dark. */
:root {
  color-scheme: dark;
  --peat: #121410;
  --bark: #1a1c17;
  --bark-2: #23261f;
  --line: #343829;
  --bone: #ebe4d3;
  --ash: #aaa492;
  --dim: #7d7868;
  --lantern: #e2a456;
  --lantern-ink: #1b140a;
  --moss: #9aa56c;
  --plate: #4e5255;
  --stage: #2a2d2a;
  --f-display: "IM Fell English SC", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-body: "Alegreya Sans", "Gill Sans", "Trebuchet MS", system-ui, sans-serif;
  --f-data: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --s-1: 0.8125rem; --s0: 1rem; --s1: 1.1875rem; --s2: 1.5rem; --s3: 2.25rem; --s4: clamp(2.5rem, 6vw, 4rem);
  --r: 6px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--peat); color: var(--bone);
  font-family: var(--f-body); font-size: var(--s0); line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: 48px;
}
img { max-width: 100%; }
.wrap { max-width: 1240px; margin-inline: auto; }
a { color: var(--lantern); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lantern); outline-offset: 2px; }
.eyebrow { font-family: var(--f-data); font-size: var(--s-1); letter-spacing: .08em; text-transform: uppercase; color: var(--moss); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; text-wrap: balance; margin: 0; letter-spacing: .01em; }
p { margin: 0; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-family: var(--f-display); font-size: var(--s2); color: var(--bone); text-decoration: none; line-height: 1; }
.topbar nav { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar nav a { color: var(--ash); text-decoration: none; font-size: var(--s-1); letter-spacing: .06em; text-transform: uppercase; font-family: var(--f-data); }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--bone); }
.fromnote { font-family: var(--f-data); font-size: 0.75rem; color: var(--ash); }
.crumbs { font-family: var(--f-data); font-size: 0.75rem; color: var(--dim); margin-top: 20px; letter-spacing: .04em; }
.crumbs a { color: var(--ash); text-decoration: none; }
.crumbs a:hover { color: var(--bone); }

/* generic sections */
section { margin-top: 56px; }
.sechead { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sechead h2 { font-size: var(--s3); }
.sechead p { margin-top: 4px; color: var(--ash); max-width: 70ch; }
.lead { color: var(--ash); font-size: var(--s1); max-width: 62ch; margin-top: 14px; }

/* hero (home, theme) */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; padding-block: 44px 8px; }
.hero h1 { font-size: var(--s4); line-height: 1.02; margin-top: 8px; }
.hero figure { margin: 0; }
.hero figure img { display: block; width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--line); }
.hero .ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bark-2); color: var(--bone); padding: 8px 14px; border-radius: var(--r); cursor: pointer; text-decoration: none; font-size: var(--s-1); line-height: 1.3; }
.btn:hover { border-color: var(--lantern); }
.btn.primary { background: var(--lantern); color: var(--lantern-ink); border-color: var(--lantern); font-weight: 700; }
.btn[aria-disabled="true"] { opacity: .6; cursor: default; }
.btn[aria-disabled="true"]:hover { border-color: var(--line); }
.buy { display: flex; flex-wrap: wrap; gap: 6px; }
.buynote { font-size: var(--s-1); color: var(--dim); margin-top: 6px; }

/* cards (themes, packs, props) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tile { border: 1px solid var(--line); background: var(--bark); border-radius: var(--r); overflow: hidden; color: inherit; text-decoration: none; display: flex; flex-direction: column; }
a.tile:hover { border-color: color-mix(in srgb, var(--lantern) 60%, var(--line)); }
.tile img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--plate); }
.tile .body { padding: 14px 16px 16px; display: grid; gap: 4px; }
.tile h3 { font-size: var(--s2); }
.tile p { color: var(--ash); font-size: var(--s-1); }
.tile .meta { font-family: var(--f-data); font-size: 0.75rem; color: var(--dim); }
.tile.muted { border-style: dashed; background: transparent; justify-content: center; min-height: 200px; }
.tile.muted .body { text-align: center; }
.status { display: inline-block; font-family: var(--f-data); font-size: 0.7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--lantern-ink); background: var(--lantern); padding: 2px 8px; border-radius: 99px; justify-self: start; }
.status.soon { background: transparent; color: var(--ash); border: 1px solid var(--line); }

/* three-up explainer */
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--r); padding: 20px; background: var(--bark); }
.panel h3 { font-size: var(--s2); }
.panel .who { color: var(--moss); font-family: var(--f-data); font-size: 0.75rem; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.panel p { color: var(--ash); margin-top: 8px; }
.panel ul { margin: 12px 0 0; padding-left: 18px; color: var(--ash); display: grid; gap: 6px; }
.panel li strong { color: var(--bone); font-weight: 500; }
.twocol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.storelist { display: flex; flex-wrap: wrap; gap: 8px; }
.storelist span { border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: var(--s-1); color: var(--ash); }
.storelist span b { color: var(--bone); font-weight: 500; }

/* pack intro */
.intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; padding-block: 24px 28px; align-items: start; }
.intro h1 { font-size: var(--s4); line-height: 1.02; margin-top: 8px; }
.packbox { border: 1px solid var(--line); border-radius: var(--r); background: var(--bark); overflow: hidden; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); margin: 0; }
.facts div { background: var(--bark); padding: 12px 14px; }
.facts dt { font-family: var(--f-data); font-size: 0.75rem; color: var(--dim); text-transform: uppercase; letter-spacing: .07em; }
.facts dd { margin: 2px 0 0; font-size: var(--s1); }
.price { padding: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.price .amount { font-family: var(--f-data); font-size: var(--s2); font-variant-numeric: tabular-nums; }
.price .amount small { font-size: var(--s-1); color: var(--dim); margin-left: 6px; }
.price .save { font-size: var(--s-1); color: var(--moss); }

/* inspector */
.inspector { display: grid; grid-template-columns: minmax(0, 1fr) 340px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--bark); }
.stage { position: relative; min-height: 420px; height: min(68vh, 640px); background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--stage) 100%, #fff 7%) 0%, var(--stage) 45%, color-mix(in srgb, var(--stage) 60%, #000) 100%); transition: background .5s; touch-action: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.toolbar { position: absolute; z-index: 2; left: 12px; right: 12px; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.toolbar.top { top: 12px; }
.toolbar.bottom { bottom: 12px; justify-content: space-between; align-items: flex-end; }
.toolbar > * { pointer-events: auto; }
.seg { display: inline-flex; flex-wrap: wrap; background: color-mix(in srgb, var(--peat) 78%, transparent); border: 1px solid var(--line); border-radius: 99px; padding: 3px; gap: 2px; backdrop-filter: blur(6px); }
.seg .lab { align-self: center; padding: 0 4px 0 10px; font-family: var(--f-data); font-size: 0.68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.seg button, .tog { border: 0; background: transparent; padding: 6px 12px; border-radius: 99px; cursor: pointer; font-size: var(--s-1); color: var(--ash); white-space: nowrap; }
.seg button:hover, .tog:hover { color: var(--bone); }
.seg button[aria-pressed="true"] { background: var(--lantern); color: var(--lantern-ink); font-weight: 700; }
.tools { display: inline-flex; gap: 2px; background: color-mix(in srgb, var(--peat) 78%, transparent); border: 1px solid var(--line); border-radius: 99px; padding: 3px; backdrop-filter: blur(6px); flex-wrap: wrap; }
.tog[aria-pressed="true"] { color: var(--lantern); }
.tog .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; margin-right: 6px; vertical-align: 1px; }
.tog[aria-pressed="true"] .dot { background: currentColor; }
.hint { font-family: var(--f-data); font-size: 0.72rem; color: color-mix(in srgb, var(--bone) 70%, transparent); background: color-mix(in srgb, var(--peat) 60%, transparent); padding: 4px 8px; border-radius: 4px; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-data); font-size: var(--s-1); color: var(--ash); pointer-events: none; }
.loading .bar { width: 160px; height: 2px; background: var(--line); margin-top: 10px; overflow: hidden; }
.loading .bar i { display: block; height: 100%; width: 0; background: var(--lantern); transition: width .2s; }
.fallback { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: var(--plate); }
.fallback img { max-height: 80%; width: auto; }
.fallback p { margin: 8px 0 0; font-size: var(--s-1); color: #f1ece0; }

.ledger { border-left: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 18px; min-width: 0; overflow-y: auto; max-height: min(68vh, 640px); }
.ledger h2 { font-size: var(--s3); line-height: 1.05; }
.ledger .desc { color: var(--ash); margin-top: 6px; }
.ledger .single { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bark-2); }
.ledger .single .amount { font-family: var(--f-data); font-size: var(--s1); font-variant-numeric: tabular-nums; }
.ledger .single .amount small { color: var(--dim); font-size: var(--s-1); margin-left: 6px; }
.ledger .inpack { font-size: var(--s-1); color: var(--ash); }
.dims { font-family: var(--f-data); font-size: var(--s0); font-variant-numeric: tabular-nums; }
.dims span { color: var(--dim); font-size: var(--s-1); }
.block h3 { font-family: var(--f-data); font-size: 0.75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin-bottom: 8px; }
.ladder { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ladder li { display: grid; grid-template-columns: 72px minmax(0, 1fr) 70px; gap: 8px; align-items: center; font-family: var(--f-data); font-size: var(--s-1); font-variant-numeric: tabular-nums; }
.ladder .track { height: 6px; background: var(--bark-2); border-radius: 3px; overflow: hidden; }
.ladder .track i { display: block; height: 100%; background: var(--moss); border-radius: 3px; }
.ladder li.hp .track i { background: var(--lantern); }
.ladder b { text-align: right; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--f-data); font-size: 0.75rem; border: 1px solid var(--line); border-radius: 4px; padding: 3px 7px; color: var(--ash); }
.linkrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linkfield { font-family: var(--f-data); font-size: 0.75rem; background: var(--peat); color: var(--ash); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; width: 100%; min-width: 0; }
.copied { font-size: var(--s-1); color: var(--moss); }

/* renders */
.renders { display: grid; grid-template-columns: minmax(0, 760px); gap: 16px; }
.renders figure { margin: 0; min-width: 0; }
.renders img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--plate); border: 1px solid var(--line); border-radius: var(--r); }
.renders figcaption { margin-top: 8px; font-size: var(--s-1); color: var(--dim); }

/* shelf */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { border: 1px solid var(--line); background: transparent; color: var(--ash); padding: 6px 12px; border-radius: 99px; cursor: pointer; font-size: var(--s-1); }
.filters button span { font-family: var(--f-data); color: var(--dim); margin-left: 4px; }
.filters button[aria-pressed="true"] { border-color: var(--moss); color: var(--bone); background: color-mix(in srgb, var(--moss) 18%, transparent); }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.card { border: 1px solid var(--line); background: var(--bark); border-radius: var(--r); overflow: hidden; color: inherit; text-decoration: none; display: flex; flex-direction: column; }
.card:hover { border-color: color-mix(in srgb, var(--lantern) 60%, var(--line)); }
.card[aria-current="true"] { border-color: var(--lantern); box-shadow: 0 0 0 1px var(--lantern); }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--plate); }
.card .meta { padding: 10px 12px 12px; display: grid; gap: 2px; }
.card .name { font-size: var(--s0); font-weight: 500; line-height: 1.25; }
.card .spec { font-family: var(--f-data); font-size: 0.75rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.card .cost { font-family: var(--f-data); font-size: 0.75rem; color: var(--lantern); }

/* prose pages */
.prose { max-width: 72ch; padding-top: 24px; }
.prose h1 { font-size: var(--s4); line-height: 1.05; margin-bottom: 16px; }
.prose h2 { font-size: var(--s2); margin-top: 36px; margin-bottom: 8px; }
.prose p, .prose li { color: var(--ash); }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 20px; display: grid; gap: 6px; }
.prose strong { color: var(--bone); font-weight: 500; }

footer { margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; color: var(--dim); font-size: var(--s-1); }
footer h4 { font-family: var(--f-data); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ash); margin: 0 0 6px; }
footer p { margin: 0 0 6px; }
footer a { color: var(--ash); }

@media (max-width: 980px) {
  .hero, .intro { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .inspector { grid-template-columns: minmax(0, 1fr); }
  .ledger { border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .three { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .stage { height: 62vh; min-height: 340px; }
  .twocol, .renders, footer { grid-template-columns: minmax(0, 1fr); }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .toolbar.bottom .hint { display: none; }
  .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; border-radius: 14px; scrollbar-width: none; }
  .tools { border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) { .stage { transition: none; } }
