:root {
    --bg: #000000;
    --text: #ffffff;
    --muted: #d7c9ff;
    --pink: #ff4fd8;
    --yellow: #ffe65f;
    --green: #46ffd6;
    --blue: #5b6cff;
    --orange: #ff9b3d;
}

* {
    box-sizing: border-box;
}

html {
    background-color: #12001f;
    overflow-y: auto;
}

html,
body {
    margin: 0;
    color: var(--text);
    font: 15px/1.5 "Comic Sans MS", "Trebuchet MS", cursive, sans-serif;
    overflow-x: hidden;
}

body {
    position: relative;
    isolation: isolate;
    background-color: #12001f;
}

/* Tile scroll via background-position (loops on 304×234); don't translate the layer */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: #12001f;
    background-image: url("assets/retro/bg.png");
    background-repeat: repeat;
    background-size: 304px 234px;
    background-position: 0 0;
    will-change: background-position;
    animation: bg-pan-diagonal 300s linear infinite;
}

@keyframes bg-pan-diagonal {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 304px 234px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body::after {
        animation: none;
        inset: 0;
    }
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.35);
}

img {
    display: block;
    max-width: 100%;
}

.page,
.footer {
    position: relative;
    z-index: 2;
}

.page {
    width: min(1120px, calc(100% - 24px));
    margin: 0 auto;
    padding: 8px 0 28px;
}

.hero {
    display: block;
    padding: 0 0 8px;
}

.hero-art {
    display: grid;
    justify-items: center;
    gap: 10px;
    width: fit-content;
    margin-left: 34px;
    transform: rotate(-3deg);
}

.logo {
    width: min(100%, 360px);
    transform-origin: center center;
    filter: saturate(1.2) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.6));
    animation: rat-rock 5s ease-in-out infinite;
}

.logo:focus-visible {
    outline: 2px solid var(--yellow);
    outline-offset: 4px;
}

.wordmark {
    width: min(100%, 430px);
    margin-left: 22px;
    transform-origin: center center;
    animation: wordmark-rock 6.5s ease-in-out infinite;
}

.hero-copy {
    margin: -8px 0 0 68px;
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--yellow);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 0.78rem;
    transform: rotate(-2deg);
}

.hero-copy h1 {
    margin: 0 0 2px;
    font-size: clamp(2.4rem, 6vw, 5rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
    display: inline-block;
    background: linear-gradient(90deg, var(--pink), var(--yellow), var(--green), var(--blue), var(--orange));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 3px 3px 0 #000;
}

.lede {
    margin: 6px 0 0;
    display: inline-block;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: rotate(-1.2deg);
}

.interest-link {
    display: inline-block;
    margin: 12px 0 0 4px;
    padding: 8px 14px;
    color: var(--yellow);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: 2px solid currentColor;
    border-radius: 18px 12px 16px 10px;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
    transform: rotate(-1.5deg);
    background: rgba(255, 255, 255, 0.04);
}

.interest-link:hover {
    color: var(--pink);
    background: rgba(255, 255, 255, 0.08);
}

.apply-page {
    max-width: 520px;
    margin: 0 auto;
    padding: 48px 20px 80px;
}

.apply-header h1 {
    margin: 12px 0 0;
    font-size: 1.6rem;
    color: var(--yellow);
    transform: rotate(-1deg);
}

.apply-lede {
    margin: 8px 0 0;
    color: var(--muted);
}

.apply-back {
    color: var(--green);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.apply-back:hover {
    color: var(--pink);
}

.apply-flash {
    margin: 20px 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 2px solid currentColor;
}

.apply-flash--ok {
    color: var(--green);
}

.apply-flash--error {
    color: #ff6b6b;
}

.apply-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.apply-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.apply-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--pink);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.apply-field input,
.apply-field textarea {
    padding: 10px 12px;
    border: 2px solid var(--blue);
    border-radius: 14px 10px 12px 8px;
    background: rgba(0, 0, 0, 0.45);
    color: var(--text);
    font: inherit;
    text-transform: none;
    letter-spacing: normal;
}

.apply-field input:focus,
.apply-field textarea:focus {
    outline: 2px solid var(--yellow);
    outline-offset: 2px;
}

.apply-submit {
    align-self: flex-start;
    margin-top: 8px;
    padding: 10px 18px;
    border: 2px solid var(--yellow);
    border-radius: 18px 12px 16px 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--yellow);
    font: inherit;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
    transform: rotate(-1deg);
}

.apply-submit:hover:not(:disabled) {
    color: var(--pink);
    border-color: var(--pink);
}

.apply-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.apply-cap {
    display: block;
    width: 100%;
    margin-top: 4px;
    min-height: 52px;
}

.apply-cap cap-widget {
    display: block;
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    --cap-widget-width: 100%;
    --cap-widget-height: 30px;
    --cap-widget-padding: 14px;
    --cap-gap: 12px;
    --cap-border-radius: 12px;
    --cap-background: rgba(0, 0, 0, 0.45);
    --cap-border-color: var(--blue);
    --cap-color: var(--text);
    --cap-checkbox-size: 25px;
    --cap-checkbox-background: rgba(255, 255, 255, 0.06);
    --cap-checkbox-border: 1px solid var(--blue);
    --cap-checkbox-border-radius: 6px;
    --cap-spinner-color: var(--yellow);
    --cap-spinner-background-color: rgba(255, 255, 255, 0.12);
    --cap-font: inherit;
    font-family: inherit;
}

.facts {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 14px 0 0;
}

.facts li {
    padding: 7px 10px;
    border: 2px solid currentColor;
    background: transparent;
    color: var(--text);
    border-radius: 18px 12px 16px 10px;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

.facts li:nth-child(1) { color: var(--pink); }
.facts li:nth-child(2) { color: var(--yellow); }
.facts li:nth-child(3) { color: var(--green); }
.facts li:nth-child(4) { color: var(--blue); }

.catalog {
    margin-top: 10px;
}

.category {
    margin-top: 8px;
    padding-top: 0;
}

.category summary {
    list-style: none;
}

.category summary::-webkit-details-marker {
    display: none;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
}

.category[open] .category-header::after {
    content: 'collapse';
    color: var(--yellow);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.category:not([open]) .category-header::after {
    content: 'expand';
    color: var(--yellow);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.category-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--pink);
    text-shadow: 2px 2px 0 #000, 1px 1px 0 var(--blue);
}

.category-header span {
    color: var(--yellow);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.module-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.category:not([open]) .module-list {
    display: none;
}

.module-item {
    position: relative;
    padding: 2px 0 4px 18px;
}

.module-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.95em;
    width: 10px;
    height: 10px;
    border-radius: 50% 20% 50% 20%;
    background: linear-gradient(135deg, var(--pink), var(--yellow), var(--green), var(--blue), var(--orange));
    box-shadow: 0 0 10px rgba(255, 230, 95, 0.35);
}

.module-name {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    text-shadow: 1px 1px 0 #000;
}

.module-desc {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

@keyframes rat-rock {
    0%, 100% {
        transform: translateY(0) rotate(-5.5deg);
    }

    50% {
        transform: translateY(-5px) rotate(-2.5deg);
    }
}

@keyframes wordmark-rock {
    0%, 100% {
        transform: rotate(0.85deg);
    }

    50% {
        transform: rotate(1.55deg);
    }
}

.catalog .category:nth-child(5n + 1) .category-header h3 { color: var(--pink); }
.catalog .category:nth-child(5n + 2) .category-header h3 { color: var(--yellow); }
.catalog .category:nth-child(5n + 3) .category-header h3 { color: var(--green); }
.catalog .category:nth-child(5n + 4) .category-header h3 { color: var(--blue); }
.catalog .category:nth-child(5n) .category-header h3 { color: var(--orange); }

.catalog > #module-list > .category:nth-child(odd) {
    transform: translateX(12px) rotate(-0.6deg);
}

.catalog > #module-list > .category:nth-child(even) {
    transform: translateX(28px) rotate(0.45deg);
}

.catalog > #module-list > .category:nth-child(3n) {
    transform: translateX(6px) rotate(-1deg);
}

.catalog > #module-list > .category:nth-child(4n) {
    transform: translateX(18px) rotate(0.8deg);
}

.footer {
    margin-top: 14px;
    padding: 12px 0 20px;
    text-align: center;
    color: var(--muted);
    border-top: 0;
}

.footer-ship {
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
    image-rendering: pixelated;
}

.footer p {
    margin: 0;
}

@media (max-width: 820px) {
    .hero-art {
        transform: none;
        margin-left: 0;
    }

    .logo {
        width: min(100%, 320px);
        animation: rat-rock 5s ease-in-out infinite;
    }

    .wordmark {
        animation: wordmark-rock 6.5s ease-in-out infinite;
    }

    .hero-copy {
        margin-left: 18px;
    }

    .catalog > #module-list > .category:nth-child(odd),
    .catalog > #module-list > .category:nth-child(even),
    .catalog > #module-list > .category:nth-child(3n),
    .catalog > #module-list > .category:nth-child(4n) {
        transform: none;
    }
}
