/* Jadeite: the page is the same seamless sweep the objects were photographed on. */
:root {
  --paper: #d9e4da;
  --paper-2: #cfdcd1;
  --ink: #1c2a24;
  --ink-2: #56675e;
  --rule: #b9c9bd;
  --enamel: #b8322a;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(16px, 3.2vw, 44px);
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: "wdth" 100;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--enamel); outline-offset: 3px; border-radius: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
code, kbd { font-family: var(--mono); font-size: 0.86em; }
kbd { border: 1px solid var(--rule); border-radius: 4px; padding: 0 5px; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: end;
  gap: var(--gutter);
  padding: clamp(28px, 6vh, 72px) var(--gutter) 0;
  min-height: min(88vh, 900px);
}
.hero h1 {
  font-size: clamp(46px, 7.4vw, 118px);
  line-height: 0.92;
  font-weight: 700;
  font-variation-settings: "wdth" 78, "opsz" 96;
  letter-spacing: -0.035em;
  margin: 0 0 0.35em;
  max-width: 9ch;
}
.lede { max-width: 38ch; font-size: 19px; color: var(--ink); margin: 0 0 1.2em; }
.hero-caption { color: var(--ink-2); margin: 0 0 clamp(28px, 6vh, 64px); min-height: 3em; max-width: 40ch; }
.hero-caption button {
  font: inherit; color: var(--ink); background: none; border: 0; padding: 0;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.hero-stage { position: relative; height: min(80vh, 820px); }
.hero-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.hero-stage canvas:active { cursor: grabbing; }
.hint { position: absolute; right: 0; bottom: 8px; margin: 0; font-size: 13px; color: var(--ink-2); }

/* ---------- filters ---------- */
.filters {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.filters-inner {
  display: flex; gap: 20px; align-items: center; justify-content: space-between;
  padding: 10px var(--gutter);
}
.chips { display: flex; gap: 4px 12px; flex-wrap: wrap; }
.chips button {
  font: inherit; font-size: 14.5px; color: var(--ink-2);
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.chips button sup { font-size: 10px; margin-left: 2px; }
.chips button:hover { color: var(--ink); }
.chips button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--enamel); }
.search input {
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--paper-2); border: 1px solid transparent; border-radius: 999px;
  padding: 6px 14px; width: 9.5em;
}
.search input::placeholder { color: var(--ink-2); }
.search input:focus { outline: none; border-color: var(--enamel); }

/* ---------- collection ---------- */
.collection { padding: 0 var(--gutter) 40px; outline: none; }
.section { padding-top: clamp(36px, 7vh, 80px); }
.section-head {
  display: flex; align-items: baseline; gap: 14px;
  border-bottom: 1px solid var(--rule); padding-bottom: 8px; margin-bottom: 4px;
}
.section-head h2 {
  margin: 0; font-weight: 650;
  font-size: clamp(30px, 4vw, 54px);
  font-variation-settings: "wdth" 82, "opsz" 72;
  letter-spacing: -0.02em; line-height: 1;
}
.section-head p { margin: 0; color: var(--ink-2); font-size: 15px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 44vw), 1fr));
  gap: 0 clamp(8px, 1.6vw, 24px);
}
.item {
  display: block; text-decoration: none; padding-bottom: 22px;
}
.item img, .item .noimg {
  display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover;
  background: var(--paper);
}
.item .noimg { display: grid; place-items: center; color: var(--ink-2); font-size: 14px; }
.item .name { display: block; font-weight: 600; font-size: 17px; line-height: 1.25; margin-top: -22px; }
.item .meta { display: block; color: var(--ink-2); font-size: 14px; }
.item:hover .name { text-decoration: underline; text-underline-offset: 3px; }
.empty { padding: 60px 0; color: var(--ink-2); font-size: 19px; }

/* ---------- colophon ---------- */
.colophon {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gutter);
  padding: 40px var(--gutter) 64px; border-top: 1px solid var(--rule); color: var(--ink-2);
}
.colophon h2 { font-size: 17px; color: var(--ink); margin: 0 0 6px; font-weight: 650; }
.colophon p { max-width: 62ch; margin: 0; }

/* ---------- inspection dialog ---------- */
dialog#inspect {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: var(--paper); color: var(--ink);
}
dialog#inspect::backdrop { background: var(--paper); }
.insp { display: grid; grid-template-columns: minmax(0, 1fr) min(460px, 38vw); height: 100%; }
.insp-stage { position: relative; min-height: 0; }
.insp-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.insp-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--ink-2); pointer-events: none; }
.insp-tools {
  position: absolute; left: var(--gutter); bottom: 18px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.insp-tools button, .insp-nav button {
  font: inherit; font-size: 14px; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 999px;
  padding: 5px 13px; cursor: pointer;
}
.insp-tools button:hover, .insp-nav button:hover { border-color: var(--ink-2); }
.insp-tools button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.insp-panel {
  overflow-y: auto; border-left: 1px solid var(--rule);
  padding: 18px 28px 40px;
}
.insp-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; }
.insp-nav span { color: var(--ink-2); font-size: 14px; margin-right: auto; margin-left: 4px; }
.insp-nav .close { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.insp-cat { margin: 0; color: var(--ink-2); }
.insp-panel h2 {
  font-size: clamp(34px, 3.4vw, 50px); line-height: 0.98; margin: 2px 0 14px;
  font-weight: 700; font-variation-settings: "wdth" 80, "opsz" 72; letter-spacing: -0.025em;
}
.insp-desc { margin: 0 0 20px; max-width: 46ch; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 18px; margin: 0 0 26px; font-size: 15px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.insp-panel h3 { font-size: 15px; font-weight: 650; margin: 0 0 8px; }
.parts { list-style: none; padding: 0; margin: 0 0 26px; font-size: 15px; }
.parts li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--rule); }
.parts .sw { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(28, 42, 36, 0.25); }
.parts .mat { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.source {
  margin: 0; padding: 14px 16px; background: #1f2d27; color: #d5e2d8;
  border-radius: 8px; overflow-x: auto; font-size: 12.5px; line-height: 1.55;
}
.source code { font-size: inherit; }
.source .k { color: #f0b67f; }
.source .s { color: #a9d6a1; }
.source .n { color: #9cc8f0; }
.source .c { color: #7f978a; font-style: italic; }
.source .f { color: #ffe29a; }
.source .d { color: #e59a92; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; align-items: start; }
  .hero-stage { height: 62vh; order: 2; }
  .hero-caption { margin-bottom: 8px; }
  .filters-inner { flex-direction: column; align-items: stretch; gap: 8px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chips button { white-space: nowrap; }
  .search input { width: 100%; }
  .insp { grid-template-columns: 1fr; grid-template-rows: 58dvh 1fr; }
  .insp-panel { border-left: 0; border-top: 1px solid var(--rule); }
  .insp-tools { bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
.insp-loading[hidden] { display: none; }
