:root {
    --bg: #0f1c17;
    --panel: #162821;
    --ink: #eef6f1;
    --muted: #9bb5a8;
    --accent: #3ecf8e;
    --accent-ink: #062416;
    --line: rgba(238, 246, 241, 0.12);
    --danger: #ff8f8f;
    --font-display: "Segoe UI", "Trebuchet MS", sans-serif;
    --font-body: "Segoe UI", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background: #010604;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 55% at 50% 0%, rgba(62, 207, 142, 0.06), transparent 55%),
        radial-gradient(ellipse 70% 50% at 50% 100%, rgba(0, 0, 0, 0.25), transparent 50%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0.03;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 2px,
        rgba(0, 0, 0, 0.55) 3px
    );
}

/* Permanent full-page background — binary Matrix rain */
#matrix-rain {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
    display: block;
}

.shell {
    position: relative;
    z-index: 2;
    width: min(760px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 3.5rem 0 4rem;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    letter-spacing: -0.03em;
    margin: 0.25rem 0 0.75rem;
    color: #f2fff8;
    text-shadow:
        0 0 18px rgba(62, 207, 142, 0.45),
        0 0 42px rgba(62, 207, 142, 0.2),
        0 2px 16px rgba(0, 0, 0, 0.7);
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    color: var(--accent);
    text-shadow: 0 0 12px rgba(62, 207, 142, 0.55);
    animation: pulse-glow 3.2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.75; text-shadow: 0 0 8px rgba(62, 207, 142, 0.35); }
    50% { opacity: 1; text-shadow: 0 0 16px rgba(62, 207, 142, 0.7); }
}

.lede {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    max-width: 42rem;
}

.lede code,
.hints code,
.message code {
    font-family: Consolas, "Courier New", monospace;
    color: #c8ffe0;
    text-shadow: 0 0 8px rgba(62, 207, 142, 0.25);
}

.hero {
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}

.panel {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid rgba(62, 207, 142, 0.22);
    border-radius: 18px;
    background: rgba(6, 16, 12, 0.82);
    backdrop-filter: blur(14px) saturate(1.15);
    box-shadow:
        0 0 0 1px rgba(62, 207, 142, 0.06) inset,
        0 0 40px rgba(62, 207, 142, 0.08),
        0 24px 48px rgba(0, 0, 0, 0.45);
}

.drop {
    display: grid;
    gap: 0.35rem;
    place-items: center;
    padding: 2rem 1rem;
    border: 1.5px dashed rgba(62, 207, 142, 0.45);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    background: rgba(8, 20, 15, 0.35);
}

.drop:hover,
.drop.is-drag {
    border-color: var(--accent);
    background: rgba(62, 207, 142, 0.1);
    box-shadow: 0 0 28px rgba(62, 207, 142, 0.15);
}

.drop input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.drop-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.drop-sub {
    color: var(--muted);
    font-size: 0.92rem;
}

.pipeline {
    margin: 1.35rem 0 1rem;
    padding: 1rem 1.05rem 1.05rem;
    border-radius: 14px;
    border: 1px solid rgba(62, 207, 142, 0.2);
    background: rgba(0, 0, 0, 0.28);
}

.pipeline-label {
    margin: 0 0 0.85rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(62, 207, 142, 0.35);
}

.pipeline-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.pipeline-steps > li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(62, 207, 142, 0.12);
    background: rgba(8, 24, 16, 0.55);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.pipeline-steps > li:hover {
    border-color: rgba(62, 207, 142, 0.35);
    background: rgba(62, 207, 142, 0.08);
}

.step-num {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--accent-ink);
    background: var(--accent);
    border-radius: 6px;
    padding: 0.15rem 0.4rem;
    box-shadow: 0 0 12px rgba(62, 207, 142, 0.35);
}

.step-body {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.step-body code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.88rem;
    color: #c8ffe0;
    word-break: break-all;
    text-shadow: 0 0 8px rgba(62, 207, 142, 0.25);
}

.step-note {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.4;
}

.hints {
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
    color: var(--muted);
    line-height: 1.55;
    display: grid;
    gap: 0.45rem;
}

.hints li {
    position: relative;
    padding: 0.55rem 0.75rem 0.55rem 1.85rem;
    border-radius: 10px;
    border: 1px solid rgba(238, 246, 241, 0.08);
    background: rgba(0, 0, 0, 0.18);
    font-size: 0.92rem;
}

.hints li::before {
    content: "›";
    position: absolute;
    left: 0.75rem;
    top: 0.5rem;
    color: var(--accent);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(62, 207, 142, 0.5);
}

.hints strong {
    color: #e8fff2;
    font-weight: 650;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 0.85rem 1.4rem;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    background: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 20px rgba(62, 207, 142, 0.35);
}

.btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 0 32px rgba(62, 207, 142, 0.55);
}
.btn:disabled { opacity: 0.55; cursor: wait; transform: none; box-shadow: none; }

.btn-secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.result {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.result h2 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.message { margin: 0 0 1rem; color: var(--muted); }
.message.is-error { color: var(--danger); }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stat {
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
    background: rgba(8, 20, 15, 0.45);
    border: 1px solid var(--line);
}

.stat .label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
}

.stat .value {
    font-size: 1.25rem;
    font-weight: 700;
}

#warnings {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    color: #ffd7a8;
    white-space: pre-wrap;
    max-height: 220px;
    overflow: auto;
    font-size: 0.85rem;
}
