/* Pass Duke Elder — the 3D atlas page. Uses the homepage tokens (body has both .home and .atlas). */
.atlas { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); }
.atlas-view { position: sticky; top: 0; height: 100vh; height: 100svh; order: 2; border-left: 1px solid var(--line); background: radial-gradient(circle at 50% 46%, #141b24 0, #06080b 68%); overflow: hidden; }
#atlas-stage { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; cursor: grab; }
#atlas-stage.ready { opacity: 1; }
#atlas-stage:active { cursor: grabbing; }
#atlas-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; }
#atlas-chip { position: absolute; z-index: 2; background: var(--ink); color: var(--accent-ink) !important; padding: 5px 9px; pointer-events: none; white-space: nowrap; }
#atlas-hint { position: absolute; left: 24px; right: 24px; top: 84px; margin: 0; text-align: center; pointer-events: none; }
.atlas-tools { position: absolute; left: 24px; right: 24px; bottom: 54px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.atlas-tools button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink); background: rgba(6, 8, 11, .6); border: 1px solid var(--line); padding: 10px 14px; cursor: pointer; transition: border-color .2s ease, color .2s ease, background .2s ease; }
.atlas-tools button:hover { border-color: var(--ink); }
.atlas-tools button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.atlas-orient { position: absolute; left: 24px; right: 24px; bottom: 20px; margin: 0; text-align: center; font-size: .92rem !important; }

.atlas-text { order: 1; padding: 0 var(--gut) 12vh; min-width: 0; }
.atlas-head { padding: clamp(120px, 20vh, 200px) 0 clamp(40px, 8vh, 90px); }
.atlas-head h1 { font: 400 clamp(3rem, 6.4vw, 6.6rem)/.93 var(--serif); letter-spacing: -.025em; margin: 22px 0 28px; }
.atlas-head h1 em { color: color-mix(in srgb, var(--ink) 58%, transparent); }
.atlas-head p { color: var(--muted); max-width: 34em; font-size: 1.08rem; }
.atlas-caveat { font-size: .92rem !important; max-width: 40em !important; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 26px; }

.ch { border-top: 1px solid var(--line); padding: 20px 0 clamp(60px, 12vh, 130px); max-width: 40em; opacity: .42; transition: opacity .4s ease; }
.ch.on { opacity: 1; }
.ch > .mono { color: var(--accent); }
.ch h2 { font: 400 clamp(2.2rem, 3.8vw, 3.8rem)/1 var(--serif); letter-spacing: -.02em; margin: 18px 0 26px; }
.ch p, .ch li { font-size: 1.06rem; line-height: 1.62; }
.ch ul, .ch ol { padding-left: 1.2em; margin: 0 0 1em; }
.ch li { margin-bottom: .45em; }
.ch li::marker { color: var(--accent); font-family: var(--code); font-size: .8em; }
.ch b { font-weight: 600; }
.ch table { width: 100%; border-collapse: collapse; margin: 6px 0 22px; font-size: .96rem; }
.ch th, .ch td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-top: 1px solid var(--line); }
.ch th { font: 500 .84rem/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); width: 34%; }
.ch tr:first-child th:not(:first-child), .ch tr:first-child th:first-child:not(:only-of-type) { width: auto; }
.ch .pearl { border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; color: var(--ink); font: italic 400 1.3rem/1.35 var(--serif); margin-top: 28px; }
.vf svg { width: 76px; height: auto; display: block; }
.vf-see { fill: #fbf8f1; }
.vf-ring { fill: none; stroke: #c9c4b8; stroke-width: .8; }
.vf-key { font-size: .95rem; color: var(--muted); }
.vf-loss { fill: #050607; }
.ch td.vfc { width: 84px; padding-right: 0; }
.key { padding: 1px 7px; color: #0b0906; font-weight: 600; white-space: nowrap; }
.key-r { background: #e39e38; }
.key-l { background: #40ada8; }
.lesions th { width: auto !important; }
.term { font: inherit; text-align: left; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--accent); padding: 0 1px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.term:hover { background: var(--accent-soft); }
.term[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.atlas-next { border-top: 1px solid var(--line); padding-top: 20px; max-width: 40em; }
.atlas-next .ed-row { grid-template-columns: 1fr 40px; }
.atlas-next .ed-row-t { font-size: clamp(1.6rem, 2.6vw, 2.6rem); }
.atlas-page .site-foot { position: relative; z-index: 1; background: var(--bg); }

@media (max-width: 900px) {
  .atlas { grid-template-columns: 1fr; }
  .atlas-view { order: 0; height: 46vh; height: 46svh; top: 0; z-index: 5; border-left: 0; border-bottom: 1px solid var(--line); }
  #atlas-hint { display: none; }
  .atlas-tools { bottom: 10px; left: 8px; right: 8px; gap: 6px; }
  .atlas-tools button { padding: 7px 9px; font-size: .92rem; }
  .atlas-orient { display: none; }
  .atlas-head { padding-top: 40px; }
  .atlas-page .site-head { position: absolute; }
}

/* labels, the structure card and the structure list */
#atlas-labels-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#atlas-labels-layer span { position: absolute; left: 0; top: 0; font: 500 .84rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #0b0906; background: var(--accent); padding: 3px 8px; white-space: nowrap; }
.atlas-card { position: absolute; left: 20px; bottom: 112px; width: min(360px, calc(100% - 40px)); background: rgba(6, 8, 11, .93); border: 1px solid var(--line); border-top: 2px solid var(--accent); padding: 16px 18px 14px; z-index: 3; }
.atlas-card h3 { font: 400 1.7rem/1.1 var(--serif); margin: 0 0 8px; letter-spacing: 0; }
.atlas-card p { font-size: 1rem; line-height: 1.5; margin: 0 0 10px; color: var(--ink); opacity: .9; }
.ac-links { display: grid; gap: 4px; margin-bottom: 12px; }
.ac-links a { color: var(--accent); font-size: .98rem; }
.ac-acts { display: flex; gap: 6px; }
.ac-acts button, .atlas-list button { font: 500 .88rem var(--sans); color: var(--ink); background: none; border: 1px solid var(--line); padding: 7px 11px; cursor: pointer; }
.ac-acts button:hover, .atlas-list button:hover { border-color: var(--accent); color: var(--accent); }
.atlas-list { position: absolute; right: 20px; top: 84px; z-index: 4; text-align: right; }
.atlas-list summary { display: inline-block; list-style: none; cursor: pointer; font: 500 .84rem var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink); border: 1px solid var(--line); background: rgba(6, 8, 11, .7); padding: 9px 13px; }
.atlas-list summary::-webkit-details-marker { display: none; }
.atlas-list[open] summary { border-color: var(--accent); color: var(--accent); }
#al-items { display: grid; gap: 4px; margin-top: 6px; max-height: 58vh; overflow: auto; background: rgba(6, 8, 11, .95); border: 1px solid var(--line); padding: 8px; width: 250px; }
#al-items button { text-align: left; border: 0; border-bottom: 1px solid var(--line); padding: 8px 6px; font-size: .95rem; }
.atlas-tools { bottom: 50px; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; }
.acts span { flex-basis: 100%; }
.act { font: 500 .95rem var(--sans); color: var(--ink); background: none; border: 1px solid var(--accent); padding: 9px 13px; cursor: pointer; }
.act:hover { background: var(--accent); color: var(--accent-ink); }
.acts-note { font-size: .95rem !important; color: var(--muted); }
@media (max-width: 900px) {
  .atlas-card { left: 8px; right: 8px; bottom: 8px; width: auto; padding: 10px 12px; max-height: 60%; overflow: auto; }
  .atlas-card h3 { font-size: 1.25rem; } .atlas-card p { font-size: .92rem; }
  .atlas-list { right: 8px; top: 60px; }
  #al-items { max-height: 30vh; }
  .atlas-tools button[id="atlas-clear"], .atlas-tools button[id="atlas-labels"] { display: none; }
}

/* jump menu under the atlas title */
.atlas-jump { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 16px; max-width: 46em; }
.atlas-jump ol { list-style: none; margin: 12px 0 0; padding: 0; columns: 2; column-gap: 28px; }
.atlas-jump a { display: block; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 1.05rem; break-inside: avoid; transition: padding .2s ease, color .2s ease; }
.atlas-jump a:hover { padding-left: 8px; color: var(--accent); }
.atlas-jump b { font: 500 .84rem var(--mono); color: var(--accent); margin-right: .8em; }
.ch { scroll-margin-top: 90px; }
@media (max-width: 900px) { .atlas-jump ol { columns: 1; } }
/* reading comfort */
.ch .pearl { font: 500 1.1rem/1.5 var(--sans); }

.vf svg { width: 112px; }
.lesions .vfc { width: 124px; }
#atlas-hint { right: 150px; text-align: left; text-transform: none; letter-spacing: 0; font: 400 .95rem var(--sans); }

.atlas-jump a.seen { color: #9fd8b3; }
.atlas-jump a.seen::after { content: " \2713"; color: #7fc79a; font-weight: 700; }
