/* Shared Aurora field and reading surfaces. Loaded after each document's styles.
   Keep filters off page/main layout roots: fixed dialogs and sticky rails rely on them. */
body.aurora-site {
  --aurora-glass: rgba(6, 14, 24, .86);
  --aurora-inner: rgba(8, 18, 29, .65);
  --aurora-border: rgba(184, 216, 227, .23);
  --ink-dim: #c0c8ce;
  --ink-faint: #aebcc6;
  --panel: rgba(12, 23, 35, .68);
  --ob-muted: #c0c8ce;
  --rr-dim: #c0c8ce;
  --rr-faint: #afbdc6;
  --alarm: #ff968c;
  --offmap: #b0bdea;
  background: #030810;
  isolation: isolate;
  min-height: 100vh;
}
body.aurora-site::before {
  content: "";
  position: fixed;
  inset: 0;
  height: 100%;
  height: 100lvh;
  z-index: -2;
  pointer-events: none;
  background:
    url("/aurora-landscape.webp") center / 100% 100% no-repeat,
    radial-gradient(ellipse at 13% 5%, rgba(35, 177, 115, .55), transparent 49%),
    radial-gradient(ellipse at 64% 43%, rgba(34, 145, 165, .42), transparent 51%),
    radial-gradient(ellipse at 100% 86%, rgba(126, 74, 198, .5), transparent 53%),
    #030810;
}
/* The image carries the shader's fine texture without a live canvas layer. */
body.aurora-site #bg { display: none !important; }
@media (max-aspect-ratio: 3/4) {
  body.aurora-site::before {
    background-image: url("/aurora-portrait.webp"),
      radial-gradient(ellipse at 13% 5%, rgba(35, 177, 115, .55), transparent 49%),
      radial-gradient(ellipse at 64% 43%, rgba(34, 145, 165, .42), transparent 51%),
      radial-gradient(ellipse at 100% 86%, rgba(126, 74, 198, .5), transparent 53%);
  }
}
body.aurora-site .grain { opacity: .025; inset: 0; animation: none; }
body.aurora-site .vignette { opacity: .25; }
body.aurora-site .ev-shade { display: none; }

/* One surface per reading group, with visible Aurora between the groups. */
.aurora-site :is(
  .aurora-glass, .ob-masthead, .ob-thesis, .ob-map-desk, .ob-on-desk,
  .ob-chapters, .ob-section-head, .ob-question-row, .ob-method-plate,
  .ob-results-desk, .ob-static-exhibit, .ob-withdrawal, .ob-feedback-plate,
  .ob-instruments, .ob-task-index, .ob-section-tail, .ob-charter, .ob-footer,
  .ob-atlas-provenance, .ob-evidence-notes > article, .ob-program-lineage, .ob-library, .ap-footer,
  .oe-exhibit, .rr-mast, .rr-opening, .rr-map-section, .rr-shelf,
  .rr-index, .rr-chapter-heading, .rr-dossier, .rr-closing, .rr-footer, #rr-empty,
  .docs-header, .docs-start, .docs-rail, .docs-reference-intro,
  .docs-reference, .docs-footer, .lab-header, .catalog-intro, .shelf,
  .interactive-lab .footer, .os-mast, .masthead, .lead, .nseg,
  .lab-site .program-links, .at-card, .ev-sec, .nf-wrap, .st-wrap,
  .bld section > .bld-wrap, .bld-foot, .gi section > .gi-wrap, .gi-ode,
  .cal section > .cal-wrap, .fr section > .fr-wrap, .fr-foot,
  .vfy section > .vfy-wrap, .vfy-foot, .mdl-hero,
  .mdl section > .mdl-wrap, .mdl-foot, .pk-hero > .pk-wrap,
  .pk-band > .pk-wrap, .pk-footer, .sh-hero > .sh-wrap,
  .sh-card, .sh-footer, .dwrap, .lgl, main.rd, main.ct, p.r,
  .bld-scrollcue, .gi-scrollcue, .cal-scrollcue, .fr-scrollcue, .vfy-scrollcue
) {
  background: var(--aurora-glass);
  border: 1px solid var(--aurora-border);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(234, 249, 255, .055), 0 16px 48px rgba(0, 0, 0, .13);
}
/* Blur only the surfaces that stay put while content scrolls under them. A panel that scrolls
   sits over the still field, which is already soft, so at .86 opacity a live blur changes almost
   nothing — but every blurred panel is its own GPU surface. With dozens per page (and all of
   /evidence as one, because the :is() above outweighed the "none" for .st-wrap), fast scrolls in
   Brave outran drawing and panels showed for a frame as bare bright Aurora: the flash. */
.aurora-site :is(.masthead, .ob-chapters, .docs-rail, .rr-index) {
  -webkit-backdrop-filter: blur(22px) saturate(115%);
  backdrop-filter: blur(22px) saturate(115%);
}

/* Header surfaces keep their existing positioning and menu stacking. */
.aurora-site :is(.masthead, .os-mast) {
  mix-blend-mode: normal;
  padding: 14px 20px;
  width: fit-content;
  max-width: calc(100% - 94px);
  top: 14px;
  left: 20px;
  right: auto;
}
.aurora-site :is(.ob-masthead, .lab-header, .docs-header, .rr-mast) {
  margin-top: 14px;
  padding-left: 22px;
  padding-right: 62px;
}
.aurora-site :is(.ob-thesis, .ob-section-head, .ob-question-row,
  .ob-section-tail, .ob-charter, .ob-task-index) { padding: 24px; }
.aurora-site .ob-opening { gap: 28px; align-items: stretch; }
.aurora-site .ob-thesis { display: flex; flex-direction: column; justify-content: center; }
.aurora-site .ob-on-desk { padding: 16px 20px; margin-bottom: 14px; }
.aurora-site .ob-chapters { padding: 10px 18px; }
.aurora-site .ob-question-row + .ob-question-row { margin-top: 16px; }
.aurora-site .ob-section-tail { margin-top: 20px; }
.aurora-site .ob-charter { margin-top: 26px; }
.aurora-site .ob-atlas-provenance { padding: 20px; margin-bottom: 20px; }
.aurora-site .ob-evidence-notes > article { padding: 24px; }
.aurora-site :is(.ob-program-lineage, .ob-library) { padding: 24px; }
.aurora-site :is(.ob-footer, .rr-footer, .docs-footer, .interactive-lab .footer) {
  padding: 26px;
  margin-bottom: 24px;
}
body.aurora-site > .ap-footer[style] {
  padding: 24px !important;
  max-width: calc(100% - 40px);
  box-sizing: border-box;
  margin: 28px auto !important;
  color: var(--ink-dim) !important;
}
.aurora-site > .ap-footer[style] > span { opacity: 1 !important; }
body.aurora-site > main.aurora-glass { box-sizing: border-box; width: calc(100% - 32px); overflow-wrap: anywhere; }
.aurora-site :is(.rr-opening, .rr-map-section, .rr-shelf, .rr-closing) {
  padding: 30px;
  margin-top: 26px;
  margin-bottom: 26px;
}
.aurora-site .rr-opening { gap: 40px; }
.aurora-site .rr-index { padding: 20px; }
.aurora-site .rr-chapter-heading { padding: 22px; margin-bottom: 18px; }
.aurora-site .rr-dossier { padding: 26px; margin-bottom: 20px; }
.aurora-site #rr-empty { padding: 24px; }
.aurora-site .docs-start { padding: 28px; margin-top: 24px; }
.aurora-site .docs-rail { padding: 18px; }
.aurora-site .docs-reference-intro { padding: 24px; margin-bottom: 16px; }
.aurora-site .docs-reference { padding: 0 22px; margin-bottom: 14px; }
.aurora-site .catalog-intro { padding: 24px; margin-top: 24px; margin-bottom: 22px; }
.aurora-site .shelf { padding: 26px; margin-bottom: 26px; }
.aurora-site :is(.lead, .nseg, .lab-site .program-links) { padding: 28px; margin-bottom: 22px; }
.aurora-site :is(.bld section > .bld-wrap, .gi section > .gi-wrap,
  .cal section > .cal-wrap, .fr section > .fr-wrap, .vfy section > .vfy-wrap,
  .mdl section > .mdl-wrap, .mdl-hero, .pk-hero > .pk-wrap, .pk-band > .pk-wrap,
  .sh-hero > .sh-wrap) {
  width: calc(100% - 40px);
  padding: clamp(22px, 3.5vw, 44px);
  box-sizing: border-box;
}
.aurora-site :is(.bld-foot, .gi-ode, .fr-foot, .vfy-foot, .mdl-foot,
  .pk-footer, .sh-footer) { padding: 24px; margin-bottom: 24px; }
.aurora-site :is(.nf-wrap, .st-wrap, .lgl, main.rd, main.ct, .dwrap) {
  padding: clamp(22px, 4vw, 44px);
  box-sizing: border-box;
  width: calc(100% - 40px);
  margin-top: 100px;
  margin-bottom: 32px;
}
/* These long legacy reading roots have no modal children; use the tint without
   a filter so their descendants retain viewport positioning if extended later. */
.aurora-site :is(.nf-wrap, .st-wrap) { -webkit-backdrop-filter: none; backdrop-filter: none; }
.aurora-site .ev-sec { margin: 28px auto; padding: clamp(24px, 4vw, 48px); }
.aurora-site :is(.bld-scrollcue, .gi-scrollcue, .cal-scrollcue, .fr-scrollcue, .vfy-scrollcue) {
  padding: 8px 12px;
}
.aurora-site p.r { padding: 24px; }
.aurora-site main.rd .rd-wm { right: 0; }
.aurora-site .dp-grid { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }

/* Inner instruments stay translucent, without stacking dozens of blur layers. */
.aurora-site :is(.ob-split-diagram, .oe-inspector, .oe-map, .oe-history,
  .oe-report, .oe-caution, .oe-empty, .tool-card, .docs-task,
  .docs-example, .docs-ep, .docs-endpoint-body .docs-example,
  .map-frame, .detail, .clist, .rank-stage) { background: var(--aurora-inner); }
.aurora-site :is(.tool-card:hover, .docs-task:hover) { background: rgba(24, 45, 56, .82); }
.aurora-site :is(.ap-menu-btn, .ap-menu-drop, #tool-dialog, .stack-modal,
  .pr-chrome, .map-tip, .tip) {
  background: rgba(7, 15, 25, .95);
  border-color: rgba(184, 216, 227, .35);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
.aurora-site dialog::backdrop { background: rgba(1, 6, 13, .62); }
.aurora-site .ap-menu-foot { color: var(--ink-faint); }
.aurora-site :is(.ob-skip, .rr-skip, .docs-skip, .skip-link):focus {
  background: rgba(7, 15, 25, .95);
  color: #ffe0b3 !important;
  border: 1px solid var(--aurora-border);
  border-radius: 8px;
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
.aurora-site :is(input, textarea, select) { color-scheme: dark; }
.aurora-site :is(input, textarea)::placeholder { color: #aebcc6; opacity: 1; }
.aurora-site :is(.rr-filter, .rr-search) { color: var(--ink); }
.aurora-site .aurora-glass .f { opacity: 1; color: var(--ink-dim); }
.aurora-site .at .map-hint { color: var(--ink-faint); }
.aurora-site button.bld-btn:not(.primary) { background: rgba(8, 18, 29, .65); }
.aurora-site :is(.rc-chip2, .ev-ex-f) { color: #ff9aa7; }
/* The archived certificate renderer writes this verdict color inline. */
.aurora-site main.ct .ct-grade[style*="#8a93b8"] { color: var(--offmap) !important; }

/* Match the reading room's outer chrome to the article grid. */
.aurora-site :is(.rr-mast, .rr-footer) {
  width: calc(100% - 76px);
  max-width: 1168px;
  margin-left: auto;
  margin-right: auto;
}
.aurora-site .ob-reading-grid { align-items: start; }
.aurora-site :is(.ob-thesis h1, .ob-section-head h2, .ob-charter h3, .tool-name) { text-wrap: balance; }
.aurora-site :is(.ob-counts dd, .oe-stat strong, .ob-result-table td) { font-variant-numeric: tabular-nums; }
.aurora-site :is(.gi, .at) .lab-insert { padding: 20px 22px; border-radius: 10px; background: var(--aurora-inner); }
.aurora-site :is(.rr-map, .rr-method-plate, .ob-split-diagram) { border-radius: 10px; }
.aurora-site :is(.ob-task-index, .gi-card, .at .map-reset) { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.aurora-site .rr-filters :is(input, select) { border-radius: 6px; background: var(--aurora-inner); }
.aurora-site .docs-reference-layout { border-top: 0; }
.aurora-site .ob-chapter:last-child { border-bottom: 0; }
.aurora-site .tool-card { transition: background .18s ease, border-color .18s ease; }
.aurora-site .tool-card:hover { border-color: rgba(184, 216, 227, .45); }
.aurora-site.catalog-enhanced #tools { align-items: stretch; }
.aurora-site.catalog-enhanced .tool-card details:not([open]) { height: 100%; }
.aurora-site.catalog-enhanced .tool-card details:not([open]) > summary { height: 100%; display: flex; flex-direction: column; }
.aurora-site.catalog-enhanced .card-affordance { margin-top: auto; padding-top: 16px; }
/* Shared utility links belong inside the page's existing glass footer. */
.aurora-site :is(.ob-footer, .docs-footer) { flex-wrap: wrap; gap: 20px 28px; }
.aurora-site .ap-footer-supplement {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 22px;
  padding-top: 18px;
  border-top: 1px solid var(--aurora-border);
  font: 10px/1.7 var(--mono);
  margin-left: 0;
}
.aurora-site .ap-footer-supplement a { color: var(--ink-dim); }
.aurora-site .ap-footer-supplement a:hover { color: var(--light); }
.aurora-site .ap-footer-supplement a[href^="mailto:"] { margin-left: auto; color: var(--light); }
@media (min-width: 1450px) {
  .aurora-site :is(.rr-mast, .rr-footer) { max-width: 1204px; }
}
@media (max-width: 700px) {
  .aurora-site :is(.rr-mast, .rr-footer) { width: calc(100% - 44px); }
  .aurora-site .rr-mast nav { column-gap: 12px; }
  .aurora-site :is(.masthead, .os-mast) { left: 12px; padding: 14px; max-width: calc(100% - 84px); }
  .aurora-site :is(.masthead, .os-mast) .wordmark { font-size: 14px; letter-spacing: .15em; padding-left: 0; }
  .aurora-site :is(.ob-thesis, .ob-section-head, .ob-question-row,
    .ob-section-tail, .ob-charter, .ob-task-index, .rr-opening, .rr-map-section,
    .rr-shelf, .rr-closing, .rr-dossier, .rr-chapter-heading, .docs-start,
    .docs-reference-intro, .catalog-intro, .shelf) { padding: 18px; }
  .aurora-site .docs-reference { padding: 0 16px; }
  .aurora-site :is(.ob-masthead, .lab-header, .docs-header, .rr-mast) {
    padding-left: 18px;
    padding-right: 52px;
  }
  .aurora-site .ob-opening { gap: 20px; }
  .aurora-site .rr-opening { gap: 28px; }
  .aurora-site .rr-opening > * { min-width: 0; }
  .aurora-site .rr-opening h1 { font-size: clamp(36px, 9.5vw, 55px); overflow-wrap: anywhere; }
  .aurora-site .rr-room-layout { grid-template-columns: minmax(0, 1fr); }
  .aurora-site :is(.rr-index, .rr-dossiers, .rr-chapter-heading > *, .rr-dossier) { min-width: 0; }
  .aurora-site :is(.rr-chapter-heading h2, .rr-dossier h3) { overflow-wrap: anywhere; }
  .aurora-site .dw-ctrl { flex-wrap: wrap; }
  .aurora-site .dw-slider { min-width: 0; }
  .aurora-site .dw-depth { flex-basis: 100%; min-width: 0; text-align: left; }
  .aurora-site .dw-verds { grid-template-columns: minmax(0, 1fr); }
  .aurora-site .gi-hero h1 { font-size: clamp(34px, 9.5vw, 46px); overflow-wrap: anywhere; }
  .aurora-site .gi .ledger .lrow { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .aurora-site .gi .ledger .claim { min-width: 0; }
  .aurora-site .at-card { padding: 18px; }
  .aurora-site .at .map-controls { width: 100%; min-width: 0; }
  .aurora-site .at .ctl { width: 100%; min-width: 0; flex-wrap: wrap; }
  .aurora-site .at :is(.pills, .sortbar) { flex-wrap: wrap; max-width: 100%; border-radius: 12px; }
  .aurora-site .at :is(.pills, .sortbar) button { flex: 1 1 auto; }
  .aurora-site .at .search { width: 100%; min-width: 0; }
  .aurora-site .at .cr { grid-template-columns: 12px minmax(0, 1fr) 50px 30px; gap: 6px; padding: 12px 10px; }
  .aurora-site .at .cr .ctxt { min-width: 0; overflow-wrap: anywhere; }
  .aurora-site .at .cr .dep { min-width: 0; }
  .aurora-site :is(.nf-wrap, .st-wrap, .lgl, main.rd, main.ct, .dwrap) {
    width: calc(100% - 24px);
    padding: 18px;
  }
}
@media (max-width: 540px) {
  .aurora-site .tool-grid, .aurora-site.catalog-enhanced #tools { grid-template-columns: minmax(0, 1fr); }
  .aurora-site .tool-card summary { min-height: 0; padding: 22px; }
  .aurora-site .tool-name { font-size: 26px; text-wrap: pretty; }
  .aurora-site .ob-method-stages { flex-direction: column; gap: 14px; }
  .aurora-site .ob-method-stages strong { font-size: 25px; overflow-wrap: normal; }
  .aurora-site .ob-method-stages p { font-size: 11px; overflow-wrap: normal; }
  .aurora-site .ob-method-stages i { align-self: flex-start; transform: rotate(90deg); padding: 0; font-size: 18px; line-height: 1; }
  .aurora-site :is(.ob-footer, .rr-footer, .docs-footer) { padding: 22px; }
  .aurora-site .ap-footer-supplement a[href^="mailto:"] { flex-basis: 100%; margin-left: 0; }
}
@media (max-width: 380px) {
  .aurora-site .oe-stat strong { font-size: clamp(23px, 7.2vw, 27px); }
}
@media (max-width: 360px) {
  .aurora-site :is(.rr-mast, .rr-footer) { width: calc(100% - 36px); }
}
@media (prefers-reduced-motion: reduce) {
  .aurora-site .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.aurora-site { --aurora-glass: rgba(6, 14, 24, .96); }
}

/* Responsive finish: shared reading insets, controls and short-screen chrome. */
body.aurora-site { min-height: 100svh; }
.aurora-site :is(.bld, .gi, .cal, .fr, .vfy, .mdl, .at, .lgl) .lab-insert {
  padding: 22px;
  margin: 24px 0 28px;
  background: var(--aurora-inner);
  border: 1px solid var(--aurora-border);
  border-radius: 10px;
}
.aurora-site .mdl-hero { margin-top: 96px; min-height: 0; }
.aurora-site :is(.bld-qchip, .vfy-in, .dq) { min-width: 0; max-width: 100%; }
.aurora-site .bld-qchip { flex-basis: 200px; }
.aurora-site .bld-vline { flex-wrap: wrap; }
.aurora-site .bld-out > * { min-width: 0; }
.aurora-site .ev .lift-row { grid-template-columns: minmax(140px, 34%) minmax(0, 1fr) 4.5em; }
.aurora-site .ev .lift-val { font-variant-numeric: tabular-nums; }
.aurora-site :is(input, textarea, select):focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 3px;
}
.aurora-site .ap-menu {
  top: max(clamp(11px, 1.6vw, 17px), env(safe-area-inset-top));
  right: max(clamp(14px, 4vw, 38px), env(safe-area-inset-right));
}
.aurora-site .ap-menu-drop {
  max-height: calc(100dvh - max(17px, env(safe-area-inset-top)) - 72px - env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.aurora-site .ap-menu-item { scroll-margin-block: 8px; }
.aurora-site #tool-dialog {
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}
.aurora-site .site-skip {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 80;
  transform: translateY(calc(-100% - 24px));
  padding: 12px 18px;
  border: 1px solid var(--aurora-border);
  border-radius: 8px;
  background: #071019;
  color: var(--light);
  font: 13px/1.5 var(--mono);
}
.aurora-site .site-skip:focus { transform: none; }
.aurora-site :is(.nf-scroll, .oe-table-wrap, .paper-table):focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 4px;
}
/* A diagram responds to its reading column, including beside another panel. */
.aurora-site .ob-method-plate { container-type: inline-size; }
@container (max-width: 380px) {
  .ob-method-stages { flex-direction: column; gap: 14px; }
  .ob-method-stages strong { font-size: 25px; overflow-wrap: normal; }
  .ob-method-stages p { font-size: 12px; overflow-wrap: normal; }
  .ob-method-stages i { align-self: flex-start; transform: rotate(90deg); padding: 0; line-height: 1; }
}
@media (max-width: 900px) {
  .aurora-site .ob-opening { grid-template-columns: minmax(0, 1fr); }
  .aurora-site .ob-thesis h1 { font-size: clamp(32px, 6.2vw, 52px); }
  .aurora-site .ob-map-desk { max-width: none; }
  .aurora-site :is(.ob-correspondence-grid, .ob-feedback-grid) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .aurora-site :is(.ob-masthead, .rr-mast) nav { gap: 0 18px; }
  .aurora-site :is(.ob-masthead, .rr-mast) nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-block: 8px;
    font-size: 12px;
  }
  .aurora-site .ob-chapters a { min-height: 44px; font-size: 10px; }
  .aurora-site :is(input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea, select) {
    font-size: 16px;
  }
  .aurora-site :is(.bld, .gi, .cal, .fr, .vfy, .mdl) > section:not(:first-child) {
    padding-block: 30px;
  }
}
@media (max-width: 540px) {
  .aurora-site :is(.bld, .gi, .cal, .fr, .vfy, .mdl, .at, .lgl) .lab-insert {
    padding: 16px;
    font-size: 16px;
  }
  .aurora-site .lab-insert h2 { font-size: 25px; line-height: 1.2; }
  .aurora-site :is(.bld-try, .vfy-card) { padding: 18px; }
  .aurora-site .vfy-in { flex-basis: 100%; }
  .aurora-site .dq { flex-basis: 100%; }
  .aurora-site .drounds { min-height: 44px; }
  .aurora-site .dgo { flex: 1; }
  .aurora-site .ob-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (max-width: 620px) {
  .aurora-site .ev .lift-row { grid-template-columns: minmax(0, 1fr) 4.5em; }
}

/* Keep program names whole in narrow map panels, including desktop columns. */
.aurora-site .ob-map-desk { container-type: inline-size; }
@container (max-width: 440px) {
  .ob-program-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ob-program-controls button { font-size: 11px; overflow-wrap: normal; }
  .ob-program-controls button:nth-child(2) { border-right: 0; }
  .ob-program-controls button:nth-child(-n+2) { border-bottom: 1px solid var(--ob-rule); }
  .ob-plate-heading { flex-wrap: wrap; gap: 6px 12px; }
}
