/* ==========================================================================
   SPLASH / LOADING — CELESTIAL ART-DECO TITLE CARD
   A nebula starfield, the ivory moon wordmark, a double-line frame with
   sparkle corners, and a PRESS START plate taken from the UI design sheet.
   The sacred-geometry loader (metatron + flower of life) is wired to the
   real boot progress (--p). Loads after premium.css, so these rules own
   the two screens.
   ========================================================================== */

/* ---------- splash shell ---------- */
#splash {
  background: #07070d !important;
  display: none;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
}
#splash.active { display: grid; place-items: center; }
#splash::after { display: none !important; }

/* the celestial sky: deep nebula washes over near-black, stars, slow line-art orbit rings */
.arc-sky { position: absolute; inset: 0; z-index: 0; overflow: hidden; background:
  radial-gradient(120vw 90vh at 78% 10%, rgba(66, 60, 112, .32), transparent 62%),
  radial-gradient(95vw 72vh at 12% 84%, rgba(54, 46, 94, .26), transparent 64%),
  radial-gradient(72vw 56vh at 50% 46%, rgba(28, 26, 52, .45), transparent 72%),
  linear-gradient(180deg, #0a0a12 0%, #07070d 55%, #050509 100%); }
.arc-stars { position: absolute; inset: 0; opacity: .8;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 18%, #fff 40%, transparent 60%),
    radial-gradient(1px 1px at 19% 42%, #fff 40%, transparent 60%),
    radial-gradient(2px 2px at 33% 12%, #fff 40%, transparent 60%),
    radial-gradient(1px 1px at 46% 32%, #fff 40%, transparent 60%),
    radial-gradient(1.4px 1.4px at 58% 8%, #fff 40%, transparent 60%),
    radial-gradient(1px 1px at 69% 38%, #fff 40%, transparent 60%),
    radial-gradient(2px 2px at 81% 16%, #fff 40%, transparent 60%),
    radial-gradient(1px 1px at 92% 44%, #fff 40%, transparent 60%),
    radial-gradient(1.2px 1.2px at 12% 58%, #fff 40%, transparent 60%),
    radial-gradient(1px 1px at 74% 62%, #fff 40%, transparent 60%);
  animation: arcTwinkle 4.5s ease-in-out infinite alternate; }
@keyframes arcTwinkle { from { opacity: .45; } to { opacity: .95; } }

.arc-neb { position: absolute; inset: -10%; opacity: .55;
  background:
    radial-gradient(38vw 26vh at 68% 22%, rgba(122, 106, 178, .16), transparent 70%),
    radial-gradient(30vw 22vh at 26% 68%, rgba(170, 134, 120, .09), transparent 70%),
    radial-gradient(26vw 18vh at 84% 74%, rgba(98, 90, 154, .13), transparent 72%); }

.arc-halo { position: absolute; left: 50%; top: 50%; width: min(118vh, 92vw); aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; border: 1px solid rgba(236, 227, 204, .1); }
.arc-halo::before { content: ''; position: absolute; inset: 9%; border-radius: 50%; border: 1px solid rgba(236, 227, 204, .07); }
.arc-halo::after { content: ''; position: absolute; inset: 23%; border-radius: 50%;
  border: 1px dashed rgba(236, 227, 204, .1); animation: spSpin 90s linear infinite; }
@keyframes spSpin { to { transform: rotate(360deg); } }

/* double hairline frame with sparkle corners (same star mark as the alt title) */
.arc-cab { position: absolute; inset: 3.2vmin; z-index: 1; pointer-events: none;
  border: 1px solid rgba(236, 227, 204, .28); }
.arc-cab::before { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(236, 227, 204, .12); }
.af-s { position: absolute; width: 15px; height: 15px; translate: -50% -50%; background: rgba(236, 227, 204, .85);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.af-s.tl { left: 0; top: 0; } .af-s.tm { left: 50%; top: 0; } .af-s.tr { left: 100%; top: 0; }
.af-s.bl { left: 0; top: 100%; } .af-s.bm { left: 50%; top: 100%; } .af-s.br { left: 100%; top: 100%; }

/* ---------- content ---------- */
.sp-wrap { position: relative; z-index: 3; display: grid; justify-items: center; gap: 15px; text-align: center; padding: 20px; }
.sp-kicker { display: flex; gap: 14px; font: 500 10px/1 var(--f-mono, monospace); letter-spacing: .52em; color: rgba(236, 227, 204, .62); }
.sp-kicker span + span::before { content: '·'; margin-right: 14px; color: rgba(236, 227, 204, .38); }

.sp-logo { width: min(42vh, 62vw); height: auto; opacity: 0;
  animation: splogo 1.2s .15s cubic-bezier(.2, .9, .2, 1) forwards;
  filter: drop-shadow(0 0 34px rgba(236, 227, 204, .16)) drop-shadow(0 12px 44px rgba(0, 0, 0, .8)); }
@keyframes splogo { from { opacity: 0; transform: scale(.94) translateY(10px); filter: blur(10px); } to { opacity: 1; transform: none; } }

/* star-burst rule from the design sheet */
.sp-rule { display: flex; align-items: center; gap: 12px; width: min(380px, 58vw); }
.sp-rule i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(236, 227, 204, .4), transparent); }
.sp-rule svg { width: 13px; height: 13px; fill: rgba(236, 227, 204, .8); flex: none; }

.sp-tag { font: 500 10px/1 var(--f-mono, monospace); letter-spacing: .34em; color: rgba(236, 227, 204, .7); }

/* PRESS START: the art-deco plate — double hairline frame, sparkle corners, serif caps */
#splash .press { position: relative; bottom: auto; margin-top: 4px; cursor: pointer; opacity: 0;
  font: 500 15px/1 'Cormorant Garamond', 'Times New Roman', Georgia, serif; letter-spacing: .42em; padding: 17px 44px 17px 50px;
  color: #ece3cc; background: transparent;
  border: 1px solid rgba(236, 227, 204, .55); border-radius: 0; text-transform: uppercase;
  animation: sppress .5s 1.15s forwards;
  transition: color .25s, border-color .25s, box-shadow .25s, background .25s; }
#splash .press::before { content: ''; position: absolute; inset: 4px; border: 1px solid rgba(236, 227, 204, .22); pointer-events: none; }
#splash .press::after { content: ''; position: absolute; inset: -6px; pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Cpath d='M0-10L2-2 10 0 2 2 0 10-2 2-10 0-2-2z' fill='%23ece3cc'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Cpath d='M0-10L2-2 10 0 2 2 0 10-2 2-10 0-2-2z' fill='%23ece3cc'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Cpath d='M0-10L2-2 10 0 2 2 0 10-2 2-10 0-2-2z' fill='%23ece3cc'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Cpath d='M0-10L2-2 10 0 2 2 0 10-2 2-10 0-2-2z' fill='%23ece3cc'/%3E%3C/svg%3E");
  background-position: left top, right top, left bottom, right bottom;
  background-size: 12px 12px; background-repeat: no-repeat; opacity: .8; transition: opacity .25s; }
#splash .press:hover, #splash .press:focus-visible { color: #fff8e6; border-color: #fff8e6;
  background: rgba(236, 227, 204, .07); box-shadow: 0 0 34px rgba(255, 240, 210, .2), inset 0 0 26px rgba(255, 240, 210, .07); }
#splash .press:hover::after, #splash .press:focus-visible::after { opacity: 1; }
#splash .press:active { transform: translateY(1px); box-shadow: 0 0 16px rgba(255, 240, 210, .16); }
@keyframes sppress { to { opacity: 1; } }

.sp-coin { font: 500 9px/1 var(--f-mono, monospace); letter-spacing: .34em; color: rgba(236, 227, 204, .5); }

.sp-build { position: absolute; z-index: 3; left: 0; right: 0; bottom: 4.6vmin; text-align: center;
  font: 500 8px/1 var(--f-mono, monospace); letter-spacing: .38em; color: rgba(236, 227, 204, .38); }

/* ---------- sacred-geometry loader ---------- */
.ld-geo { position: absolute; z-index: 1; top: 50%; left: 50%; translate: -50% -50%; width: min(48vh, 52vw); aspect-ratio: 1;
  display: grid; place-items: center; opacity: .95; pointer-events: none; }
.ld-geo svg { width: 100%; height: 100%; overflow: visible; }
.ld-geo circle, .ld-geo path { fill: none; stroke: rgba(255, 224, 168, .55); stroke-width: .8; }
.geo-halo { animation: spSpin 46s linear infinite; transform-origin: 100px 100px; opacity: .55; }
.geo-halo .geo-dash { stroke-dasharray: 2 7; stroke: rgba(236, 227, 204, .55); }
.geo-metatron { animation: geoSpinR 34s linear infinite; transform-origin: 100px 100px; opacity: .38; }
.geo-metatron path { stroke: rgba(236, 227, 204, .4); }
.geo-flower { animation: spSpin 26s linear infinite; transform-origin: 100px 100px; opacity: .3; }
.geo-track { stroke: rgba(255, 226, 168, .18); stroke-width: 1.2; }
.geo-prog { stroke: #ffe2a8; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 610;
  stroke-dashoffset: calc(610 - 610 * var(--p, 0)); transform: rotate(-90deg); transform-origin: 100px 100px;
  filter: drop-shadow(0 0 8px rgba(255, 210, 140, .9)); transition: stroke-dashoffset .35s linear; }
@keyframes geoSpinR { to { transform: rotate(-360deg); } }
.geo-core { position: absolute; display: grid; justify-items: center; font: 700 clamp(20px, 3.6vh, 34px)/1 var(--f-hud, monospace); color: #fff; text-shadow: 0 0 22px rgba(255, 210, 140, .75); }
.geo-core small { font-size: .5em; letter-spacing: .2em; opacity: .8; }

/* the loader sits behind the year-3000 art without hiding it */
#loading .ld-geo { top: 54%; }
#loading .ld-map { top: 9vh; }
#loading .ld-foot { bottom: calc(4.4vh + var(--safe-b)); }
.ld-skel { display: grid; gap: 6px; margin-top: 4px; opacity: .55; }
.ld-skel .skel-line { height: 5px; }
.ld-skel .skel-line.sm { justify-self: center; --w: 32%; }

@media (max-width: 720px) {
  .sp-logo { width: min(36vh, 72vw); }
  #splash .press { padding: 14px 28px 14px 34px; font-size: 12px; letter-spacing: .3em; }
  .sp-kicker { letter-spacing: .3em; font-size: 8px; }
  .ld-geo { width: min(40vh, 64vw); opacity: .8; }
}
@media (max-height: 620px) { .sp-logo { width: min(32vh, 60vw); } .sp-tag, .sp-coin { display: none; } .ld-geo { width: 34vh; } }

@media (prefers-reduced-motion: reduce) {
  .arc-stars, .arc-halo::after, .geo-halo, .geo-metatron, .geo-flower { animation: none !important; }
  .sp-logo { animation: splogo .01s forwards !important; }
  #splash .press { animation: sppress .01s forwards !important; }
}

/* One calm space treatment for both boot and map transitions. */
#splash .arc-sky { background: radial-gradient(ellipse at 50% 44%, #162135 0, #080e1a 46%, #040710 100%); }
#splash .arc-neb { opacity: .28; }
#splash .arc-cab { border-color: rgba(220, 230, 244, .18); }
#splash .arc-cab::before, #splash .af-s.tm, #splash .af-s.bm { display: none; }
#splash .sp-logo { filter: drop-shadow(0 8px 36px rgba(0, 0, 0, .65)); }
#splash .press { border-color: rgba(228, 230, 228, .48); font-family: var(--f-mono, monospace); font-size: 11px; letter-spacing: .25em; }
#splash .press::before, #splash .press::after { display: none; }
#splash .press:hover, #splash .press:focus-visible { background: rgba(220, 230, 244, .12); box-shadow: none; outline: 2px solid #e5ebf4; outline-offset: 4px; }
#loading .ld-geo { width: min(30vh, 42vw); opacity: .75; }
#loading .geo-metatron, #loading .geo-flower { display: none; }
#loading .geo-halo { opacity: .55; }
#loading .geo-track { stroke: rgba(210, 225, 244, .25); }
#loading .geo-prog { stroke: #e5ddc9; filter: none; }
#loading .geo-core { text-shadow: 0 1px 8px #000; font-size: clamp(20px, 3vh, 28px); }
#loading .ld-skel { display: none; }
#loading .ld-map b { font-size: clamp(25px, 5vh, 52px); letter-spacing: .1em; }
#loading .ld-map::after { height: 1px; background: rgba(227, 222, 209, .45); }
#loading .ld-foot { gap: 10px; width: min(560px, calc(100vw - 48px)); }
#loading .ld-bar { height: 3px; border: 0; box-shadow: none; background: rgba(220, 230, 244, .2); }
#loading .ld-bar i { background: #e5ddc9; box-shadow: none; }
#loading .ld-bar i::after { display: none; }

/* Reference-led opening screen: the provided art stays behind real, selectable UI. */
#splash .sp-art { position: absolute; inset: 0; background: #08090e url('../img/art/start-reference.webp') center / cover no-repeat; }
#splash .sp-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 48%, rgba(7, 8, 13, .96) 59%, rgba(7, 8, 13, .98) 98%); }
#splash .sp-wrap { position: absolute; left: 58%; right: 4%; top: 40%; display: grid; gap: clamp(32px, 7vh, 72px); padding: 20px; }
#splash .sp-title { margin: 0; color: #f4f1f2; font: 300 clamp(24px, 3vw, 52px)/1 var(--f-hud, sans-serif); letter-spacing: .28em; white-space: nowrap; text-shadow: 0 2px 18px #000; }
#splash .sp-title span { color: #f4a6d1; text-shadow: 0 0 18px #ef8ec8; }
#splash .press { animation: none; opacity: 1; margin: 0; padding: 15px 30px; border: 0; border-block: 1px solid rgba(255,255,255,.45); color: #fff; font: 500 13px/1 var(--f-mono, monospace); letter-spacing: .3em; }
#splash .press:hover, #splash .press:focus-visible { background: rgba(244,166,209,.12); outline-color: #f4a6d1; }
#splash .sp-corner { position: absolute; z-index: 2; left: 3%; text-align: left; color: rgba(255,255,255,.8); font: 500 9px/1.6 var(--f-mono, monospace); letter-spacing: .25em; }
#splash .sp-corner-top { top: 5%; } #splash .sp-corner-bottom { bottom: 5%; }
#splash .sp-build { left: auto; right: 3%; bottom: 5%; text-align: right; color: rgba(255,255,255,.7); line-height: 1.6; letter-spacing: .22em; }
@media (max-width: 720px) {
  #splash .sp-art { background-position: 30% center; }
  #splash .sp-art::after { background: linear-gradient(180deg, transparent 30%, rgba(7,8,13,.75) 67%, #07080d 100%); }
  #splash .sp-wrap { left: 3%; right: 3%; top: auto; bottom: 13%; gap: 30px; }
  #splash .sp-title { font-size: clamp(22px, 6vw, 38px); letter-spacing: .18em; }
}
