/* Layout: the two diamond-growing machines side by side, each stepped through like a process
   sheet; the crystal each one makes; how a laboratory tells them apart (simulated DiamondView
   images and a feature table); the four classic ways coloured stones are grown; naming rules. */
:root {
  --paper: #ffffff;
  --ink: #16161a;
  --ink-soft: #3d3d45;
  --muted: #6b6b75;
  --rule: #e4e2de;
  --mist: #f4f3f1;
  --ruby: #9b1b30;
  --gold: #b8892f;
  --steel: #8a929b;
  --hot: #e2641c;
  --plasma: #b45cff;
  --stage: #15171c;
  --stage-ink: #e9edf2;
  --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; --steel: #a6aeb7; --stage: #0b0c10; 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: 1200px; 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: 23px; margin: 0; line-height: 1.15; }
.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; }
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); }
.callout { margin: 0; padding: 10px 14px; background: var(--mist); border-left: 3px solid var(--ruby); font-size: 14px; max-width: 84ch; }
button { font: 600 13px var(--font-body); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); padding: 5px 10px; cursor: pointer; }
button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--ruby); outline-offset: 2px; }

/* the two machines */
.machines { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .machines { grid-template-columns: 1fr; } }
.machine { display: grid; gap: 10px; align-content: start; }
.machine .tag { font: 500 12px var(--font-data); color: var(--muted); }
.stage { background: var(--stage); color: var(--stage-ink); }
.stage svg { display: block; width: 100%; height: auto; }
.controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.controls input[type=range] { flex: 1 1 140px; accent-color: var(--ruby); }
.stepno { font: 500 12px var(--font-data); color: var(--muted); min-width: 64px; text-align: right; }
.steptext { min-height: 92px; display: grid; gap: 4px; align-content: start; }
.steptext h4 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 19px; }
.steptext p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; margin: 0; font-size: 13px; border-top: 1px solid var(--rule); padding-top: 8px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-variant-numeric: tabular-nums; }

/* crystals and fluorescence */
.trio { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .trio { grid-template-columns: 1fr; } }
.fig { display: grid; gap: 6px; align-content: start; }
.fig svg, .fig canvas { width: 100%; height: auto; display: block; }
.fig .cap { font-size: 13px; color: var(--ink-soft); margin: 0; }
.fig h4 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 20px; }
.dv { background: #000; aspect-ratio: 1; max-width: 100%; }
.rough3d { position: relative; aspect-ratio: 3 / 1; background: radial-gradient(120% 100% at 50% 30%, #2a2b31, #0e0f12); }
@media (max-width: 760px) { .rough3d { aspect-ratio: 3 / 2; } }
.rough3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.rough3d .tip { position: absolute; left: 10px; bottom: 8px; font-size: 12px; color: #c9c6bf; pointer-events: none; }

.tablebox { overflow-x: auto; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; border-bottom: 1px solid var(--ink); }
td:first-child { font-weight: 600; white-space: nowrap; }

/* coloured stone methods */
.methods { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .methods { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .methods { grid-template-columns: 1fr; } }
.method { border-top: 3px solid var(--ink); padding-top: 10px; display: grid; gap: 8px; align-content: start; }
.method svg { width: 100%; height: auto; display: block; background: var(--stage); }
.method p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.method .clue { font-size: 13px; color: var(--ink); border-left: 2px solid var(--gold); padding-left: 8px; }
.names { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .names { grid-template-columns: 1fr; } }
.names ul { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 14px; display: grid; gap: 4px; }
.ok { color: #2f7d4f; font-weight: 600; } .no { color: var(--ruby); font-weight: 600; }
.sources { display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); max-width: 92ch; }
.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; }
