/* ------------------------------------------------------------------
   Pre-bundle boot screen. A separate render-blocking stylesheet: the
   browser paints nothing until it arrives, so the loader is on screen
   before the JS bundle (and the app's own CSS) can. Kept out of the
   bundle so it is a plain static file, not a module dependency.
   `#root:not(:empty) ~ #boot` fades it out the moment React commits
   its first tree — no timers, no extra JS.

   The loader is the whole viewport, not a card: a full-screen terminal
   with the KiKé Group wordmark as the banner and the banking stack
   reporting in below it.
   ------------------------------------------------------------------ */
#boot {
  --b-bg: #f7f7f9;
  --b-panel: #ffffff;
  --b-panel2: #efeff2;
  --b-line: #e2e4ea;
  --b-rule: #0b0f14;
  --b-fg: #0b0f14;
  --b-dim: #5a6070;
  --b-accent: #0b1b33;
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  background: var(--b-bg);
  color: var(--b-fg);
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas,
    monospace;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
html[data-theme="dark"] #boot {
  --b-bg: #121316;
  --b-panel: #191b1e;
  --b-panel2: #212428;
  --b-line: #30343a;
  --b-rule: #e9eaec;
  --b-fg: #f2f3f4;
  --b-dim: #a6abb2;
  --b-accent: #e4e5e7;
}
#root:not(:empty) ~ #boot {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
/* Seen earlier in this tab: never paint the overlay, not even for a frame. */
html[data-boot="seen"] #boot {
  display: none;
}
/* Once the app owns the screen, stop the decorative loops instead of
   animating an invisible layer for the rest of the session. */
#root:not(:empty) ~ #boot,
#root:not(:empty) ~ #boot *,
#root:not(:empty) ~ #boot::after {
  animation: none !important;
}

.boot-grid {
  position: absolute;
  inset: -60px;
  background-image: linear-gradient(var(--b-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--b-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 28% 18%, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse at 28% 18%, #000 10%, transparent 72%);
  animation: boot-grid 18s linear infinite;
}
.boot-glow {
  position: absolute;
  top: -16vmax;
  left: -12vmax;
  width: 58vmax;
  height: 58vmax;
  border-radius: 50%;
  background: radial-gradient(circle, var(--b-accent), transparent 62%);
  opacity: 0.14;
  filter: blur(48px);
  animation: boot-breathe 4.5s ease-in-out infinite;
}
#boot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: repeating-linear-gradient(
    to bottom,
    rgba(11, 15, 20, 0.05) 0 1px,
    transparent 1px 3px
  );
  opacity: 0.5;
  pointer-events: none;
  animation: boot-lines 9s linear infinite;
}
html[data-theme="dark"] #boot::after {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0 1px,
    transparent 1px 3px
  );
}

.boot-screen {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  animation: boot-in 0.5s ease both;
}

.boot-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem clamp(1.25rem, 5vw, 5rem);
  border-bottom: 2px solid var(--b-rule);
  background: var(--b-panel2);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--b-dim);
}
.boot-lights {
  display: inline-flex;
  gap: 5px;
}
.boot-lights i {
  width: 8px;
  height: 8px;
  border: 1px solid var(--b-rule);
  border-radius: 50%;
}
.boot-lights i:first-child {
  background: var(--b-accent);
}
.boot-bar__title {
  flex: 1;
}
.boot-bar__status {
  color: var(--b-accent);
}
.boot-bar__esc {
  opacity: 0.65;
}

.boot-main {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-content: start;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(2rem, 7vh, 5rem) clamp(1.25rem, 5vw, 5rem) 2rem;
}

.boot-hero {
  animation: boot-rise 0.6s 0.08s ease both;
}
.boot-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--b-dim);
}
.boot-eyebrow::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--b-rule);
}
.boot-name {
  margin: 1rem 0 0;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(3.4rem, 9vw, 7.5rem);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.055em;
}
.boot-name em {
  font-style: italic;
  color: var(--b-accent);
}
.boot-tagline {
  max-width: 46ch;
  margin: 1.35rem 0 0;
  color: var(--b-dim);
  font-size: clamp(0.78rem, 1.1vw, 0.95rem);
  line-height: 1.6;
}

.boot-console {
  align-self: start;
  padding-left: clamp(1rem, 2vw, 2.5rem);
  border-left: 1px solid var(--b-line);
  animation: boot-rise 0.6s 0.16s ease both;
}
.boot-cmd {
  margin: 0 0 1rem;
  font-size: clamp(12px, 1vw, 14px);
  white-space: nowrap;
}
.boot-prompt {
  color: var(--b-accent);
  font-weight: 700;
}
.boot-type {
  display: inline-block;
  width: 0;
  overflow: hidden;
  vertical-align: bottom;
  border-right: 2px solid var(--b-accent);
  animation: boot-type 0.8s steps(14) 0.25s forwards,
    boot-caret 0.9s steps(1) 1.1s infinite;
}

.boot-log {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(11.5px, 0.95vw, 13px);
  color: var(--b-dim);
}
.boot-log li {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  opacity: 0;
  transform: translateY(3px);
  animation: boot-line 0.35s ease forwards;
}
.boot-log li:nth-child(1) {
  animation-delay: 0.6s;
}
.boot-log li:nth-child(2) {
  animation-delay: 0.76s;
}
.boot-log li:nth-child(3) {
  animation-delay: 0.92s;
}
.boot-log li:nth-child(4) {
  animation-delay: 1.08s;
}
.boot-log li:nth-child(5) {
  animation-delay: 1.24s;
}
.boot-log li:nth-child(6) {
  animation-delay: 1.4s;
}
.boot-ok {
  color: var(--b-accent);
  font-weight: 700;
}
.boot-svc {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.08em;
  opacity: 0.5;
}

.boot-foot {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  padding: 1rem clamp(1.25rem, 5vw, 5rem);
  border-top: 2px solid var(--b-rule);
  background: var(--b-panel2);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--b-dim);
}
.boot-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--b-rule);
  background: repeating-linear-gradient(
    90deg,
    var(--b-bg) 0 6px,
    transparent 6px 8px
  );
}
.boot-track span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--b-accent));
  animation: boot-sweep 1.15s ease-in-out infinite;
}
.boot-pulse {
  display: inline-flex;
  gap: 3px;
}
.boot-pulse i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--b-accent);
  animation: boot-pulse 1.1s ease-in-out infinite;
}
.boot-pulse i:nth-child(2) {
  animation-delay: 0.15s;
}
.boot-pulse i:nth-child(3) {
  animation-delay: 0.3s;
}

.boot-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes boot-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes boot-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes boot-type {
  to {
    width: 14ch;
  }
}
@keyframes boot-caret {
  0%,
  49% {
    border-color: var(--b-accent);
  }
  50%,
  100% {
    border-color: transparent;
  }
}
@keyframes boot-line {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes boot-sweep {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}
@keyframes boot-pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes boot-grid {
  to {
    background-position: 56px 56px, 56px 56px;
  }
}
@keyframes boot-lines {
  to {
    transform: translateY(3px);
  }
}
@keyframes boot-breathe {
  0%,
  100% {
    opacity: 0.1;
    transform: scale(0.94);
  }
  50% {
    opacity: 0.18;
    transform: scale(1.04);
  }
}

@media (max-width: 860px) {
  .boot-main {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    padding-top: 2rem;
  }
  .boot-console {
    padding-top: 1.5rem;
    padding-left: 0;
    border-top: 1px solid var(--b-line);
    border-left: 0;
  }
}
@media (max-width: 640px) {
  .boot-bar__status {
    display: none;
  }
  .boot-svc {
    display: none;
  }
  .boot-foot {
    grid-template-columns: 1fr auto;
  }
  .boot-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  #boot,
  #boot *,
  #boot::after {
    animation: none !important;
    transition: none !important;
  }
  .boot-log li,
  .boot-hero,
  .boot-console {
    opacity: 1;
    transform: none;
  }
  .boot-type {
    width: 14ch;
  }
}
