/* Site theme, matched to the XMARK promo video: near-black stage with violet / teal / pink light, coarse film grain,
   Inter Display headlines with gradient key words, JetBrains Mono labels, translucent glass tiles, a scroll-progress line.
   Loaded last on every page. Data colours (risk orange/teal, H&E-read blue, cell-role hues) are untouched. */
@font-face { font-family: "Inter Display"; src: url("fonts/InterDisplay-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
:root {
  --page: #05060b; --panel: rgba(255, 255, 255, .05); --hair: rgba(255, 255, 255, .10);
  --text: #eef0f7; --text-2: rgba(238, 240, 247, .70); --text-3: rgba(238, 240, 247, .48);
  --display: "Inter Display", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", "DejaVu Sans Mono", ui-monospace, monospace;
  --tile: rgba(255, 255, 255, .04); --tile-edge: inset 0 0 0 1px rgba(255, 255, 255, .10);
  --lift: 0 40px 110px -50px rgba(0, 0, 0, .8);
  --grad: linear-gradient(90deg, #a99bff, #6aa2ff 50%, #46e6c8);
}
body {
  background:
    radial-gradient(1500px 1100px at 88% -12%, rgba(143, 125, 255, .17), transparent 60%),
    radial-gradient(1200px 900px at -10% 105%, rgba(47, 217, 187, .11), transparent 60%),
    radial-gradient(1000px 800px at 15% 18%, rgba(255, 111, 168, .06), transparent 60%),
    #05060b;
  background-attachment: fixed;
}
/* film grain: soft analog noise generated at display resolution (fractal noise, greyscale, normal blend) */
body::after {
  content: ""; position: fixed; inset: -50%; pointer-events: none; z-index: 90; opacity: .11;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='g' x='0' y='0'><feTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/><feComponentTransfer><feFuncR type='linear' slope='2.2' intercept='-.6'/><feFuncG type='linear' slope='2.2' intercept='-.6'/><feFuncB type='linear' slope='2.2' intercept='-.6'/></feComponentTransfer></filter><rect width='100%25' height='100%25' filter='url(%23g)'/></svg>");
  background-size: 300px 300px;
}

/* type */
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -0.032em; color: var(--text); }
h1 { line-height: 1.02; }
.gw { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .12em; }
.eyebrow { font-family: var(--mono) !important; font-size: 11.5px !important; letter-spacing: .19em !important; text-transform: uppercase; color: var(--text-2) !important; }
.wordmark { font-family: var(--mono); font-weight: 500; letter-spacing: .24em; font-size: 13px; display: inline-flex; align-items: center; gap: 11px; }
.wordmark .logo { height: 26px; width: auto; display: block; flex: none; }
.nav-links a { font-family: var(--mono); text-transform: uppercase; letter-spacing: .16em; font-size: 11.5px; }
.nums b, .g-head b, .ev-strip b, .at-stats b, .ev-facts b, .num { font-family: var(--display); font-weight: 600; letter-spacing: -.03em; }
.seg button { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }
.tag, .ch-n, .scalebar span { font-family: var(--mono); }

/* tiles */
.ch, .card, .at-stats div, .at-map, .at-right, .at-multi figure, .km, .ev-facts div, .verdict {
  background: var(--tile) !important; box-shadow: var(--tile-edge), var(--lift) !important; border-radius: 24px;
}
.card { padding: 12px 12px 18px; transition: transform .25s cubic-bezier(.2, .7, .2, 1), background .25s; }
.card:hover, .ch:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .065) !important; }
.viewer, .card .img, .ch-img, .maps canvas, .slide-view { box-shadow: 0 40px 110px -45px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .10) !important; }

/* controls */
.seg { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .12); backdrop-filter: blur(12px); }
.seg button.on { background: rgba(255, 255, 255, .12); color: var(--text); }
.menu { background: rgba(14, 15, 24, .94) !important; backdrop-filter: blur(16px); box-shadow: var(--tile-edge), 0 24px 60px -20px rgba(0, 0, 0, .8) !important; }
.at-tools input { background: rgba(255, 255, 255, .05); }
.code { background: rgba(0, 0, 0, .42) !important; box-shadow: var(--tile-edge) !important; }
/* top bar: clear at the top of the page, frosted once the page scrolls (theme.js adds .stuck) */
.nav, .nav.solid { background: transparent; transition: background .3s ease, box-shadow .3s ease, padding .3s ease, backdrop-filter .3s ease; }
.nav.stuck {
  background: rgba(8, 9, 15, .72); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 12px 40px -20px rgba(0, 0, 0, .8); padding-top: 14px; padding-bottom: 14px;
}
.detail-ov { background: rgba(5, 6, 11, .97) !important; }
.ov-bar { background: linear-gradient(180deg, rgba(5, 6, 11, .98), rgba(5, 6, 11, 0)) !important; }
.cta { background: var(--text); }

/* scroll-progress line along the bottom edge, as in the video */
.progress { position: fixed; left: 0; bottom: 0; height: 2px; width: 0; z-index: 91; background: var(--grad); opacity: .85; pointer-events: none; }

/* two-column page head: title on the left, the page's own figure or summary on the right (biomarkers, composer, atlas, evidence) */
.g-head.hx { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); column-gap: 72px; align-items: end; padding-top: 132px; }
.g-head.hx h1 { margin-bottom: 0; }
.g-head.hx .g-main p { margin-top: 22px; }
.g-head.hx p.g-aside { justify-self: end; max-width: 600px; padding-bottom: 6px; }
@media (max-width: 1000px) {
  .g-head.hx { grid-template-columns: 1fr; }
  .g-head.hx .g-aside { margin-top: 26px; justify-self: start !important; }
}

/* narrow screens: menu button and a frosted drop-down for the links (theme.js) */
.nav-toggle { display: none; }
@media (max-width: 820px) {
  .nav { padding: 16px 20px; }
  .nav-toggle { display: grid; place-content: center; gap: 6px; width: 40px; height: 40px; border: 0; border-radius: 12px; cursor: pointer;
    background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); pointer-events: auto; }
  .nav-toggle i { display: block; width: 16px; height: 1.5px; background: var(--text); border-radius: 1px; transition: transform .3s; }
  .nav.open .nav-toggle i:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav.open .nav-toggle i:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .nav-links { position: absolute; top: calc(100% + 6px); right: 16px; left: 16px; flex-direction: column; gap: 0; padding: 8px;
    border-radius: 18px; background: rgba(10, 11, 18, .92); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10), 0 30px 60px -20px rgba(0, 0, 0, .8);
    opacity: 0; transform: translateY(-6px); pointer-events: none !important; transition: opacity .25s, transform .25s; }
  .nav.open .nav-links { opacity: 1; transform: none; pointer-events: auto !important; }
  .nav-links a { padding: 14px 14px; border-radius: 10px; font-size: 12.5px; }
  .nav-links a:hover, .nav-links a.cur { background: rgba(255, 255, 255, .06); }
  .nav.stuck { padding-top: 12px; padding-bottom: 12px; }
}

/* ---- citation footer on every page (theme.js) ---- */
.site-foot { margin-top: 40px; border-top: 1px solid var(--hair); background: linear-gradient(180deg, rgba(255, 255, 255, .015), transparent 70%); }
.sf-in { max-width: 1480px; margin: 0 auto; padding: 54px 40px 40px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .6fr) minmax(0, 1.35fr); gap: 56px; align-items: start; }
.sf-mark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.sf-mark img { width: 24px; height: 24px; }
.sf-title { margin: 16px 0 10px; font-family: var(--display); font-size: 19px; line-height: 1.32; letter-spacing: -.015em; color: var(--text); max-width: 460px; }
.sf-auth { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--text-2); }
.sf-auth small { color: var(--text-3); font-size: 12px; }
.sf-name { white-space: nowrap; }
.sf-auth sup { font-size: .7em; color: #a9b6ff; margin-left: 1px; }
.sf-auth small { display: inline-block; margin-top: 8px; }
.sf-tbd { color: var(--text-3); font-style: italic; }
.sf-aff { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-3); }
.sf-lab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.sf-links { display: flex; flex-direction: column; gap: 11px; }
.sf-links .sf-lab { margin-bottom: 4px; }
.sf-links a { color: var(--text-2); text-decoration: none; font-size: 14.5px; transition: color .2s; width: fit-content; }
.sf-links a:hover { color: var(--text); }
.sf-links a span { color: var(--text-3); }
.sf-cite pre { margin: 0; padding: 16px 18px; border-radius: 14px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px var(--hair);
  font-family: var(--mono); font-size: 12px; line-height: 1.65; color: #cfd3e6; white-space: pre-wrap; word-break: break-word; }
.sf-copy { font: inherit; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); background: rgba(255, 255, 255, .05);
  border: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); padding: 6px 11px; border-radius: 999px; cursor: pointer; transition: color .2s, background .2s; }
.sf-copy:hover { color: var(--text); background: rgba(255, 255, 255, .09); }
.sf-copy.ok { color: #6ff0d6; box-shadow: inset 0 0 0 1px rgba(70, 230, 200, .45); }
.sf-base { max-width: 1480px; margin: 0 auto; padding: 18px 40px 34px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, .05); font-size: 12px; color: var(--text-3); }
.sf-base a { color: var(--text-3); text-decoration: none; } .sf-base a:hover { color: var(--text); }
/* buttons to the paper and the code (index hero and Run it); a link without a URL stays hidden */
[data-link][hidden] { display: none !important; }
.xl-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.xl-links a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; font-size: 13.5px; text-decoration: none; color: var(--text);
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); transition: background .2s, box-shadow .2s; }
.xl-links a:hover { background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .26); }
.xl-links a.pri { background: #eef0f7; color: #07080d; box-shadow: none; font-weight: 600; }
.xl-links a.pri:hover { background: #fff; }
.xl-links svg { width: 15px; height: 15px; fill: currentColor; }
@media (max-width: 1000px) { .sf-in { grid-template-columns: 1fr 1fr; gap: 36px; } .sf-cite { grid-column: 1 / -1; } }
@media (max-width: 640px) { .sf-in { grid-template-columns: 1fr; padding: 40px 20px 28px; } .sf-base { padding: 16px 20px 28px; } }
