/* ========================================
   BIODYN , About, shared core styles
   Palette, type and primitives shared by every
   version. Version-specific layout and motion
   live in about-<version>.css.
   ======================================== */

.ab-body,
.ab-scope {
  /* Fluorescence (dark) */
  --ab-field: #05070d;
  --ab-panel: #090d16;
  --ab-panel-2: #0c1220;
  --ab-bone: #e9edf4;
  --ab-dim: #98a2b3;
  --ab-faint: #626c7e;
  --ab-line: rgba(150, 175, 210, 0.14);
  --ab-line-strong: rgba(150, 175, 210, 0.3);
  --ab-grid: rgba(150, 175, 210, 0.045);

  --ab-ch1: #57d8ea;
  --ab-ch2: #e26bb0;
  --ab-ch3: #6fdfa4;
  --ab-ch4: #a78bfa;
  --ab-ch: var(--ab-ch1);

  --ab-font-display: 'Instrument Serif', 'Outfit', Georgia, serif;
  --ab-font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ab-font-display: 'Instrument Serif', 'Outfit', Georgia, serif;
}

.ab-body {
  --bg-primary: var(--ab-field);
  --nav-scrolled-bg: rgba(5, 7, 13, 0.86);
  --mobile-nav-bg: rgba(5, 7, 13, 0.97);

  background: var(--ab-field);
  color: var(--ab-bone);
}

/* Brightfield (light) */
:root[data-theme="light"] .ab-body,
:root[data-theme="light"] .ab-scope {
  --ab-field: #f6f7f9;
  --ab-panel: #ffffff;
  --ab-panel-2: #f1f3f7;
  /* Brightfield needs materially darker body text than a dark field does:
     thin serif strokes and light greys wash out on paper. */
  --ab-bone: #080d16;
  --ab-dim: #333d4b;
  --ab-faint: #5b6472;
  --ab-line: rgba(13, 20, 32, 0.15);
  --ab-line-strong: rgba(13, 20, 32, 0.32);
  --ab-grid: rgba(13, 20, 32, 0.05);

  --ab-ch1: #0b8ea6;
  --ab-ch2: #b8407f;
  --ab-ch3: #17845a;
  --ab-ch4: #6244c9;
}

:root[data-theme="light"] .ab-body {
  --nav-scrolled-bg: rgba(246, 247, 249, 0.86);
  --mobile-nav-bg: rgba(246, 247, 249, 0.97);
}

.ab-body[data-channel="2"], .ab-scope[data-channel="2"] { --ab-ch: var(--ab-ch2); }
.ab-body[data-channel="3"], .ab-scope[data-channel="3"] { --ab-ch: var(--ab-ch3); }
.ab-body[data-channel="4"], .ab-scope[data-channel="4"] { --ab-ch: var(--ab-ch4); }

/* ---------------------------------------
   Shell
   --------------------------------------- */

.ab-main {
  padding-top: clamp(132px, 15vh, 184px);
  padding-bottom: clamp(64px, 9vh, 108px);
}

.ab-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------
   Type primitives
   --------------------------------------- */

.ab-eyebrow {
  font-family: var(--ab-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ab-faint);
}

.ab-display {
  font-family: var(--ab-font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 5.6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--ab-bone);
}

.ab-display em {
  font-style: italic;
  color: var(--ab-ch);
  transition: color 0.6s ease;
}

.ab-lede {
  font-size: clamp(0.98rem, 1.1vw, 1.06rem);
  line-height: 1.8;
  color: var(--ab-dim);
}

.ab-numeral {
  font-family: var(--ab-font-display);
  font-style: italic;
  line-height: 1;
  color: var(--ab-ch);
  transition: color 0.6s ease;
}

.ab-case-title {
  font-family: var(--ab-font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 2.7vw, 2.5rem);
  line-height: 1.13;
  letter-spacing: -0.01em;
  color: var(--ab-bone);
}

.ab-case-body {
  font-size: 1rem;
  line-height: 1.82;
  color: var(--ab-dim);
  max-width: 52ch;
}

.ab-case-body a,
.ab-prose a {
  color: var(--ab-bone);
  text-decoration: none;
  border-bottom: 1px solid var(--ab-ch);
  padding-bottom: 1px;
  transition: color var(--transition-fast);
}

.ab-case-body a:hover,
.ab-prose a:hover {
  color: var(--ab-ch);
}

.ab-prose {
  font-size: 1rem;
  line-height: 1.82;
  color: var(--ab-dim);
  max-width: 58ch;
}

.ab-prose + .ab-prose {
  margin-top: 16px;
}

/* ---------------------------------------
   Readout
   --------------------------------------- */

.ab-readout {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--ab-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ab-faint);
}

.ab-readout-ch {
  color: var(--ab-ch);
  font-weight: 500;
  transition: color 0.6s ease;
  flex: none;
}

.ab-readout-body {
  border-left: 1px solid var(--ab-line);
  padding-left: 12px;
}

/* ---------------------------------------
   Controls
   --------------------------------------- */

.ab-action {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 13px 22px;
  background: transparent;
  border: 1px solid var(--ab-line-strong);
  border-radius: 2px;
  color: var(--ab-bone);
  font-family: var(--ab-font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--transition-medium), color var(--transition-medium);
}

.ab-action:hover {
  border-color: var(--ab-ch);
  color: var(--ab-ch);
}

.ab-action-arrow {
  display: inline-block;
  transition: transform var(--transition-medium);
}

.ab-action:hover .ab-action-arrow {
  transform: translateX(4px);
}

.ab-action[aria-expanded="true"] .ab-action-arrow {
  transform: rotate(90deg);
}

:where(.ab-body) button:focus-visible,
:where(.ab-body) a:focus-visible {
  outline: 2px solid var(--ab-ch);
  outline-offset: 3px;
}

/* ---------------------------------------
   Papers
   --------------------------------------- */

.ab-refs {
  list-style: none;
  display: grid;
  gap: 16px;
}

.ab-refs li {
  position: relative;
  padding-left: 20px;
}

.ab-refs li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 1px;
  background: var(--ab-ch);
}

.ab-refs a {
  display: block;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ab-bone);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.ab-refs a:hover {
  color: var(--ab-ch);
}

.ab-venue {
  display: block;
  margin-top: 5px;
  font-family: var(--ab-font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ab-faint);
}

.ab-pending-mark {
  display: inline-block;
  font-family: var(--ab-font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ab-ch);
  border: 1px solid var(--ab-ch);
  border-radius: 2px;
  padding: 5px 11px;
  margin-bottom: 22px;
}

/* ---------------------------------------
   Chamber furniture
   --------------------------------------- */

.ab-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.ab-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid var(--ab-line);
  background-image:
    linear-gradient(to right, var(--ab-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--ab-grid) 1px, transparent 1px);
  background-size: 12.5% 12.5%;
}

.ab-frame::before,
.ab-frame::after {
  content: '';
  position: absolute;
  left: -1px;
  right: -1px;
  height: 17px;
  border-left: 1px solid var(--ab-ch);
  border-right: 1px solid var(--ab-ch);
  opacity: 0.75;
  transition: border-color 0.6s ease;
}

.ab-frame::before { top: -1px; }
.ab-frame::after { bottom: -1px; }

.ab-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 600px) {
  .ab-venue { font-size: 0.72rem; }
}
