/* --- DESIGN TOKENS --- */
:root {
    --bg: #0e0e12;
    --bg-card: #18181f;
    --text: #e8e6e3;
    --text-dim: #9997a7;
    --accent: #5cff5c;
    --accent-glow: rgba(92, 255, 92, 0.15);
    --accent-dark: #1a8a1a;
    --border: #33333d;
    --border-light: #4a4a58;
    --code-bg: #13131a;
    --tier1: #5cff5c;
    --tier2: #6ba3ff;
    --tier3: #d4a0ff;

    /* Minecraft panel bevel */
    --bevel: inset 2px 2px 0 rgba(255,255,255,0.13), inset -2px -2px 0 rgba(0,0,0,0.45);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

#pc-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

#pc-particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* Content above both canvases */
.hc-flag, nav, section, footer {
    position: relative;
    z-index: 2;
}


/* --- NAV --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 0.6rem 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: rgba(14, 14, 18, 0.92);
    border-bottom: 2px solid var(--border);
    box-shadow: var(--bevel);
}
.nav-slots {
    list-style: none;
    display: flex;
    gap: 0.5rem;
}
.nav-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    background: #1a1a22;
    color: var(--text-dim);
    text-decoration: none;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    line-height: 1;
    white-space: nowrap;
    border: 2px solid #3a3a44;
    border-top-color: #55555f;
    border-left-color: #55555f;
    border-right-color: #0e0e14;
    border-bottom-color: #0e0e14;
    transition: color 0.15s, transform 0.15s, border-color 0.15s;
}
.nav-slot:hover {
    color: var(--accent);
    transform: translateY(-2px);
    border-top-color: #5cff5c;
    border-left-color: #5cff5c;
    border-right-color: #1a8a1a;
    border-bottom-color: #1a8a1a;
    box-shadow: 0 0 10px rgba(92, 255, 92, 0.15);
}

/* Mobile hamburger */
.nav-hamburger {
    display: none;
    background: none;
    border: 2px solid var(--border);
    padding: 0.3rem;
    cursor: pointer;
    box-shadow: var(--bevel);
    transition: border-color 0.15s;
}
.nav-hamburger:hover {
    border-color: var(--accent);
}
.nav-hamburger img {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
}

/* Hack Club flag */
.hc-flag {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
}
.hc-flag img {
    width: 88px;
    height: auto;
}

/* --- HERO --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 6rem 2rem 4rem;
    position: relative;
}
.hero-logo {
    width: min(560px, 88vw);
    height: auto;
    border-radius: 4px;
    margin-bottom: 0.1rem;
}
.hero h1 {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    line-height: 2;
    margin-bottom: 1.5rem;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.6);
}
.hero h1 .green {
    color: var(--accent);
    text-shadow: 3px 3px 0 var(--accent-dark);
}
.hero p {
    max-width: 560px;
    font-size: 1.05rem;
    color: var(--text-dim);
    line-height: 1.8;
    margin-bottom: 2.5rem;
}
.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
    border: 2px solid transparent;
    line-height: 1;
}
.btn-primary {
    background: var(--accent);
    color: #0a1a0a;
    border-color: rgba(255,255,255,0.2);
    box-shadow: inset 2px 2px 0 rgba(255,255,255,0.3), inset -2px -4px 0 rgba(0,0,0,0.3);
}
.btn-primary:hover {
    background: #7fff7f;
    transform: translateY(-2px);
    box-shadow: inset 2px 2px 0 rgba(255,255,255,0.4), inset -2px -4px 0 rgba(0,0,0,0.3), 0 6px 20px rgba(92,255,92,0.25);
}
.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border-light);
    box-shadow: var(--bevel);
}
.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* --- SECTIONS --- */
section {
    max-width: 900px;
    margin: 0 auto;
    padding: 5rem 2rem;
}
.section-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0 var(--accent-dark);
}
section h2 {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.85rem, 2vw, 1.2rem);
    line-height: 2;
    margin-bottom: 1.25rem;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}
section > p {
    color: var(--text-dim);
    font-size: 1rem;
    max-width: 640px;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

/* --- HOW IT WORKS (steps) --- */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.step {
    background: var(--bg-card);
    border: 2px solid var(--border);
    padding: 1.5rem;
    position: relative;
    transition: border-color 0.15s, transform 0.15s;
    box-shadow: var(--bevel);
}
.step:hover { border-color: var(--accent); transform: translateY(-3px); }
.step-num {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.6rem;
    color: var(--accent);
    opacity: 0.75;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 0 var(--accent-dark);
}
.step h3 {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    line-height: 1.9;
    margin-bottom: 0.75rem;
}
.step p {
    color: var(--text-dim);
    font-size: 0.875rem;
    line-height: 1.7;
}

/* --- STEP 04 PI ICON (enchanted float) --- */
.step-pi {
    overflow: hidden;
}
.step-pi-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 80px;
    height: auto;
    opacity: 0.38;
    filter: drop-shadow(0 0 6px rgba(92, 255, 92, 0.4));
    animation: enchant-float 3s ease-in-out infinite, enchant-glow 2s ease-in-out infinite;
    transition: transform 0.4s ease, opacity 0.3s;
}
.step-pi:hover .step-pi-icon {
    opacity: 0.45;
    transform: translate(-4px, -3px) rotate(-6deg) scale(1.08);
    filter: drop-shadow(0 0 10px rgba(92, 255, 92, 0.6))
           drop-shadow(0 0 20px rgba(92, 255, 92, 0.25));
}

@keyframes enchant-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}
@keyframes enchant-glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(92, 255, 92, 0.3)); }
    50%      { filter: drop-shadow(0 0 10px rgba(92, 255, 92, 0.6))
                       drop-shadow(0 0 20px rgba(92, 255, 92, 0.2)); }
}

/* --- TIERS --- */
.tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.tier {
    background: var(--bg-card);
    border: 2px solid var(--border);
    padding: 2rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
    box-shadow: var(--bevel);
}
.tier:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}
.tier::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}
.tier:nth-child(1)::before { background: var(--tier1); }
.tier:nth-child(2)::before { background: var(--tier2); }
.tier:nth-child(3)::before { background: var(--tier3); }

.tier-name {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
    line-height: 1.8;
}
.tier:nth-child(1) .tier-name { color: var(--tier1); }
.tier:nth-child(2) .tier-name { color: var(--tier2); }
.tier:nth-child(3) .tier-name { color: var(--tier3); }

.tier h3 {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.68rem;
    line-height: 2;
    margin-bottom: 0.5rem;
}
.tier .hours {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
}
.tier .reward {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: rgba(92,255,92,0.08);
    border: 2px solid rgba(92,255,92,0.2);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    line-height: 1.8;
    color: var(--accent);
    margin-bottom: 1.5rem;
    box-shadow: var(--bevel);
}
.tier ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.tier li {
    font-size: 0.875rem;
    color: var(--text-dim);
    padding-left: 1.2rem;
    position: relative;
    line-height: 1.6;
}
.tier li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 0.6rem;
    top: 0.2em;
}

/* --- GUIDE --- */
.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}
.guide-step {
    background: var(--bg-card);
    border: 2px solid var(--border);
    padding: 2rem;
    box-shadow: var(--bevel);
}
.guide-step h3 {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65rem;
    line-height: 2;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.guide-step h3 .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: var(--bg);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    flex-shrink: 0;
    box-shadow: inset -2px -2px 0 rgba(0,0,0,0.35), inset 1px 1px 0 rgba(255,255,255,0.3);
}
.guide-step p, .guide-step li {
    color: var(--text-dim);
    font-size: 0.925rem;
    line-height: 1.8;
}
.guide-step ul {
    margin-top: 0.75rem;
    padding-left: 1.5rem;
}
.guide-step li { margin-bottom: 0.5rem; }
.guide-step a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(92,255,92,0.3);
    text-underline-offset: 3px;
}
.guide-step a:hover { text-decoration-color: var(--accent); }

/* --- GUIDE IMAGES --- */
.guide-img {
    display: block;
    max-width: 100%;
    margin: 1.25rem 0;
    border: 2px solid var(--border);
    box-shadow: var(--bevel), 0 4px 16px rgba(0, 0, 0, 0.4);
    image-rendering: auto;
    background-image: none !important;
}

code, .code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--code-bg);
    padding: 0.15rem 0.45rem;
    font-size: 0.85em;
    color: var(--accent);
    border: 1px solid var(--border);
}
pre {
    background: var(--code-bg);
    border: 2px solid var(--border);
    padding: 1.25rem;
    overflow-x: auto;
    margin-top: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--text-dim);
    box-shadow: var(--bevel);
}
pre .comment { color: #555568; }
pre .keyword { color: #d4a0ff; }
pre .string { color: #5cff5c; }
pre .annotation { color: #6ba3ff; }
pre .key { color: #6ba3ff; }
pre .line:has(.hl) { background: rgba(92, 255, 92, 0.06); border-left: 2px solid var(--accent); }

/* --- IDE CODE BLOCK --- */
.ide-block {
    margin-top: 1rem;
    border: 2px solid var(--border);
    box-shadow: var(--bevel);
    overflow: hidden;
}
.ide-header {
    background: #0a0a10;
    border-bottom: 1px solid var(--border);
    padding: 0.45rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    position: relative;
}

/* --- TNT COPY BUTTON --- */
.ide-copy {
    margin-left: auto;
    background: none;
    border: 2px solid var(--border);
    padding: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: var(--bevel);
    transition: border-color 0.15s, transform 0.15s;
    position: relative;
}
.ide-copy:hover {
    border-color: #ff4444;
    transform: scale(1.1);
}
.ide-copy:active {
    transform: scale(0.9);
}
.ide-copy img {
    width: 20px;
    height: 20px;
    image-rendering: pixelated;
}
.ide-copy-label {
    margin-right: 0.25rem;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.45rem;
    color: var(--text-dim);
    transition: color 0.2s;
}
.ide-copy:hover .ide-copy-label {
    color: #ff4444;
}
.ide-copy-label.copied {
    color: #ff4444;
}
.ide-block.copied .ide-header {
    background: rgba(255, 68, 68, 0.08);
}
.ide-block.copied .ide-copy {
    border-color: #ff4444;
}

/* Explosion particles */
.tnt-particle {
    position: fixed;
    image-rendering: pixelated;
    pointer-events: none;
    z-index: 9999;
}
.ide-lang {
    font-size: 0.6rem;
    color: #6ba3ff;
    background: rgba(107,163,255,0.1);
    border: 1px solid rgba(107,163,255,0.25);
    padding: 0.1rem 0.4rem;
    letter-spacing: 0.05em;
}
.ide-filename {
    font-size: 0.72rem;
    color: var(--text);
    opacity: 0.85;
}
.ide-block pre {
    margin: 0;
    border: none;
    box-shadow: none;
    background-image: none;
    padding: 0.6rem 0;
    counter-reset: line-num;
}
.ide-block pre .line {
    display: block;
    counter-increment: line-num;
    padding-left: 4rem;
    padding-right: 1.5rem;
    position: relative;
    min-height: 1.7em;
}
.ide-block pre .line:hover {
    background: rgba(255,255,255,0.03);
}
.ide-block pre .line::before {
    content: counter(line-num);
    position: absolute;
    left: 0;
    width: 3rem;
    text-align: right;
    padding-right: 0.75rem;
    color: #33334a;
    user-select: none;
    pointer-events: none;
    border-right: 1px solid #1e1e2e;
}

/* --- SHIPPED --- */
.shipped-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}
.shipped-item {
    background: var(--bg-card);
    border: 2px solid var(--border);
    padding: 1.5rem;
    box-shadow: var(--bevel);
    transition: border-color 0.15s, transform 0.15s;
}
.shipped-item:hover { border-color: var(--accent); transform: translateY(-3px); }
.shipped-item h3 {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    line-height: 2;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.shipped-icon {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
    flex-shrink: 0;
}
.shipped-item p {
    color: var(--text-dim);
    font-size: 0.875rem;
    line-height: 1.7;
}

/* --- TERMINAL --- */
.terminal {
    margin-top: 1rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
}
.terminal-bar {
    background: #2a2a35;
    padding: 0.5rem 0.75rem;
    display: flex;
    gap: 6px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}
.t-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}
.t-red    { background: #ff5f57; }
.t-yellow { background: #febc2e; }
.t-green  { background: #28c840; }
.terminal-body {
    background: #0a0a0f;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.terminal-body p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-dim);
    font-size: 0.82rem;
}
.t-prompt {
    color: var(--accent);
    margin-right: 0.5rem;
    user-select: none;
}
.t-out {
    color: #6b7a8d;
    padding-left: 1rem;
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 2px solid var(--border);
    color: var(--text-dim);
    font-size: 0.85rem;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* --- RESPONSIVE --- */
@media (max-width: 640px) {
    .nav-slots { display: none; }
    .nav-slots.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(14, 14, 18, 0.96);
        border-bottom: 2px solid var(--border);
        padding: 0.75rem;
        gap: 0.4rem;
    }
    .nav-hamburger { display: block; margin-left: auto; }
    .hero h1 { font-size: 0.9rem; }
    section { padding: 3rem 1.25rem; }
    .tiers { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr 1fr; }
}
