/* Layout: the 11 GIA clarity grades, then the 3D stone beside its plotting diagram with every GIA
   clarity characteristic, then the five clarity factors at 10x, then reports, treatments and sources. */
:root {
  --paper: #ffffff;
  --ink: #16161a;
  --ink-soft: #3d3d45;
  --muted: #6b6b75;
  --rule: #e4e2de;
  --mist: #f4f3f1;
  --ruby: #9b1b30;
  --gold: #b8892f;
  --good: #2f7d4f;
  --plot-red: #d0202f;
  --plot-green: #178a3e;
  --plot-black: #16161a;
  --stage-top: #5b5e66;
  --stage-bottom: #23252b;
  --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; --good: #5fbf86; --plot-black: #e9e7e1; 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: 26px; }
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; text-wrap: balance; }
h3 { font-family: var(--font-display); font-weight: 500; font-size: 22px; margin: 0; line-height: 1.15; }
.lede { max-width: 64ch; 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; }
p.copy { margin: 0; color: var(--ink-soft); max-width: 72ch; }
.mini { font: 600 12px var(--font-body); letter-spacing: .14em; text-transform: uppercase; margin: 0; color: var(--ink-soft); }
section.study { border-top: 1px solid var(--ink); padding-top: 18px; display: grid; gap: 16px; }
.help { font-size: 12px; color: var(--muted); }
.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, select:focus-visible { outline: 2px solid var(--ruby); outline-offset: 2px; }
.callout { margin: 0; padding: 10px 14px; background: var(--mist); border-left: 3px solid var(--ruby); font-size: 14px; max-width: 84ch; }

/* grade scale */
.scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
@media (max-width: 760px) { .scale { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.scale button { font: 600 15px var(--font-data); padding: 12px 2px 10px; border: 1px solid var(--rule); background: var(--mist); color: var(--ink); cursor: pointer; display: grid; gap: 2px; justify-items: center; }
.scale button small { font: 500 12px var(--font-body); color: var(--muted); letter-spacing: .02em; }
.scale button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.scale button[aria-pressed="true"] small { color: var(--paper); opacity: .8; }
.cats { display: grid; grid-template-columns: 1fr 1fr 2fr 2fr 2fr 3fr; gap: 4px; font-size: 12px; color: var(--muted); text-align: center; }
.cats span { border-top: 2px solid var(--rule); padding-top: 4px; }
@media (max-width: 760px) { .cats { display: none; } }
.gradecard { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .gradecard { grid-template-columns: 1fr; } }
.gradecard blockquote { margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 1.3; }
.gradecard cite { display: block; font: 500 12px var(--font-body); color: var(--muted); margin-top: 6px; font-style: normal; }
table.eq { border-collapse: collapse; width: 100%; font-size: 13px; }
table.eq th, table.eq td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
table.eq th { color: var(--muted); font-weight: 600; font-size: 12px; }
table.eq tr.cur td { background: var(--mist); font-weight: 600; }

/* 3D + plot */
.mapgrid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 960px) { .mapgrid { grid-template-columns: 1fr; } }
.stage { position: relative; aspect-ratio: 1 / 1; background: radial-gradient(110% 90% at 50% 30%, var(--stage-top), var(--stage-bottom)); clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px)); overflow: hidden; touch-action: none; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage .tag { position: absolute; top: 10px; left: 12px; font-size: 12px; color: #e6e3dc; pointer-events: none; }
.stage .views { position: absolute; bottom: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.stage .views button { font: 600 12px var(--font-body); border: 1px solid rgba(255,255,255,.55); background: rgba(0,0,0,.25); color: #fff; padding: 4px 9px; cursor: pointer; }
.stage .views button[aria-pressed="true"] { background: #fff; color: #16161a; }
.plotbox { display: grid; gap: 8px; }
.plotbox svg { width: 100%; height: auto; display: block; background: var(--paper); border: 1px solid var(--rule); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-soft); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 18px; height: 3px; display: inline-block; }
.charlist { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .charlist { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .charlist { grid-template-columns: 1fr; } }
.group { display: grid; gap: 6px; align-content: start; }
.group .gh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font: 500 13px var(--font-body); border: 1px solid var(--rule); background: var(--paper); color: var(--ink); padding: 4px 8px 4px 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--rule); background: transparent; }
.chip[aria-pressed="true"] { border-color: var(--ink); }
.chip[aria-pressed="true"] .dot { border: 0; }
.chip.focus { outline: 2px solid var(--ruby); outline-offset: 1px; }
.linkbtn { font: 600 12px var(--font-body); background: none; border: 0; color: var(--ruby); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.info { display: grid; gap: 8px; border: 1px solid var(--rule); border-top: 3px solid var(--ink); padding: 12px 14px; }
.info p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.info .def { font-family: var(--font-display); font-size: 19px; color: var(--ink); line-height: 1.3; }
.info .kind { font: 600 12px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ruby); }

/* five factors */
.factors { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
@media (max-width: 900px) { .factors { grid-template-columns: 1fr; } }
.loupe { background: radial-gradient(100% 100% at 50% 40%, #2b2c31, #0f1013); border-radius: 50%; aspect-ratio: 1 / 1; max-width: 460px; width: 100%; margin: 0 auto; overflow: hidden; box-shadow: inset 0 0 0 6px #3a3b41, inset 0 0 40px rgba(0,0,0,.8); }
.loupe svg { width: 100%; height: 100%; display: block; }
.fctl { display: grid; gap: 14px; }
.slider { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.slider label { font-size: 13px; font-weight: 600; }
.slider output { font: 500 13px var(--font-data); }
.slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--ruby); }
.flist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.flist li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; font-size: 14px; border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
.flist b { font-weight: 600; }
.flist .q { color: var(--muted); font-size: 12px; display: block; }
.flist .dir { font-weight: 600; }
.dir.more { color: var(--ruby); }
.dir.less { color: var(--good); }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { border: 1px solid var(--rule); border-top: 3px solid var(--ink); padding: 12px 14px; display: grid; gap: 6px; align-content: start; }
.card h4 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 20px; }
.card p { margin: 0; font-size: 14px; color: var(--ink-soft); }
table.gloss { border-collapse: collapse; width: 100%; font-size: 14px; }
table.gloss th, table.gloss td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.gloss th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.gloss td:first-child { font-weight: 600; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
.sw { display: inline-block; width: 22px; height: 4px; vertical-align: middle; }
.sources { font-size: 13px; color: var(--ink-soft); display: grid; gap: 4px; padding-left: 18px; margin: 0; }
footer.note { 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; }
