/* Pearl enamel, amethyst and silverwork from the approved portal design. */
:root {
  --midnight: #21164d;
  --plum-ink: #362858;
  --serif: Georgia, "Noto Serif KR", "Gowun Batang", serif;
  --enamel: linear-gradient(165deg,#fcfaff 0%,#e6dff7 33%,#fffcff 48%,#ddd6f0 73%,#f5f0ff);
  --sapphire: radial-gradient(ellipse at 77% 110%,#794cce 0%,transparent 48%),linear-gradient(155deg,#50458c,#27296b 46%,#322475 72%,#4c3987);
  --silver-rim: inset 0 0 0 1px #fff, inset 0 0 0 3px #c3b6d4, inset 0 0 0 4px #fcf9ff, 0 2px 5px #55476b55;
}
body.cosmic-bg {
  background: radial-gradient(ellipse at 20% 6%,#fffaff,transparent 36rem),linear-gradient(110deg,#cfc6e3,#f1edf9 36%,#f9f4ff 55%,#d9cde8);
}
#starfield-canvas {opacity:.25}
.mast {
  width:100%; background:var(--enamel); border-block:2px solid #a69bbd;
  box-shadow:inset 0 0 0 1px #fff,0 3px 9px #1a143f; min-height:55px;
  padding:9px max(3%,calc((100% - 1250px)/2));
}
.mast .brand {color:#1a1951;letter-spacing:.1em;font-size:clamp(16px,2.1vw,29px);gap:8px}
.brand small {color:#363257;font:600 clamp(8px,.82vw,12px)/1.4 Georgia,serif;letter-spacing:.13em}
.mast .crest {width:38px;height:38px;filter:brightness(.47) saturate(2)}
.mast .expand,.atlas-head .expand,.mast .enter {
  display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;
  min-height:36px;padding:7px 16px;border-radius:5px 16px;border:1px solid #857398;
  box-shadow:var(--silver-rim);background:var(--enamel);color:var(--midnight);font-weight:700;
}
.mast .enter {background:var(--sapphire);color:white;box-shadow:inset 0 0 0 1px #fff5fa,inset 0 0 0 3px #9185ab,0 2px 5px #47336b66}
.mast .enter span {color:#e4ceff}
.night-court {background:#302965;border:0;box-shadow:none}
.night-court:after {display:none}
.gateway {
  overflow:hidden;isolation:isolate;width:100%;max-width:none;padding:0;
  border-inline:2px solid #b4a8cd;background:#302965;
}
.gateway:before {
  content:"";position:absolute;inset:0;z-index:-2;
  background:url("assets/observatory-night.webp") center 54% / cover;
  filter:brightness(1.34) saturate(1.18);
}
.gateway:after {
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:linear-gradient(180deg,#7160b13d,transparent 40%,#abadff12),radial-gradient(ellipse at 50% 23%,#6b5ba033,transparent 68%);
}
.frontispiece {display:flex;flex-direction:column;align-items:center;justify-content:space-between;width:100%;margin:auto;padding:clamp(20px,2.4vw,40px) 0 11px;min-height:clamp(265px,35vw,458px)}
.frontispiece h1 {width:min(76%,535px);margin:auto;isolation:auto}
.frontispiece h1 img {mix-blend-mode:screen;mask-image:radial-gradient(ellipse 63% 65% at center,#000 61%,#000b 76%,transparent 99%)}
.orrery {inset:3% 16% 14%;opacity:.45}
.frontispiece p {position:relative;width:100%;padding:7px 14px;margin-top:8px;color:#fff;text-shadow:0 1px 3px #100829;letter-spacing:0;
  font:600 clamp(14px,1.6vw,21px)/1.65 var(--serif);
  background:linear-gradient(90deg,transparent,#211650bb 22%,#302362df 48%,#211650bb 78%,transparent)}
.frontispiece p:before,.frontispiece p:after {content:"";position:absolute;left:14%;right:14%;height:1px;background:linear-gradient(90deg,transparent,#ede5ff,transparent)}
.frontispiece p:before {top:0}.frontispiece p:after {bottom:0}
.frontispiece strong {color:white}
.archive-nav {border-block:2px solid #b2a3ca;background:var(--enamel);box-shadow:0 3px 8px #4e3c6b4d;overflow:visible}
.archive-nav>div {width:min(1140px,97%);gap:5px;padding:4px 0 7px}
.archive-nav button {display:flex;flex-direction:row;align-items:center;gap:10px;min-height:50px;padding:8px 6px;background:var(--enamel);border:1px solid #9482ae;border-radius:18px 6px;box-shadow:var(--silver-rim);color:#2b205a}
.archive-nav button>span {font:700 clamp(18px,2vw,26px)/1.2 var(--serif)}
.archive-nav small {display:none}
.archive-nav button .nav-sigil {width:26px;height:26px;color:inherit;stroke-width:1.6}
.archive-nav button[aria-pressed=true] {background:var(--sapphire);color:#fff;box-shadow:inset 0 0 0 1px white,inset 0 0 0 3px #9c8aba,0 0 6px #8b55d4}
.archive-nav button[aria-pressed=true] .nav-sigil {color:#f1e8ff}
.archive-nav button[aria-pressed=true]:after {content:"";position:absolute;left:calc(50% - 5px);right:auto;bottom:-6px;width:10px;height:10px;transform:rotate(45deg);border:1px solid #fff7ff;background:conic-gradient(#a275eb,#4e277c,#f3dfff,#9154c8,#a275eb);box-shadow:0 0 0 1px #74558c,0 0 6px #b590e3}
main:has(#tab-world) {width:min(1210px,97%);max-width:none;padding:14px 0 35px}
.atlas {
  position:relative;background:var(--enamel);border:1px solid #a692b8;border-radius:5px;
  padding:18px clamp(16px,2.2vw,32px) 24px;box-shadow:var(--silver-rim);gap:19px 25px;
}
.atlas:before,.atlas:after {content:"";position:absolute;width:clamp(48px,8vw,110px);height:clamp(48px,8vw,110px);background:url("assets/pearl-scroll.webp") top left / contain no-repeat;mix-blend-mode:multiply;pointer-events:none;top:3px;bottom:auto;transform:none;mask-image:linear-gradient(135deg,#000 43%,transparent 76%)}
.atlas:before{left:3px;right:auto}.atlas:after{right:3px;left:auto;transform:scaleX(-1)}
.atlas-head {display:grid;grid-template-columns:1fr auto 1fr;align-items:center;text-align:center;padding:1px 0 10px;border-bottom:1px solid #a18faf}
.atlas-head:before{left:calc(50% - 3px);background:#8f65b8}
.atlas-heading {grid-column:2}
.atlas-heading h2,.folio-title h2 {font:700 clamp(26px,4.1vw,46px)/1.3 var(--serif);color:#2c215c;letter-spacing:-.04em;text-shadow:0 1px 0 white}
.atlas-heading h2:before,.atlas-heading h2:after,.folio-title span {content:"";display:inline-block;vertical-align:middle;width:clamp(28px,7vw,81px);height:clamp(24px,4.2vw,56px);margin:0 6px;background:url("assets/silver-wing.webp") center / contain no-repeat;mix-blend-mode:multiply;mask-image:radial-gradient(ellipse at center,#000 50%,transparent 82%)}
.atlas-heading h2:after,.folio-title span:last-child {transform:scaleX(-1)}
.atlas-head small {color:#493a70;font-weight:700;letter-spacing:.27em}
.atlas-head .expand {justify-self:end;z-index:1}
.plate {position:relative;border:2px solid #e4dcf5;border-radius:3px;box-shadow:0 0 0 1px #766580,0 0 0 3px #f7f0ff,0 0 0 4px #b5a4c7,0 4px 11px #3a235d55}
.atlas-legend summary>span {color:#2d215d}.atlas-legend small,.atlas #active-map-info>div:first-child{color:#62517e}
#active-map-info :is(.text-white,.text-slate-300){color:#3f3555}
.map-strip button {background:var(--enamel);color:#39295b}
.map-strip button[aria-pressed=true],.map-strip button:hover {background:var(--sapphire);color:white}
#tab-world .astral-panel,#tab-locations .astral-panel,.person-file,#modal-body-area {border:1px solid #afa1c2;box-shadow:inset 0 0 0 2px #e7def633,0 4px 15px #56426838}
#tab-world .astral-panel,#tab-locations>.astral-panel,#modal-body-area {background:var(--corners),radial-gradient(ellipse at top left,#514776,transparent 65%),linear-gradient(135deg,#373358,#24223e)}
#tab-locations h4,#character-sections-container h3 {color:#3e2b60}
#tab-locations .astral-panel h4 {color:#fff1fa}
#tab-world>div>h3 {color:#30254e}
@media(max-width:800px) {
  .night-court .gateway {padding:0}.frontispiece {min-height:clamp(262px,62vw,385px);padding:12px 0 6px}
  .frontispiece h1 {width:min(78%,430px);margin:auto}
  .atlas {grid-template-columns:1fr}.atlas-directory .map-strip{order:0}
  .atlas-head .expand {font-size:12px;padding:5px 8px;min-height:30px}
}
@media(max-width:550px) {
  .mast {padding:6px 2%;min-height:44px}.mast .brand {font-size:14px;gap:3px}.mast .crest {width:26px;height:29px}
  .mast-actions{gap:4px}.mast-actions :is(.expand,.enter){font-size:11px;padding:6px 8px;min-height:31px}.enter span{display:none}
  .frontispiece p{font-size:clamp(12px,3.3vw,17px);padding:5px 2px}.archive-nav button{min-height:40px;gap:5px;padding:6px 3px}
  .archive-nav button .nav-sigil{width:19px;height:19px}.archive-nav>div{gap:3px}
  main:has(#tab-world){width:100%;padding-top:2px}
  #tab-characters,#tab-locations,#tab-world>div {margin-inline:9px}
  .atlas {padding:13px 12px 15px;gap:10px;border-radius:0}
  .atlas-head{grid-template-columns:1fr auto 1fr;min-height:64px;padding-bottom:10px}
  .atlas-heading h2{font-size:clamp(21px,5.6vw,30px)}.atlas-heading h2:before,.atlas-heading h2:after{width:23px;margin:0 3px}
  .atlas-heading small{font-size:9px}.atlas-head .expand{position:absolute;right:0;bottom:5px;padding:3px 6px;min-height:24px;font-size:11px}
}
/* Soften the join between the animated title and the illustrated sky. */
.frontispiece h1 img {
  mask-image:linear-gradient(180deg,transparent,#000 17%,#000 79%,transparent),linear-gradient(90deg,transparent,#000 15%,#000 85%,transparent);
  mask-composite:intersect;
}
.atlas:before,.atlas:after {
  mask-image:linear-gradient(90deg,#000 45%,transparent 100%),linear-gradient(180deg,#000 35%,transparent 95%);
  mask-composite:intersect;
}
.plate:before,.plate:after {
  content:"";position:absolute;z-index:1;pointer-events:none;inset:0;
  background:var(--engraving) left top / clamp(34px,5vw,65px) auto no-repeat;
  filter:drop-shadow(0 1px 1px #2d2046);
}
.plate:after {transform:rotate(180deg)}

#organizations-heading {color:#362858;text-shadow:0 1px 0 #fff;}
