/* Dr. Jens R. Chapman: shared design system
   Format and motion follow rod/assets/css/global.css so the SSF doctors read as one family.
   Type is his own: Vollkorn (Friedrich Althausen) for display and editorial text,
   Fira Sans and Fira Sans Condensed (Erik Spiekermann, Ralph du Carrois) for text and labels.
   Both designed in Germany, like him.

   Shape rule, used everywhere: buttons and inputs 4px, cards and panels 10px, photos 6px.
   Colour rule: one accent per page, set by the palette tokens below. */

:root {
  /* Palette "Fluoro", lightbox monochrome, picked by the client team on 2026-09-23.
     The page is the lightbox: white and one cool grey. Dark panels are the films. */
  --paper: #FFFFFF;
  --mist: #F2F4F7;
  --mist-2: #E4E8ED;

  /* Ink: near black and slate, straight from the palette; muted is its grey, darkened to read */
  --ink: #0A0D12;
  --ink-2: #161B22;
  --muted: #5D646D;
  --faint: #A3ABB5;
  --line: rgba(10, 13, 18, 0.10);
  --line-2: rgba(10, 13, 18, 0.18);

  /* Lightbox blue is a fill and a glow, never text on white (1.5:1). Film blue is its text-safe
     shade (7:1 on white) for links, labels and picked states, like the blue base of X-ray film. */
  --lightbox: #BFD9EE;
  --lightbox-deep: #A0C3DF;
  --accent: #2E5D7E;
  --accent-deep: #1B4664;
  --accent-tint: #E6F2FC;
  --accent-glow: rgba(191, 217, 238, 0.7);
  --danger: #B42318;

  /* Type */
  --display: 'Vollkorn', Georgia, 'Times New Roman', serif;
  --sans: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --label: 'Fira Sans Condensed', 'Fira Sans', system-ui, sans-serif;

  /* Space and size */
  --max: 1240px;
  --gutter: max(1.25rem, 4vw);
  --nav-h: 68px;
  --r-btn: 4px;
  --r-card: 10px;
  --r-photo: 6px;

  /* Motion, taken from Rod's site */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --shadow-1: 0 1px 2px rgba(10, 13, 18, 0.05), 0 6px 20px rgba(10, 13, 18, 0.06);
  --shadow-2: 0 2px 6px rgba(10, 13, 18, 0.06), 0 18px 48px rgba(10, 13, 18, 0.10);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--lightbox); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.footer :focus-visible, .quote :focus-visible, .cred--ao :focus-visible { outline-color: var(--lightbox); }

/* Skip link: the first thing a keyboard user reaches */
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 300; padding: 0.7rem 1rem; background: var(--ink); color: #fff; border-radius: var(--r-btn); font-weight: 500; text-decoration: none; transition: top 0.2s; }
.skip:focus { top: 1rem; }
main:focus { outline: none; }
p { text-wrap: pretty; }

/* Type. One heading, one style: no italic display device anywhere (no-ai-slop 24). */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.012em;
  font-style: normal;
  font-variant-numeric: lining-nums;
}
h1 { font-size: clamp(2.5rem, 4.4vw, 4.1rem); line-height: 1.04; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 3.2vw, 3rem); line-height: 1.08; }
h3 { font-size: clamp(1.3rem, 1.8vw, 1.6rem); line-height: 1.2; }
p { margin: 0; }
.lede { font-size: clamp(1.08rem, 1.3vw, 1.22rem); line-height: 1.6; color: var(--muted); max-width: 44ch; }
.num {
  font-family: var(--label);
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Layout */
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.section { padding-block: clamp(4.5rem, 9vw, 8rem); }
.section--mist { background: var(--mist); }
.stack > * + * { margin-top: var(--stack, 1rem); }

/* Buttons: 4px corners, one label per intent across the site */
.btn {
  --btx: 0px; --bty: 0px;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.35rem;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.98rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transform: translate(var(--btx), var(--bty));
  transition:
    background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s,
    transform 0.6s var(--ease-spring);
}
.btn:active { transform: translate(0, 1px) scale(0.98); }
.btn--solid { background: var(--lightbox); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(10, 13, 18, 0.08); }
.btn--solid:hover { background: var(--lightbox-deep); }
.btn--line { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn--line:hover { border-color: var(--ink); }
.btn__arrow { transition: transform 0.35s var(--ease-spring); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* Text link with a drawn underline */
.link {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s var(--ease-out), color 0.2s;
  padding-bottom: 2px;
}
.link:hover { background-size: 100% 1px; color: var(--accent); }
.link--arrow { font-weight: 500; }
.link--arrow span { display: inline-block; margin-left: 0.2rem; transition: transform 0.35s var(--ease-spring); }
.link--arrow:hover span { transform: translateX(4px); }

/* Reveal: Rod's fade-up, used sparingly on blocks that earn it. It runs as an animation on the
   `translate` property, so it never fights the tilt (which owns `transform`) or a card's own
   transitions. Hidden only when JS is running, so the page still reads without it. */
@keyframes reveal-up { from { opacity: 0; translate: 0 20px; } to { opacity: 1; translate: 0 0; } }
.js [data-reveal] { opacity: 0; }
.js [data-reveal].revealed { opacity: 1; animation: reveal-up 0.7s var(--ease-out) backwards; }
[data-delay="100"] { animation-delay: 0.1s; }
[data-delay="200"] { animation-delay: 0.2s; }
[data-delay="300"] { animation-delay: 0.3s; }

/* Tilt cards with a pointer spotlight (Rod's SSF bento) */
.tilt {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease-out), box-shadow 0.4s ease;
}
.tilt::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle 220px at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.55), transparent 70%);
  transition: opacity 0.4s ease;
  mix-blend-mode: soft-light;
}
.tilt:hover::after { opacity: 1; }

/* Photos */
.photo { border-radius: var(--r-photo); overflow: hidden; background: var(--mist-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------------------
   INNER PAGES: shared pieces. Each page adds its own signature section inline.
   --------------------------------------------------------------------------- */

/* Page opening: the headline leads, nothing above it */
.page-hero { padding: calc(var(--nav-h) + clamp(2.75rem, 7vw, 5.5rem)) 0 clamp(2.5rem, 5vw, 4rem); }
.page-hero h1 { font-size: clamp(2.4rem, 4.6vw, 4.2rem); max-width: 18ch; text-wrap: balance; }
.page-hero .lede { margin-top: 1.25rem; max-width: 50ch; }

/* Closing band: one sentence and the next step, different on every page */
.next { padding-block: clamp(4rem, 8vw, 6.5rem); background: var(--mist); }
.next__inner { display: flex; align-items: end; justify-content: space-between; gap: 2rem 3rem; flex-wrap: wrap; }
.next h2 { max-width: 20ch; }
.next__actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* Filters. These are real controls (they change what the page shows), so they may look like
   toggles; static text never does (no-ai-slop 14 and 16). */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
.search {
  position: relative; flex: 1 1 18rem; max-width: 26rem;
}
.search input {
  width: 100%; height: 46px; padding: 0 1rem 0 2.6rem;
  font: inherit; font-size: 0.98rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-btn);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search svg { position: absolute; left: 0.9rem; top: 50%; translate: 0 -50%; color: var(--faint); pointer-events: none; }
.toggles { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.toggle {
  display: inline-flex; align-items: center; gap: 0.45rem;
  height: 36px; padding: 0 0.85rem;
  font-family: var(--label); font-weight: 600; font-size: 0.9rem; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-btn);
  cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.35s var(--ease-spring);
}
.toggle:hover { border-color: var(--ink); }
.toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.toggle:active { transform: scale(0.96); }
.toggle .n { font-weight: 500; opacity: 0.6; }
.select {
  height: 36px; padding: 0 2rem 0 0.8rem; font-family: var(--label); font-weight: 600; font-size: 0.9rem; color: var(--ink-2);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235D646D' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  border: 1px solid var(--line-2); border-radius: var(--r-btn); appearance: none; cursor: pointer;
}
.count-line { font-family: var(--label); font-weight: 600; color: var(--muted); font-size: 0.95rem; }
.count-line b { color: var(--ink); font-weight: 600; }
.empty { padding: 3rem 0; color: var(--muted); }

/* The side view of the spine that every small spine on the site draws from (spine-art.js): paper
   vertebrae with a hairline edge, the skull base and pelvis as faint ghosts. A chosen region fills
   down its vertebrae from head to tail, one bone after another (--i, set per vertebra). */
.spa { display: block; overflow: visible; }
.spa__anat path, .spa__anat circle {
  fill: none; stroke: var(--ink-2); stroke-opacity: 0.2; stroke-width: 1.1;
  stroke-linecap: round; vector-effect: non-scaling-stroke;
}
.spa__body, .spa__arch {
  fill: var(--paper); stroke: var(--ink-2); stroke-opacity: 0.5; stroke-width: 1;
  stroke-linejoin: round; vector-effect: non-scaling-stroke;
  transition: fill 0.5s cubic-bezier(0.32, 0.72, 0, 1), stroke 0.5s cubic-bezier(0.32, 0.72, 0, 1), stroke-opacity 0.5s;
}
.spa__arch { fill: var(--mist); }
.spa__hit { fill: transparent; }
.spa__v { transition: translate 0.6s cubic-bezier(0.32, 0.72, 0, 1); }
.spa__region.is-on .spa__body { fill: var(--accent); stroke: var(--accent-deep); stroke-opacity: 1; transition-delay: calc(var(--i) * 26ms); }
.spa__region.is-on .spa__arch { fill: var(--lightbox); stroke: var(--accent-deep); stroke-opacity: 0.7; transition-delay: calc(var(--i) * 26ms); }
/* the vertebra under the pointer, and the tag that names it (SpineArt.reader) */
.spa .spa__root .spa__region .spa__v.is-level .spa__body { fill: var(--ink); stroke: var(--ink); stroke-opacity: 1; transition-duration: 0.18s; transition-delay: 0s; }
.spa-tag {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1;
  font-family: var(--label); font-weight: 600; font-size: 0.78rem; line-height: 1; letter-spacing: 0.02em;
  padding: 0.32rem 0.5rem; border-radius: 999px; background: var(--ink); color: var(--paper);
  translate: var(--tx, 0px) var(--ty, 0px); opacity: 0; scale: 0.9;
  transition: translate 0.45s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s, scale 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.spa-tag.is-on { opacity: 1; scale: 1; }
.spa-tag.is-snap { transition: opacity 0.25s, scale 0.35s cubic-bezier(0.32, 0.72, 0, 1); }

/* The spine as a region filter: region toggles beside the drawing lying on its side, skull end on
   the left. Pointing at a toggle raises its vertebrae; pointing along the spine names the vertebra
   under the pointer in a small tag that glides from bone to bone (spine-picker.js). Research and Videos. */
.spine-pick { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem 2.5rem; flex-wrap: wrap; }
.spine-pick__toggles { flex: 1 1 19rem; }
.spine-pick .toggle.is-hot:not([aria-pressed="true"]) { border-color: var(--accent); color: var(--accent-deep); }
.spine-pick__figure { position: relative; flex: 1 1 28rem; max-width: 42rem; display: grid; gap: 0.5rem; padding-top: 1.6rem; }
.spine-pick__art { width: 100%; height: auto; -webkit-tap-highlight-color: transparent; }
.spine-pick__art .spa__region { cursor: pointer; }
.spine-pick__art .spa__region:not(.is-on) .spa__body { fill: color-mix(in srgb, var(--lightbox) calc(var(--d, 0) * 80%), var(--paper)); }
.spine-pick__art .spa__region.is-hot .spa__v { translate: 6px 0; transition-delay: calc(var(--i) * 18ms); }
.spine-pick__art .spa__region.is-hot:not(.is-on) .spa__body { fill: var(--lightbox-deep); stroke-opacity: 0.85; }
.spine-pick[data-value="whole-spine"] .spa__region.is-on .spa__body,
.spine-pick[data-value="whole-spine"] .spa__region.is-on .spa__arch { transition-delay: calc(var(--n) * 11ms); }
.spine-pick__art .spa__region.is-empty { opacity: 0.3; cursor: default; }
.spine-pick__under { position: relative; height: 2.3rem; }
.spine-pick__rule {
  position: absolute; left: 0; top: 0.15rem; height: 0.4rem; width: var(--w, 0px); translate: var(--x, 0px) 0;
  border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 3px 3px; opacity: 0;
  transition: translate 0.5s cubic-bezier(0.32, 0.72, 0, 1), width 0.5s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s;
}
.spine-pick__rule.is-on { opacity: 1; }
.spine-pick__cap {
  position: absolute; left: 0; top: 0.85rem; white-space: nowrap; translate: var(--cx, 0px) 0;
  font-family: var(--label); font-weight: 600; font-size: 0.85rem; color: var(--muted);
  transition: translate 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}
@media (max-width: 720px) {
  .spine-pick__figure { flex-basis: 100%; order: -1; padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .spa__body, .spa__arch, .spa__v, .spa-tag, .spine-pick__rule, .spine-pick__cap { transition-duration: 0.01s !important; transition-delay: 0s !important; }
}


/* The surgeons he trained (lineage.js): every fellow as a mark on one line of years. Home and Teaching. */
.lineage__head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem 3rem; flex-wrap: wrap; }
.lineage__head .lede { margin-top: 1rem; }
.lineage { margin-top: clamp(2rem, 4vw, 3rem); position: relative; }
.lineage__plot { position: relative; height: 250px; border-bottom: 1px solid var(--line-2); }
.lineage__era { position: absolute; top: 0; bottom: 0; background: var(--mist); border-radius: 6px 6px 0 0; }
.lineage__era.is-alt { background: var(--mist-2); }
.lineage__era span { position: absolute; top: 0.6rem; left: 0.75rem; font-family: var(--label); font-weight: 600; font-size: 0.84rem; line-height: 1.2; color: var(--muted); }
.lineage__era.is-alt span { color: var(--ink-2); }
.lineage__era b { font-weight: inherit; }
.lineage__era .s { display: none; }
@media (max-width: 760px) { .lineage__era .l { display: none; } .lineage__era .s { display: inline; } }
.lineage__dot {
  position: absolute; width: 12px; height: 12px; margin: 0 0 0 -6px; border-radius: 50%;
  background: var(--ink-2); border: 0; padding: 0; cursor: pointer;
  transform: scale(0); transition: transform 0.5s var(--ease-spring), background 0.2s, box-shadow 0.2s;
}
.lineage.is-in .lineage__dot { transform: scale(1); }
.lineage__dot.is-research { background: #fff; box-shadow: inset 0 0 0 2px var(--ink-2); }
.lineage__dot:hover, .lineage__dot:focus-visible, .lineage__dot.is-on { background: var(--lightbox); box-shadow: inset 0 0 0 2px var(--ink); transform: scale(1.45); }
.lineage__axis { position: relative; height: 1.8rem; font-family: var(--label); font-weight: 600; font-size: 0.85rem; color: var(--muted); }
.lineage__axis span { position: absolute; top: 0.5rem; transform: translateX(-50%); }
.lineage__foot { margin-top: 1.1rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem 2rem; flex-wrap: wrap; }
.lineage__read { min-height: 2.4rem; display: flex; gap: 0.35rem 1.1rem; align-items: baseline; flex-wrap: wrap; }
.lineage__read .n { font-family: var(--display); font-weight: 600; font-size: 1.45rem; color: var(--ink); }
.lineage__read .y { font-family: var(--label); font-weight: 600; color: var(--accent); }
.lineage__read .e { color: var(--muted); }
.lineage__key { display: flex; gap: 1.5rem; font-size: 0.9rem; color: var(--muted); }
.lineage__key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.45rem; vertical-align: -0.5px; background: var(--ink-2); }
.lineage__key i.r { background: #fff; box-shadow: inset 0 0 0 2px var(--ink-2); }
.lineage__dot.is-dim { opacity: 0.18; }
.lineage__dot.is-quiet { opacity: 0.2; transform: scale(0.8); }
.lineage__era { transition: background 0.3s; }
.lineage__era:hover { background: var(--mist-2); }
.lineage__era.is-alt:hover { background: color-mix(in srgb, var(--mist-2), var(--ink) 6%); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 100% { box-shadow: 0 0 0 12px rgba(0, 0, 0, 0); } }
.lineage__dot.is-ping { animation: ping 0.7s var(--ease-out); }
@media (max-width: 560px) {
  .lineage__dot { width: 8px; height: 8px; margin-left: -4px; }
  .lineage__dot.is-research { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
  .lineage__era span { left: 0.4rem; font-size: 0.74rem; }
}

/* Reduced motion: everything settles immediately */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; }
}
