/* ============================================================
   ENHANCED AXIS — DESIGN SYSTEM
   Editorial-scientific: near-black ground, warm ivory type,
   cobalt for signal, orange used sparingly for emphasis.
   ============================================================ */

:root {
  /* Ground */
  --bg: #0a0a0b;
  --bg-2: #0f0f11;
  --surface: #131316;
  --surface-2: #18181c;
  --line: rgba(237, 230, 214, 0.10);
  --line-2: rgba(237, 230, 214, 0.18);

  /* Type */
  --ivory: #ede6d6;
  --ivory-2: #c9c2b2;
  --muted: #8e897e;
  --faint: #5c5951;

  /* Signal */
  --cobalt: #3d63ff;
  --cobalt-2: #6f8cff;
  --cobalt-dim: rgba(61, 99, 255, 0.14);
  --orange: #e8743b;
  --orange-dim: rgba(232, 116, 59, 0.14);

  /* Type families */
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Layout */
  --max: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 4px;
  --header-h: 68px;

  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--cobalt); color: #fff; }

/* Fine grain + faint coordinate grid over the whole page */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
  opacity: .35;
}
main, header, footer { position: relative; z-index: 1; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Type primitives ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before {
  content: ""; width: 28px; height: 1px; background: var(--cobalt);
}
.eyebrow.orange::before { background: var(--orange); }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(44px, 7vw, 92px); line-height: .98; letter-spacing: -0.03em; }
h2 { font-size: clamp(34px, 4.6vw, 58px); line-height: 1.04; letter-spacing: -0.025em; }
h3 { font-size: 24px; line-height: 1.2; }
h1 em, h2 em { font-style: italic; color: var(--ivory-2); }
.accent-cobalt { color: var(--cobalt-2); }
.lead { font-size: clamp(17px, 1.4vw, 19.5px); color: var(--ivory-2); max-width: 60ch; }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); }
.small { font-size: 13.5px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--line-2);
  display: inline-flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 22px;
  border: 1px solid var(--b); border-radius: var(--radius);
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase;
  background: transparent; cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease), color .25s, transform .25s var(--ease);
  white-space: nowrap;
}
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn:hover { border-color: var(--ivory-2); }
.btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn-primary:hover { background: #2f54ee; border-color: #2f54ee; }
.btn-ivory { background: var(--ivory); border-color: var(--ivory); color: #0a0a0b; }
.btn-ivory:hover { background: #fff; border-color: #fff; }
.btn-sm { height: 40px; padding: 0 16px; font-size: 11.5px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(10, 10, 11, .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-family: var(--serif); font-size: 21px; letter-spacing: -0.01em; line-height: 1; }
.brand-name span { font-style: italic; color: var(--ivory-2); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  font-size: 14px; color: var(--ivory-2); padding: 8px 12px; border-radius: var(--radius);
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--ivory); background: rgba(237,230,214,.05); }
.header-cta { margin-left: 8px; }
.menu-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px;
  background: none; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer;
  position: relative;
}
.menu-toggle span {
  position: absolute; left: 12px; right: 12px; height: 1px; background: var(--ivory);
  transition: transform .3s var(--ease), opacity .2s;
}
.menu-toggle span:nth-child(1) { top: 17px; }
.menu-toggle span:nth-child(2) { top: 26px; }
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { transform: translateY(-4.5px) rotate(-45deg); }

@media (max-width: 1080px) {
  .nav, .header-cta { display: none; }
  .menu-toggle { display: block; }
  .menu-open .nav {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: var(--bg); padding: 16px var(--gutter) 40px; overflow-y: auto;
    border-top: 1px solid var(--line);
  }
  .menu-open .nav a {
    font-family: var(--serif); font-size: 28px; color: var(--ivory);
    padding: 14px 0; border-bottom: 1px solid var(--line); border-radius: 0;
  }
  .menu-open .nav a:hover { background: none; }
  .menu-open .nav .nav-cta-mobile { display: inline-flex; margin-top: 24px; font-family: var(--mono); font-size: 12.5px; color: #fff; justify-content: center; border-bottom: 0; }
}
.nav .nav-cta-mobile { display: none; }

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding: clamp(80px, 11vw, 150px) 0; }
.section-tight { padding: clamp(60px, 8vw, 100px) 0; }
.section-head { display: grid; grid-template-columns: 1fr; gap: 22px; margin-bottom: clamp(40px, 6vw, 72px); max-width: 820px; }
.section-head.split { max-width: none; grid-template-columns: 1.1fr .9fr; align-items: end; gap: 40px; }
.section-head.split .lead { margin: 0; }
@media (max-width: 860px) { .section-head.split { grid-template-columns: 1fr; gap: 22px; } }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Mono "figure" label like a journal plate */
.fig {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; gap: 16px;
}
.fig b { color: var(--ivory-2); font-weight: 500; }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 7vw, 96px) 0 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 4vw, 64px); align-items: center; }
.hero h1 { margin: 26px 0 28px; font-size: clamp(42px, 5.2vw, 78px); }
.hero h1 .line { display: block; }
@media (min-width: 961px) { .hero h1 .line { white-space: nowrap; } }
.hero .lead { margin-bottom: 38px; }
.hero-meta {
  margin-top: 46px; display: flex; flex-wrap: wrap; gap: 28px 40px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.hero-meta div { display: flex; align-items: center; gap: 10px; }
.hero-meta i { width: 6px; height: 6px; border-radius: 50%; background: var(--cobalt); display: inline-block; }
.hero-meta div:nth-child(2) i { background: var(--orange); }
.hero-meta div:nth-child(3) i { background: var(--ivory-2); }

.specimen {
  position: relative; aspect-ratio: 1 / 1.02; width: 100%;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background:
    radial-gradient(ellipse 70% 60% at 55% 45%, rgba(61,99,255,.13), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  overflow: hidden;
}
.specimen canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.specimen .fig { position: absolute; left: 18px; right: 18px; z-index: 2; }
.specimen .fig.top { top: 16px; }
.specimen .fig.bottom { bottom: 16px; }
.specimen .corner { position: absolute; width: 14px; height: 14px; border-color: var(--ivory-2); border-style: solid; opacity: .5; z-index: 2; }
.specimen .c-tl { top: 44px; left: 18px; border-width: 1px 0 0 1px; }
.specimen .c-tr { top: 44px; right: 18px; border-width: 1px 1px 0 0; }
.specimen .c-bl { bottom: 44px; left: 18px; border-width: 0 0 1px 1px; }
.specimen .c-br { bottom: 44px; right: 18px; border-width: 0 1px 1px 0; }
.specimen .legend {
  position: absolute; right: 18px; top: 58px; z-index: 2;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  display: grid; gap: 6px; text-align: right;
}
.specimen .legend span::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 8px; vertical-align: 0; }
.specimen .legend .c::after { background: var(--ivory); }
.specimen .legend .o::after { background: var(--orange); }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .specimen { aspect-ratio: 1 / .85; max-width: 620px; }
}

/* Ticker */
.ticker {
  margin-top: clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; white-space: nowrap; position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track { display: inline-flex; animation: ticker 60s linear infinite; }
.ticker-track span {
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  padding: 18px 28px; display: inline-flex; align-items: center; gap: 28px;
}
.ticker-track span::after { content: "◇"; color: var(--cobalt); font-size: 10px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Method (principles) ---------- */
.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.method-card {
  padding: 32px 28px 36px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  position: relative; transition: background .35s var(--ease);
}
.method-card:hover { background: rgba(237,230,214,.025); }
.method-card .num { font-family: var(--mono); font-size: 12px; color: var(--cobalt-2); letter-spacing: .1em; }
.method-card h3 { margin: 52px 0 14px; font-size: 25px; }
.method-card p { font-size: 15px; color: var(--ivory-2); margin: 0; }
.method-card .glyph { position: absolute; top: 28px; right: 26px; width: 34px; height: 34px; color: var(--faint); transition: color .35s; }
.method-card:hover .glyph { color: var(--orange); }
@media (max-width: 1000px) { .method-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .method-grid { grid-template-columns: 1fr; } .method-card h3 { margin-top: 32px; } }

/* ---------- Disciplines ---------- */
.disciplines { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.disc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.disc-item {
  display: grid; grid-template-columns: 70px 1fr 1.2fr 40px; gap: 24px; align-items: baseline;
  padding: 26px 0; border-bottom: 1px solid var(--line); position: relative; cursor: default;
}
.disc-item::before {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0; background: var(--cobalt);
  transition: width .6s var(--ease);
}
.disc-item:hover::before { width: 100%; }
.disc-item .idx { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.disc-item h3 { font-size: clamp(24px, 2.6vw, 34px); transition: transform .4s var(--ease), color .3s; }
.disc-item:hover h3 { transform: translateX(8px); }
.disc-item p { margin: 0; font-size: 15px; color: var(--muted); transition: color .3s; }
.disc-item:hover p { color: var(--ivory-2); }
.disc-item .tag { font-family: var(--mono); font-size: 11px; color: var(--faint); text-align: right; }
@media (max-width: 760px) {
  .disc-item { grid-template-columns: 44px 1fr; gap: 6px 16px; }
  .disc-item p { grid-column: 2; }
  .disc-item .tag { display: none; }
}

/* ---------- Library preview ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--ivory-2); cursor: pointer; transition: all .2s;
}
.chip:hover { border-color: var(--ivory-2); color: var(--ivory); }
.chip[aria-pressed="true"] { background: var(--ivory); border-color: var(--ivory); color: #0a0a0b; }
.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.compound {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 22px 22px 20px; display: flex; flex-direction: column; min-height: 250px;
  transition: border-color .3s, transform .4s var(--ease), opacity .3s;
  position: relative; overflow: hidden;
}
.compound:hover { border-color: var(--line-2); transform: translateY(-3px); }
.compound.hidden { display: none; }
.compound .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.compound .cls { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--cobalt-2); }
.compound .status { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.compound h3 { font-size: 27px; margin: 26px 0 6px; }
.compound .alt { font-size: 14px; color: var(--muted); margin: 0; }
.compound .formula { font-family: var(--mono); font-size: 14px; color: var(--ivory-2); margin-top: auto; padding-top: 22px; border-top: 1px dashed var(--line-2); display: flex; justify-content: space-between; }
.compound .formula b { font-weight: 400; }
.compound .formula span { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.compound sub { font-size: .72em; vertical-align: -0.25em; }
.compound .mini-skel { position: absolute; right: -20px; bottom: 54px; width: 150px; opacity: .07; color: var(--ivory); transition: opacity .4s; }
.compound:hover .mini-skel { opacity: .16; }
.lib-foot { margin-top: 32px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
@media (max-width: 960px) { .lib-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .lib-grid { grid-template-columns: 1fr; } }

/* ---------- PK Explorer ---------- */
.pk { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pk-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
.pk-panel { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg); }
.pk-panel .fig { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.pk-chart { padding: 18px 12px 6px 4px; }
.pk-chart svg { width: 100%; height: auto; overflow: visible; }
.pk-controls { display: grid; gap: 26px; margin-top: 34px; }
.ctrl label { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.ctrl output { color: var(--ivory); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--cobalt) var(--p, 50%), var(--line-2) var(--p, 50%)); }
input[type="range"]::-moz-range-track { height: 2px; background: var(--line-2); }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--cobalt); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -7px; border-radius: 50%; background: var(--ivory); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--ivory); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ivory); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--ivory); }
input[type="range"]:focus-visible { outline: 1px dashed var(--cobalt-2); outline-offset: 4px; }
.pk-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.pk-stat { padding: 16px 18px; border-right: 1px solid var(--line); }
.pk-stat:last-child { border-right: 0; }
.pk-stat .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pk-stat .v { font-family: var(--serif); font-size: 32px; line-height: 1.1; margin-top: 6px; }
.pk-stat .v small { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: 4px; }
.pk-note { font-size: 13px; color: var(--muted); margin-top: 18px; }
.axis-text { font-family: var(--mono); font-size: 10px; fill: var(--muted); letter-spacing: .06em; }
@media (max-width: 960px) { .pk-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .pk-stat .v { font-size: 24px; } .pk-stat { padding: 14px 12px; } }

/* ---------- Research / articles ---------- */
.articles { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; }
.article {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: var(--surface);
  display: flex; flex-direction: column; min-height: 320px; transition: border-color .3s;
}
.article:hover { border-color: var(--line-2); }
.article.feature { background: linear-gradient(160deg, rgba(61,99,255,.16), var(--surface) 55%); }
.article .meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.article .meta .cat { color: var(--cobalt-2); }
.article h3 { margin: auto 0 14px; padding-top: 48px; font-size: 26px; }
.article.feature h3 { font-size: clamp(28px, 2.8vw, 38px); }
.article p { font-size: 15px; color: var(--ivory-2); margin: 0; }
.article .more { margin-top: 22px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 960px) { .articles { grid-template-columns: 1fr 1fr; } .article.feature { grid-column: 1 / -1; } }
@media (max-width: 600px) { .articles { grid-template-columns: 1fr; } .article { min-height: 260px; } }

/* ---------- Product blocks (guide / playbook / consult) ---------- */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 90px); align-items: center; }
.product.reverse .product-visual { order: 2; }
.product h2 { margin: 22px 0 22px; }
.price-line { display: flex; align-items: baseline; gap: 16px; margin: 30px 0 28px; flex-wrap: wrap; }
.price { font-family: var(--serif); font-size: 64px; line-height: 1; letter-spacing: -0.03em; }
.price-note { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.spec-list { list-style: none; padding: 0; margin: 28px 0 0; border-top: 1px solid var(--line); }
.spec-list li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; color: var(--ivory-2); }
.spec-list li span { font-family: var(--mono); font-size: 11px; color: var(--cobalt-2); padding-top: 4px; }
@media (max-width: 900px) {
  .product { grid-template-columns: 1fr; }
  .product.reverse .product-visual { order: 0; }
}

/* ---------- Publication mockups (real cover artwork, never altered) ---------- */
/* Shared stage: soft cobalt halo + floor shadow */
.pub-stage {
  position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1;
  perspective: 1800px;
}
.pub-stage::before {
  content: ""; position: absolute; inset: 8%;
  background: radial-gradient(circle at 50% 45%, var(--glow, rgba(61,99,255,.20)), transparent 62%);
  filter: blur(10px); pointer-events: none;
}
.pub-stage::after {
  content: ""; position: absolute; left: 22%; right: 18%; bottom: 7%; height: 7%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.75), transparent 70%);
  filter: blur(8px); pointer-events: none;
}
.pub-stage.orange { --glow: rgba(232,116,59,.16); }

/* Hardcover book — the cover image is shown at its own aspect ratio, uncropped */
.book3d {
  --w: 300px; --t: 28px; --ar: 1055 / 1491;
  position: relative; z-index: 1; width: min(var(--w), 64%); aspect-ratio: var(--ar);
  transform-style: preserve-3d;
  transform: rotateY(-26deg) rotateX(2deg);
  transition: transform 1.1s var(--ease);
}
.pub-stage:hover .book3d, .shelf-item:hover .book3d { transform: rotateY(-12deg) rotateX(1deg) translateY(-6px); }
.book3d > * { position: absolute; }
.book3d .cover {
  inset: 0; transform: translateZ(calc(var(--t) / 2));
  border-radius: 2px 5px 5px 2px; overflow: hidden; background: #000;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset;
}
.book3d .cover img { width: 100%; height: 100%; display: block; object-fit: fill; }
/* hinge crease + faint gloss: lighting on the mockup, not edits to the art */
.book3d .cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.38) 0, rgba(255,255,255,.10) 1.6%, rgba(0,0,0,.16) 3.2%, transparent 6.5%),
    linear-gradient(118deg, transparent 38%, rgba(255,255,255,.07) 48%, transparent 58%);
}
.book3d .pages {
  top: 1.2%; bottom: 1.2%; right: 0; width: var(--t);
  transform-origin: right center; transform: translateZ(calc(var(--t) / 2)) rotateY(-90deg) translateX(0);
  background:
    linear-gradient(90deg, rgba(0,0,0,.25), transparent 30%, transparent 70%, rgba(0,0,0,.18)),
    repeating-linear-gradient(90deg, #ece5d4 0 1px, #d6cfbe 1px 2px);
}
.book3d .spine {
  top: 0; bottom: 0; left: 0; width: var(--t);
  transform-origin: left center; transform: translateZ(calc(var(--t) / 2)) rotateY(90deg);
  background: linear-gradient(90deg, #050507, #121216 50%, #050507);
}
.book3d .back {
  inset: 0; transform: translateZ(calc(var(--t) / -2)) rotateY(180deg);
  background: #070709; border-radius: 5px 2px 2px 5px;
  box-shadow: -40px 50px 80px -30px rgba(0,0,0,.9);
}

/* Free guide — loose printed field guide, real cover on top */
.doc-stack { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; }
.doc {
  position: absolute; z-index: 1; width: 56%; aspect-ratio: 1055 / 1491; border-radius: 2px;
  background: #ece6d8; box-shadow: 0 30px 60px -22px rgba(0,0,0,.75), 0 0 0 1px rgba(0,0,0,.06);
  transition: transform .9s var(--ease);
}
.doc.d3 { transform: rotate(-10deg) translate(-15%, 3%); background: #d4cdbd; }
.doc.d2 { transform: rotate(-4deg) translate(-6%, 1%); background: #e0d9c9; }
.doc.d1 { transform: rotate(4deg) translate(8%, -1%); overflow: hidden; }
.doc.d1 img { width: 100%; height: 100%; display: block; object-fit: fill; }
.doc.d1::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(125deg, rgba(255,255,255,.10), transparent 35%, transparent 70%, rgba(0,0,0,.08)); }
.doc-stack:hover .d3 { transform: rotate(-14deg) translate(-25%, 4%); }
.doc-stack:hover .d2 { transform: rotate(-6deg) translate(-12%, 2%); }
.doc-stack:hover .d1 { transform: rotate(6deg) translate(13%, -2%); }
.doc-tag {
  position: absolute; z-index: 2; right: 8%; bottom: 13%;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px; color: var(--ivory-2);
}

/* Publication catalogue code next to eyebrows */
.pub-code { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-left: 12px; }

@media (max-width: 600px) { .pub-code { display: none; } }

/* Publications shelf (overview of all three) */
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.shelf-item {
  border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--surface), var(--bg));
  padding: 28px 24px 24px; display: flex; flex-direction: column; transition: border-color .3s;
}
.shelf-item:hover { border-color: var(--line-2); }
.shelf-item .pub-stage { aspect-ratio: 1 / 1.05; }
.shelf-item .book3d { --w: 200px; width: min(var(--w), 62%); }
.shelf-item .doc-stack { aspect-ratio: 1 / 1.05; }
.shelf-item .doc { width: 52%; }
.shelf-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.shelf-meta .p { color: var(--ivory); }
.shelf-meta .p.tbc { color: var(--orange); }
.shelf-item h3 { font-size: 23px; margin-top: 12px; }
.shelf-item .go { margin-top: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--cobalt-2); }
@media (max-width: 900px) { .shelf { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }

/* ---------- Official logo ---------- */
.brand-logo { width: 40px; height: 40px; border-radius: 50%; display: block; object-fit: cover; box-shadow: 0 0 0 1px rgba(237,230,214,.08); }
.site-footer .brand-logo { width: 72px; height: 72px; }
.logo-plate {
  position: relative; margin-top: 44px; aspect-ratio: 1 / 1; max-width: 360px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: radial-gradient(circle at 50% 50%, rgba(61,99,255,.12), transparent 65%), var(--bg-2);
  display: grid; place-items: center; overflow: hidden;
}
.logo-plate img { width: 62%; border-radius: 50%; position: relative; z-index: 1; box-shadow: 0 30px 60px -20px rgba(0,0,0,.8); }
.logo-plate .orbit { position: absolute; inset: 12%; border: 1px dashed rgba(237,230,214,.12); border-radius: 50%; animation: spin 60s linear infinite; }
.logo-plate .orbit::before { content: ""; position: absolute; top: 50%; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.logo-plate .orbit.o2 { inset: 4%; border-style: solid; border-color: rgba(61,99,255,.18); animation-duration: 90s; animation-direction: reverse; }
.logo-plate .orbit.o2::before { background: var(--cobalt-2); top: -4px; left: 50%; }
.logo-plate .fig { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 2; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .logo-plate .orbit { animation: none; } }

/* Consult */
.consult-card { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.consult-card .head { padding: 26px 28px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.consult-card .head .fig { flex-direction: column; gap: 6px; }
.consult-cols { display: grid; grid-template-columns: 1fr 1fr; }
.consult-cols > div { padding: 24px 28px 28px; }
.consult-cols > div + div { border-left: 1px solid var(--line); }
.consult-cols h4 { margin: 0 0 14px; font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.consult-cols .is h4 { color: var(--cobalt-2); }
.consult-cols .isnt h4 { color: var(--orange); }
.consult-cols ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.consult-cols li { font-size: 15px; color: var(--ivory-2); padding-left: 22px; position: relative; }
.consult-cols .is li::before { content: "+"; position: absolute; left: 0; color: var(--cobalt-2); font-family: var(--mono); }
.consult-cols .isnt li::before { content: "–"; position: absolute; left: 0; color: var(--orange); font-family: var(--mono); }
@media (max-width: 560px) { .consult-cols { grid-template-columns: 1fr; } .consult-cols > div + div { border-left: 0; border-top: 1px solid var(--line); } }

.timer { display: flex; align-items: center; gap: 14px; }
.timer svg { width: 54px; height: 54px; }

/* ---------- Resources ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tool {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-height: 210px;
  display: flex; flex-direction: column; background: linear-gradient(180deg, var(--surface), var(--bg));
  position: relative; overflow: hidden;
}
.tool .ico { width: 40px; height: 40px; color: var(--cobalt-2); }
.tool h3 { font-size: 21px; margin: auto 0 8px; padding-top: 30px; }
.tool p { font-size: 14px; color: var(--muted); margin: 0; }
.tool .badge { position: absolute; top: 22px; right: 22px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--orange); }
.tool.live { border-color: rgba(61,99,255,.45); }
.tool.live .badge { color: var(--cobalt-2); }
@media (max-width: 1000px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tools-grid { grid-template-columns: 1fr; } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(36px, 6vw, 90px); }
.about-quote { font-family: var(--serif); font-size: clamp(28px, 3.2vw, 42px); line-height: 1.15; letter-spacing: -0.02em; }
.about-quote em { color: var(--cobalt-2); }
.about-body p { color: var(--ivory-2); }
.commit { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); margin-top: 32px; }
.commit div { padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ivory-2); display: flex; gap: 12px; }
.commit div:nth-child(odd) { padding-right: 18px; }
.commit span { font-family: var(--mono); font-size: 11px; color: var(--orange); padding-top: 4px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .commit { grid-template-columns: 1fr; } }

/* ---------- Newsletter band ---------- */
.newsletter {
  border-top: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 100% at 85% 100%, rgba(61,99,255,.18), transparent 70%),
    radial-gradient(ellipse 40% 80% at 10% 0%, rgba(232,116,59,.07), transparent 70%),
    var(--bg-2);
}
.nl-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: end; }
.nl-grid h2 { margin-top: 20px; }
.nl-box { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 26px; background: rgba(10,10,11,.6); }
.nl-box p { color: var(--ivory-2); font-size: 15px; }
.nl-box .btn { width: 100%; justify-content: center; margin-top: 6px; }
@media (max-width: 860px) { .nl-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 64px 0 40px; background: var(--bg); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.foot-grid h5 { margin: 0 0 16px; font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot-grid a { font-size: 14.5px; color: var(--ivory-2); transition: color .2s; }
.foot-grid a:hover { color: var(--ivory); }
.foot-grid .brand { margin-bottom: 18px; }
.foot-grid .tag { font-size: 14.5px; color: var(--muted); max-width: 34ch; }
.disclaimer {
  margin-top: 56px; padding: 22px 24px; border: 1px solid var(--line); border-left: 2px solid var(--orange);
  border-radius: var(--radius); font-size: 13px; line-height: 1.65; color: var(--muted); background: var(--bg-2);
}
.disclaimer strong { color: var(--ivory-2); font-weight: 500; }
.foot-bottom { margin-top: 28px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:first-child { grid-column: 1 / -1; } }

/* ---------- Setup warnings: visible ONLY in the local preview, never on the public site ---------- */
.setup-mode [data-link-missing], .setup-mode [data-domain-check] { position: relative; }
.setup-mode [data-link-missing]::after, .setup-mode [data-domain-check]::after {
  content: "LINK NEEDED"; position: absolute; top: -9px; right: -6px; z-index: 3;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; padding: 2px 5px; border-radius: 2px;
  background: var(--orange); color: #0a0a0b; pointer-events: none;
}
.setup-mode [data-domain-check]::after { content: "DOMAIN CHECK"; background: #f2c14e; }
[data-link-missing] { cursor: not-allowed; }

/* ---------- Guide bundle ---------- */
.bundle {
  margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(24px, 4vw, 56px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 44px);
  background:
    radial-gradient(ellipse 60% 90% at 25% 50%, rgba(61,99,255,.12), transparent 70%),
    radial-gradient(ellipse 40% 70% at 30% 60%, rgba(232,116,59,.07), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--bg));
  transition: border-color .3s;
}
.bundle:hover { border-color: var(--line-2); }
.bundle-stage { position: relative; aspect-ratio: 1.35 / 1; perspective: 1800px; }
.bundle-stage::after {
  content: ""; position: absolute; left: 14%; right: 10%; bottom: 3%; height: 9%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.75), transparent 70%); filter: blur(8px);
}
.bundle-book { position: absolute; top: 50%; transform-style: preserve-3d; transition: transform 1s var(--ease); }
.bundle-book .book3d { width: 100%; --w: 100%; }
.bundle-book.b1 { left: 10%; width: 40%; transform: translateY(-52%); z-index: 1; }
.bundle-book.b2 { left: 42%; width: 43%; transform: translateY(-48%); z-index: 2; }
.bundle:hover .bundle-book.b1 { transform: translateY(-52%) translateX(-6%); }
.bundle:hover .bundle-book.b2 { transform: translateY(-48%) translateX(5%); }
.bundle:hover .book3d { transform: rotateY(-14deg) rotateX(1deg); }
.bundle-copy h3 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; margin: 20px 0 16px; letter-spacing: -0.02em; }
.bundle-copy h3 em { color: var(--ivory-2); }
.bundle-copy p { color: var(--ivory-2); font-size: 16px; max-width: 46ch; }
.bundle-price { display: flex; align-items: baseline; gap: 14px; margin: 24px 0 24px; flex-wrap: wrap; }
.bundle-price .price { font-size: 56px; }
.bundle-price .was { font-family: var(--serif); font-size: 26px; color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; }
.bundle-price .save { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); border: 1px solid rgba(232,116,59,.4); border-radius: 999px; padding: 4px 10px; }
@media (max-width: 860px) { .bundle { grid-template-columns: 1fr; } .bundle-stage { max-width: 460px; width: 100%; margin: 0 auto; } }

.inline-link { color: var(--ivory-2); border-bottom: 1px solid var(--line-2); transition: color .2s, border-color .2s; }
.inline-link:hover { color: var(--ivory); border-color: var(--cobalt-2); }

/* ---------- Email signup (Systeme.io) ---------- */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.signup-row { display: flex; gap: 10px; max-width: 560px; }
.signup-row input {
  flex: 1; min-width: 0; height: 50px; padding: 0 16px;
  background: var(--bg); color: var(--ivory); font: 16px var(--sans);
  border: 1px solid var(--line-2); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s;
}
.signup-row input::placeholder { color: var(--faint); }
.signup-row input:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-dim); }
.signup-row input[aria-invalid="true"] { border-color: var(--orange); }
.signup-row.stack { flex-direction: column; }
.signup-row.stack input { flex: none; width: 100%; }
.signup-row.stack .btn { width: 100%; justify-content: center; }
.signup-msg { margin: 10px 0 0; min-height: 1.2em; }
.signup-msg.err { color: var(--orange); }
.signup-msg.ok { color: var(--cobalt-2); }
.signup-embed { max-width: 560px; }
@media (max-width: 560px) { .signup-row { flex-direction: column; } .signup-row input { flex: none; width: 100%; } .signup-row .btn { justify-content: center; } }

/* =====================================================================
   COMPOUND RESEARCH LIBRARY
   ===================================================================== */

/* ---------- Library controls ---------- */
.lib-controls { display: grid; gap: 18px; margin-bottom: 30px; }
.lib-search { position: relative; display: flex; align-items: center; max-width: 560px; }
.lib-search svg { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.lib-search input {
  width: 100%; height: 52px; padding: 0 86px 0 46px;
  background: var(--surface); color: var(--ivory); font: 16px var(--sans);
  border: 1px solid var(--line-2); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s;
}
.lib-search input::placeholder { color: var(--faint); }
.lib-search input:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-dim); }
.lib-search input::-webkit-search-cancel-button { display: none; }
.lib-clear {
  position: absolute; right: 8px; height: 36px; padding: 0 12px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-2); border-radius: var(--radius);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  transition: color .2s, border-color .2s;
}
.lib-clear:hover { color: var(--ivory); border-color: var(--ivory-2); }
.lib-count { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.compound.is-live { cursor: pointer; }
.compound.is-live:hover { border-color: var(--cobalt); }
.compound.is-live .formula span { color: var(--cobalt-2); }

/* ---------- Status pills (shared) ---------- */
.sec-st {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 9px; white-space: nowrap; color: var(--muted);
}
.st-ok     { color: #6fd49a; border-color: rgba(111,212,154,.4); }
.st-mixed  { color: #f2c14e; border-color: rgba(242,193,78,.4); }
.st-draft  { color: var(--ivory-2); }
.st-await  { color: var(--orange); border-color: rgba(232,116,59,.35); }
.st-no     { color: var(--orange); border-color: rgba(232,116,59,.4); }

/* ---------- Empty state ---------- */
.empty {
  display: flex; gap: 16px; align-items: flex-start;
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: 22px 24px; background: rgba(232,116,59,.03);
}
.empty-i { flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--orange); }
.empty strong { font-weight: 500; color: var(--ivory); }
.empty p { margin: 6px 0 0; font-size: 14.5px; color: var(--muted); max-width: 64ch; }
.empty-inline { font-size: 14px; color: var(--muted); font-style: italic; padding: 10px 0; }

/* ---------- Profile header ---------- */
#profile { padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(60px, 8vw, 100px); }
.crumbs { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; gap: 10px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--ivory); }
.crumbs b { color: var(--ivory-2); font-weight: 400; }
.c-head { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 4vw, 60px); align-items: center; margin: 26px 0 clamp(40px, 5vw, 64px); }
.c-head:not(:has(.c-specimen)) { grid-template-columns: 1fr; }
.c-head h1 { font-size: clamp(42px, 6vw, 76px); margin: 18px 0 6px; }
.c-sub { font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--ivory-2); margin: 0 0 18px; }
.c-badges { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.c-rev { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.c-alias { margin-top: 16px; font-size: 14px; color: var(--muted); }
.c-alias span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-right: 8px; }
.c-specimen { aspect-ratio: 1 / 1; margin: 0; }
@media (max-width: 920px) { .c-head { grid-template-columns: 1fr; } .c-specimen { max-width: 520px; } }

/* ---------- Chemical identity ---------- */
.idblock { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 20px; }
.idblock .fig { padding: 13px 20px; border-bottom: 1px solid var(--line); }
.idblock dl { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; }
.idblock dl > div { padding: 18px 20px; border-right: 1px solid var(--line); }
.idblock dl > div:last-child { border-right: 0; }
.idblock dt { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
/* Long systematic names (IUPAC, InChIKey) must break inside the cell
   rather than forcing the column wider or spilling over its edge. */
.idblock dd { margin: 8px 0 0; font-size: 15px; color: var(--ivory); line-height: 1.4;
  overflow-wrap: anywhere; word-break: break-word; hyphens: auto; }
.idblock sub { font-size: .72em; vertical-align: -.25em; }
@media (max-width: 1000px) { .idblock dl { grid-template-columns: repeat(2, 1fr); } .idblock dl > div { border-bottom: 1px solid var(--line); } }
@media (max-width: 560px) { .idblock dl { grid-template-columns: 1fr; } .idblock dl > div { border-right: 0; } }

/* ---------- Research-draft notice (one per profile) ---------- */
.draft-notice {
  display: flex; align-items: center; gap: 16px; margin-bottom: 18px;
  border: 1px solid rgba(242,193,78,.32); border-left: 2px solid #f2c14e;
  border-radius: var(--radius); padding: 16px 20px; background: rgba(242,193,78,.05);
}
.dn-tag { flex: none; font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: #f2c14e; border: 1px solid rgba(242,193,78,.45);
  border-radius: 999px; padding: 4px 11px; }
.draft-notice p { margin: 0; font-size: 14.5px; color: var(--ivory-2); }
@media (max-width: 560px) { .draft-notice { flex-direction: column; align-items: flex-start; gap: 10px; } }

/* ---------- In brief (plain-language entry point) ---------- */
.brief { display: grid; grid-template-columns: 1.45fr .55fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 18px; overflow: hidden; }
.brief-main { padding: 26px 28px; }
.brief-what { font-family: var(--serif); font-size: clamp(19px, 1.8vw, 23px); line-height: 1.4; color: var(--ivory); margin: 16px 0 0; max-width: 60ch; }
.brief-points { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.brief-points li { position: relative; padding-left: 22px; font-size: 15.5px; color: var(--ivory-2); }
.brief-points li::before { content: ""; position: absolute; left: 0; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--cobalt); }
.brief-idonly { grid-template-columns: 1fr; }
.brief-idonly .brief-id { border-left: 0; }
.brief-idonly dl { display: grid; grid-template-columns: repeat(3, 1fr); }
.brief-idonly dl > div { border-right: 1px solid var(--line); }
@media (max-width: 760px) { .brief-idonly dl { grid-template-columns: 1fr; } }
.brief-id { border-left: 1px solid var(--line); background: var(--bg-2); }
.brief-id .fig { padding: 13px 20px; border-bottom: 1px solid var(--line); }
.brief-id dl { margin: 0; }
.brief-id dl > div { padding: 13px 20px; border-bottom: 1px solid var(--line); }
.brief-id dl > div:last-child { border-bottom: 0; }
.brief-id dt { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
/* Long systematic names (IUPAC, InChIKey) must break inside the cell
   rather than widening the column or spilling past its edge. */
.brief-id dd { margin: 5px 0 0; font-size: 14px; color: var(--ivory); line-height: 1.45;
  overflow-wrap: anywhere; word-break: break-word; }
.brief-id sub { font-size: .72em; vertical-align: -.25em; }
@media (max-width: 900px) { .brief { grid-template-columns: 1fr; } .brief-id { border-left: 0; border-top: 1px solid var(--line); } }

/* ---------- Reading-mode bar ---------- */
.readbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  border: 1px solid var(--line); border-left: 2px solid var(--cobalt); border-radius: var(--radius);
  padding: 18px 22px; background: var(--bg-2); margin-bottom: 10px; }
.readbar p { margin: 8px 0 0; max-width: 72ch; }
.modes { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; flex: none; }
.modes button { border: 0; background: transparent; cursor: pointer; border-radius: 999px; padding: 8px 16px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); transition: all .2s; }
.modes button:hover { color: var(--ivory); }
.modes button[aria-pressed="true"] { background: var(--ivory); color: #0a0a0b; }

/* Part 07 pointer — visible only in Essentials, so no part is unreachable */
.adv-hidden { display: none; }
#profile[data-mode="essentials"] .adv-hidden {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  border: 1px dashed rgba(232,116,59,.35); border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: clamp(44px, 6vw, 72px); background: rgba(232,116,59,.03);
}
.adv-hidden strong { color: var(--ivory); font-weight: 500; }
.adv-hidden p { margin: 6px 0 0; font-size: 14.5px; color: var(--muted); max-width: 68ch; }
.adv-hidden .btn { flex: none; }

/* Essentials mode hides specialist material */
#profile[data-mode="essentials"] .part[data-level="advanced"],
#profile[data-mode="essentials"] .toc-parts > li[data-level="advanced"],
#profile[data-mode="essentials"] .tech { display: none; }

/* ---------- Parts ---------- */
.part { margin-bottom: clamp(44px, 6vw, 72px); scroll-margin-top: calc(var(--header-h) + 16px); }
.part-head { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start;
  padding-bottom: 20px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.part-n { font-family: var(--serif); font-size: clamp(38px, 4.5vw, 58px); line-height: .85; color: var(--faint); }
.part-head h2 { font-size: clamp(26px, 3vw, 38px); margin: 10px 0 8px; }
.part-blurb { margin: 0; font-size: 15.5px; color: var(--muted); max-width: 70ch; }
.part[data-level="advanced"] .part-n { color: rgba(232,116,59,.45); }
.adv-note { margin: 0 0 16px; padding: 14px 18px; border: 1px dashed rgba(232,116,59,.35);
  border-radius: var(--radius); font-size: 14px; color: var(--muted); background: rgba(232,116,59,.03); }

/* ---------- Plain-language prose ---------- */
.plainwrap { display: grid; gap: 14px; }
.plain { margin: 0; font-size: 16.5px; line-height: 1.68; color: var(--ivory-2); max-width: 74ch; }
.plainwrap .plain:first-child { color: var(--ivory); }
.tech-body p { max-width: 74ch; }
.brief-what + .brief-what { margin-top: 12px; }
.mono-sm { font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.claim-detail { max-width: 74ch; }

/* ---------- Organ-system blocks ---------- */
.sysgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.sysblock { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--bg); }
.sysblock h4 { margin: 0 0 10px; font-family: var(--mono); font-weight: 400; font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--cobalt-2); }
.sysblock .plain { font-size: 15px; }
@media (max-width: 760px) { .sysgrid { grid-template-columns: 1fr; } }

/* ---------- Study cards ---------- */
.study { border: 1px solid var(--line); border-left: 2px solid var(--cobalt); border-radius: var(--radius);
  padding: 18px 20px; background: var(--bg); }
.study header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.study h4 { margin: 0; font-size: 19px; line-height: 1.25; }
.study-meta { display: flex; gap: 28px; flex-wrap: wrap; margin: 14px 0 0; }
.study-meta dt { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.study-meta dd { margin: 4px 0 0; font-size: 14.5px; color: var(--ivory-2); }
.study-part { margin-top: 14px; }
.study-part h5 { margin: 0 0 5px; font-family: var(--mono); font-weight: 400; font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ivory-2); }
.study-part p { margin: 0; font-size: 15px; color: var(--ivory-2); }
.study-part.lim h5 { color: var(--orange); }
.study-part.lim p { color: var(--muted); }

/* ---------- Technical (advanced) blocks ---------- */
.techwrap { display: grid; gap: 8px; }
.tech { border: 1px dashed var(--line-2); border-radius: var(--radius); background: rgba(61,99,255,.04); }
.tech > summary { cursor: pointer; list-style: none; padding: 13px 18px; display: flex; align-items: center;
  gap: 12px; font-size: 15px; color: var(--ivory-2); }
.tech > summary::-webkit-details-marker { display: none; }
.tech > summary:hover { color: var(--ivory); }
.tech-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cobalt-2); border: 1px solid rgba(61,99,255,.4); border-radius: 999px; padding: 3px 9px; flex: none; }
.tech-body { padding: 0 18px 18px; display: grid; gap: 12px; }
.tech-body p { margin: 0; font-size: 15px; color: var(--ivory-2); }

/* In Full detail the advanced material is part of the section, not a widget
   to click. It sits directly under the plain-language text, separated by a
   rule and a cobalt edge, with its label acting as the subheading. */
#profile[data-mode="full"] .techwrap {
  gap: 0; margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line);
}
#profile[data-mode="full"] .tech {
  border: 0; border-left: 2px solid rgba(61,99,255,.45); border-radius: 0;
  background: transparent; padding-left: 16px; margin-top: 16px;
}
#profile[data-mode="full"] .tech > summary { padding: 0 0 8px; gap: 10px; }
#profile[data-mode="full"] .tech > summary::marker { content: ""; }
#profile[data-mode="full"] .tech-body { padding: 0; }
#profile[data-mode="full"] .tech-tag {
  border-color: transparent; background: rgba(61,99,255,.14); color: var(--cobalt-2);
  letter-spacing: .14em; padding: 4px 10px;
}
/* The reader can still collapse an individual block if they want to. */
#profile[data-mode="full"] .tech > summary:hover .tech-tag { background: rgba(61,99,255,.26); }

/* ---------- Figures ---------- */
.cfig { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cfig figcaption { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between;
  gap: 12px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ivory-2); }
.concept { color: #f2c14e; border: 1px solid rgba(242,193,78,.4); border-radius: 999px; padding: 2px 9px; font-size: 9.5px; }
.cfig-body { padding: 16px; }

/* ---------- References ---------- */
.refblock { margin-bottom: 20px; }
.refblock h3 { font-size: 21px; margin-bottom: 14px; }
.reflist { margin: 0; padding-left: 22px; display: grid; gap: 12px; }
.reflist li { font-size: 14px; color: var(--ivory-2); }
.cc-wrap { display: grid; gap: 10px; }

/* ---------- Evidence key: two axes ---------- */
.evkey { display: grid; grid-template-columns: 1fr 1.25fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: clamp(32px, 4vw, 48px); background: var(--bg-2); }
.evkey-col { padding: 18px 22px; }
.evkey-col + .evkey-col { border-left: 1px solid var(--line); }
.evkey-col h4 { margin: 0 0 14px; font-family: var(--mono); font-weight: 400; font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ivory-2); }
.evkey-col h4 span { color: var(--faint); text-transform: none; letter-spacing: .04em; }
.evkey ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.evkey li { display: grid; grid-template-columns: 148px 1fr; gap: 12px; align-items: baseline; font-size: 13px; color: var(--muted); }
.evkey li > :first-child { justify-self: start; }
@media (max-width: 900px) { .evkey { grid-template-columns: 1fr; } .evkey-col + .evkey-col { border-left: 0; border-top: 1px solid var(--line); } }
@media (max-width: 560px) { .evkey li { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Evidence strength badge ---------- */
.str { display: inline-flex; align-items: center; flex: none; cursor: help;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  border-radius: 999px; padding: 4px 11px; border: 1px solid currentColor; }
.str-s4 { color: #6fd49a; background: rgba(111,212,154,.10); }
.str-s3 { color: #7fd0ff; background: rgba(127,208,255,.10); }
.str-s2 { color: #f2c14e; background: rgba(242,193,78,.10); }
.str-s1 { color: var(--orange); background: rgba(232,116,59,.10); }
.str-s0 { color: var(--ivory-2); background: rgba(237,230,214,.06); }

.claim-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.claim-types { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ev-ref { color: #c9c2b2; } .ev-ref i { color: #16150f; }
.ev-reg { color: #e0a3ff; } .ev-reg i { color: #1b0a22; }
.ev-gdl { color: #7fd0ff; } .ev-gdl i { color: #04141f; }
.ev-his { color: #d9b38c; } .ev-his i { color: #1d1308; }
.refnote { margin: -4px 0 16px; max-width: 74ch; }
.reflist li .ev { margin-right: 8px; vertical-align: middle; }

/* ---------- Evidence badge ---------- */
.ev {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid currentColor; border-radius: 999px; padding: 3px 10px 3px 3px; cursor: help;
}
.ev i { font-style: normal; font-size: 9px; width: 20px; height: 18px; display: grid; place-items: center; border-radius: 999px; background: currentColor; }
.ev-ch { color: #6fd49a; } .ev-ch i { color: #06130c; }
.ev-oh { color: #6f8cff; } .ev-oh i { color: #05081a; }
.ev-pc { color: #c9a0ff; } .ev-pc i { color: #11071f; }
.ev-tm { color: #f2c14e; } .ev-tm i { color: #1a1304; }
.ev-ie { color: var(--orange); } .ev-ie i { color: #1a0b04; }
/* Source types that must not be confused with a controlled clinical trial:
   a human administration/analytical study, a single case, and animal work. */
.ev-ha { color: #58d7d0; } .ev-ha i { color: #041917; }
.ev-hc { color: #ffb37a; } .ev-hc i { color: #211004; }
.ev-an { color: #b7c47a; } .ev-an i { color: #121603; }
.ev-unc { color: var(--muted); } .ev-unc i { color: #0c0c0d; }

/* ---------- Profile layout ---------- */
.c-layout { display: grid; grid-template-columns: 250px 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.c-toc { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; }
.c-toc::-webkit-scrollbar { width: 4px; }
.c-toc::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 2px; }
.c-toc .fig { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.toc-parts { list-style: none; margin: 14px 0 20px; padding: 0; display: grid; gap: 10px; }
.toc-parts > li[data-level="advanced"] .toc-part { color: var(--orange); }
.c-toc a { display: block; padding: 5px 8px; border-radius: var(--radius); font-size: 13px; color: var(--muted); transition: color .2s, background .2s; }
.c-toc a:hover { color: var(--ivory); background: rgba(237,230,214,.04); }
.c-toc a.on { color: var(--ivory); background: rgba(61,99,255,.12); }
.toc-part { display: grid !important; grid-template-columns: 24px 1fr; gap: 6px; font-family: var(--sans);
  font-size: 13.5px; color: var(--ivory-2) !important; }
.toc-part span { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.toc-part.on { color: var(--ivory) !important; }
.toc-parts ul { list-style: none; margin: 2px 0 0 24px; padding: 0; display: grid; gap: 1px;
  border-left: 1px solid var(--line); }
.toc-parts ul a { font-size: 12.5px; padding-left: 10px;
  display: grid; grid-template-columns: 30px 1fr; gap: 6px; align-items: baseline; }
/* The section number sits in its own column so it cannot run into the title. */
.toc-n { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.c-toc a.on .toc-n { color: var(--cobalt-2); }
@media (max-width: 960px) {
  .c-layout { grid-template-columns: 1fr; }
  .c-toc { position: static; max-height: none; overflow: visible; }
  .toc-parts { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (max-width: 560px) { .toc-parts { grid-template-columns: 1fr; } }

/* ---------- Expandable sections ---------- */
.sec { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; scroll-margin-top: calc(var(--header-h) + 16px); }
.sec[open] { border-color: var(--line-2); background: var(--bg-2); }
.sec > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 34px 1fr auto 20px;
  gap: 14px; align-items: center; padding: 18px 20px; transition: background .2s;
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary:hover { background: rgba(237,230,214,.03); }
.sec-n { font-family: var(--mono); font-size: 11px; color: var(--cobalt-2); white-space: nowrap; }
.sec-t { font-family: var(--serif); font-size: 20px; line-height: 1.2; }
.sec-chev { width: 10px; height: 10px; border-right: 1px solid var(--ivory-2); border-bottom: 1px solid var(--ivory-2); transform: rotate(45deg); transition: transform .3s var(--ease); justify-self: end; }
.sec[open] > summary .sec-chev { transform: rotate(-135deg); }
.sec-body { padding: 4px 20px 24px; display: grid; gap: 14px; }
.sec-intro { margin: 0; color: var(--ivory-2); font-size: 15.5px; max-width: 72ch; }
@media (max-width: 560px) { .sec > summary { grid-template-columns: 26px 1fr 20px; gap: 10px; } .sec > summary .sec-st { grid-column: 2; justify-self: start; } .sec-t { font-size: 18px; } }

/* ---------- Claim card ---------- */
.claim { border: 1px solid var(--line); border-left: 2px solid var(--line-2); border-radius: var(--radius); padding: 16px 18px; background: var(--bg); }
.claim-head { margin-bottom: 10px; }
.claim-text { margin: 0; font-size: 16px; color: var(--ivory); }
.claim-detail { margin: 8px 0 0; font-size: 14.5px; color: var(--muted); }
.claim-nosrc { margin: 10px 0 0; font-size: 12.5px; color: var(--orange); font-style: italic; }
.claim-src { margin-top: 12px; }
.claim-src summary { cursor: pointer; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--cobalt-2); }
.claim-src ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.claim-src li { font-size: 13.5px; color: var(--ivory-2); padding-left: 14px; border-left: 1px solid var(--line-2); }
.src-cite { display: block; }
.src-links { display: flex; gap: 14px; margin-top: 5px; }
.src-links a { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--cobalt-2); border-bottom: 1px solid transparent; }
.src-links a:hover { border-color: var(--cobalt-2); }

/* ---------- Comparison table ---------- */
.ctable { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ctable figcaption { padding: 12px 16px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ivory-2); }
.ctable-scroll { overflow-x: auto; }
.ctable table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ctable th, .ctable td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ctable th { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ctable td { color: var(--ivory-2); }
.ctable-note, .ctable .empty-inline { padding: 12px 16px; margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- Claim-check & open questions ---------- */
.cc-block { margin-top: clamp(36px, 5vw, 56px); }
.cc-block h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 20px; }
.cc { display: grid; grid-template-columns: .85fr 1.15fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.cc-claim { padding: 20px; background: var(--surface); border-right: 1px solid var(--line); }
.cc-q { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }
.cc-claim p { margin: 10px 0 0; font-family: var(--serif); font-size: 19px; line-height: 1.3; }
.cc-ans { padding: 20px; display: grid; gap: 12px; align-content: start; }
.cc-ans p { margin: 0; font-size: 15px; color: var(--ivory-2); }
.verdict { justify-self: start; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; border-radius: 999px; padding: 4px 11px; border: 1px solid currentColor; }
.v-ok { color: #6fd49a; } .v-mixed { color: #f2c14e; } .v-no { color: var(--orange); } .v-untested { color: var(--muted); }
.oq { border: 1px solid var(--line); border-left: 2px solid var(--orange); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 10px; background: var(--surface); }
.oq h3 { font-size: 20px; margin-bottom: 8px; }
.oq p { margin: 0; color: var(--ivory-2); font-size: 15px; }
@media (max-width: 760px) { .cc { grid-template-columns: 1fr; } .cc-claim { border-right: 0; border-bottom: 1px solid var(--line); } }

.c-disclaim { margin-top: 36px; padding: 18px 20px; border: 1px solid var(--line); border-left: 2px solid var(--orange); border-radius: var(--radius); font-size: 13px; color: var(--muted); background: var(--bg-2); }
.c-404 { padding: clamp(40px, 8vw, 100px) 0; max-width: 60ch; }
.c-404 h1 { margin: 20px 0 16px; }
.c-404 .btn { margin-top: 26px; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track { animation: none; }
  * { transition-duration: .01ms !important; }
}

:focus-visible { outline: 1px dashed var(--cobalt-2); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--ivory); color: #000; padding: 8px 12px; }
