/* Layout: fancy colour diamonds. Pick a colour and move through GIA's fancy grades on one ray-traced stone; the
   grades on a tone x saturation map; every grade of the colour side by side; why coloured diamonds are graded
   face-up; what causes each colour; natural, treated or laboratory-grown; how cut changes face-up colour. */
:root {
  --paper: #ffffff; --ink: #16161a; --ink-soft: #3d3d45; --muted: #6b6b75; --rule: #e4e2de; --mist: #f4f3f1;
  --ruby: #9b1b30; --gold: #b8892f;
  --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; color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
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: 24px; }
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; 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; text-wrap: balance; }
.lede { max-width: 70ch; 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; }
.help { font-size: 12.5px; color: var(--muted); margin: 0; }
.mini { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
section.study { border-top: 1px solid var(--ink); padding-top: 18px; display: grid; gap: 14px; }
.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: 6px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.2); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--ruby); outline-offset: 2px; }
/* viewer */
.viewer { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .viewer { grid-template-columns: 1fr; } }
.stage { position: relative; display: grid; place-items: center; min-height: 340px; padding: 30px 16px 40px; background: radial-gradient(circle at 50% 44%, #f4f4f2, #d9d8d3 78%); border: 1px solid var(--rule); }
.stage img { width: min(280px, 80%); height: auto; display: block; }
.stage img.pending { visibility: hidden; }
.stage .loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: #6b6b75; }
.stage .cap { position: absolute; left: 12px; top: 10px; font: 600 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: #5a5a62; }
.stage .chipbox { position: absolute; right: 12px; bottom: 12px; display: grid; justify-items: center; gap: 2px; font: 600 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: #5a5a62; }
.stage .chip { width: 44px; height: 44px; border: 1px solid rgba(0,0,0,.18); }
.controls { display: grid; gap: 14px; align-content: start; }
.controls .blk { display: grid; gap: 6px; }
.gradeName { font-family: var(--font-display); font-weight: 500; font-size: clamp(28px, 4vw, 40px); line-height: 1.05; margin: 0; }
.slider input { width: 100%; accent-color: var(--ruby); }
.ticks { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; font: 500 12px var(--font-body); color: var(--muted); text-align: center; line-height: 1.15; }
.ticks span.off { opacity: .35; text-decoration: line-through; }
.ticks span.on { color: var(--ink); font-weight: 600; }
.note { font-size: 13.5px; padding: 8px 10px; background: var(--mist); border-left: 3px solid var(--gold); margin: 0; }
/* map */
.mapgrid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .mapgrid { grid-template-columns: 1fr; } }
.mapbox svg { width: 100%; height: auto; display: block; }
.legend { display: grid; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.legend div { border-top: 1px solid var(--rule); padding-top: 6px; }
.legend b { color: var(--ink); }
/* strip */
.strip { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 760px) { .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cell { border: 1px solid var(--rule); background: #f4f4f2; padding: 6px 4px 8px; display: grid; justify-items: center; gap: 4px; cursor: pointer; font: 600 12px var(--font-body); color: #16161a; text-align: center; line-height: 1.15; min-height: 120px; }
.cell img { width: 72px; height: 72px; object-fit: contain; }
.cell.off { opacity: .35; cursor: default; }
.cell[aria-pressed="true"] { outline: 2px solid var(--ruby); outline-offset: 1px; }
/* cards */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { border-top: 2px solid var(--gold); padding-top: 8px; font-size: 14px; color: var(--ink-soft); display: grid; gap: 6px; align-content: start; }
.card h3 { font-family: var(--font-display); font-weight: 500; font-size: 21px; margin: 0; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.card h3 i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; border: 1px solid rgba(0,0,0,.2); }
.card p { margin: 0; }
.card .tag { font: 500 12px var(--font-data); color: var(--muted); }
.cutrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 620px) { .cutrow { grid-template-columns: 1fr; } }
.cutcell { border: 1px solid var(--rule); background: radial-gradient(circle at 50% 44%, #f4f4f2, #dcdbd6 80%); display: grid; justify-items: center; gap: 4px; padding: 14px 8px 10px; font: 600 12px var(--font-body); color: #16161a; text-align: center; }
.cutcell img { width: 140px; height: 140px; object-fit: contain; }
.cutcell span { font-weight: 400; color: #5a5a62; font-size: 12px; }
.sources { display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); max-width: 92ch; }
.sources p { margin: 0; }
footer.note2 { font-size: 12px; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 12px; max-width: 95ch; }
/* 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; }
