/* ================================================================
   BOOT — ASCII SIGNAL SKIN
   The loading screen in the same terminal language as the site:
   black field, IBM Plex Mono, the --ascii-* greens, a glyph field that
   fills in with the load (same ramp + cell as os/scene3d/ascii.js), and
   the card sitting exactly where #site-nav lands so the handoff reads
   as one screen. Scoped to body.ascii-site; the classic skin is untouched.
   Loaded after ascii-site.css. No backdrop-filter, no gradients that
   animate, no WebGL — phones stay cheap while the real scene spins up.
   ================================================================ */

body.ascii-site #boot { background: var(--ascii-black) !important; }
body.ascii-site #boot-flash { background: #0b2a15; }

body.ascii-site #splash {
  display: block;
  background: var(--ascii-black) !important;
}
body.ascii-site #splash::before { display: none; }       /* chrome sweep off */

/* ---- glyph field ---- */
body.ascii-site .boot-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  white-space: pre;
  font: 500 var(--bf-size, 12px)/var(--bf-line, 14px) "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: var(--bf-track, 0px);
  color: #2eb861;
  text-shadow: none;
  opacity: .62;
  /* keep the card side clean, same falloff as .character-vignette */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 22%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 22%, #000 58%);
}
body.ascii-site .boot-field.is-hot {
  z-index: 1;
  color: #d6ffe2;
  opacity: .8;
  text-shadow: 0 0 6px rgba(113,255,154,.35);
}
body.ascii-site #boot.ready .boot-field { transition: opacity .6s ease; }

/* ---- the card: sits where the directory panel will be ---- */
body.ascii-site .splash-card {
  position: absolute !important;
  z-index: 2 !important;
  left: clamp(20px, 3vw, 46px);
  top: 50%;
  transform: translateY(-50%);
  width: min(320px, calc(100vw - 40px));
  padding: 16px 18px 14px !important;
  border: 0 !important;
  border-left: 1px solid rgba(113,255,154,.34) !important;
  border-radius: 0 !important;
  background: linear-gradient(90deg, rgba(0,7,3,.92), rgba(0,5,2,.6) 70%, transparent) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  text-align: left;
  overflow: visible;
}
body.ascii-site .splash-card::after { display: none; }
body.ascii-site #boot.ready .splash-card { border-color: rgba(113,255,154,.34) !important; box-shadow: none !important; }

/* wordmark: the same logo.png mask the directory uses, so the file is
   requested once and shared (the old <img> got aborted when #boot left) */
body.ascii-site .splash-mark {
  display: block;
  width: 100%;
  aspect-ratio: 2059 / 385;
  background: var(--ascii-green-hot);
  -webkit-mask: url(../assets/logo.png) left center / contain no-repeat;
  mask: url(../assets/logo.png) left center / contain no-repeat;
  /* luminance, as in ascii-site.css: the PNG's opaque black outline must not fill in */
  -webkit-mask-source-type: luminance;
  mask-mode: luminance;
  filter: drop-shadow(0 0 9px rgba(113,255,154,.22));
}
body.ascii-site .splash-logo,
body.ascii-site .splash-sun { display: none !important; }
body.ascii-site .splash-word {             /* kept for screen readers only */
  position: absolute !important;
  width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
  animation: none !important; background: none !important;
}

body.ascii-site .splash-sub {
  margin: 6px 0 16px !important;
  text-align: left;
  font-size: 10px;
  line-height: 1.4;
  font-family: inherit !important;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(113,255,154,.62) !important;
  text-shadow: none !important;
}

/* POST-style log, numbered like the directory rows */
body.ascii-site .splash-log {
  display: grid;
  gap: 0;
  margin: 0 0 12px;
  font-size: 10.5px;
  line-height: 1;
  font-family: inherit;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(207,255,220,.72);
}
body.ascii-site .splash-log > div {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 24px;
  border-bottom: 1px solid rgba(113,255,154,.12);
}
body.ascii-site .splash-log .n { width: 16px; color: rgba(113,255,154,.5); font-size: 9px; }
body.ascii-site .splash-log .t { flex: 1; }
body.ascii-site .splash-log .s { color: rgba(113,255,154,.5); font-size: 9px; }
body.ascii-site .splash-log .ok { color: var(--ascii-green); }
body.ascii-site .splash-log > div:last-child .t { color: var(--ascii-green-hot); }

/* progress: block cells, not a glossy pill */
body.ascii-site .splash-bar {
  height: 8px !important;
  padding: 1px !important;
  border: 1px solid rgba(113,255,154,.35) !important;
  border-radius: 0 !important;
  background: #031007 !important;
  box-shadow: none !important;
}
body.ascii-site .splash-bar i {
  border-radius: 0 !important;
  background: repeating-linear-gradient(90deg, var(--ascii-green) 0 5px, transparent 5px 7px) !important;
  box-shadow: 0 0 8px rgba(113,255,154,.25) !important;
}

body.ascii-site .splash-tick {
  margin-top: 10px !important;
  font-size: 11px;
  line-height: 1.5;
  font-family: inherit !important;
  letter-spacing: .06em;
  color: var(--ascii-green) !important;
  opacity: 1 !important;
}
body.ascii-site .splash-tick::after {
  content: "\2588";
  display: inline-block;
  margin-left: 4px;
  font-size: .85em;
  animation: bootCaret 1s steps(1) infinite;
}
@keyframes bootCaret { 50% { opacity: 0; } }

body.ascii-site .splash-foot {
  margin-top: 12px !important;
  font-size: 9px;
  line-height: 1.4;
  font-family: inherit !important;
  letter-spacing: .16em;
  color: rgba(113,255,154,.5) !important;
}

/* ---- phones: the directory docks to the bottom, so does the card ---- */
@media (max-width: 759px) {
  body.ascii-site .splash-card {
    left: 14px;
    right: 14px;
    top: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    width: auto;
    transform: none;
    padding: 12px !important;
    background: rgba(0,7,2,.9) !important;
  }
  body.ascii-site .splash-mark { width: min(100%, 230px); }
  body.ascii-site .splash-log > div { min-height: 22px; }
  body.ascii-site .boot-field {
    opacity: .5;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 38%, transparent 72%);
    mask-image: linear-gradient(180deg, #000 0%, #000 38%, transparent 72%);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.ascii-site .splash-tick::after { animation: none; }
}
