/* =========================================================
   BOOT SEQUENCE — the site's entry gate.

   Design decision, made explicit: the obvious version of this
   is a fake progress bar that ticks up on a timer while generic
   "Loading..." text sits above it. That was rejected — it's the
   exact pattern the brief calls out as forgettable, and it lies
   to the visitor about what's actually happening.

   Three alternatives considered before this one:
   1. A reactor-style circular button with concentric spinning
      rings — visually loud, but it's a sci-fi-kit cliché and
      shares no visual DNA with the rest of the site.
   2. A full-bleed terminal window (like a real OS console) —
      authentic, but cold; it reads as a developer tool, not as
      "Code Universe."
   3. The HUD-panel bracket button used everywhere else on the
      site, scaled up, feeding into a bracket-cornered terminal
      card — reuses the one visual language already established
      (see components.css) instead of inventing a fourth one.

   (3) won, merged with a few ideas from the others: the terminal
   card keeps a real monospace log (from #2), and the button
   still breathes/glows to invite the click (a calmer descendant
   of #1). Every animation below is either progress feedback,
   a state transition, or ambient atmosphere — nothing loops
   forever just to look busy.
========================================================= */

.boot{
  position: fixed; inset: 0; z-index: 9998;
  background: var(--void);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
}
.boot.exit{ animation: boot-exit .85s var(--ease2) forwards; }
@keyframes boot-exit{
  0%{ opacity: 1; filter: brightness(1) blur(0); transform: scale(1); }
  55%{ filter: brightness(2.2) blur(2px); }
  100%{ opacity: 0; filter: brightness(2.4) blur(10px); transform: scale(1.08); }
}

/* --- ambient texture: scanlines + a radial vignette so the void
   doesn't read as flat-black emptiness before anything happens --- */
.boot-vignette{
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(201,165,90,.05), transparent 62%);
}
.boot-scan{
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: .5;
  background: repeating-linear-gradient(to bottom,
    rgba(255,255,255,.035) 0px, rgba(255,255,255,.035) 1px, transparent 1px, transparent 3px);
  animation: boot-scan-drift 9s linear infinite;
}
@keyframes boot-scan-drift{ from{ background-position: 0 0; } to{ background-position: 0 180px; } }

/* --- hex columns: pure decoration, refreshed by boot.js only
   while the sequence runs, stopped on exit --- */
.boot-hex{
  position: absolute; top: 0; bottom: 0; width: 130px; padding: 3rem 1rem;
  font-family: var(--ff-mono); font-size: .6rem; line-height: 1.7; color: var(--gold3);
  opacity: .22; overflow: hidden; white-space: pre; pointer-events: none;
}
.boot-hex.left{ left: 0; }
.boot-hex.right{ right: 0; text-align: right; }
@media (max-width: 760px){ .boot-hex{ display: none; } } /* no room to breathe on small screens */

/* =========================================================
   THE GATE — single button, nothing competing with it
========================================================= */
.boot-gate{
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 1.8rem;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.boot-gate.hide{ opacity: 0; transform: scale(.92); pointer-events: none; }

.boot-btn{
  --hud-c: var(--void3); /* dark brackets read against the gold fill, unlike the light brackets elsewhere */
  background-color: transparent;
  background-image: linear-gradient(135deg, var(--gold), var(--gold2)), var(--hud-corners);
  background-size: auto, var(--hud-corners-size);
  background-position: 0 0, var(--hud-corners-pos);
  color: var(--void);
  padding: 1.7rem 3.4rem;
  font-size: .84rem;
  letter-spacing: .2em;
  animation: boot-btn-breathe 3.4s ease-in-out infinite;
}
@keyframes boot-btn-breathe{
  0%, 100%{ box-shadow: 0 0 30px rgba(201,165,90,.26), 0 8px 30px rgba(201,165,90,.2); }
  50%{ box-shadow: 0 0 54px rgba(201,165,90,.48), 0 8px 30px rgba(201,165,90,.3); }
}
.boot-btn:active{ transform: translateY(-1px) scale(.97); }

.boot-hint{
  font-family: var(--ff-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted2);
}

.boot-sound{
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--ff-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted2); transition: color .3s;
}
.boot-sound:hover{ color: var(--ivory2); }
.boot-sound-icon{ width: 7px; height: 7px; border-radius: 50%; background: var(--muted2); transition: background .3s, box-shadow .3s; }
.boot-sound[aria-pressed="true"] .boot-sound-icon{ background: var(--gold2); box-shadow: 0 0 8px var(--gold2); }

/* --- ignition flash: the single moment of "impact" when the
   button is pressed, before the terminal takes over --- */
.boot-flash{
  position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,.92), transparent 68%);
}
.boot-flash.fire{ animation: boot-flash-fire .5s var(--ease2) forwards; }
@keyframes boot-flash-fire{
  0%{ opacity: 0; }
  18%{ opacity: .8; }
  100%{ opacity: 0; }
}

/* =========================================================
   THE TERMINAL — real boot phases, typed in real time
========================================================= */
.boot-term{
  position: relative; z-index: 2; width: min(560px, 88vw);
  flex-direction: column; align-items: stretch;
  padding: clamp(1.8rem, 4vw, 2.6rem) clamp(1.6rem, 4vw, 2.4rem);
  opacity: 0; transform: scale(.96);
  transition: opacity .5s var(--ease) .15s, transform .5s var(--ease) .15s;
}
/* `display` deliberately lives only here, not on the base rule above:
   the element carries the `hidden` attribute until JS reveals it, and
   an author-stylesheet `display` on the base rule would silently beat
   the UA `[hidden]{display:none}` rule regardless of specificity,
   making it visible before the boot button was ever pressed. */
.boot-term.show{ display: flex; opacity: 1; transform: scale(1); }
.boot-term.glitch{ animation: boot-glitch .18s steps(2, end) 1; }
@keyframes boot-glitch{
  0%, 100%{ transform: translate(0,0); }
  20%{ transform: translate(-2px, 1px); }
  40%{ transform: translate(2px, -1px); }
  60%{ transform: translate(-1px, 0); }
  80%{ transform: translate(1px, 1px); }
}

.boot-term-lines{ min-height: 12.2em; margin-bottom: 1.5rem; }
.boot-line{
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-family: var(--ff-mono); font-size: .8rem; line-height: 1.95; color: var(--ivory2);
  opacity: 0; transform: translateX(-6px); transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.boot-line.show{ opacity: 1; transform: translateX(0); }
.boot-line .txt{ white-space: nowrap; overflow: hidden; }
.boot-line .txt::after{ content: ''; display: inline-block; width: 6px; height: 1em; margin-left: 2px; background: var(--gold2); vertical-align: -2px; opacity: 0; }
.boot-line.typing .txt::after{ opacity: 1; animation: tcursor-blink .8s step-end infinite; }
.boot-line .status{ font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; flex-shrink: 0; opacity: 0; transition: opacity .2s; }
.boot-line.done .status{ opacity: 1; }
.boot-line .status.ok{ color: var(--gold2); }
.boot-line .status.warn{ color: var(--nebula2); }

.boot-term-foot{ display: flex; align-items: center; gap: 1rem; }
.boot-bar{ flex: 1; height: 2px; background: var(--rim2); position: relative; overflow: hidden; }
.boot-bar-fill{
  position: absolute; inset: 0; width: 0%;
  background: linear-gradient(90deg, var(--gold3), var(--gold), var(--gold2));
  box-shadow: 0 0 10px var(--gold);
  transition: width .18s linear;
}
.boot-pct{ font-family: var(--ff-mono); font-size: .7rem; color: var(--muted); width: 3.6em; text-align: right; }

.boot-skip{
  position: absolute; bottom: clamp(1.6rem, 4vw, 2.6rem); left: 50%; transform: translateX(-50%);
  font-family: var(--ff-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted2); padding: .6rem 1rem; opacity: 0; transition: opacity .4s var(--ease), color .3s;
}
.boot-skip.show{ opacity: 1; }
.boot-skip:hover{ color: var(--gold2); }

@media (prefers-reduced-motion: reduce){
  .boot-btn{ animation: none; }
  .boot-scan{ animation: none; opacity: .3; }
  .boot-flash.fire{ animation: none; opacity: 0; }
  .boot.exit{ animation: none; opacity: 0; }
  .boot-term.glitch{ animation: none; }
  .boot-gate, .boot-term, .boot-line{ transition-duration: .15s; }
}
