:root {
  color-scheme: light;
  --ink: #30483a;
  --muted: #657167;
  --paper: #faf8f2;
  --cream: #fffefa;
  --line: #d8ddd3;
  --sage: #8e9b76;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 system-ui, sans-serif; }
.vessel-page { width: min(100%, 960px); margin: auto; padding: 12px 12px 104px; }
.back-link { display: inline-block; margin: 0 0 6px; color: #365a49; text-underline-offset: 4px; }
.eyebrow { margin: 0 0 3px; color: #687b65; font-size: 12px; font-weight: 750; letter-spacing: .12em; }
body .vessel-page h1 { margin: 2px 0 6px !important; font: 400 clamp(27px, 5vw, 40px)/1.08 Georgia, serif !important; }
.intro { max-width: 68ch; margin: 0 0 10px; color: var(--muted); font-size: 15px; line-height: 1.38; }
.animation-card { padding: 12px; border: 1px solid var(--line); border-left: 5px solid #8a9a86; border-radius: 15px; background: var(--cream); box-shadow: 0 7px 24px #263d3010; }
.scene-row { display: flex; justify-content: center; align-items: center; gap: 6px; }
body .vessel-page .scene-arrow { display: grid; flex: 0 0 40px; width: 40px !important; height: 44px !important; min-height: 44px !important; place-items: center; padding: 0 !important; border: 1px solid #c9d2c5 !important; border-radius: 12px !important; background: #edf1e9 !important; color: #405845 !important; font-size: 29px !important; line-height: 1 !important; cursor: pointer; box-shadow: 0 2px 5px #263d3010 !important; }
.scene-art { position: relative; flex: 0 1 auto; width: auto; height: min(56svh, 600px); max-width: calc(100% - 92px); aspect-ratio: 2 / 3; overflow: hidden; border: 1px solid #e2e2d7; border-radius: 12px; background-color: #f8f5ed; background-repeat: no-repeat; background-size: contain; background-position: center; }
.scene-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.heart-cutaway-image, .flow-overlay { display: none; }
.scene-art[data-visual="heart"] { aspect-ratio: 1199 / 1312; }
.scene-art[data-step="1"] .connected-image { display: none; }
.scene-art[data-step="1"] .heart-cutaway-image { display: block; }
.flow-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scene-art[data-step="1"] .flow-overlay { display: block; }
.flow-particles { fill: none; }
.flow-blue circle { fill: #4d91cb; stroke: #fffefa; stroke-width: 4; filter: drop-shadow(0 1px 3px #233b5080); }
.flow-red circle { fill: #df5a54; stroke: #fffefa; stroke-width: 4; filter: drop-shadow(0 1px 3px #63302f80); }
.vessel-overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.focus-mark { display: none; }
.focus-mark.active { display: inline; }
.callout-line { fill: none; stroke: #49634f; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; marker-end: url(#vessel-arrow); }
.callout-box { fill: #fffdf3ee; stroke: #aab69f; stroke-width: 4; }
.callout-text { fill: #344f3d; font: 700 38px system-ui, sans-serif; }
.target-ring { fill: #fff7d8aa; stroke: #d0a64e; stroke-width: 10; animation: vesselPulse 1.8s ease-in-out infinite; }
.target-dot { fill: #fffdf3; stroke: #49634f; stroke-width: 8; }
.nerve-tag rect { fill: #fffdf2ee; stroke: #718b6f; stroke-width: 4; }
.nerve-tag text { fill: #35513f; font: 750 25px system-ui, sans-serif; }
.nerve-tag-vii rect { stroke: #80699c; }
.nerve-tag-vii text { fill: #66517f; font-size: 24px; }
.nerve-target { fill: #f5d996ee; stroke: #9c7730; stroke-width: 5; }
.nerve-v1, .nerve-v2, .nerve-v3, .nerve-vii, .nerve-leader { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nerve-v1, .nerve-v2, .nerve-v3 { stroke-width: 8; filter: drop-shadow(0 1px 2px #fffefa); }
.nerve-v1 { stroke: #dcad4f; }
.nerve-v2 { stroke: #c79339; }
.nerve-v3 { stroke: #ad7d32; }
.nerve-vii { stroke: #826aa1; stroke-width: 7; }
.nerve-leader { stroke-width: 4; }
.nerve-leader.nerve-v1 { stroke: #dcad4f; }
.nerve-leader.nerve-v2 { stroke: #c79339; }
.nerve-leader.nerve-v3 { stroke: #ad7d32; }
.nerve-leader.nerve-vii { stroke: #826aa1; }
.arterial-route { fill: none; stroke: #d9534f; stroke-width: 17; stroke-dasharray: 24 18; stroke-linecap: round; marker-end: url(#vessel-arrow-red); animation: returnFlow 1.2s linear infinite; }
.return-route { fill: none; stroke: #4d86ba; stroke-width: 18; stroke-dasharray: 22 16; stroke-linecap: round; marker-end: url(#vessel-arrow-blue); animation: returnFlow 1.2s linear infinite; }
.scene-art[data-visual="diagram"] { flex: 0 1 640px; width: min(100%, 640px); height: auto; max-height: none; aspect-ratio: 1.26 / 1; background-color: #fffefa; background-size: contain; }
.scene-art[data-visual="diagram"] .scene-image, .scene-art[data-visual="diagram"] .vessel-overlay { display: none; }
.scene-art[data-step="8"] { background-image: url('assets/maxillary-supply.svg?v=1'); }
.scene-art[data-step="9"] { background-image: url('assets/palatal-supply.svg?v=1'); }
.scene-art[data-step="10"] { background-image: url('assets/dental-drainage.svg?v=1'); }
@keyframes vesselPulse { 50% { opacity: .55; transform: scale(.92); transform-box: fill-box; transform-origin: center; } }
@keyframes returnFlow { to { stroke-dashoffset: -38; } }
.scene-copy { padding: 7px 2px 0; text-align: center; }
.step-count { margin: 0; color: #6c7869; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.step-section { margin: 1px 0 0; color: #78836f; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
body .vessel-page .scene-copy h2 { margin: 2px 0 4px !important; font: 400 clamp(20px, 3.2vw, 25px)/1.18 Georgia, serif !important; }
.scene-copy p:not(.step-count) { max-width: 62ch; margin: 0 auto; color: #566157; font-size: 15px; line-height: 1.38; }
.scene-dots { display: flex; justify-content: center; gap: 3px; margin: 5px 0 0; }
body .vessel-page .scene-dots button { position: relative; display: grid; width: 32px !important; height: 32px !important; min-height: 32px !important; place-items: center; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: transparent !important; box-shadow: none !important; }
body .vessel-page .scene-dots button::before { width: 8px; height: 8px; border-radius: 50%; background: #c8d0c1; content: ""; }
body .vessel-page .scene-dots button[aria-current="step"]::before { width: 10px; height: 10px; background: #526c55; box-shadow: 0 0 0 3px #e8eddf; }
.scene-arrow:focus-visible, .scene-dots button:focus-visible { outline: 3px solid #91a482 !important; outline-offset: 2px; }
.key-row { display: flex; justify-content: center; gap: 14px; margin: 8px 0 0; color: #566157; font-size: 13px; }
.key-row span { display: inline-flex; align-items: center; gap: 6px; }
.key-row [hidden] { display: none; }
.key-row i { width: 11px; height: 11px; border-radius: 50%; }
.artery-swatch { background: #d9534f; }
.vein-swatch { background: #5d8cb7; }
.trigeminal-swatch { background: #c79339; }
.facial-swatch { background: #826aa1; }
.learning-note { margin: 8px 4px 0; padding: 8px 11px; border-left: 4px solid #b69a58; border-radius: 8px; background: #fbf5e5; color: #535d52; font-size: 14px; line-height: 1.4; }
.learning-note a { color: #365a49; text-underline-offset: 3px; }

@media (max-width: 600px) {
  .vessel-page { padding: 10px 8px 96px; }
  .intro { margin-bottom: 8px; font-size: 14px; line-height: 1.35; }
  .animation-card { padding: 8px; border-radius: 13px; }
  .scene-row { gap: 4px; }
  body .vessel-page .scene-arrow { flex-basis: 36px; width: 36px !important; height: 44px !important; min-height: 44px !important; border-radius: 11px !important; }
  .scene-art { height: min(56svh, 600px); max-width: calc(100% - 80px); aspect-ratio: 2 / 3; border-radius: 10px; }
  .scene-art[data-visual="diagram"] { flex-basis: 640px; width: min(100%, 640px); height: auto; aspect-ratio: 1.12 / 1; }
  .scene-copy { padding: 6px 1px 0; }
  .step-section { font-size: 9px; }
  body .vessel-page .scene-copy h2 { margin: 2px 0 3px !important; font-size: 20px !important; }
  .scene-copy p:not(.step-count) { font-size: 14px; line-height: 1.34; }
  .scene-dots { margin-top: 3px; }
  body .vessel-page .scene-dots button { width: 29px !important; height: 29px !important; min-height: 29px !important; }
  .key-row { margin-top: 6px; font-size: 12px; }
  .learning-note { margin-top: 6px; padding: 7px 9px; font-size: 13px; }
}

@media (max-width: 380px) {
  .vessel-page { padding-right: 6px; padding-left: 6px; }
  .animation-card { padding: 7px; }
  .scene-row { gap: 3px; }
  body .vessel-page .scene-arrow { flex-basis: 34px; width: 34px !important; }
  .scene-art { aspect-ratio: 2 / 3; }
}

@media (prefers-reduced-motion: reduce) { .target-ring, .arterial-route, .return-route { animation: none; } .flow-overlay { display: none !important; } }
