/* Papier Arches on the title plate, with the same engraved rule in each archive. */
html[data-phase-theme] {
  --gallery-band: #F4EFE0;
  --gallery-caption: var(--canvas-muted, #504E4A);
  --gallery-seal: #8E101E;
  --gallery-ink-rule: #141418;
}
html[data-phase-theme="dark"] {
  --gallery-band: #17171C;
  --gallery-caption: #B4B2AC;
  --gallery-seal: #F24454;
  --gallery-ink-rule: #F3F1EC;
}
#pz-content :is(#atlas-main,main) :is(.phase-home-hero,.atlas-lead,.guide-reader__hero,.alttp-hero,.alttp-search-heading) {
  --world-band: var(--gallery-band);
  --world-title: var(--text-primary);
  --world-caption: var(--gallery-caption);
  --world-crumb: var(--gallery-seal);
  --guide-ink: var(--text-primary);
  --guide-muted: var(--gallery-caption);
  --guide-link: var(--accent-shield);
  --guide-gold: var(--gallery-seal);
  position: relative;
  isolation: isolate;
  color: var(--text-primary);
  background: var(--gallery-band) var(--canvas-tile) repeat 0 0 / 512px 512px;
  border-block-end: 2px solid var(--gallery-ink-rule);
  box-shadow: inset 0 -1px #C4902E;
}
#pz-content :is(#atlas-main,main) :is(.phase-home-hero,.atlas-lead,.guide-reader__hero,.alttp-hero,.alttp-search-heading)::after {
  content: ""; position: absolute; z-index: 1; inset: auto auto -2px 0; width: min(110px,30%); height: 3px;
  background: var(--accent-ruby); opacity: 1; pointer-events: none;
}
#pz-content :is(#atlas-main,main) :is(.phase-home-hero, .atlas-lead,.guide-reader__hero,.alttp-hero,.alttp-search-heading) h1 {
  color: var(--text-primary); font-family: var(--phase-serif); text-shadow: none;
}
#pz-content :is(#atlas-main,main) :is(.phase-home-intro,.atlas-lead__copy,.guide-reader__hero,.alttp-hero-copy,.alttp-search-heading)
  :is(p,.atlas-breadcrumb,.atlas-breadcrumb a,.atlas-breadcrumb span,.alttp-back) { color: var(--gallery-caption); }
#pz-content :is(#atlas-main,main) :is(.atlas-lead,.guide-reader__hero,.alttp-hero-copy,.alttp-search-heading)
  :is(.atlas-eyebrow,.alttp-kicker) {
  color: var(--gallery-seal); font-weight: 650;
}
#pz-content :is(#atlas-main,main) :is(.atlas-eyebrow,.alttp-kicker):where(.atlas-lead *, .alttp-hero *, .alttp-search-heading *)::before {
  content: ""; display: inline-block; vertical-align: .08em; margin-inline-end: .58em; width: .52em; height: .52em;
  border-radius: 50%; background: var(--accent-ruby); box-shadow: 0 0 0 1px var(--gallery-band), 0 0 0 2px var(--accent-ruby);
}
#pz-content :is(#atlas-main,main) :is(.s2-guide .atlas-lead,.atlas-lead[data-section="remake"]) .atlas-eyebrow {
  color: var(--accent-shield);
}
#pz-content :is(#atlas-main,main) :is(.s2-guide .atlas-lead,.atlas-lead[data-section="remake"]) .atlas-eyebrow::before {
  background: var(--accent-shield); box-shadow: 0 0 0 1px var(--gallery-band), 0 0 0 2px var(--accent-shield);
}
#pz-content :is(#atlas-main,main) :is(.atlas-lead,.guide-reader__hero) :is(figure.atlas-lead-art,figure.atlas-section-art) {
  border-color: var(--border-hairline); background: var(--bg-paper);
}
#pz-content :is(#atlas-main,main) .atlas-lead figure figcaption {
  background: var(--bg-paper); color: var(--text-muted); border-color: var(--border-hairline);
}
#pz-content :is(#atlas-main,main) .atlas-lead-art--official > img { background-color: var(--bg-paper); }
#pz-content :is(#atlas-main,main) .totk-guide-hero > img { border-color: var(--border-hairline); }
#pz-content :is(#atlas-main,main) :is(.atlas-lead,.guide-reader__hero) :is(.bottle-hero-art figcaption,.atlas-artifact-number) { color: var(--gallery-caption); }
#pz-content :is(#atlas-main,main) :is(.guide-reader__hero,.alttp-hero-copy,.alttp-search-heading) a:not(.alttp-official-art) { color: var(--accent-shield); }
#pz-content :is(#atlas-main,main) .alttp-hero-copy :is(.alttp-edition-stamp,.alttp-edition-stamp *) { color: var(--text-primary); }
#pz-content :is(#atlas-main,main) .phase-home-search > span {
  color: var(--text-primary); background: var(--bg-paper); border-color: var(--border-hairline);
}
#pz-content :is(#atlas-main,main) .phase-home-search input::placeholder { color: var(--text-muted); }
#pz-content :is(#atlas-main,main) .phase-home-search button,
.pz-search-dialog button[type="submit"] { color: #FFFAFA; background: #CC2030; border-color: #8E101E; box-shadow: none; }
#pz-content :is(#atlas-main,main) .phase-home-chips a {
  background: var(--bg-paper); color: var(--text-primary); border-color: var(--border-hairline);
}
#pz-content :is(#atlas-main,main) .phase-home-chips a:is(:hover,:focus-visible) { color: var(--accent-shield); border-color: currentColor; }
#pz-content :is(#atlas-main,main) .phase-home-hero :focus-visible { outline-color: var(--accent-shield); }
#pz-content .phase-home-portal :is(.phase-home-door,.phase-home-feature-primary) {
  --home-ink-on-dark: #FFFAFA; --home-secondary-on-dark: #F3F1EC; --home-gold-on-dark: #F5DA94;
  color: var(--home-ink-on-dark); border-color: rgb(235 194 104 / .56);
}
#pz-content .phase-home-portal :is(.phase-home-door-switch,.phase-home-feature-primary) {
  background: linear-gradient(112deg,#184898 16%,#2660B8);
}
#pz-content .phase-home-portal .phase-home-feature-primary {
  background-image: radial-gradient(ellipse 56% 158% at 95% 121%,transparent 47%,rgb(153 205 255 / .1) 49%,transparent 53%,rgb(153 205 255 / .08) 57%,transparent 62%), linear-gradient(112deg,#184898 16%,#2660B8);
}
#pz-content .phase-home-portal .phase-home-door-classic { background: #18181D; }
#pz-content .phase-home-door a { color: var(--home-ink-on-dark); }
#pz-content .phase-home-portal :is(.phase-home-door,.phase-home-feature-primary) :focus-visible {
  outline-color: #F5DA94;
}
@media (forced-colors: active) {
  #pz-content :is(#atlas-main,main) :is(.phase-home-hero,.atlas-lead,.guide-reader__hero,.alttp-hero,.alttp-search-heading)::after { display: none; }
}


/* Keep the two credited ALttP plates in their own cells beside the title. */
#pz-content :is(#atlas-main,main) header.alttp-hero:has(.alttp-world-plate) {
  display: grid; grid-template: "copy plate edition" 1fr "copy credit edition" auto / minmax(0,1.3fr) minmax(0,1fr) minmax(150px,.46fr);
  align-items: center; gap: 0 clamp(12px,2.5vw,40px); padding: clamp(18px,2vw,30px) var(--world-pad); min-height: 0;
}
#pz-content :is(#atlas-main,main) header.alttp-hero .alttp-hero-copy {
  grid-area: copy; padding: 0; margin: 0; width: 100%; max-width: 65ch;
}
#pz-content :is(#atlas-main,main) header.alttp-hero .alttp-world-plate {
  grid-area: plate; position: static; z-index: auto; width: 100%; height: clamp(135px,15vw,220px);
  align-self: end; object-fit: cover; animation: none; border: 1px solid var(--border-hairline);
}
#pz-content :is(#atlas-main,main) header.alttp-hero .alttp-lead-credit {
  grid-area: credit; justify-self: stretch; align-self: start; position: static; width: auto; padding: 4px 8px;
  background: var(--bg-paper); color: var(--text-muted); text-align: end;
}
#pz-content :is(#atlas-main,main) header.alttp-hero .alttp-edition-stamp {
  grid-area: edition; position: static; margin: 0; padding: 8px; color: var(--text-primary);
  background: var(--bg-paper); border: 1px solid var(--border-hairline);
}
#pz-content :is(#atlas-main,main) .alttp-edition-stamp :is(a,small,span,strong),
#pz-content :is(#atlas-main,main) header.alttp-hero h1 span { color: var(--text-primary); }
@media (max-width: 900px) {
  #pz-content :is(#atlas-main,main) header.alttp-hero:has(.alttp-world-plate) {
    grid-template: "copy plate" 1fr "copy credit" auto / minmax(0,1.3fr) minmax(0,1fr);
  }
  #pz-content header.alttp-hero .alttp-edition-stamp { display: none; }
}
@media (max-width: 600px) {
  #pz-content :is(#atlas-main,main) header.alttp-hero:has(.alttp-world-plate) {
    grid-template: "copy" auto "plate" auto "credit" auto / minmax(0,1fr);
  }
  #pz-content :is(#atlas-main,main) header.alttp-hero .alttp-world-plate { margin-top: 14px; height: clamp(110px,36vw,190px); }
}

/* The home archive's second desk, field map, notebook and video reference. */
#pz-content #atlas-main :is(.atlas-frontier,.atlas-home-library,.atlas-home-answers,.atlas-home-sources,.atlas-living-map,.atlas-home-beyond) {
  color: var(--text-primary); background: var(--bg-canvas) var(--canvas-tile) repeat 0 0 / 512px 512px; border-color: var(--border-hairline);
}
#pz-content #atlas-main :is(.atlas-frontier,.atlas-home-library,.atlas-home-answers,.atlas-home-sources,.atlas-living-map,.atlas-home-beyond) :is(h2,h3) { color: var(--text-primary); }
#pz-content #atlas-main :is(.atlas-frontier,.atlas-home-library,.atlas-home-answers,.atlas-home-sources,.atlas-home-beyond) :is(p,small) { color: var(--gallery-caption); }
#pz-content #atlas-main :is(.field-chart,.atlas-finder__input-wrap,.atlas-navi__link,.atlas-home-beyond > div > a) {
  color: var(--text-primary); background: var(--bg-paper); border-color: var(--border-hairline);
}
#pz-content #atlas-main .atlas-home-beyond > div > a :is(span,strong,h2,h3,small) { color: var(--text-primary); }
#pz-content #atlas-main :is(.studio-landmarks__view,.official-trailer-poster) { background-color: #18181D; }
#pz-content #atlas-main .field-chart__places > button { color: #141418; background-color: #FAF6EC; }
#pz-content #atlas-main .studio-atlas-link { color: #141418; background-color: #EBC268; }
#pz-content #atlas-main .studio-atlas-link::after { border-color: currentColor; }
#pz-content #atlas-main .atlas-finder__submit { color: #FFFAFA; background: #CC2030; }
#pz-content #atlas-main :is(.atlas-finder__input-wrap input,.atlas-finder__input-wrap svg,.atlas-navi__link) { color: var(--text-primary); }
#pz-content #atlas-main .atlas-living-map__stage { background: linear-gradient(160deg,#18181D,#272731 62%,#141418); color: #F3F1EC; }
#pz-content #atlas-main .atlas-living-map__horizon { background: #6BA3F7; }
#pz-content #atlas-main .atlas-living-map__surface { background: #1B1B21; }
#pz-content #atlas-main .atlas-living-map__map-shade { background: linear-gradient(0deg,#141418a8,transparent 63%); }
#pz-content #atlas-main .atlas-living-map__route-shadow { stroke: #17171C; }
#pz-content #atlas-main .atlas-living-map__pin::before { background: #8E101E; }
#pz-content #atlas-main .atlas-living-map__north svg { fill: #141418; }
#pz-content #atlas-main .atlas-living-map__north > span { text-shadow: 0 1px 2px #141418; }
#pz-content #atlas-main .atlas-living-map button { color: var(--text-primary); background: var(--bg-paper); }
#pz-content #atlas-main .atlas-living-map select { color: #F3F1EC; background: #18181D; }
#pz-content #atlas-main .carnet-open { color: #FFFAFA; background: #18181D; border-color: #18181D; }
#pz-content #atlas-main .official-trailer { color: var(--text-primary); background: var(--bg-paper); border-color: var(--border-hairline); }
#pz-content #atlas-main .official-trailer-copy :is(p,h2) { color: var(--text-primary); }
#pz-content #atlas-main .official-trailer-copy a { color: #FFFAFA; background: #184898; }
#pz-content #atlas-main .official-trailer-poster::after { background: linear-gradient(0deg,#141418a8,transparent 65%); }
#pz-content #atlas-main .atlas-frontier :is(.atlas-finder label,.atlas-navi__label) { color: var(--text-primary); }
#pz-content #atlas-main .atlas-frontier :is(.studio-landmarks__map,.atlas-quick-questions a,.atlas-finder__shortcuts a) { color: var(--accent-shield); }
#pz-content #atlas-main .atlas-navi__link[data-active="true"] .atlas-navi__label { color: var(--accent-shield); }
#pz-content #atlas-main .atlas-living-map {
  --living-forest: var(--bg-canvas); --living-surface: var(--bg-paper); --living-paper: var(--text-primary);
  --living-gold: var(--accent-shield); --living-muted: var(--gallery-caption);
  --living-line: var(--border-hairline); --living-focus: var(--accent-shield);
}
#pz-content #atlas-main .atlas-living-map__stage {
  --living-forest: #141418; --living-surface: #1B1B21; --living-paper: #F3F1EC;
  --living-gold: #EBC268; --living-muted: #B4B2AC; --living-focus: #6BA3F7;
}
#pz-content #atlas-main :is(.atlas-living-map__world-controls,.field-chart__places) button[aria-pressed="true"] {
  color: #FFFAFA; background: #8E101E; border-color: #CC2030;
}
