/* ─────────────────────────────────────────────────────────────────────────
   Boot / loading overlay — industrial CAD splash.
   Depends on the following CSS custom properties (define them in :root):
     --bg          warm paper background      e.g. #f1efe6
     --ink         near-black ink             e.g. #0a0a0a
     --mute        pencil grey                e.g. #777267
     --hair        hairline rule color        e.g. rgba(10,10,10,0.18)
     --hair-soft   subtle grid line color     e.g. rgba(10,10,10,0.08)
     --accent      engineering red            e.g. #d9251e
   And the fonts: "Bricolage Grotesque" (display) and "JetBrains Mono" (mono).
   ───────────────────────────────────────────────────────────────────────── */

.boot {
  position: fixed; inset: 0; z-index: 100000;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity .6s ease, visibility .6s;
  overflow: hidden;
}
.boot.done { opacity: 0; visibility: hidden; pointer-events: none; }

/* paper grid */
.boot::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--hair-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--hair-soft) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.7;
}
/* paper dot pattern overlay */
.boot::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(10,10,10,0.10) 0.6px, transparent 0.6px);
  background-size: 14px 14px;
  opacity: 0.45;
}

/* corner registration crosshairs */
.boot-reg { position: absolute; width: 22px; height: 22px; }
.boot-reg::before, .boot-reg::after { content: ""; position: absolute; background: var(--ink); }
.boot-reg::before { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%); }
.boot-reg::after  { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%); }
.boot-reg.tl { top: 14px; left: 14px; }
.boot-reg.tr { top: 14px; right: 14px; }
.boot-reg.bl { bottom: 14px; left: 14px; }
.boot-reg.br { bottom: 14px; right: 14px; }

/* top status bar */
.boot-topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  border-bottom: 1px solid var(--ink);
  background: var(--bg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--mute);
}
.boot-topbar > div {
  padding: 7px 14px;
  border-right: 1px solid var(--hair);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.boot-topbar > div:last-child { border-right: none; text-align: right; }
.boot-topbar b { color: var(--ink); }

/* center card */
.boot-card {
  position: relative;
  width: min(560px, 88vw);
  border: 1px solid var(--ink);
  background: var(--bg);
  padding: 18px 22px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.boot-head {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hair);
  color: var(--mute);
}
.boot-head b { color: var(--ink); }
.boot-head .fig { display: inline-flex; align-items: baseline; gap: 6px; color: var(--ink); }
.boot-head .fig b { font-size: 14px; }

.boot-mark {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--hair);
}
.boot-mark .glyph {
  width: 48px; height: 48px; border: 1px solid var(--ink);
  display: grid; place-items: center; color: var(--ink);
}
.boot-mark .title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700; font-size: 24px;
  line-height: 0.96; letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--ink);
}
.boot-mark .title .red { color: var(--accent); }
.boot-mark .sub { color: var(--mute); margin-top: 4px; font-size: 10px; }

/* progress meter */
.boot-meter-wrap {
  margin: 14px 0 8px;
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
}
.boot-meter {
  position: relative; height: 8px;
  border: 1px solid var(--ink);
  overflow: hidden;
  background:
    repeating-linear-gradient(45deg,
      transparent 0 4px,
      rgba(10,10,10,0.05) 4px 8px);
}
.boot-bar {
  height: 100%; width: 0%;
  background: var(--accent);
  transition: width .35s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.boot-bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 60%, rgba(255,255,255,0.45) 90%, transparent);
  animation: bootSheen 1.4s ease-in-out infinite;
}
@keyframes bootSheen {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.boot-pct {
  color: var(--ink); font-weight: 700;
  min-width: 4ch; text-align: right; font-size: 11px;
}

/* log lines */
.boot-log {
  list-style: none;
  margin: 4px 0 0; padding: 0;
  font-size: 10px; color: var(--mute);
  border-top: 1px solid var(--hair);
  padding-top: 10px;
}
.boot-log li {
  padding: 3px 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .25s ease, transform .25s ease;
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
}
.boot-log li.show { opacity: 1; transform: translateX(0); }
.boot-log li em {
  font-style: normal; color: var(--accent); font-weight: 700;
}

/* footer of card */
.boot-foot {
  display: flex; justify-content: space-between;
  border-top: 1px solid var(--hair);
  margin-top: 10px; padding-top: 10px;
  color: var(--mute);
  font-size: 9.5px;
}
.boot-foot b { color: var(--ink); }
.boot-foot .pip {
  display: inline-block; width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--accent);
  animation: pip 1.4s ease-in-out infinite;
}
@keyframes pip {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* bottom data bar */
.boot-bottombar {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid var(--ink);
  background: var(--bg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--mute);
}
.boot-bottombar > div { padding: 7px 14px; border-right: 1px solid var(--hair); }
.boot-bottombar > div:last-child { border-right: none; text-align: right; }
.boot-bottombar .scan {
  display: inline-block; height: 6px; width: 60px;
  background:
    repeating-linear-gradient(to right,
      var(--ink) 0 2px,
      transparent 2px 4px);
  vertical-align: middle; margin-left: 6px;
}
