/* Corpus — design tokens, themes, reset, typography */

/* Source Serif 4 (Adobe, SIL OFL 1.1, see assets/fonts/OFL.txt), bundled so the
   atlas reads the same on every device. Subset to Latin, Greek, punctuation and
   arrows; variable weight 400–700 and optical size 8–60. */
@font-face {
  font-family: "Source Serif 4";
  src: url("../assets/fonts/SourceSerif4-Roman.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../assets/fonts/SourceSerif4-Italic.woff2") format("woff2");
  font-weight: 400 700; font-style: italic; font-display: swap;
}

:root {
  color-scheme: light;

  /* surfaces & ink */
  --paper: #f3eee4;
  --paper-2: #f8f4ec;
  --paper-3: #e9e2d4;
  --ink: #2a231c;
  --ink-2: #5b5044;
  --ink-3: #6f6456;
  --line: #d9cfbe;
  --line-2: #c7bba7;
  --focus: #1f6f75;

  /* bone drawing */
  --bone: #fbf7ee;
  --bone-line: #6b5a48;
  --bone-back: #e6ddcc;
  --bone-back-line: #a39279;
  --bone-deep: #9a8b74;
  --bone-detail: #b5a48c;
  --cart: #dbe4e0;
  --cart-line: #889c96;
  --cavity: #3b322b;
  --tooth: #fffdf7;
  /* realistic drawings: form shadow, lit rim and recesses (foramina, fossae) */
  --bone-shade: #6e5238;
  --bone-light: #fffdf7;
  --bone-pore: #4a3626;

  /* states */
  --sel: #c8402a;
  --sel-fill: #f4b9a9;
  --sel-soft: rgba(200, 64, 42, 0.1);
  --rel: #1f7a80;
  --rel-fill: #bfe1df;
  --rel-soft: rgba(31, 122, 128, 0.1);
  --hover-fill: #fff3d6;

  /* joint classes */
  --j-synovial: #1f7a80;
  --j-cartilaginous: #b07a1f;
  --j-fibrous: #7d6754;

  /* urgency */
  --u-self: #4e7a4b;
  --u-doctor: #9a6a12;
  --u-urgent: #b8361f;

  /* regions */
  --rg-fill: rgba(200, 64, 42, 0.05);
  --rg-line: rgba(200, 64, 42, 0.45);
  --rg-hover: rgba(200, 64, 42, 0.16);
  --rg-sel: rgba(200, 64, 42, 0.28);

  /* organs (muted, watercolour) */
  --o-brain: #e3c3bb;
  --o-thyroid: #c97c6c;
  --o-trachea: #e2d6c4;
  --o-esophagus: #cf948b;
  --o-lung: #eab0aa;
  --o-heart: #b8483f;
  --o-liver: #93463a;
  --o-gallbladder: #7d9653;
  --o-stomach: #dfa293;
  --o-spleen: #85404d;
  --o-pancreas: #e6c592;
  --o-kidney: #a5503f;
  --o-small-intestine: #edbba8;
  --o-large-intestine: #cf9a84;
  --o-appendix: #cf9a84;
  --o-bladder: #e8c88f;
  --o-ureter: #e8c88f;
  --o-duodenum: #e8ae98;
  --o-rectum: #c58a75;
  --o-pharynx: #d9a39a;
  --o-larynx: #d8c6ad;
  --o-adrenal-gland: #e3b25c;
  --o-pituitary: #d98f8a;
  --o-parathyroid: #d9a55e;
  --o-pineal-gland: #c9a0b4;
  --o-eye: #e9e4dc;
  --o-ear: #e2a98f;
  --o-nose: #dca08c;
  --o-tongue: #d9797a;
  --o-salivary-glands: #e6c08a;
  --o-gonad: #dc9ea6;
  --o-repro: #d4848a;
  --o-repro-duct: #e2b49c;
  --o-breast: #efcbb0;
  --o-line: rgba(70, 30, 20, 0.55);

  /* muscles */
  --muscle: #b65a4e;
  --muscle-deep: #9a4a40;
  --muscle-line: #6d2c23;
  --muscle-fibre: rgba(255, 228, 218, 0.34);
  --tendon: #ece3d1;
  --tendon-line: #a7967b;
  /* vessels & nerves */
  --artery: #b8363a;
  --artery-line: #6e1a1d;
  --vein: #3f63a8;
  --vein-line: #1f3566;
  --nerve: #e2bc3c;
  --nerve-line: #8a6a12;
  --lymph: #6a9f45;
  --lymph-line: #2f5320;
  --ligament: #d8ccab;
  --ligament-line: #7a6845;

  /* type */
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(40, 30, 20, 0.06), 0 8px 24px rgba(40, 30, 20, 0.08);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #121417;
    --paper-2: #181b1f;
    --paper-3: #20252a;
    --ink: #ece6da;
    --ink-2: #c2b9aa;
    --ink-3: #a1988a;
    --line: #2b3036;
    --line-2: #3a4047;
    --focus: #6fd0d4;
    --bone: #e7e0d2;
    --bone-line: #5a4d3f;
    --bone-back: #8d8576;
    --bone-back-line: #4d463d;
    --bone-deep: #6e6557;
    --bone-detail: #a69983;
    --cart: #a9b9b5;
    --cart-line: #5c6e69;
    --cavity: #0b0c0e;
    --tooth: #f2ede2;
    --bone-shade: #4a3a2c;
    --bone-light: #fffaf0;
    --bone-pore: #2a2018;
    --sel: #ff7a5c;
    --sel-fill: #ff9d85;
    --sel-soft: rgba(255, 122, 92, 0.14);
    --rel: #5cc8cc;
    --rel-fill: #7fd3d4;
    --rel-soft: rgba(92, 200, 204, 0.14);
    --hover-fill: #fff6df;
    --j-synovial: #5cc8cc;
    --j-cartilaginous: #e3b056;
    --j-fibrous: #b89f86;
    --u-self: #8cc287;
    --u-doctor: #e3b056;
    --u-urgent: #ff7a5c;
    --rg-fill: rgba(255, 122, 92, 0.06);
    --rg-line: rgba(255, 122, 92, 0.5);
    --rg-hover: rgba(255, 122, 92, 0.2);
    --rg-sel: rgba(255, 122, 92, 0.32);
    --o-brain: #b9978f;
    --o-thyroid: #a8604f;
    --o-trachea: #b8ac9a;
    --o-esophagus: #a8716a;
    --o-lung: #c98a85;
    --o-heart: #a63a33;
    --o-liver: #7d3a30;
    --o-gallbladder: #6b8446;
    --o-stomach: #bd8274;
    --o-spleen: #73384a;
    --o-pancreas: #c4a674;
    --o-kidney: #8e4334;
    --o-small-intestine: #c99a88;
    --o-large-intestine: #ab7c69;
    --o-appendix: #ab7c69;
    --o-bladder: #c2a46f;
    --o-ureter: #c2a46f;
    --o-duodenum: #c08f7d;
    --o-rectum: #a0705e;
    --o-pharynx: #b07c74;
    --o-larynx: #ad9c84;
    --o-adrenal-gland: #b98f45;
    --o-pituitary: #b0706c;
    --o-parathyroid: #af8546;
    --o-pineal-gland: #a07f90;
    --o-eye: #bdb7ad;
    --o-ear: #b88470;
    --o-nose: #b27d6c;
    --o-tongue: #b05e60;
    --o-salivary-glands: #bb9a6a;
    --o-gonad: #b57f87;
    --o-repro: #ad6970;
    --o-repro-duct: #b88f7b;
    --o-breast: #c3a38c;
    --o-line: rgba(0, 0, 0, 0.55);
    --muscle: #a64e43;
    --muscle-deep: #8a4037;
    --muscle-line: #3c1712;
    --muscle-fibre: rgba(255, 220, 210, 0.22);
    --tendon: #9d9380;
    --tendon-line: #574e40;
  --artery: #d9534f;
  --artery-line: #5a1513;
  --vein: #6d8fd6;
  --vein-line: #1c2c52;
  --nerve: #f0cf5a;
  --nerve-line: #6b5210;
  --lymph: #8fc46e;
  --lymph-line: #20391a;
  --ligament: #a89a74;
  --ligament-line: #2e2717;
    --artery: #d9534f;
    --artery-line: #5a1513;
    --vein: #6d8fd6;
    --vein-line: #1c2c52;
    --nerve: #f0cf5a;
    --nerve-line: #6b5210;
    --lymph: #8fc46e;
    --lymph-line: #20391a;
    --ligament: #a89a74;
    --ligament-line: #2e2717;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121417;
  --paper-2: #181b1f;
  --paper-3: #20252a;
  --ink: #ece6da;
  --ink-2: #c2b9aa;
  --ink-3: #a1988a;
  --line: #2b3036;
  --line-2: #3a4047;
  --focus: #6fd0d4;
  --bone: #e7e0d2;
  --bone-line: #5a4d3f;
  --bone-back: #8d8576;
  --bone-back-line: #4d463d;
  --bone-deep: #6e6557;
  --bone-detail: #a69983;
  --cart: #a9b9b5;
  --cart-line: #5c6e69;
  --cavity: #0b0c0e;
  --tooth: #f2ede2;
  --bone-shade: #4a3a2c;
  --bone-light: #fffaf0;
  --bone-pore: #2a2018;
  --sel: #ff7a5c;
  --sel-fill: #ff9d85;
  --sel-soft: rgba(255, 122, 92, 0.14);
  --rel: #5cc8cc;
  --rel-fill: #7fd3d4;
  --rel-soft: rgba(92, 200, 204, 0.14);
  --hover-fill: #fff6df;
  --j-synovial: #5cc8cc;
  --j-cartilaginous: #e3b056;
  --j-fibrous: #b89f86;
  --u-self: #8cc287;
  --u-doctor: #e3b056;
  --u-urgent: #ff7a5c;
  --rg-fill: rgba(255, 122, 92, 0.06);
  --rg-line: rgba(255, 122, 92, 0.5);
  --rg-hover: rgba(255, 122, 92, 0.2);
  --rg-sel: rgba(255, 122, 92, 0.32);
  --o-brain: #b9978f;
  --o-thyroid: #a8604f;
  --o-trachea: #b8ac9a;
  --o-esophagus: #a8716a;
  --o-lung: #c98a85;
  --o-heart: #a63a33;
  --o-liver: #7d3a30;
  --o-gallbladder: #6b8446;
  --o-stomach: #bd8274;
  --o-spleen: #73384a;
  --o-pancreas: #c4a674;
  --o-kidney: #8e4334;
  --o-small-intestine: #c99a88;
  --o-large-intestine: #ab7c69;
  --o-appendix: #ab7c69;
  --o-bladder: #c2a46f;
  --o-ureter: #c2a46f;
  --o-duodenum: #c08f7d;
  --o-rectum: #a0705e;
  --o-pharynx: #b07c74;
  --o-larynx: #ad9c84;
  --o-adrenal-gland: #b98f45;
  --o-pituitary: #b0706c;
  --o-parathyroid: #af8546;
  --o-pineal-gland: #a07f90;
  --o-eye: #bdb7ad;
  --o-ear: #b88470;
  --o-nose: #b27d6c;
  --o-tongue: #b05e60;
  --o-salivary-glands: #bb9a6a;
  --o-gonad: #b57f87;
  --o-repro: #ad6970;
  --o-repro-duct: #b88f7b;
  --o-breast: #c3a38c;
  --o-line: rgba(0, 0, 0, 0.55);
  --muscle: #a64e43;
  --muscle-deep: #8a4037;
  --muscle-line: #3c1712;
  --muscle-fibre: rgba(255, 220, 210, 0.22);
  --tendon: #9d9380;
  --tendon-line: #574e40;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.serif { font-family: var(--serif); }
.latin { font-family: var(--serif); font-style: italic; color: var(--ink-2); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
