:root {
    --bg: #0a0a0a;
    --bg-secondary: #141414;
    --text: #e5e5e5;
    --text-dim: #a3a3a3;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --green: #22c55e;
    --border: #262626;
    --code-bg: #222222;
    --red: #ef4444;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
    animation: turnOn 1.2s ease-out;
}

/* CRT scanlines */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 2;
    animation: scanlines 8s linear infinite;
}

/* Phosphor glow + vignette */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 50% 50%, transparent 0%, rgba(0, 0, 0, 0.4) 100%),
        radial-gradient(ellipse at 50% 0%, rgba(34, 197, 94, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
    animation: flicker 0.15s infinite;
}

@keyframes scanlines {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100px;
    }
}

@keyframes flicker {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.98;
    }
}

/* CRT turn-on animation */
@keyframes turnOn {
    0% {
        transform: scaleY(0.01) scaleX(0);
        filter: brightness(30);
    }

    20% {
        transform: scaleY(0.01) scaleX(1);
        filter: brightness(30);
    }

    40% {
        transform: scaleY(1) scaleX(1);
        filter: brightness(1.5);
    }

    100% {
        transform: scaleY(1) scaleX(1);
        filter: brightness(1);
    }
}

/* Occasional glitch effect */
@keyframes glitch {
    0%,
    94%,
    100% {
        transform: translateX(0);
        filter: none;
    }

    95% {
        transform: translateX(-3px);
        filter: hue-rotate(90deg);
    }

    96% {
        transform: translateX(3px);
        filter: hue-rotate(-90deg);
    }

    97% {
        transform: translateX(-2px);
        filter: none;
    }

    98% {
        transform: translateX(2px);
        filter: hue-rotate(45deg);
    }

    99% {
        transform: translateX(0);
        filter: none;
    }
}

/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rgbShift {
    0%,
    100% {
        filter: drop-shadow(3px 6px 0 rgba(23, 178, 159, 0.3)) drop-shadow(-1px 0 0 rgba(255, 0, 0, 0.15))
            drop-shadow(1px 0 0 rgba(0, 255, 255, 0.15));
    }

    50% {
        filter: drop-shadow(3px 6px 0 rgba(23, 178, 159, 0.3)) drop-shadow(1px 0 0 rgba(255, 0, 0, 0.15))
            drop-shadow(-1px 0 0 rgba(0, 255, 255, 0.15));
    }
}

.container {
    max-width: 750px;
    width: 100%;
    position: relative;
    z-index: 1;
    animation: glitch 20s infinite;
}

.hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.banner-container {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 550px;
    margin-bottom: 1rem;
}

.banner {
    width: 100%;
    height: auto;
    filter: drop-shadow(3px 6px 0 rgba(23, 178, 159, 0.3));
    animation: rgbShift 4s ease-in-out infinite alternate;
}

.version-badge {
    position: absolute;
    bottom: -8px;
    right: -10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}

.version-badge:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.description {
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 680px;
    margin: 0 auto;
}

.description strong {
    color: var(--text);
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.section-title:first-of-type {
    margin-top: 0;
}

.install-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.tab-bar {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.tabs {
    display: flex;
    flex: 1;
}

.tab {
    padding: 0.875rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.tab.active {
    color: var(--text);
    background: var(--code-bg);
    border-bottom-color: var(--accent);
}

.view-script-tab {
    padding: 0.875rem 1rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.view-script-tab:hover {
    color: var(--green);
}

.code-container {
    display: none;
    padding: 1rem;
    background: var(--code-bg);
}

.code-container.active {
    display: block;
}

.code-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.prompt {
    color: var(--green);
    user-select: none;
    text-shadow:
        0 0 10px rgba(34, 197, 94, 0.8),
        0 0 20px rgba(34, 197, 94, 0.4);
}

code {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.875rem;
    color: var(--text);
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
    text-shadow:
        0 0 8px rgba(34, 197, 94, 0.4),
        0 0 2px rgba(34, 197, 94, 0.6);
}

.copy-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    color: var(--text);
}

.copy-btn.copied {
    color: var(--green);
}

.copy-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-dim);
    font-size: 0.875rem;
    line-height: 1.5;
}

.notice-warn {
    margin-top: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-dim);
    font-size: 0.875rem;
    line-height: 1.5;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    padding: 0.875rem 1.25rem;
}

.notice-warn .notice-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red);
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 0.1rem;
}

.notice-warn a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(239, 68, 68, 0.4);
    transition: all 0.2s;
}

.notice-warn a:hover {
    color: var(--red);
    border-bottom-color: var(--red);
}

.notice-warn code {
    background: var(--code-bg);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    color: var(--text);
    font-size: 0.85em;
}

.feature-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    background: rgba(34, 197, 94, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    font-size: 0.7rem;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.feature a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed var(--border);
    transition: all 0.2s;
}

.feature a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.usage-note {
    margin-top: 2.5rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.5rem;
}

.usage-note code {
    background: var(--code-bg);
    padding: 0.25rem 0.35rem;
    border-radius: 4px;
    color: var(--accent);
    font-weight: 500;
    font-size: 1rem;
    text-shadow:
        0 0 8px rgba(59, 130, 246, 0.6),
        0 0 2px rgba(59, 130, 246, 0.8);
}

.links {
    margin-top: 2.5rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}

.links a {
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.links a svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.links a:hover svg {
    color: var(--green);
    filter: drop-shadow(0 0 6px var(--green));
}

/* Focus states for accessibility */
.tab:focus-visible,
.copy-btn:focus-visible,
.links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .banner {
        max-width: 100%;
    }

    code {
        font-size: 0.75rem;
    }

    .copy-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
}
