/* The site's styles. Everything is built from the viewer's vocabulary (tokens.css): 1 px hairlines instead of
   shadows, 0.75 / 0.5 / 0.4 rem radii, 44 px controls, a 2 px focus ring, the system font stack.
   Layout: the home page is the continuation of the 3D stage (header on --bg-top, stage edge to edge, the rest on
   --bg-bottom); every other page is a flat reading surface (--panel-solid) with the stage as a framed figure. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--panel-solid);
  overflow-wrap: anywhere;
}

body.home {
  background: var(--bg-bottom);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

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

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

.wrap {
  width: min(100% - 2rem, 80rem);
  margin-inline: auto;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.8125rem;
}

.latin {
  font-style: italic;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.skip {
  position: absolute;
  inset-block-start: 0.5rem;
  inset-inline-start: 0.5rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: var(--radius-control);
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

/* --- Controls --- */
.btn,
.select,
.input {
  min-height: var(--control);
  font: inherit;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  border-color: currentColor;
}

.btn-primary {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.btn svg,
.search svg {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
}

.select {
  max-width: min(10.5rem, 38vw);
  padding: 0 0.6rem;
  background: var(--panel-solid);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search svg {
  position: absolute;
  inset-inline-start: 0.85rem;
  color: var(--muted);
  pointer-events: none;
}

.input {
  width: 100%;
  padding: 0 0.85rem 0 2.6rem;
  background: var(--panel-solid);
}

.input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--control);
  padding: 0.3rem 0.8rem;
  color: inherit;
  text-decoration: none;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

a.chip:hover {
  border-color: currentColor;
}

.chip.no-mesh {
  color: var(--muted);
}

/* The pictogram of a body system: an alpha mask from the viewer's layer icons, tinted with the text colour. */
.sys-icon {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  background: currentColor;
  -webkit-mask: var(--system-icon) center / contain no-repeat;
  mask: var(--system-icon) center / contain no-repeat;
}

.swatch {
  flex: none;
  width: 0.8rem;
  height: 0.8rem;
  background: var(--system);
  border: 1px solid var(--border);
  border-radius: 50%;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
}

a.badge {
  min-height: 1.75rem;
  font-size: 0.8125rem;
}

.badges,
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* --- Header --- */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 5;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--border);
}

/* Home: the header lies on the top colour of the stage gradient, so the stage below starts where it ends. */
.home .site-header {
  position: static;
  background: var(--bg-top);
  border-bottom: 0;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--control);
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.wordmark svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
}

.spacer {
  flex: 1;
}

.nav-links {
  display: none;
  gap: 0.25rem;
}

.nav-links a,
.menu nav a {
  display: flex;
  align-items: center;
  min-height: var(--control);
  padding: 0 0.75rem;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-control);
}

.nav-links a:hover,
.nav-links a[aria-current],
.menu nav a:hover,
.menu nav a[aria-current] {
  background: var(--accent-soft);
}

.site-header .search {
  display: none;
  width: 17rem;
}

/* Phones: navigation and search open below the bar. <details> needs no script. */
.menu > summary {
  list-style: none;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu[open] > summary {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.menu-panel {
  flex-basis: 100%;
  display: grid;
  gap: 0.5rem;
  padding: 0.25rem 0 0.5rem;
}

.site-header .menu-panel .search {
  display: flex;
  width: auto;
}

.menu:not([open]) + .menu-panel {
  display: none;
}

@media (min-width: 60em) {
  .site-header .wrap {
    flex-wrap: nowrap;
    gap: 1rem;
  }

  .nav-links {
    display: flex;
  }

  .site-header .search {
    display: flex;
  }

  .menu,
  .menu + .menu-panel {
    display: none !important;
  }
}

/* --- Footer --- */
.site-footer {
  padding: 2rem 0 2.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

.site-footer strong {
  color: var(--text);
}

.site-footer a {
  color: inherit;
}

.site-footer p + p {
  margin-top: 0.5rem;
}

.lang-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
}

.lang-list a {
  display: inline-flex;
  align-items: center;
  min-height: var(--control);
  padding: 0 0.6rem;
  border-radius: var(--radius-control);
}

.lang-list a[aria-current] {
  color: var(--text);
  background: var(--accent-soft);
  text-decoration: none;
}

@media (min-width: 48em) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* --- Cards and lists --- */
.card {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.stage {
  position: relative;
  overflow: hidden;
  background: linear-gradient(var(--bg-top), var(--bg-bottom));
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.section-head h2,
.page-head h1 + p {
  font-size: 1.375rem;
  font-weight: 650;
}

.grid-atlases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.atlas-card {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.atlas-card:hover {
  border-color: currentColor;
}

.atlas-card .stage {
  aspect-ratio: 4 / 3;
}

.atlas-card .stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.atlas-card-body {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  padding: 0.85rem 1rem 1rem;
}

.atlas-card h3 {
  font-size: 1rem;
  font-weight: 650;
}

.index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.25rem;
}

.index a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.35rem 0;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.index a:hover {
  color: var(--accent);
}

.index .count {
  margin-inline-start: auto;
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.index.one {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 48em) {
  .grid-atlases {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }

  .index,
  .index.one {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 2rem;
  }
}

@media (min-width: 64em) {
  .index,
  .index.one {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.grid-systems {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.sys-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.sys-card .stage {
  display: block;
  aspect-ratio: 4 / 3;
}

.sys-card .stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sys-card-body {
  display: grid;
  gap: 0.3rem;
  align-content: start;
  padding: 0.85rem 1rem 1rem;
}

.sys-card h2 {
  font-size: 1.0625rem;
  font-weight: 650;
}

.sys-card h2 a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--control);
  color: inherit;
  text-decoration: none;
}

/* The whole card is the link of its heading. */
.sys-card {
  position: relative;
}

.sys-card h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.sys-card:hover {
  border-color: currentColor;
}

.sys-card p a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: var(--control);
}

@media (min-width: 48em) {
  .grid-systems {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 64em) {
  .grid-systems {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.band {
  padding: 2rem 0;
}

.band + .band {
  border-top: 1px solid var(--border);
}

.band.tint {
  background: var(--bg-top);
}

.page-head {
  display: grid;
  gap: 0.5rem;
  padding: 1.5rem 0 0.5rem;
}

.page-head h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.page-head .lead {
  max-width: 46rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--muted);
}

@media (min-width: 48em) {
  .band {
    padding: 3rem 0;
  }

  .page-head {
    padding-top: 2.5rem;
  }

  .page-head h1 {
    font-size: 2.75rem;
  }
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* --- Home (layout A) --- */
.hero {
  position: relative;
}

.hero .anatomy-embed {
  border-radius: 0;
}

/* The call to action of the home page is the button of the intro panel; the embed keeps no second one. The stage
   picture has no credit strip (the credit is printed as text) and is shown whole at any height: it is a vertical
   gradient as tall as the stage, so the bands left and right of it continue it without a seam. */
.hero .anatomy-embed__load {
  display: none;
}

.hero .anatomy-embed__poster {
  object-fit: contain;
}

.hero-top {
  background: var(--bg-top);
  padding: 0.25rem 0 0.75rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(8px);
}

.intro {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.intro h1 {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.intro .lead {
  display: none;
  line-height: 1.5;
  color: var(--muted);
}

.intro .search .input {
  border-radius: var(--radius-card);
}

.intro .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.intro .actions .btn {
  flex: 1 1 auto;
}

.layers {
  padding: 0.6rem;
}

.layers h2 {
  padding: 0.25rem 0.4rem 0.5rem;
  font-size: 1rem;
  font-weight: 650;
}

.layers ul {
  display: flex;
  gap: 0.35rem;
  padding-bottom: 0.25rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.layers .chip {
  flex: none;
  white-space: nowrap;
}

.hero-bottom {
  padding: 0.75rem 0 0;
}

.hero-credit {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

@media (min-width: 60em) {
  /* Desktop: the stage fills the first screen edge to edge and the two panels float over it, like the viewer's own
     panels. Once the model is live they step aside: the viewer brings its own name box and buttons. */
  .hero {
    display: grid;
    min-height: clamp(34rem, 100svh - 9.5rem, 46rem);
  }

  .hero > * {
    grid-area: 1 / 1;
  }

  .hero .anatomy-embed {
    aspect-ratio: auto;
    height: 100%;
    min-height: inherit;
  }

  .hero-top,
  .hero-bottom {
    z-index: 1;
    align-self: center;
    padding: 0;
    background: none;
    pointer-events: none;
  }

  .hero-top .wrap,
  .hero-bottom .wrap {
    display: flex;
  }

  .hero-bottom .wrap {
    justify-content: flex-end;
  }

  .hero-top .intro,
  .hero-bottom .layers {
    pointer-events: auto;
  }

  .intro {
    width: 27rem;
    gap: 1rem;
    padding: 1.5rem;
  }

  .intro h1 {
    font-size: 2.5rem;
  }

  .intro .lead {
    display: block;
  }

  /* Two columns: fourteen systems in one column are taller than the stage on a laptop screen. */
  .layers {
    width: 23rem;
  }

  .layers ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .layers .chip {
    min-height: var(--control);
    padding-block: 0.15rem;
    white-space: normal;
    line-height: 1.2;
  }

  .hero:has(.anatomy-embed.is-live) .hero-top,
  .hero:has(.anatomy-embed.is-live) .hero-bottom {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .hero-bottom .wrap {
    position: static;
  }

  .hero-credit {
    position: absolute;
    inset-block-end: 0.6rem;
    inset-inline-start: max(1rem, (100vw - 80rem) / 2);
    max-width: 27rem;
    margin: 0;
  }
}

.features {
  display: grid;
  gap: 0.75rem;
}

.feature {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  overflow: hidden;
}

.feature .stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature > div:last-child {
  display: grid;
  gap: 0.3rem;
  align-content: center;
  padding: 0.85rem 1rem;
}

.feature h3 {
  font-size: 1rem;
  font-weight: 650;
}

@media (min-width: 48em) {
  .features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .feature {
    grid-template-columns: 9rem minmax(0, 1fr);
    min-height: 9rem;
  }
}

.home .band + .band {
  border-top: 0;
  padding-top: 0;
}

.home .index a {
  border-bottom-color: var(--border);
}

/* --- Structure (layout B) --- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.4rem;
  padding-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.crumbs li {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
}

.crumbs a {
  color: inherit;
}

.crumbs li + li::before {
  content: "›";
  margin-inline-end: 0.4rem;
}

.structure {
  display: grid;
  grid-template-areas: "head" "viewer" "body";
  gap: 1.25rem;
  padding: 0.75rem 0 2.5rem;
}

.structure-head {
  grid-area: head;
  display: grid;
  gap: 0.5rem;
}

.structure-head h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.structure-head .latin {
  font-size: 1.125rem;
  color: var(--muted);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
}

.review-note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.review-note::before {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.structure-viewer {
  grid-area: viewer;
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: 0;
}

.structure-body {
  grid-area: body;
  display: grid;
  gap: 1.75rem;
  align-content: start;
  min-width: 0;
}

.block h2 {
  margin-bottom: 0.6rem;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.structure-body .block + .block,
.structure-viewer .block {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.prose {
  font-size: 1.0625rem;
  line-height: 1.6;
}

.prose p + p {
  margin-top: 0.75rem;
}

.source {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.rel > div {
  display: grid;
  gap: 0.15rem 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
}

.rel > div:first-child {
  padding-top: 0;
  border-top: 0;
}

.rel dt {
  font-weight: 650;
}

.rel dd {
  line-height: 1.6;
}

@media (min-width: 40em) {
  .rel > div {
    grid-template-columns: 11rem minmax(0, 1fr);
  }
}

.ids {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.25rem 1rem;
  font-size: 0.875rem;
}

.ids dt {
  color: var(--muted);
}

.more > summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--control);
  padding-inline: 0.25rem;
  color: var(--accent);
  cursor: pointer;
}

.more > ul {
  margin-top: 0.25rem;
}

.no-model {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  border-radius: var(--radius-card);
}

@media (min-width: 60em) {
  .structure {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-areas: "head viewer" "body viewer";
    grid-template-rows: auto 1fr;
    column-gap: 3.5rem;
    row-gap: 2rem;
    padding: 1.25rem 0 4rem;
  }

  .structure-head h1 {
    font-size: 3rem;
  }

  .structure-viewer {
    position: sticky;
    inset-block-start: 5rem;
  }
}

/* --- Atlas page: the full viewer --- */
/* Phones: nearly the whole screen under the site header. The viewer stacks its search, tabs, layer strip and tool
   strip, and in a shorter box they cover the model entirely (seen on a Redmi: the plugin's 4:5 also won here). */
.anatomy-embed.anatomy-embed--full {
  aspect-ratio: auto;
  height: clamp(30rem, 100svh - 5.5rem, 44rem);
}

/* Two classes: the plugin's embed.css loads after this file and sets 16:9 on .anatomy-embed; with the height below
   that ratio made the box narrower than the page and left it hanging on the left. */
@media (min-width: 48em) {
  .anatomy-embed.anatomy-embed--full {
    aspect-ratio: auto;
    width: 100%;
    height: min(46rem, 100svh - 9rem);
    min-height: 30rem;
  }
}

.atlas-text {
  display: grid;
  gap: 1.75rem;
  align-content: start;
  min-width: 0;
}

.atlas-text .block + .block {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.atlas-meta {
  display: grid;
  gap: 1.75rem;
  padding: 1.5rem 0 3rem;
}

@media (min-width: 60em) {
  .atlas-meta {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: 3.5rem;
  }
}

/* --- Search results --- */
.results a {
  display: grid;
  gap: 0.1rem;
  padding: 0.75rem 0;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.results strong {
  font-weight: 650;
  color: var(--accent);
}

.results a:hover strong {
  text-decoration: underline;
}

.search-large {
  max-width: 36rem;
  margin-top: 0.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  .btn,
  .chip,
  .atlas-card,
  .nav-links a,
  .index a {
    transition: border-color 150ms, background-color 150ms, color 150ms;
  }
}

/* --- Guides (articles) --- */
.guides {
  display: grid;
  gap: 0.75rem;
}

.guide {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  height: 100%;
  padding: 1rem;
  color: inherit;
  text-decoration: none;
}

.guide:hover {
  border-color: currentColor;
}

.guide h3 {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.3;
}

.guide .sys-icon {
  align-self: center;
  width: 1.25rem;
  height: 1.25rem;
}

@media (min-width: 40em) {
  .guides {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 64em) {
  .guides {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.article-solo {
  display: grid;
  gap: 1.25rem;
  max-width: 46rem;
  padding: 0.75rem 0 3rem;
}

.article-solo .structure-head,
.article-solo .structure-body {
  grid-area: auto;
}

.takeaways {
  padding: 1rem 1.25rem;
  background: var(--accent-soft);
  border-radius: var(--radius-card);
}

.takeaways h2,
.toc h2 {
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.takeaways ul {
  display: grid;
  gap: 0.4rem;
  padding-inline-start: 1.1rem;
  line-height: 1.5;
  list-style: disc;
}

.takeaways p {
  margin-top: 0.75rem;
}

.takeaways .btn {
  background: var(--panel-solid);
}

.article-body h2,
.faq h2 {
  margin: 2rem 0 0.6rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.article-body > :first-child {
  margin-top: 0;
}

.article-body h3,
.faq h3 {
  margin: 1.4rem 0 0.4rem;
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.3;
}

.article-body p + p,
.article-body ul + p,
.article-body ol + p,
.article-body .table-wrap + p {
  margin-top: 0.75rem;
}

.article-body ul,
.article-body ol {
  display: grid;
  gap: 0.35rem;
  margin: 0.6rem 0;
  padding-inline-start: 1.4rem;
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body code {
  padding: 0.05rem 0.3rem;
  font-size: 0.9em;
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
}

.note {
  padding: 0.6rem 0.85rem;
  color: var(--muted);
  border-inline-start: 3px solid var(--border);
}

/* A table scrolls inside its own box on a phone instead of widening the page. */
.table-wrap {
  margin: 1rem 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.table-wrap:focus-visible {
  outline: 2px solid var(--focus);
}

.table-wrap table {
  width: 100%;
  min-width: 30rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
  overflow-wrap: normal;
}

.table-wrap th,
.table-wrap td {
  padding: 0.55rem 0.75rem;
  text-align: start;
  vertical-align: top;
  border-top: 1px solid var(--border);
}

.table-wrap thead th {
  font-weight: 650;
  background: var(--bg-top);
  border-top: 0;
}

.faq p {
  font-size: 1.0625rem;
  line-height: 1.6;
}

.toc ol {
  display: grid;
  gap: 0.1rem;
}

.toc a {
  display: flex;
  align-items: center;
  min-height: 2.25rem;
  color: inherit;
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* On a phone the list of sections would push the text down: it is a desktop aid. */
@media (max-width: 59.99em) {
  .toc {
    display: none;
  }
}

@media (min-width: 60em) {
  .structure-viewer:has(.toc) {
    max-height: calc(100svh - 6rem);
    overflow-y: auto;
  }
}

/* Grid items may not grow with their content: a wide table scrolls in its own box instead of widening the page. */
.structure-body > *,
.article-solo > *,
.atlas-text > * {
  min-width: 0;
}

/* --- The home stage in motion (assets/js/hero.js) --- */
/* The turntable frames are 8:9; on a phone the stage takes that shape so the picture's gradient is the stage's.
   The frames show the middle 80 % of the viewer's stage (tools/wpshots/turntable.mjs, TRIM), so the stage behind
   them is painted with that same part of the gradient: picture and stage match to the pixel. */
.hero[data-turn-frames] .anatomy-embed:not(.is-live) {
  background: linear-gradient(color-mix(in srgb, var(--bg-top) 90%, var(--bg-bottom)), color-mix(in srgb, var(--bg-top) 10%, var(--bg-bottom)));
}

.hero[data-turn-frames] .anatomy-embed {
  aspect-ratio: 8 / 9;
}

.hero-turn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: grab;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.hero.is-dragging .hero-turn {
  cursor: grabbing;
}

.hero-hint {
  display: none;
}

/* Shown once the model can be turned, gone after the first drag. */
.hero.is-turning:not(.was-dragged) .hero-hint {
  /* Bottom right, clear of the model's feet and of the credit on the left. */
  position: absolute;
  inset-block-end: 0.6rem;
  inset-inline-end: max(1rem, (100vw - 80rem) / 2);
  z-index: 1;
  display: flex;
  pointer-events: none;
}

.hero-hint {
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.hero-hint svg {
  width: 1.125rem;
  height: 1.125rem;
}

@media (max-width: 59.99em) {
  /* On a phone the hint sits on the stage itself, above the systems panel. */
  .hero.is-turning:not(.was-dragged) .hero-hint {
    position: static;
    margin: 0 0 0.5rem;
  }

  .hero-bottom .wrap {
    display: flex;
    flex-direction: column;
  }

  .hero-hint {
    order: -1;
  }
}

@media (min-width: 60em) {
  .hero[data-turn-frames] .anatomy-embed {
    aspect-ratio: auto;
  }
}

/* The first screen arrives in three beats: stage, then the two panels. Nothing moves for a reader who asked for
   less motion, and nothing is hidden if the animation never runs. */
@media (prefers-reduced-motion: no-preference) {
  .hero .intro,
  .hero .layers {
    animation: hero-rise 500ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero .layers {
    animation-delay: 120ms;
  }

  .hero-turn {
    animation: hero-fade 400ms ease-out both;
  }

  .layers .chip {
    transition: border-color 150ms, background-color 150ms, transform 150ms;
  }

  .layers .chip:hover {
    transform: translateX(2px);
  }
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}

@keyframes hero-fade {
  from {
    opacity: 0;
  }
}

/* --- Light and motion (2026-10-10) ---
   The site is dark on every device. This layer adds depth to the viewer's flat vocabulary: light that drifts over
   the home stage, a gradient on the headline and the primary button, glass panels, cards that lift, and blocks that
   rise into place as they scroll in (assets/js/reveal.js). The stage colours themselves are untouched, so the
   posters and turntable frames still meet the stage without a seam: the light is painted over both with `screen`.
   Everything that moves is inside prefers-reduced-motion: no-preference. */
:root {
  --glow-blue: 96 165 250;
  --glow-violet: 129 140 248;
  --glow-rose: 244 114 128;
  --lift: 0 1.25rem 2.5rem -1.25rem rgb(var(--glow-blue) / 0.45), 0 0 0 1px rgb(var(--glow-blue) / 0.25);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Reading pages: a faint light from above, so the surface is not one flat colour. */
body:not(.home) {
  background:
    radial-gradient(70rem 26rem at 50% -8rem, rgb(var(--glow-blue) / 0.13), transparent 70%) no-repeat,
    var(--panel-solid);
}

body.home {
  background:
    radial-gradient(60rem 30rem at 85% 62rem, rgb(var(--glow-violet) / 0.1), transparent 70%) no-repeat,
    radial-gradient(60rem 30rem at 10% 110rem, rgb(var(--glow-blue) / 0.09), transparent 70%) no-repeat,
    var(--bg-bottom);
}

.site-header:not(.home .site-header) {
  background: color-mix(in srgb, var(--panel-solid) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}

.wordmark svg {
  filter: drop-shadow(0 0 0.5rem rgb(var(--glow-blue) / 0.7));
}

/* The light over the home stage: two soft sources, one cool and one warm (the muscle layer's red, answered). */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(38rem 26rem at 22% 38%, rgb(var(--glow-blue) / 0.3), transparent 68%),
    radial-gradient(34rem 24rem at 80% 70%, rgb(var(--glow-violet) / 0.24), transparent 68%),
    radial-gradient(24rem 9rem at 50% 84%, rgb(var(--glow-rose) / 0.2), transparent 70%);
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  /* The light dies away before the edges of the stage, so the bands above and below still continue it. */
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 80%, transparent);
  mask-image: linear-gradient(transparent, #000 14%, #000 80%, transparent);
  transition: opacity 400ms;
}

/* The live viewer shows its own true colours. */
.hero:has(.anatomy-embed.is-live)::after {
  opacity: 0;
}

/* The panels stay above the light (on a phone they are not layered and the light simply passes over them). */
@media (min-width: 60em) {
  .hero-top,
  .hero-bottom {
    z-index: 2;
  }
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .intro h1,
  .page-head h1,
  .structure-head h1 {
    color: transparent;
    background: linear-gradient(175deg, #ffffff 35%, #a9ccff 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }
}

@media (forced-colors: active) {
  .intro h1,
  .page-head h1,
  .structure-head h1 {
    color: CanvasText;
    background: none;
  }
}

.eyebrow {
  color: var(--accent);
}

/* Glass: the panels of the first screen get a lit edge instead of a flat hairline. */
.panel {
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(140deg, rgb(var(--glow-blue) / 0.6), rgb(226 232 240 / 0.1) 38%, rgb(var(--glow-violet) / 0.45)) border-box;
  border-color: transparent;
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 2rem 4rem -2rem rgb(0 0 0 / 0.7), inset 0 1px 0 rgb(255 255 255 / 0.06);
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #bfdbfe, #93c5fd 45%, #a5b4fc);
  border-color: transparent;
  box-shadow: 0 0.75rem 1.75rem -0.75rem rgb(var(--glow-blue) / 0.8);
}

/* A band of light that crosses the button when it is pointed at. */
.btn-primary::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / 0.55), transparent);
  transform: skewX(-18deg);
  opacity: 0;
}

.section-head h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-head h2::before {
  content: "";
  flex: none;
  width: 0.25rem;
  height: 1.1em;
  background: linear-gradient(#93c5fd, #818cf8);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0.75rem rgb(var(--glow-blue) / 0.8);
}

.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-solid) 92%, #ffffff), var(--panel-solid));
}

.atlas-card:hover,
.sys-card:hover,
.guide:hover,
.feature:hover {
  border-color: rgb(var(--glow-blue) / 0.7);
  box-shadow: var(--lift);
}

a.chip:hover,
.index a:hover {
  border-color: rgb(var(--glow-blue) / 0.7);
  background-color: var(--accent-soft);
}

/* A body-system chip answers in the colour of its layer. */
a.chip[data-system]:hover {
  box-shadow: inset 3px 0 0 var(--system);
}

.input:focus,
.select:focus {
  border-color: rgb(var(--glow-blue) / 0.8);
  box-shadow: 0 0 0 0.25rem rgb(var(--glow-blue) / 0.18);
}

.site-footer {
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(var(--glow-blue) / 0.7) 30%, rgb(var(--glow-violet) / 0.7) 70%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .hero::after {
    animation: hero-light 22s ease-in-out infinite alternate;
  }

  .btn,
  .card,
  .chip,
  .index a,
  .input,
  .select {
    transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), border-color 180ms, background-color 180ms;
  }

  .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 1rem 2.25rem -0.75rem rgb(var(--glow-blue) / 0.95);
  }

  .btn-primary:hover::after {
    opacity: 1;
    inset-inline-start: 120%;
    transition: inset-inline-start 700ms var(--ease-out);
  }

  .atlas-card:hover,
  .sys-card:hover,
  .guide:hover,
  .feature:hover {
    transform: translateY(-4px);
  }

  .card .stage img {
    transition: transform 700ms var(--ease-out);
  }

  .card:hover .stage img {
    transform: scale(1.05);
  }

  /* Blocks marked by reveal.js rise into place the first time they are seen. Without the script, or before it
     runs, nothing is hidden. */
  [data-reveal] {
    opacity: 0;
    transform: translateY(1.25rem);
  }

  [data-reveal].is-in {
    opacity: 1;
    transform: none;
    transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
    transition-delay: calc(var(--reveal-i, 0) * 70ms);
  }

  /* Once it has arrived a card answers the pointer at once, not after its entrance delay. */
  [data-reveal].is-done {
    transition-delay: 0s;
  }
}

@keyframes hero-light {
  from {
    background-position: 0 0, 0 0, 0 0;
  }

  to {
    background-position: 6rem -2rem, -7rem 2rem, 0 0;
  }
}

/* --- The phone menu ---
   The panel is a sibling of <details class="menu">, not a child: its links were never reached by ".menu nav a" and
   showed as bare underlined text run together. It is a card under the bar: search first, then one full-width row
   per section with the current one marked. */
.menu-panel {
  gap: 0.6rem;
  margin-top: 0.25rem;
  padding: 0.6rem;
  background: color-mix(in srgb, var(--panel-solid) 88%, #ffffff);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 1.5rem 3rem -1.5rem rgb(0 0 0 / 0.8);
}

.site-header .wrap:has(.menu[open]) {
  padding-bottom: 0.75rem;
}

.menu-panel .search {
  order: -1;
}

.menu-panel nav {
  display: grid;
}

.menu-panel nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3rem;
  padding: 0 0.75rem;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-control);
}

.menu-panel nav a + a {
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  border-start-start-radius: 0;
  border-start-end-radius: 0;
}

/* A chevron that says "this goes somewhere" (mirrored in right-to-left pages by the logical border sides). */
.menu-panel nav a::after {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-block-start: 2px solid var(--muted);
  border-inline-end: 2px solid var(--muted);
  transform: rotate(45deg);
}

.menu-panel nav a:hover,
.menu-panel nav a[aria-current] {
  background: var(--accent-soft);
}

.menu-panel nav a[aria-current] {
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.menu-panel nav a[aria-current]::after {
  border-color: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .menu[open] + .menu-panel {
    animation: menu-open 220ms var(--ease-out) both;
  }
}

@keyframes menu-open {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
}

/* --- Study tools (anatomy-tools.php) --- */
.tools .page-head .review-note {
  margin-top: 0.5rem;
}

.tools-stage {
  max-width: 56rem;
  margin: 0 0 1.5rem;
}

.tools-stage .anatomy-embed {
  max-height: min(52vh, 26rem);
  width: 100%;
}

.tools-item .btn-primary {
  margin-bottom: 1rem;
}

/* Two names to a row at most: these are full muscle names, not single words. */
.index.tools-targets {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 30em) {
  .index.tools-targets {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The chart: names stay in view while the row is read sideways on a phone. */
.tools-table table {
  min-width: 52rem;
  font-size: 0.9375rem;
}

.tools-table th[scope="row"] {
  position: sticky;
  inset-inline-start: 0;
  min-width: 11rem;
  text-align: start;
  background: var(--panel-solid);
}

.tools-table th[scope="row"] .latin {
  display: block;
  font-weight: 400;
  color: var(--muted);
}

.tools-table td {
  vertical-align: top;
  line-height: 1.5;
}

.tools-index .count {
  margin-inline-start: auto;
  color: var(--muted);
}

.tools-plain {
  display: flex;
  align-items: center;
  min-height: 3rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.tools-item {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 60em) {
  .tools-item {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    align-items: start;
  }

  .tools-item .tools-stage {
    position: sticky;
    inset-block-start: 5rem;
    margin: 0;
  }
}

/* Latin terms: three columns read comfortably at any width, and a column can be hidden for a self-test. */
.tools-terms table {
  min-width: 0;
  font-size: 1rem;
}

.tools-terms th[scope="row"] {
  font-weight: 600;
}

.tools-quiz {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tools-quiz[hidden] {
  display: none;
}

.tools-terms .is-hidden {
  cursor: pointer;
}

.tools-terms .is-hidden > * {
  visibility: hidden;
}

/* The covered cell: a bar where the words were, so the row keeps its height and the eye knows something is there. */
.tools-terms .is-hidden {
  background-image: linear-gradient(var(--accent-soft), var(--accent-soft));
  background-repeat: no-repeat;
  background-position: 0.75rem center;
  background-size: min(70%, 12rem) 1.1em;
}

.tools-terms td.is-hidden {
  color: transparent;
}

.tools-quiz .btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.tools-deck {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

.tools-deck[hidden] {
  display: none;
}

.tools-deck .anatomy-notice {
  flex-basis: 100%;
  margin: 0;
}

.tools-deck .anatomy-notice .btn {
  margin-inline-start: 0.5rem;
}

/* Organ sizes: a bar per person, as long as that person's organ is to the largest one. */
.tools-sizes table {
  min-width: 0;
}

.tools-sizes th[scope="row"] {
  min-width: 0;
  position: static;
}

.tools-bar-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 11rem;
}

.tools-bar {
  flex: none;
  width: calc(var(--share) * 0.6);
  max-width: 60%;
  height: 0.7rem;
  background: linear-gradient(90deg, #60a5fa, #818cf8);
  border-radius: var(--radius-pill);
}

.tools-sizes tfoot th,
.tools-sizes tfoot td {
  padding: 0.55rem 0.75rem;
  text-align: start;
  font-weight: 650;
  border-top: 1px solid var(--border);
}

.tools-group + .tools-group {
  margin-top: 2rem;
}

/* Vertebral levels: the code leads each row of the index; on a level's page the names can be hidden like the terms. */
.tools-index strong {
  flex: none;
  min-width: 2.6rem;
  color: var(--accent);
}

.tools-system {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0 0.25rem;
  font-size: 1rem;
  font-weight: 650;
}

.tools-levels .is-hidden {
  cursor: pointer;
  background-image: linear-gradient(var(--accent-soft), var(--accent-soft));
  background-repeat: no-repeat;
  background-position: 0 center;
  background-size: min(80%, 14rem) 1.1em;
}

.tools-levels .is-hidden > * {
  visibility: hidden;
}

/* The tools as cards with a picture each. */
.tools-cards {
  display: grid;
  gap: 1rem;
}

.tools-cards .stage {
  aspect-ratio: 8 / 5;
}

.tools-cards .atlas-card h3 {
  font-size: 1.0625rem;
}

@media (min-width: 40em) {
  .tools-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64em) {
  .tools-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
