[data-bs-theme="dark"] {
    --bs-body-bg: #1a1d20;
    --bs-body-color: #e1e4e8;
    --bs-border-color: #3a3f44;
    --accent-color: #3b82f6;

    --hero-color: #3b82f6;
    --hero-bright: #93c5fd;
    --hero-glow-strong: rgba(59, 130, 246, 0.7);
    --hero-glow-soft: rgba(59, 130, 246, 0.3);
    --layer-a: #60a5fa;
    --layer-b: #1d4ed8;

    --matrix-head: rgba(96, 165, 250, 0.95);
    --matrix-tail: rgba(37, 99, 235, 0.85);
    --matrix-glow: rgba(59, 130, 246, 0.9);
    --matrix-trail-alpha: 0.06;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overscroll-behavior: none;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

#matrix {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 0;
    display: block;
    background-color: var(--bs-body-bg);
}

.crt {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0) 0px,
            rgba(0, 0, 0, 0) 2px,
            rgba(0, 0, 0, 0.18) 3px,
            rgba(0, 0, 0, 0) 4px
        ),
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%);
    mix-blend-mode: multiply;
}

.stage {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 3vh, 36px);
    container-type: inline-size;
}

.ascii-wrap {
    position: relative;
    line-height: 1;
    text-align: center;
    max-width: min(95vw, 1400px);
    filter: drop-shadow(0 0 6px var(--hero-glow-strong)) drop-shadow(0 0 18px var(--hero-glow-soft));
}

pre.ascii {
    margin: 0;
    color: var(--hero-color);
    font-family: "Fira Code", "JetBrains Mono", "Consolas", "Menlo", monospace;
    font-weight: 700;
    font-size: clamp(5px, 1.35cqw, 28px);
    letter-spacing: 0;
    white-space: pre;
    text-shadow:
        0 0 2px var(--hero-color),
        0 0 10px var(--hero-glow-strong),
        0 0 28px var(--hero-glow-soft);
    animation: flicker 3.6s infinite steps(1, end);
}

pre.ascii.layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.85;
    text-shadow: none;
    filter: none;
    animation: none;
}

pre.ascii.layer.a { color: var(--layer-a); transform: translate(0, 0); }
pre.ascii.layer.b { color: var(--layer-b); transform: translate(0, 0); }

@keyframes flicker {
    0%, 92%, 100% { opacity: 1; }
    93%           { opacity: 0.55; }
    94%           { opacity: 1; }
    96%           { opacity: 0.7; }
    97%           { opacity: 1; }
}

.slice {
    position: absolute;
    left: 0;
    right: 0;
    overflow: hidden;
    pointer-events: none;
}

.slice pre {
    margin: 0;
    color: var(--hero-color);
    font-family: inherit;
    font-weight: 700;
    font-size: clamp(5px, 1.35cqw, 28px);
    line-height: 1;
    white-space: pre;
    text-shadow: 0 0 6px var(--hero-glow-strong);
}

.link-line {
    position: relative;
    z-index: 1;
    font-family: "Fira Code", "JetBrains Mono", "Consolas", "Menlo", monospace;
    font-size: clamp(10px, 2.6cqi, 22px);
    letter-spacing: 0.04em;
    color: var(--hero-color);
    text-shadow: 0 0 6px var(--hero-glow-strong), 0 0 14px var(--hero-glow-soft);
    text-decoration: none;
    user-select: text;
    cursor: pointer;
    padding: 8px 12px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: text-shadow 120ms ease, color 120ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .link-line:hover {
        color: var(--hero-bright);
        text-shadow: 0 0 8px var(--hero-glow-strong), 0 0 22px var(--hero-glow-strong);
    }
}

.link-line:active {
    color: var(--hero-bright);
    text-shadow: 0 0 8px var(--hero-glow-strong), 0 0 22px var(--hero-glow-strong);
}

.caret {
    display: inline-block;
    width: 0.6ch;
    margin-left: 2px;
    background: var(--hero-color);
    color: transparent;
    animation: caret 1s steps(1, end) infinite;
    box-shadow: 0 0 8px var(--hero-glow-strong);
}

@keyframes caret {
    50% { background: transparent; box-shadow: none; }
}

@media (max-width: 767.98px) {
    main {
        padding: 1rem;
    }
}

@media (max-height: 480px) {
    .stage { gap: 10px; }
    main { padding: 0.5rem; }
    .link-line { font-size: clamp(11px, 2.2cqi, 18px); padding: 6px 10px; min-height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    pre.ascii { animation: none; }
    .caret { animation: none; background: var(--hero-color); }
}
