/* Gray's Vertebrate Anatomy: site styles */
@font-face { font-family: "Red Hat Display"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/red-hat-display-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Red Hat Display"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/red-hat-display-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Red Hat Display"; font-weight: 700; font-style: italic; font-display: swap; src: url(fonts/red-hat-display-latin-700-italic.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/open-sans-normal-400.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/open-sans-normal-600.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/open-sans-italic-400.woff2) format("woff2"); }

:root {
  --bg: #000;
  --panel: #111;
  --line: #2a2a2a;
  --text: #e2e2e2;
  --muted: #a8a8a8;
  --heading: #fff;
  --accent: #5eead4;
  --accent-deep: #1f9e92;
  --on-accent: #06231f;
  --accent-hover: #8ff2e1;
  --btn: #5f5f5f;
  --btn-hover: #747474;
  --display: "Red Hat Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1100px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: -0.015em; color: var(--heading); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 1.2em; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.lead { font-size: 1.15rem; color: var(--text); }
.small { font-size: .875rem; color: var(--muted); }
.eyebrow { font-size: .85rem; color: var(--accent); letter-spacing: .02em; margin-bottom: .6em; }
.eyebrow a { text-decoration: none; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: #fff; color: #000; padding: 8px 12px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(0,0,0,.92); backdrop-filter: blur(6px); z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 88px; }
.logo img { width: 160px; height: auto; }
#site-nav ul { list-style: none; margin: 0; padding: 0; }
#site-nav > ul { display: flex; gap: 6px; }
#site-nav a { display: block; padding: 8px 12px; color: var(--text); text-decoration: none; border-radius: 8px; }
#site-nav a:hover, #site-nav .active > a, #site-nav a[aria-current] { color: #fff; background: #1c1c1c; }
.has-sub { position: relative; }
.has-sub > a::after { content: " \25BE"; font-size: .8em; }
.sub { display: none; position: absolute; top: 100%; left: 0; min-width: 240px; background: #111; border: 1px solid var(--line); border-radius: 10px; padding: 6px !important; }
.has-sub:hover .sub, .has-sub:focus-within .sub { display: block; }
.menu-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; }
.bars, .bars::before, .bars::after { display: block; width: 22px; height: 2px; background: #fff; margin: 0 auto; position: relative; content: ""; }
.bars::before { position: absolute; top: -7px; } .bars::after { position: absolute; top: 7px; }
@media (max-width: 820px) {
  .menu-toggle { display: block; }
  #site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #000; border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  #site-nav.open { display: block; }
  #site-nav > ul { flex-direction: column; }
  .sub { display: block; position: static; border: 0; background: none; padding: 0 0 0 16px !important; }
  .has-sub > a::after { content: ""; }
}

main { padding-bottom: 64px; }
section { margin-top: 48px; }
.page-head { margin-top: 56px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 22px; border-radius: 999px; background: var(--btn); color: #fff; font-weight: 600; text-decoration: none; font-size: .95rem; line-height: 1.3; text-align: center; border: 0; cursor: pointer; }
.btn:hover { background: var(--btn-hover); color: #fff; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-small { padding: 6px 14px; font-size: .85rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.btn-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.btn-link { background: #3a3a3a; }

/* home */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; min-height: calc(100vh - 220px); }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; min-height: 0; } .hero-img img { max-width: 320px; margin: 0 auto; } }

/* about */
.about-intro { display: grid; grid-template-columns: 320px 1fr; gap: 48px; align-items: start; }
.about-photo img { border-radius: var(--radius); }
@media (max-width: 760px) { .about-intro { grid-template-columns: 1fr; } .about-photo img { max-width: 280px; } }
.pubs { padding-left: 1.4em; }
.pubs li { margin-bottom: 1.2em; padding-left: .3em; }
.pubs li p { margin: 0; }
.pubs strong { color: #fff; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 140px 1fr; gap: 24px; padding: 0 0 28px 24px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-deep); box-shadow: 0 0 0 2px var(--accent); }
.exp-date { color: var(--accent); font-weight: 600; }
.exp-body h4 { margin-bottom: .2em; }
.exp-body p { margin: 0 0 .2em; color: var(--muted); }
@media (max-width: 600px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }

/* cards & grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.card-img { border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; margin-bottom: 18px; }
.card h3 { font-size: 1.6rem; }
.cta { border-top: 1px solid var(--line); padding-top: 32px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

.tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 24px; }
.tiles-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile img { border-radius: 10px; background: transparent; aspect-ratio: 1; object-fit: contain; width: 100%; }
.tile-lg img { aspect-ratio: 4 / 3; }
.tile h3 { font-size: 1.05rem; margin: 10px 0 4px; }
.tile p { color: var(--muted); font-size: .92rem; margin-bottom: 8px; }
.tile .btn-row { margin: 6px 0 0; gap: 6px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #1a1a1a; color: #fff; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 8px; vertical-align: -2px; border: 1px solid rgba(255,255,255,.3); }

/* embeds */
.embed { position: relative; width: 100%; border-radius: var(--radius); overflow: hidden; background: #0b0b0b; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-wide, .embed-model { aspect-ratio: 16 / 10; }
.embed-doc { aspect-ratio: 4 / 5; max-height: 90vh; }

/* educational */
.edu-section { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: start; border-top: 1px solid var(--line); padding-top: 40px; }
.edu-section h2 { margin-top: 0; }
@media (max-width: 820px) { .edu-section { grid-template-columns: 1fr; } }
.kits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kit img { border-radius: 10px; transition: transform .2s; }
.kit:hover img { transform: translateY(-3px); }

/* gallery */
.masonry { column-count: 3; column-gap: 20px; }
.masonry figure { margin: 0 0 20px; break-inside: avoid; }
.masonry img { border-radius: 10px; width: 100%; }
.masonry a:hover img { outline: 2px solid var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 820px) { .masonry { column-count: 2; } }
@media (max-width: 520px) { .masonry { column-count: 1; } }

/* skull pages */
.skull-figs { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.skull-figs figure { margin: 0; }
.skull-figs img { border-radius: 10px; }

.refs p { color: var(--muted); }
.contact-list ul { padding-left: 1.2em; }
.contact-list li { margin-bottom: .5em; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.social { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; flex-wrap: wrap; }
.social a { color: var(--text); text-decoration: none; }
.social a:hover { color: var(--accent); }
.copyright { margin: 0; color: var(--muted); font-size: .85rem; }

/* layout fixes */
.split > *, .grid-2 > *, .edu-section > *, .about-intro > *, .hero > * { min-width: 0; }
.pubs a, .refs a, .about-text a { overflow-wrap: anywhere; }
.embed { margin-bottom: 24px; }

/* educational resources */
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.jump a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; font-size: .9rem; }
.jump a:hover { border-color: var(--accent); color: var(--accent); }
.section-title { margin-top: 0; padding-top: 8px; }
.section-intro { color: var(--muted); max-width: 70ch; margin-bottom: 24px; }
.tag { display: inline-block; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); border: 1px solid rgba(94,234,212,.35); border-radius: 999px; padding: 2px 10px; margin-bottom: 10px; }
.btn-lg { padding: 13px 26px; font-size: 1rem; margin-top: 8px; }
.feature { display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.feature-img img { border-radius: 12px; border: 1px solid var(--line); transition: transform .2s; }
.feature-img:hover img { transform: scale(1.01); }
.feature h3 { font-size: 1.8rem; }
@media (max-width: 820px) { .feature { grid-template-columns: 1fr; } }
.kit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.coll-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .kit-grid, .coll-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .kit-grid, .coll-grid { grid-template-columns: 1fr; } }
.kit-card, .coll-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.kit-cover { display: block; background: #7fd3f5; }
.kit-cover img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; transition: transform .2s; }
.kit-cover:hover img { transform: scale(1.02); }
.kit-body, .coll-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.kit-body h3, .coll-body h3 { font-size: 1.2rem; }
.kit-body p:not(.tag), .coll-body p { color: var(--muted); font-size: .95rem; }
.kit-body .btn { margin-top: auto; align-self: flex-start; }
.coll-body .btn-row { margin: auto 0 0; }
.embed-card { aspect-ratio: 4 / 3; border-radius: 0; margin: 0; }
#tools, #kits, #collections { margin-top: 72px; }
#tools { margin-top: 48px; }
.kit-body .tag, .feature-body .tag { align-self: flex-start; }
.kit-cover img { aspect-ratio: auto; object-fit: initial; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 860px) { .tool-grid { grid-template-columns: 1fr; } }
.tool-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.tool-img { display: block; border-bottom: 1px solid var(--line); overflow: hidden; }
.tool-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; transition: transform .25s; }
.tool-img:hover img { transform: scale(1.02); }
.tool-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.tool-body .tag { align-self: flex-start; }
.tool-body h3 { font-size: 1.6rem; }
.tool-body p:not(.tag):not(.small) { color: var(--text); }
.tool-body .btn { margin-top: auto; align-self: flex-start; }
/* forelimb page: centered buttons */
.page-forelimb .btn-row { justify-content: center; }
.page-forelimb .tile { text-align: center; }
/* keep anchored sections clear of the sticky header */
[id] { scroll-margin-top: 110px; }

/* ---- purple accents (from the CT Parameter Explorer palette) ---- */
:root {
  --purple: #c4a8ff;          /* lavender, explorer's --change */
  --purple-deep: #2a1f45;
  --purple-hover: #3a2b60;
  --panel: #120d20;           /* explorer's panel color */
  --line: #2a2340;
  --muted: #a99fc4;           /* lavender-gray, like the explorer's muted text */
}
.eyebrow, .eyebrow a { color: var(--purple); }
.tag { color: var(--purple); border-color: rgba(196,168,255,.4); }
.btn, .btn-link { background: var(--purple-deep); color: #ece4ff; }
.btn:hover, .btn-link:hover { background: var(--purple-hover); color: #fff; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
#site-nav a:hover, #site-nav .active > a, #site-nav a[aria-current] { background: var(--purple-deep); }
.sub { background: var(--panel); }
th { background: #1a1430; }
.timeline { border-left-color: var(--purple-deep); }
.timeline li::before { background: var(--purple); box-shadow: 0 0 0 3px #000, 0 0 0 4px var(--purple-deep); }
.jump a:hover { border-color: var(--purple); color: var(--purple); }
.page-head h1::after, .section-title::after, .about-text h1::after {
  content: ""; display: block; width: 64px; height: 3px; border-radius: 3px; margin-top: 14px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
}
.social a:hover { color: var(--purple); }
.cta { border-top-color: var(--line); }

/* ---------- About page (revamp) ---------- */
.page-about main > section { margin-bottom: 72px; }
.about-hero { display: grid; grid-template-columns: 340px 1fr; gap: 56px; align-items: center; padding-top: 48px; }
.about-photo { position: relative; }
.about-photo::before { content: ""; position: absolute; inset: 14px -14px -14px 14px; border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-deep), var(--purple)); opacity: .55; z-index: 0; }
.about-photo img { position: relative; z-index: 1; border-radius: 18px; width: 100%; display: block; }
.about-role { font-family: var(--display); font-weight: 600; color: var(--purple); font-size: 1.1rem; margin: -4px 0 18px; }
.about-bio p { max-width: 68ch; }
.about-actions { margin-top: 24px; }
.about-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)) minmax(0,2.2fr); gap: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-family: var(--display); font-weight: 700; font-size: 2.2rem; line-height: 1; color: var(--accent); }
.stat:nth-child(2) .stat-num { color: var(--purple); }
.stat:nth-child(3) .stat-num { color: #fff; }
.stat-label { color: var(--muted); font-size: .9rem; }
.stat-focus .stat-label { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--purple); margin-bottom: 6px; }
.focus-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.focus-list li { font-size: .85rem; padding: 4px 12px; border-radius: 999px; background: var(--purple-deep); color: #ece4ff; }

.exp-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
.exp-heading { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--purple); margin-bottom: 16px; }
.exp-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.exp-card { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent-deep); border-radius: 12px; padding: 16px 20px; }
.exp-list li:first-child.exp-card { border-left-color: var(--accent); }
.exp-grid > div:last-child .exp-card { border-left-color: var(--purple); }
.exp-date { font-size: .8rem; font-weight: 600; color: var(--accent); margin: 0 0 4px; letter-spacing: .02em; }
.exp-grid > div:last-child .exp-date { color: var(--purple); }
.exp-card h3 { font-size: 1.1rem; margin: 0 0 6px; }
.exp-lines p { margin: 0; color: var(--muted); font-size: .92rem; }

.pub-year { display: grid; grid-template-columns: 110px 1fr; gap: 24px; border-top: 1px solid var(--line); padding: 24px 0 8px; }
.year-label { font-size: 1.6rem; color: var(--purple); margin: 0; position: sticky; top: 110px; align-self: start; }
.pub-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }
.pub-title { font-family: "Open Sans", system-ui, sans-serif; font-size: 1.05rem; font-weight: 600; letter-spacing: 0; line-height: 1.4; color: #fff; margin: 0 0 4px; }
.pub-authors { margin: 0 0 2px; color: var(--muted); font-size: .9rem; }
.pub-authors strong { color: var(--text); }
.pub-venue { margin: 0 0 6px; font-size: .9rem; font-style: italic; color: var(--text); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.tag-first { font-style: normal; margin: 0; font-size: .68rem; }
.pub-link { font-size: .85rem; color: var(--accent); overflow-wrap: anywhere; }
.more-authors { display: inline; }
.more-authors summary { display: inline; cursor: pointer; color: var(--purple); list-style: none; }
.more-authors summary::-webkit-details-marker { display: none; }
.more-authors[open] summary { display: block; margin-bottom: 4px; }

@media (max-width: 900px) {
  .about-hero { grid-template-columns: 1fr; gap: 36px; padding-top: 24px; }
  .about-photo { max-width: 300px; }
  .about-stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .stat-focus { grid-column: 1 / -1; }
  .exp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .about-stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { grid-column: 1 / -1; }
  .pub-year { grid-template-columns: 1fr; gap: 8px; }
  .year-label { position: static; }
}
.more-authors { display: block; margin: 2px 0 0; }
.more-authors summary { display: inline-block; font-size: .85rem; }
.more-authors[open] summary { display: inline-block; }
.stat { justify-content: center; }
.about-stats { align-items: stretch; }
/* about: lab photo + highlights band */
.about-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 32px; align-items: center; }
.lab-photo { margin: 0; }
.lab-photo img { width: 100%; border-radius: 18px; border: 1px solid var(--line); display: block; height: auto; }
.lab-photo figcaption { color: var(--muted); font-size: .85rem; margin-top: 10px; }
.about-band .about-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: center; }
.about-band .stat-wide, .about-band .stat-focus { grid-column: 1 / -1; }
.about-band .stat { justify-content: flex-start; }
@media (max-width: 900px) {
  .about-band { grid-template-columns: 1fr; }
  .lab-photo { max-width: 420px; }
}
@media (max-width: 560px) { .about-band .about-stats { grid-template-columns: 1fr 1fr; } .about-band .stat:nth-child(3) { grid-column: 1 / -1; } }
.about-band { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 56px; }
.band-text p { max-width: 62ch; }
.band-text .focus-list { margin-top: 22px; }

.about-photo::before { display: none; }
.about-photo img { border: 1px solid var(--line); }
/* lab photo on the right */
.about-band { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.about-band .lab-photo { order: 2; }
@media (max-width: 900px) { .about-band { grid-template-columns: 1fr; } .about-band .lab-photo { order: 0; } }
