  /* ===== SPLASH / BOOT SCREEN =====
     #splash is a 1x1 grid with place-items:center, and every background
     layer is absolutely positioned, so #splash-scene is the only thing
     that participates in layout — it stays dead centre no matter how the
     boot log, tip or wordmark change size. */
  #splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    grid-template: 1fr / 1fr;
    place-items: center;
    overflow: hidden;
    background:
      radial-gradient(ellipse 120% 85% at 50% 44%, #1b1d2b 0%, #101119 55%, #08080c 100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  #splash.fade-out { opacity: 0; transform: scale(1.02); pointer-events: none; }

  #splash > *:not(#splash-scene) {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  /* ---- background layer: scrolling buffer text ---- */
  #splash-rain {
    margin: 0;
    padding: 0 0 0 42px;
    font-family: var(--font);
    font-size: 11px;
    line-height: 17px;
    white-space: pre;
    color: #7aa2f7;
    opacity: 0.055;
    animation: rainScroll 38s linear infinite;
    user-select: none;
  }
  @keyframes rainScroll {
    from { transform: translateY(0); }
    to   { transform: translateY(-50%); }
  }

  /* ---- background layer: Vim's empty-line tilde column ---- */
  .splash-tildes {
    display: flex;
    flex-direction: column;
    padding-left: 14px;
    font-size: 11px;
    line-height: 17px;
    color: #7aa2f7;
    user-select: none;
  }
  .splash-tildes i {
    font-style: normal;
    opacity: 0;
    animation: tildeIn 0.5s ease forwards;
  }
  @keyframes tildeIn { to { opacity: 0.16; } }

  /* ---- background layer: accent bloom ---- */
  .splash-glow {
    inset: auto !important;
    left: 50% !important;
    top: 34% !important;
    width: 680px;
    height: 340px;
    transform: translate(-50%, -50%);
    background: radial-gradient(closest-side, rgba(122, 162, 247, 0.17), transparent 70%);
    filter: blur(16px);
    animation: glowPulse 4.6s ease-in-out infinite;
  }
  @keyframes glowPulse {
    0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 0.9;  transform: translate(-50%, -50%) scale(1.07); }
  }

  /* ---- background layer: CRT lines ---- */
  .splash-scanlines {
    opacity: 0.35;
    background: repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.022) 0px,
      rgba(255, 255, 255, 0.022) 1px,
      transparent 1px,
      transparent 3px
    );
    animation: scanDrift 7s linear infinite;
  }
  @keyframes scanDrift { from { background-position-y: 0; } to { background-position-y: 3px; } }

  /* ---- background layer: vignette ---- */
  .splash-vignette { box-shadow: inset 0 0 240px 70px rgba(0, 0, 0, 0.78); }

  /* ================= the scene ================= */
  #splash-scene {
    position: relative;
    z-index: 2;
    grid-area: 1 / 1;
    width: 560px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: sceneIn 0.6s cubic-bezier(0.2, 0.8, 0.25, 1) both;
  }
  @keyframes sceneIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
  }

  /* ---- the shared brand lockup, scaled up ---- */
  .splash-mark-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 20px;
  }
  .splash-logo {
    --gz-size: 46px;
    padding: 0 0.2em;
    border-radius: 0.2em;
    filter: drop-shadow(0 0 26px rgba(122, 162, 247, 0.30));
    animation: markIn 0.8s cubic-bezier(0.2, 0.8, 0.25, 1) both 0.08s;
  }
  @keyframes markIn {
    from { opacity: 0; transform: translateY(8px) scale(0.96); filter: blur(8px); }
    to   { opacity: 1; transform: none; filter: drop-shadow(0 0 26px rgba(122, 162, 247, 0.30)); }
  }

  .splash-tagline {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 22px;
  }
  .splash-tag-text {
    font-size: 9.5px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #565f89;
    white-space: nowrap;
  }
  .splash-rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(122, 162, 247, 0.42), rgba(122, 162, 247, 0.04));
  }
  .splash-ver {
    font-size: 10px;
    letter-spacing: 1.6px;
    color: #7aa2f7;
    border: 1px solid rgba(122, 162, 247, 0.32);
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
  }

  /* ---- boot terminal ---- */
  #splash-terminal {
    width: 100%;
    background: rgba(16, 17, 25, 0.94);
    border: 1px solid #2a2b3d;
    border-radius: 10px;
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(122, 162, 247, 0.05);
    overflow: hidden;
    font-size: 11.5px;
  }
  .splash-term-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid #232432;
  }
  .splash-term-head .dot { width: 9px; height: 9px; border-radius: 50%; display: block; }
  .dot-r { background: #f7768e; }
  .dot-y { background: #e0af68; }
  .dot-g { background: #9ece6a; }
  .splash-term-title {
    margin-left: 8px;
    font-size: 10px;
    letter-spacing: 1px;
    color: #565f89;
  }
  .splash-mode {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.4px;
    border-radius: 3px;
    padding: 2px 7px;
    background: #7aa2f7;
    color: #10111a;
    transition: background 0.2s ease;
  }
  .splash-mode[data-mode="INSERT"]  { background: #9ece6a; }
  .splash-mode[data-mode="VISUAL"]  { background: #bb9af7; }
  .splash-mode[data-mode="REPLACE"] { background: #f7768e; }

  /* Fixed height so streaming rows never resize the card. */
  #splash-boot {
    height: 116px;
    padding: 9px 12px 4px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    overflow: hidden;
  }
  .boot-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    line-height: 17px;
    color: #a9b1d6;
    animation: bootRowIn 0.24s ease both;
  }
  @keyframes bootRowIn {
    from { opacity: 0; transform: translateX(-7px); }
    to   { opacity: 1; transform: none; }
  }
  .boot-icon { color: #9ece6a; width: 10px; flex-shrink: 0; }
  .boot-fail .boot-icon { color: #f7768e; }
  .boot-name { color: #7aa2f7; min-width: 70px; flex-shrink: 0; }
  .boot-dots {
    flex: 0 0 22px;
    height: 1px;
    align-self: center;
    background: repeating-linear-gradient(90deg, #2f3350 0 2px, transparent 2px 5px);
  }
  .boot-detail {
    color: #565f89;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .boot-ms { color: #e0af68; flex-shrink: 0; font-variant-numeric: tabular-nums; }

  #splash-cmd {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 7px 12px 10px;
    border-top: 1px solid #232432;
    color: #c0caf5;
    line-height: 20px;
    min-height: 37px;
    white-space: pre;
  }
  .st-prompt { color: #7aa2f7; font-weight: 700; margin-right: 7px; }
  .st-cursor { color: #c0caf5; animation: blinkCursor 0.62s step-end infinite; }
  .st-cursor.st-cursor-run { animation: blinkCursor 0.28s step-end infinite; color: #9ece6a; }
  @keyframes blinkCursor { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

  /* Little keycap that pops for each simulated keypress. */
  .splash-keycap {
    margin-left: auto;
    min-width: 22px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    font-size: 10px;
    color: #c0caf5;
    border: 1px solid #363849;
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #1a1b26;
    opacity: 0;
    flex-shrink: 0;
  }
  .splash-keycap.pop { animation: keycapPop 0.34s ease-out; }
  @keyframes keycapPop {
    0%   { opacity: 0; transform: translateY(-3px) scale(0.86); border-color: #7aa2f7; }
    30%  { opacity: 1; transform: none; border-color: #7aa2f7; }
    100% { opacity: 0.25; transform: none; border-color: #363849; }
  }

  /* ---- progress ---- */
  .splash-bar-wrap {
    width: 100%;
    height: 2px;
    background: #232432;
    border-radius: 1px;
    overflow: hidden;
    margin-top: 18px;
  }
  .splash-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 1px;
    background: linear-gradient(90deg, #7aa2f7, #bb9af7, #ff9e64);
    transition: width 0.26s cubic-bezier(0.3, 0.9, 0.3, 1);
    box-shadow: 0 0 12px rgba(122, 162, 247, 0.6);
  }
  .splash-bar-fill.done { background: linear-gradient(90deg, #9ece6a, #7aa2f7); }

  .splash-meter {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    min-height: 16px;
    font-size: 10px;
    letter-spacing: 0.6px;
    color: #565f89;
  }
  #splash-stage {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #splash-stage b { color: #9ece6a; font-weight: 600; }
  #splash-pct { color: #7aa2f7; font-variant-numeric: tabular-nums; flex-shrink: 0; }

  /* Per-stage duration sparkline, drawn once boot finishes. */
  .splash-spark {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
    flex-shrink: 0;
  }
  .splash-spark i {
    width: 3px;
    background: #7aa2f7;
    opacity: 0.55;
    border-radius: 1px 1px 0 0;
    animation: sparkIn 0.3s ease both;
  }
  @keyframes sparkIn { from { transform: scaleY(0); } to { transform: scaleY(1); } }

  /* ---- tip + hint ---- */
  .splash-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 26px;
    min-height: 24px;
    font-size: 11px;
    color: #565f89;
    max-width: 100%;
  }
  .splash-tip kbd {
    font-family: var(--font);
    font-size: 11px;
    color: #ff9e64;
    background: rgba(255, 158, 100, 0.09);
    border: 1px solid rgba(255, 158, 100, 0.28);
    border-radius: 4px;
    padding: 2px 8px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .splash-tip span { min-width: 0; }

  .splash-hint {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 16px;
    min-height: 18px;
    font-size: 9px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #3b4261;
    opacity: 0;
    transition: opacity 0.35s ease;
  }
  .splash-hint kbd {
    font-family: var(--font);
    letter-spacing: 1px;
    color: #565f89;
    border: 1px solid #2a2b3d;
    border-bottom-width: 2px;
    border-radius: 3px;
    padding: 1px 6px;
    text-transform: none;
  }
  .splash-hint.show { opacity: 1; animation: hintPulse 2s ease-in-out infinite; }
  @keyframes hintPulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

  /* ---- Vim status line, pinned to the bottom ---- */
  .splash-statusline {
    inset: auto 0 0 0 !important;
    display: flex;
    align-items: center;
    height: 24px;
    font-size: 10px;
    color: #565f89;
    background: #14151d;
    border-top: 1px solid #232432;
    --ssl: #7aa2f7;
  }
  .splash-statusline[data-mode="INSERT"]  { --ssl: #9ece6a; }
  .splash-statusline[data-mode="VISUAL"]  { --ssl: #bb9af7; }
  .splash-statusline[data-mode="REPLACE"] { --ssl: #f7768e; }

  .ssl-mode {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-weight: 700;
    letter-spacing: 1.4px;
    background: var(--ssl);
    color: #10111a;
    transition: background 0.2s ease;
  }
  .ssl-arrow {
    width: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 10px solid var(--ssl);
    transition: border-color 0.2s ease;
  }
  .ssl-arrow-r {
    width: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 10px solid var(--ssl);
    transition: border-color 0.2s ease;
  }
  .ssl-file { padding: 0 12px; color: #a9b1d6; }
  .ssl-seg { padding: 0 10px; border-left: 1px solid #232432; }
  .ssl-branch { color: #9ece6a; }
  .ssl-spacer { flex: 1; }
  .ssl-pos {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--ssl);
    color: #10111a;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: background 0.2s ease;
  }

  /* ---- motion / size ---- */
  @media (prefers-reduced-motion: reduce) {
    #splash-rain, .splash-tildes i, .splash-scanlines, .splash-glow,
    .splash-hint.show, .st-cursor, .splash-keycap.pop { animation: none; }
    .splash-tildes i { opacity: 0.16; }
    #splash-scene, .splash-logo, .boot-row, .splash-spark i { animation-duration: 0.01ms; }
  }

  @media (max-width: 900px) {
    .splash-logo { --gz-size: 38px; }
  }
  @media (max-width: 768px) {
    #splash-scene { width: 94vw; }
    .splash-logo { --gz-size: 30px; }
    .splash-tag-text { font-size: 8px; letter-spacing: 2px; white-space: normal; }
    #splash-terminal { font-size: 10px; }
    .boot-name { min-width: 56px; }
    .boot-dots { display: none; }
    #splash-boot { height: 100px; }
    #splash-rain, .splash-tildes { display: none; }
    .ssl-branch, .ssl-seg:nth-of-type(n+2) { display: none; }
  }
  @media (max-width: 480px) {
    .splash-logo { --gz-size: 23px; }
    .boot-detail { display: none; }
    .splash-spark { display: none; }
  }
