/* v3 theme layer for pages that keep their original scripts and markup.
   Loaded after the original stylesheets; it maps the old palette and components onto the article design. */
@font-face { font-family: "Naskh AR"; src: url(../fonts/RrQKbpV-9Dd1b1OAGA6M9PkyDuVBeN2DHV20Lg.woff2) format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
:root {
  --primary: #24282B; --secondary: #1E5466; --paper: #FCFBF8; --surface: #FFFFFF; --line: #E4E1DA;
  --gold: #A39E94; --gold-text: #4D555B; --gold-light: #F3F1EC; --deep: #24282B;
  --ink: #24282B; --muted: #4D555B; --primary-soft: #F3F1EC;
  --sans: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --display: "Naskh AR", "IBM Plex Sans Arabic", serif;
  --mono: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --ink-2: #4D555B; --ink-3: #737B81; --rule: #E4E1DA; --panel: #F3F1EC; --oxide: #B23A30; --petrol: #1E5466;
  --shrink: #3F72B8; --grow: #B26F12;
  color-scheme: light;
}
html, body { background: var(--paper) !important; }
body { color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
:focus-visible, button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--petrol) !important; outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); letter-spacing: 0; }
bdi { unicode-bidi: isolate; }

/* Shared top bar */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 12px clamp(18px, 4vw, 48px) !important; background: rgba(252,251,248,.95) !important; backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule) !important; box-shadow: none !important; font-family: var(--sans); color: var(--ink); }
.topbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 16px/1 var(--sans); color: var(--ink); }
.topbar .brand img { width: 26px; height: 26px; }
.topbar nav, .topbar .nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 26px; font-size: 15px; width: auto; margin: 0; padding: 0; background: none; }
.topbar nav a { text-decoration: none; color: var(--ink-2); padding: 4px 0; border: 0; background: none; font: 400 15px/1.6 var(--sans); }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a[aria-current] { color: var(--petrol); font-weight: 600; box-shadow: inset 0 -2px 0 var(--petrol); }
.topbar .present-toggle { margin-inline-start: 8px; padding: 4px 12px; border: 1px solid var(--rule); border-radius: 999px; background: #fff; color: var(--ink-2); font: 400 14px/1.4 var(--sans); }
@media (max-width: 980px) {
  .topbar { flex-wrap: wrap; gap: 6px; padding-bottom: 6px !important; }
  .topbar nav, .topbar .nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 20px; scrollbar-width: none; }
  .topbar nav a { white-space: nowrap; font-size: 14px; }
}

/* Shared footer */
.v3-foot { border-top: 1px solid var(--rule); margin-top: 64px; padding: 32px clamp(18px, 4vw, 48px) 44px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px;
  font: 400 14px/1.8 var(--sans); color: var(--ink-2); background: var(--paper); }
.v3-foot strong { display: block; font: 700 17px/1.6 var(--display); color: var(--ink); }
.v3-foot span { display: block; }
.foot-map { display: flex; flex-wrap: wrap; gap: 20px 48px; }
.foot-map p { margin: 0 0 4px; font-size: 12.5px; color: var(--ink-3); }
.foot-map a { display: block; color: var(--ink-2); text-decoration: none; }
.foot-map a:hover { color: var(--petrol); text-decoration: underline; text-underline-offset: 4px; }

/* Page headings used by the original pages */
.record-top, .page-intro { background: var(--paper) !important; color: var(--ink) !important; border: 0 !important; padding: 52px 0 26px !important; text-align: center; }
.record-top h1, .page-intro h1, main h1 { font: 700 clamp(32px, 4vw, 50px)/1.4 var(--display) !important; color: var(--ink) !important; max-width: 900px; margin-inline: auto !important; }
.record-top p, .page-intro > p { color: var(--ink-2) !important; font: 400 16.5px/1.8 var(--sans) !important; max-width: 760px; margin: 6px auto 0 !important; }
.crumb { display: block !important; text-align: center; font: 400 13.5px/1.6 var(--sans); color: var(--ink-3) !important; margin-bottom: 6px !important; }
.crumb a { color: var(--ink-2) !important; }
.eyebrow { font: 500 14px/1.6 var(--sans) !important; color: var(--ink-2) !important; letter-spacing: 0 !important; text-transform: none !important; }
.eyebrow.light { color: var(--ink-2) !important; }
.local-links, .actions { justify-content: center; }
.local-links a, .actions a, .actions .solid, .solid { border-radius: 999px !important; }

/* Buttons and controls */
.solid, .action.primary, .action.on-dark, button.primary, .btn-primary { background: var(--petrol) !important; color: #fff !important; border-color: var(--petrol) !important; }
.action, .action.ghost, .action.quiet, .small-action, .icon-button, .seg button, .seg a { border-radius: 999px !important; }
.action.ghost, .action.quiet, .small-action { background: #fff !important; color: var(--ink) !important; border: 1px solid #C9CFD3 !important; }
select, input[type=number], input[type=text] { border: 1px solid #C9CFD3 !important; border-radius: 4px !important; background: #fff !important; color: var(--ink) !important; }
input[type=range] { accent-color: var(--ink); }

/* Article text, figures and tables */
.record-content p, .theory p, .theory-row p { font: 400 18px/2 var(--display); color: #23292D; }
.record-content h2, .theory h2 { font: 700 26px/1.5 var(--display) !important; margin-top: 40px !important; }
.evidence-fig { background: var(--panel) !important; border: 0 !important; border-radius: 4px !important; padding: 16px !important; box-shadow: none !important; }
.evidence-fig figcaption, figcaption, .figcap { font: 400 14.5px/1.85 var(--sans) !important; color: var(--ink-2) !important; }
.fig-no { font-weight: 600 !important; color: var(--ink) !important; }
.facts { border: 1px solid var(--rule) !important; border-radius: 4px !important; background: #fff !important; }
.facts dt { color: var(--ink-3) !important; font: 400 13px/1.5 var(--sans) !important; }
.facts dd { color: var(--ink) !important; font: 600 15.5px/1.5 var(--sans) !important; }
.datatable { font-family: var(--sans) !important; border-collapse: collapse !important; }
.datatable th, .datatable td { border-color: var(--rule) !important; }
.datatable thead th { background: var(--panel) !important; color: var(--ink) !important; font-weight: 600 !important; }
.datatable tbody tr:hover { background: #F8F9FA !important; }
.formula, .mathline { background: var(--panel) !important; border: 0 !important; border-inline-start: 3px solid var(--ink) !important; border-radius: 0 !important; color: var(--ink) !important; font-family: var(--sans) !important; }
.sources a, .crosslinks a, .tool-links a { border: 1px solid var(--rule) !important; border-radius: 999px !important; background: #fff !important; color: var(--ink) !important; }
.sidebox { background: var(--panel) !important; border: 0 !important; border-radius: 4px !important; box-shadow: none !important; }
.sidebox h2 { font: 600 15px/1.6 var(--sans) !important; color: var(--ink-3) !important; margin: 0 0 8px !important; }
.sidebox a { color: var(--petrol) !important; }
.text-link, .record-content a, .theory a, .crumb a { color: var(--petrol) !important; text-decoration: underline !important; text-decoration-color: rgba(30,84,102,.4) !important; text-underline-offset: 4px; }

/* Cards, panels and charts in tool pages */
.card, .map-card, .calc, .kpi, .sim-side, .sim-form, .data-grid > *, .plate, .spec, .slider-box { background: #fff !important; border: 1px solid var(--rule) !important; border-radius: 4px !important; box-shadow: none !important; }
.kpi dt, .kpi .label, .kpis dt { color: var(--ink-3) !important; }
.kpi dd, .kpi .value, .kpis dd { color: var(--ink) !important; font-family: var(--sans) !important; }
.card-head, .section-head h2 { color: var(--ink) !important; }
.demo-band, .tools-band, .talk-stage, .front-hero { background: var(--panel) !important; color: var(--ink) !important; }
.demo-band *, .tools-band * { color: inherit; }
.demo-band h2, .tools-band h2 { color: var(--ink) !important; }
.demo-status, .light-link { color: var(--ink-2) !important; }

/* Notes about the newer release shown on pages whose data predate it */
.v3-note { max-width: 760px; margin: 0 auto 24px; padding: 12px 16px; background: var(--panel); border-inline-start: 3px solid var(--ink); font: 400 14.5px/1.8 var(--sans); color: var(--ink-2); }

/* Corrections to the original layout rules */
.topbar .nav { height: auto !important; justify-content: flex-start !important; gap: 4px 26px !important; flex: 0 1 auto; }
.topbar .brand span { white-space: nowrap; }
.atlas-wrap, .record-top .atlas-wrap { border: 0 !important; padding-inline-start: 0 !important; }
.record-top { padding: 26px 0 14px !important; }
.record-grid { grid-template-columns: minmax(0, 720px) minmax(200px, 260px) !important; justify-content: center; gap: 56px !important; }
@media (max-width: 980px) { .record-grid { grid-template-columns: 1fr !important; } }
.sidebox a { border-top-color: var(--rule) !important; }
.record-content section + section { margin-top: 64px; }
.record-content .part-head { border-top: 1px solid var(--rule); padding-top: 28px; margin-top: 56px; }
.record-content .part-head:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.record-content .part-head h2 { margin-top: 0 !important; font-size: 30px !important; }
.record-content .part-head p { color: var(--ink-2); font: 400 16px/1.8 var(--sans); margin-top: 6px; }
.record-content h3 { font: 700 21px/1.5 var(--display); margin: 34px 0 10px; }
.part-index { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.part-index a { color: var(--ink) !important; }

/* Experiments index */
.hub-top { padding-bottom: 8px !important; }
.hub-sec { max-width: 980px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 48px); }
.hub-sec[hidden] { display: none; }
.hub-group { margin: 40px 0 6px; font: 600 17px/1.6 var(--sans); color: var(--ink); }
.exp-list { display: grid; gap: 0; }
.exp { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding: 24px 0; border-top: 1px solid var(--rule); align-items: start; }
.exp:last-child { border-bottom: 1px solid var(--rule); }
.exp img { width: 220px; height: 165px; object-fit: cover; border: 1px solid #CFCBC2; background: var(--panel); }
.exp h3 { font: 700 22px/1.5 var(--display); margin: 0 0 6px; }
.exp h3 a { color: var(--ink); text-decoration: none; }
.exp h3 a:hover { color: var(--petrol); text-decoration: underline; text-underline-offset: 5px; }
.exp p { margin: 0 0 8px; }
.exp .cond { display: flex; flex-wrap: wrap; gap: 4px 16px; font: 400 14px/1.7 var(--sans); color: var(--ink-3); margin: 0; }
.exp .cond span { unicode-bidi: isolate; }
.tool-list { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; border-top: 1px solid var(--rule); padding-top: 22px; }
.tool { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; text-decoration: none; color: var(--ink-2); font: 400 15px/1.8 var(--sans); }
.tool img { width: 120px; height: 90px; object-fit: cover; border: 1px solid #CFCBC2; }
.tool b { display: block; font: 600 17px/1.6 var(--sans); color: var(--petrol); }
.tool:hover b { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 700px) {
  .exp { grid-template-columns: 104px 1fr; gap: 14px; padding: 18px 0; }
  .exp img { width: 104px; height: 78px; }
  .exp h3 { font-size: 18.5px; }
  .exp .result { font-size: 15px !important; line-height: 1.85 !important; }
  .exp .cond { font-size: 13px; gap: 2px 12px; }
  .tool-list { grid-template-columns: 1fr; }
  .tool { grid-template-columns: 104px 1fr; }
  .tool img { width: 104px; height: 78px; }
}
.demo-metrics div, .demo-metrics > * { background: #fff !important; color: var(--ink) !important; border: 1px solid var(--rule) !important; border-radius: 4px !important; }
.demo-metrics dt { color: var(--ink-3) !important; }
.demo-metrics dd { color: var(--ink) !important; }
.page-intro .eyebrow { text-align: center; }
.record-content .part-index { margin-bottom: 24px; }

/* Fixed type scale shared with the article page */
.record-top h1, .page-intro h1, main h1 { font-size: 40px !important; line-height: 1.35 !important; }
.record-content h2, .theory h2, .part-head h2 { font-size: 28px !important; }
.record-content h3 { font-size: 21px !important; }
.record-content p, .theory p, .theory-row p { font-size: 18.5px !important; line-height: 2 !important; }
figcaption, .evidence-fig figcaption, .figcap { font-size: 15px !important; line-height: 1.8 !important; }
@media (max-width: 700px) { .record-top h1, .page-intro h1, main h1 { font-size: 30px !important; } .record-content h2, .part-head h2 { font-size: 24px !important; } }
.result-box { background: var(--panel); border-inline-start: 3px solid var(--petrol); padding: 14px 18px; margin: 16px 0 22px; }
.result-box p { margin: 0 !important; font: 500 17px/1.9 var(--sans) !important; color: var(--ink) !important; }
.result-box b { display: block; font: 600 13px/1.6 var(--sans); color: var(--petrol); margin-bottom: 2px; }
details.more { margin: 26px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
details.more > summary { cursor: pointer; padding: 14px 0; font: 600 16px/1.6 var(--sans); color: var(--petrol); list-style-position: inside; }
details.more[open] > summary { border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.filters { max-width: 980px; margin: 4px auto 0; padding: 0 clamp(18px, 4vw, 48px); display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { border: 1px solid #CFCBC2; background: #fff; color: var(--ink-2); border-radius: 999px; padding: 5px 14px; font: 500 14.5px/1.5 var(--sans); }
.filters button[aria-pressed="true"] { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.exp .result { font: 400 16.5px/1.9 var(--sans) !important; color: var(--ink) !important; }
.exp .kind { font: 500 13.5px/1.6 var(--sans) !important; color: var(--petrol) !important; margin: 0 0 2px !important; }
.fig-no { font-weight: 600 !important; color: var(--ink) !important; }
.talk-crumb { margin: 0 !important; font: 500 14.5px/1.6 var(--sans) !important; color: var(--ink-2) !important; }
.talk-crumb b { color: var(--ink); font-weight: 600; }
.talk-crumb a { color: var(--petrol) !important; }
.nw { white-space: nowrap; }
.slide-tabs a { color: var(--ink-2) !important; }
.slide-tabs a[aria-current] { background: var(--petrol) !important; border-color: var(--petrol) !important; color: #fff !important; box-shadow: none !important; }
.seg button[aria-pressed="true"], .view-tools .seg button[aria-pressed="true"] { background: var(--petrol) !important; color: #fff !important; border-color: var(--petrol) !important; }
.timebar .play, button.play { background: var(--petrol) !important; border-color: var(--petrol) !important; color: #fff !important; }
/* Archived experiment pages */
.exp .tag { display: inline-block; margin-inline-start: 10px; padding: 0 8px; border: 1px solid #B9CDD3; border-radius: 999px; font: 500 12px/1.7 var(--sans); color: var(--petrol); background: #EEF4F5; }
.seed-grid .step-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.seed-grid .step-btns button { border: 1px solid #CFCBC2; background: #fff; color: var(--ink-2); border-radius: 999px; padding: 4px 14px; font: 500 14.5px/1.5 var(--sans); cursor: pointer; }
.seed-grid .step-btns button[aria-pressed="true"] { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.seed-maps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.seed-map { margin: 0; }
.seed-map img { width: 100%; height: auto; aspect-ratio: 1; border: 1px solid #CFCBC2; background: var(--panel); }
.seed-map figcaption { font: 500 14px/1.7 var(--sans) !important; color: var(--ink-2); margin-top: 4px; display: flex; justify-content: space-between; gap: 6px; }
.seed-grid > figcaption { margin-top: 14px; }
.datatable tr.sum th, .datatable tr.sum td { font-weight: 600; border-top: 2px solid var(--rule); }
@media (max-width: 700px) { .seed-maps { grid-template-columns: 1fr 1fr; } }
.curve-title { margin: 0 0 6px !important; font: 600 15px/1.6 var(--sans) !important; color: var(--ink) !important; }
.curve-box { width: 100%; direction: ltr; }
.curve-box svg { display: block; max-width: 100%; height: auto; }
.curve-box .bg { fill: #fff; }
.curve-box .grid { stroke: #E6E3DC; }
.curve-box .tick { fill: var(--ink-2); font: 400 13px var(--sans); }
.curve-box .axis { fill: var(--ink-2); font: 500 13px var(--sans); }
.curve-box .band { fill: #DAD6CD; opacity: .75; }
.curve-box .run { fill: none; stroke-width: 1.4; opacity: .9; }
.curve-box .mean { fill: none; stroke: var(--ink); stroke-width: 2.4; }
.curve-box .cursor { stroke: var(--oxide); stroke-width: 1.2; stroke-dasharray: 4 3; }
.curve-key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0 !important; font: 400 14px/1.7 var(--sans) !important; color: var(--ink-2) !important; }
.curve-key i { display: inline-block; width: 16px; height: 3px; margin-inline-end: 6px; vertical-align: middle; }
.curve-key i.k-mean { background: var(--ink); height: 4px; }
.curve-key i.k-band { background: #DAD6CD; height: 10px; }
