/* The cover is an editorial illustration. All evidence lives in the atlas records. */
.atlas-cover {
  isolation: isolate; position: relative; overflow: hidden; min-height: 345px;
  display: flex; align-items: center; padding: clamp(28px, 4.5vw, 76px);
  color: #fbf7ef; background: #071016; border: 1px solid #364046;
  border-radius: 18px 18px 0 0;
}
.atlas-cover-img {
  position: absolute; inset: 0 auto 0 0; width: 76%; height: 100%;
  z-index: -2; object-fit: cover; object-position: 50% 52%;
}
.atlas-cover::before {
  position: absolute; inset: 0; content: ''; z-index: -1;
  background: linear-gradient(90deg, transparent 16%, #07101609 30%, #071016e8 63%, #071016 81%);
}
.atlas-cover-copy { width: min(53%, 34rem); }
.atlas-cover h1 { color: #fff9ee; line-height: 1.1; }
.atlas-cover h1 span { display: block; font-size: clamp(19px, 2.4vw, 29px); font-weight: 400; letter-spacing: 0; }
.atlas-cover h1 bdi { display: block; margin: 10px 0 16px; font: 500 clamp(39px, 5.7vw, 88px)/.98 Georgia, serif; letter-spacing: -.045em; }
.atlas-cover-copy p { font-size: 1rem; line-height: 1.9; color: #ede8de; max-width: 38ch; }
.cover-links, .directory-links { display: flex; flex-wrap: wrap; gap: 8px; }
.cover-links { margin-top: 22px; }
.cover-links .button, html[data-theme] .cover-links .button {
  background: #182027; border-color: #748088; color: #fffaf2; min-height: 44px;
}
html[data-theme] .cover-links .primary { background: #ebe2ce; color: #202427; border-color: #ebe2ce; }
html[data-theme] .cover-links .button:hover { background: #293641; }
html[data-theme] .cover-links .primary:hover { background: #fff4d9; }
.cover-credit { position: absolute; bottom: 12px; left: 16px; color: #eee9de; background: #081016bf; padding: 2px 8px; border-radius: 3px; font-size: .75rem; }
.atlas-checkpoints {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 16px 16px;
}
.atlas-checkpoints button { text-align: start; padding: 17px clamp(12px,2vw,28px); border-inline-end: 1px solid var(--border); }
.atlas-checkpoints button:last-child { border: 0; }
.atlas-checkpoints button:hover, .atlas-checkpoints button:focus-visible { background: var(--purple-light); }
.atlas-checkpoints button:focus-visible { outline-offset: -4px; }
.atlas-checkpoints span, .atlas-checkpoints small { display: block; color: var(--muted); }
.atlas-checkpoints span { font-size: .875rem; }
.atlas-checkpoints strong { display: inline-block; font-size: 1.2rem; margin: 2px 0; }
.atlas-checkpoints strong[dir=auto] { unicode-bidi: isolate; }
.atlas-explorer { margin: 38px 0 24px; scroll-margin-top: 88px; }
.explorer-heading, .atlas-directory {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px;
}
.explorer-heading { margin-bottom: 16px; }
.explorer-heading h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
.explorer-heading p, .atlas-directory p { color: var(--muted); }
.atlas-switch { display: inline-flex; background: var(--surface); padding: 4px; border: 1px solid var(--border); border-radius: 12px; }
.atlas-switch button { min-height: 40px; min-width: 65px; border-radius: 8px; color: var(--muted); }
.atlas-switch button[aria-pressed=true] { color: var(--ink); font-weight: 700; background: var(--purple-light); }
.tree-canvas {
  --wire: #abb3ba; background-color: var(--surface);
  background-image: radial-gradient(circle, #85909f29 1px, transparent 1.2px); background-size: 19px 19px;
  border: 1px solid var(--border); border-radius: 16px; padding: clamp(18px,2.5vw,34px);
}
html[data-theme=dark] .tree-canvas { --wire: #627282; }
.tree-canvas ul { list-style: none; margin: 0; padding: 0; }
.tree-root {
  position: relative; width: max-content; margin: 0 auto; padding: 11px 24px;
  border: 1px solid #b7a98c; border-radius: 30px; color: #f6ebd5; background: #24292f;
  font: 600 16px/1.3 Georgia,serif; letter-spacing: .12em;
}
.tree-root::after, .tree-branch::before { content: ''; position: absolute; width: 1px; height: 15px; left: 50%; background: var(--wire); }
.tree-root::after { top: 100%; }
.tree-canvas .tree-branches { --gap: clamp(10px,1.5vw,24px); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--gap); padding-top: 30px; }
.tree-branch { position: relative; min-width: 0; --accent: #6e5897; --tint: #efeaf7; }
.tree-branch.cosmology { --accent: #326c75; --tint: #e4f0ef; }
.tree-branch.models { --accent: #875e38; --tint: #f4ebdf; }
html[data-theme=dark] .tree-branch { --accent: #d4bff0; --tint: #332f42; }
html[data-theme=dark] .tree-branch.cosmology { --accent: #aadbd6; --tint: #233b40; }
html[data-theme=dark] .tree-branch.models { --accent: #e6c49a; --tint: #40372e; }
.tree-branch::before { top: -15px; }
.tree-branch:nth-child(2)::after {
  content: ''; position: absolute; height: 1px; top: -15px; right: calc(-50% - var(--gap)); left: calc(-50% - var(--gap)); background: var(--wire);
}
.tree-branch summary {
  display: flex; align-items: center; gap: 9px; cursor: pointer; position: relative;
  min-height: 54px; padding: 9px 12px; border: 1px solid var(--wire); border-radius: 10px;
  background: var(--tint); color: var(--ink); font-weight: 700; list-style: none;
}
.tree-branch summary::-webkit-details-marker { display: none; }
.tree-branch summary:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.branch-icon { display: inline-flex; color: var(--accent); }
.branch-chevron { width: 8px; height: 8px; margin-inline: auto 2px; flex: 0 0 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.tree-branch details[open] .branch-chevron { transform: rotate(225deg); }
.tree-canvas .tree-leaves { padding-inline: 15px 0; }
.tree-leaves li { position: relative; padding: 12px 14px 0 0; }
.tree-leaves li::before { content: ''; position: absolute; inset: 0 0 0 auto; width: 1px; background: var(--wire); }
.tree-leaves li::after { content: ''; position: absolute; top: calc(50% + 6px); right: 0; width: 14px; border-top: 1px solid var(--wire); }
.tree-leaves li:last-child::before { bottom: calc(50% - 6px); }
.tree-leaves button {
  display: grid; width: 100%; text-align: start; min-height: 65px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink);
}
.tree-leaves button:hover, .tree-leaves button:focus-visible { background: var(--tint); border-color: var(--accent); }
.tree-leaves button span { font-size: 1rem; font-weight: 700; }
.tree-leaves small { color: var(--muted); font: .8125rem/1.6 ui-monospace, monospace; overflow-wrap: anywhere; }
.atlas-directory { padding: 20px; border-block: 1px solid var(--border); }
@media(max-width:1100px) {
  .tree-branch summary { font-size: .94rem; }
  .tree-leaves button span { font-size: .94rem; }
}
@media(max-width:850px) {
  .tree-canvas .tree-branches { grid-template-columns: 1fr; padding: 0 16px 0 0; gap: 0; }
  .tree-root { margin: 0 0 0 auto; }
  .tree-root::after, .tree-branch:nth-child(2)::after { display: none; }
  .tree-branch { padding: 15px 18px 0 0; }
  .tree-branch::before { top: 0; bottom: 0; right: 0; left: auto; width: 1px; height: auto; }
  .tree-branch:last-child::before { height: 42px; }
  .tree-branch summary::before { content: ''; width: 18px; position: absolute; right: -19px; top: 50%; border-top: 1px solid var(--wire); }
}
@media(max-width:660px) {
  .atlas-cover { align-items: end; min-height: 390px; padding: 125px 22px 25px; }
  .atlas-cover-img { width: 100%; height: 70%; object-position: 50% 46%; }
  .atlas-cover::before { background: linear-gradient(0deg,#071016 15%,#071016f2 35%,#07101640 68%,transparent); }
  .atlas-cover-copy { width: 100%; }
  .atlas-cover h1 bdi { font-size: clamp(46px, 12vw, 62px); margin: 6px 0 10px; }
  .cover-credit { bottom: auto; top: 10px; left: 10px; }
  .atlas-checkpoints { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .atlas-checkpoints button { border-bottom: 1px solid var(--border); }
  .atlas-checkpoints button:nth-child(2) { border-inline-end: 0; }
  .atlas-checkpoints button:nth-child(3) { border-bottom: 0; }
  .atlas-explorer { margin-top: 27px; }
  .atlas-directory { padding: 18px 0; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } }
