/* Layout: a parts catalogue. Filter by family (clasps, earring backs, ear wires, bails and
   connectors, rings) and by what the piece is for; each part is a drawn plate with its trade names,
   how it closes, and what it suits. Click a plate to see it open where it has a mechanism. */
:root {
  --paper: #ffffff;
  --ink: #16161a;
  --ink-soft: #3d3d45;
  --muted: #6b6b75;
  --rule: #e4e2de;
  --mist: #f4f3f1;
  --ruby: #9b1b30;
  --gold: #b8892f;
  --plate: #f6f3ec;
  --m1: #f3dfae;
  --m2: #c4a46a;
  --m3: #8a6a33;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-data: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

:root[data-theme="dark"] {
  --paper: #121216; --ink: #f1efe9; --ink-soft: #c9c6bf; --muted: #9a978f; --rule: #2c2c33; --mist: #1b1b21;
  --ruby: #e0566c; --gold: #e1b25a; --plate: #1c1d22; color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; margin: 0; }
a { color: var(--ink); text-decoration-color: var(--ruby); text-underline-offset: 3px; }
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 48px; display: grid; gap: 22px; }
header.top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ink); padding-bottom: 14px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ruby); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; flex: none; width: 4px; height: 15px; background: var(--gold); clip-path: polygon(0 24%, 100% 0, 100% 76%, 0 100%); }
h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(30px, 4.6vw, 48px); line-height: 1.03; letter-spacing: -.01em; margin: 6px 0 0; text-wrap: balance; }
h2.sec { font-family: var(--font-display); font-weight: 500; font-size: 28px; margin: 0; line-height: 1.1; }
.lede { max-width: 66ch; color: var(--ink-soft); margin: 6px 0 0; }
.prototype { font-size: 12px; color: var(--muted); border: 1px solid var(--rule); padding: 4px 10px; white-space: nowrap; }
.bar { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: end; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { font: 600 13px var(--font-body); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); padding: 5px 10px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--ruby); outline-offset: 2px; }
.search { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.search input { font: 500 15px var(--font-body); color: var(--ink); background: var(--paper); border: 1px solid var(--ink); padding: 7px 9px; border-radius: 0; width: 240px; max-width: 100%; }
.count { font-size: 12px; color: var(--muted); }

.family { display: grid; gap: 12px; }
.family h2 { display: flex; align-items: baseline; gap: 10px; border-top: 1px solid var(--ink); padding-top: 14px; }
.family h2 span { font: 500 12px var(--font-data); color: var(--muted); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.part { border: 1px solid var(--rule); display: grid; grid-template-rows: auto 1fr; background: var(--paper); }
.part .plate { background: var(--plate); aspect-ratio: 16 / 10; display: grid; place-items: center; cursor: pointer; border: 0; padding: 0; width: 100%; position: relative; }
.part .plate svg { width: 82%; height: 82%; }
.part .plate .hint { position: absolute; right: 8px; bottom: 6px; font: 600 12px var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.part .body { padding: 10px 12px 12px; display: grid; gap: 6px; align-content: start; }
.part h3 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 20px; line-height: 1.15; }
.part .aka { font-size: 12.5px; color: var(--muted); }
.part p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font: 500 12px var(--font-data); border: 1px solid var(--rule); padding: 1px 6px; color: var(--ink-soft); }
.hold { font-size: 12.5px; }
.hold b { font-weight: 600; }
.mech .open { opacity: 0; transition: opacity .25s; }
.mech .closed { transition: opacity .25s; }
.part.is-open .mech .open { opacity: 1; }
.part.is-open .mech .closed { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .mech .open, .mech .closed { transition: none; } }
.sources { display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); max-width: 92ch; border-top: 1px solid var(--ink); padding-top: 14px; }
.sources p { margin: 0; }
/* jewelloop.net: one column that never grows wider than the screen */
.wrap { grid-template-columns: minmax(0, 1fr); }
.jl-table-scroll { overflow-x: auto; max-width: 100%; }
/* shown once the page's script has run (static/visual/ready.js): no jump while loading */
html:not(.jl-ready) .wrap { visibility: hidden; }

/* On jewelloop.net the page around it shows the title and the introduction. */
header.top { display: none !important; }
