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

:root {
    --accent: #2bff00;
    --accent-rgb: 43 255 0;
    --text-main: #c0c0c0;
    --text-soft: #8a908c;
}

body {
    background:
        radial-gradient(circle at top, rgb(var(--accent-rgb) / 0.12), transparent 38%),
        linear-gradient(180deg, #0d0f0d 0%, #070808 55%, #040505 100%);
    color: var(--text-main);
    font-family: 'Courier New', Courier, monospace;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translate(-50%, -180%);
    z-index: 20;
    padding: 10px 14px;
    border: 1px solid rgb(var(--accent-rgb) / 0.34);
    border-radius: 999px;
    background: rgba(5, 8, 7, 0.96);
    color: #f2fbf5;
    text-decoration: none;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    font-size: 0.72rem;
    box-shadow: 0 0 18px rgb(var(--accent-rgb) / 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.skip-link:focus {
    transform: translate(-50%, 0);
}

header {
    background: linear-gradient(180deg, rgba(17, 17, 17, 0.92), rgba(10, 12, 11, 0.88));
    border-bottom: 1px solid rgb(var(--accent-rgb) / 0.35);
    padding: 48px 20px 32px;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

header h1 {
    font-size: 3rem;
    color: var(--accent);
    text-shadow: 0 0 10px rgb(var(--accent-rgb) / 0.9), 0 0 30px rgb(var(--accent-rgb) / 0.35);
    letter-spacing: 8px;
    text-transform: uppercase;
}

.tagline {
    color: #68706a;
    font-size: 0.9rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 10px;
}

.archive-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px 20px 56px;
}

.archive-main:focus,
.story-page:focus {
    outline: none;
}

.stories {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 720px;
}

.story-btn {
    --button-accent: #2bff00;
    --button-accent-rgb: 43 255 0;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgb(var(--button-accent-rgb) / 0.08), transparent 48%),
        rgba(13, 16, 15, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-left: 3px solid rgb(var(--button-accent-rgb) / 0.32);
    border-radius: 12px;
    padding: 20px 24px;
    text-decoration: none;
    color: var(--text-main);
    opacity: 0;
    transform: translateY(18px);
    animation: story-card-enter 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.story-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgb(var(--button-accent-rgb) / 0.08), transparent);
    transform: translateX(-100%);
    transition: transform 0.45s ease;
}

.story-btn:hover {
    border-color: rgb(var(--button-accent-rgb) / 0.55);
    box-shadow: 0 0 18px rgb(var(--button-accent-rgb) / 0.18), inset 0 0 18px rgb(var(--button-accent-rgb) / 0.08);
    transform: translateX(8px);
}

.story-btn:active {
    transform: translateX(4px) scale(0.992);
    border-color: rgb(var(--button-accent-rgb) / 0.62);
    box-shadow: 0 0 12px rgb(var(--button-accent-rgb) / 0.22), inset 0 0 18px rgb(var(--button-accent-rgb) / 0.12);
}

.story-btn:active .story-badge {
    transform: scale(0.985);
    border-color: rgb(var(--button-accent-rgb) / 0.44);
}

.story-btn:hover::before {
    transform: translateX(100%);
}

.story-btn:nth-child(1) {
    animation-delay: 0.05s;
}

.story-btn:nth-child(2) {
    animation-delay: 0.13s;
}

.story-btn:nth-child(3) {
    animation-delay: 0.21s;
}

.story-btn:nth-child(4) {
    animation-delay: 0.29s;
}

.story-btn:nth-child(5) {
    animation-delay: 0.37s;
}

.story-badge {
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 76px;
    padding: 12px 10px;
    border: 1px solid rgb(var(--button-accent-rgb) / 0.28);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgb(var(--button-accent-rgb) / 0.18), rgb(var(--button-accent-rgb) / 0.05)),
        rgba(6, 10, 9, 0.88);
    box-shadow: inset 0 0 18px rgb(var(--button-accent-rgb) / 0.12);
    position: relative;
    z-index: 1;
}

.story-badge::after {
    content: "";
    width: 32px;
    height: 1px;
    background: rgb(var(--button-accent-rgb) / 0.3);
}

.story-number {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    color: var(--button-accent);
    text-shadow: 0 0 8px rgb(var(--button-accent-rgb) / 0.55);
    font-weight: bold;
    line-height: 1.1;
    letter-spacing: 2px;
}

.story-emblem {
    font-size: 0.72rem;
    color: #e0ebe2;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.story-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    position: relative;
    z-index: 1;
}

.story-title {
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.story-teaser {
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 54ch;
}

.story-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.story-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 10px;
    border: 1px solid rgb(var(--button-accent-rgb) / 0.2);
    border-radius: 999px;
    background: rgb(var(--button-accent-rgb) / 0.08);
    color: #d3ddd6;
    font-size: 0.72rem;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.story-btn:hover .story-title {
    color: var(--button-accent);
    text-shadow: 0 0 8px rgb(var(--button-accent-rgb) / 0.5);
}

.story-btn:hover .story-teaser {
    color: #bcc6bf;
}

.story-btn:hover .story-tag {
    border-color: rgb(var(--button-accent-rgb) / 0.38);
    background: rgb(var(--button-accent-rgb) / 0.12);
    color: #f0f6f2;
}

.story-btn.story-signal {
    --button-accent: #84fbff;
    --button-accent-rgb: 132 251 255;
}

.story-btn.story-drift {
    --button-accent: #53ff8f;
    --button-accent-rgb: 83 255 143;
}

.story-btn.story-colony {
    --button-accent: #b8ff72;
    --button-accent-rgb: 184 255 114;
}

.story-btn.story-watcher {
    --button-accent: #9af7c9;
    --button-accent-rgb: 154 247 201;
}

.story-btn.story-echo {
    --button-accent: #72ffe2;
    --button-accent-rgb: 114 255 226;
}

@keyframes story-card-enter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }

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

footer {
    text-align: center;
    padding: 20px;
    color: #4a504c;
    font-size: 0.75rem;
    letter-spacing: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Story page styles */
.story-page {
    max-width: 760px;
    margin: 48px auto;
    padding: 36px 28px 28px;
    border: 1px solid rgb(var(--story-accent-rgb, 43 255 0) / 0.22);
    border-radius: 18px;
    background:
        linear-gradient(160deg, rgb(var(--story-accent-rgb, 43 255 0) / 0.08), transparent 36%),
        rgba(8, 10, 10, 0.9);
    box-shadow: 0 0 32px rgb(var(--story-accent-rgb, 43 255 0) / 0.08);
}

.story-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 30px;
    padding: 18px 18px 20px;
    border: 1px solid rgb(var(--story-accent-rgb, 43 255 0) / 0.2);
    border-radius: 14px;
    background:
        linear-gradient(140deg, rgb(var(--story-accent-rgb, 43 255 0) / 0.1), transparent 44%),
        rgba(6, 9, 9, 0.65);
}

.story-header-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.story-header-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.story-kicker {
    color: rgb(var(--story-accent-rgb, 43 255 0) / 0.74);
    font-size: 0.74rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.story-page .story-header .story-meta {
    margin-bottom: 0;
}

.story-header-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.story-chip.story-progress {
    color: var(--story-accent, var(--accent));
    border-color: rgb(var(--story-accent-rgb, 43 255 0) / 0.34);
    background: rgb(var(--story-accent-rgb, 43 255 0) / 0.14);
}

.story-page .story-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 11px;
    border: 1px solid rgb(var(--story-accent-rgb, 43 255 0) / 0.22);
    border-radius: 999px;
    background: rgb(var(--story-accent-rgb, 43 255 0) / 0.08);
    color: #dce6df;
    font-size: 0.7rem;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.story-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 38px;
    align-items: stretch;
}

.story-nav-link {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    gap: 8px;
    min-height: 132px;
    min-width: 0;
    padding: 18px 18px 20px;
    border: 1px solid rgb(var(--story-accent-rgb, 43 255 0) / 0.22);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgb(var(--story-accent-rgb, 43 255 0) / 0.12), transparent 46%),
        rgba(6, 9, 9, 0.7);
    color: inherit;
    text-decoration: none;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.story-nav-link:hover {
    transform: translateY(-2px);
    border-color: rgb(var(--story-accent-rgb, 43 255 0) / 0.42);
    box-shadow: 0 0 18px rgb(var(--story-accent-rgb, 43 255 0) / 0.12);
}

.story-nav-link.story-nav-prev {
    text-align: left;
    align-items: flex-start;
}

.story-nav-link.story-nav-next {
    text-align: left;
    align-items: flex-start;
}

.story-nav-link.story-nav-archive {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.story-nav-label {
    display: block;
    width: 100%;
    text-align: left;
    color: rgb(var(--story-accent-rgb, 43 255 0) / 0.72);
    font-size: 0.74rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.story-nav-title {
    display: block;
    width: 100%;
    text-align: center;
    color: var(--story-accent, var(--accent));
    font-size: 1.05rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.story-nav-copy {
    color: #b6beb8;
    line-height: 1.65;
}

.story-nav-link.story-nav-next .story-nav-label {
    text-align: right;
    align-self: stretch;
}

.story-nav-link.story-nav-archive .story-nav-label,
.story-nav-link.story-nav-archive .story-nav-title,
.story-nav-link.story-nav-archive .story-nav-copy {
    text-align: center;
}

.story-btn:focus-visible,
.skip-link:focus-visible,
.back-link:focus-visible,
.story-nav-link:focus-visible {
    outline: 2px solid rgb(var(--story-accent-rgb, var(--button-accent-rgb, 43 255 0)) / 0.9);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgb(var(--story-accent-rgb, var(--button-accent-rgb, 43 255 0)) / 0.16);
}

.skip-link:focus-visible {
    outline-color: rgb(var(--accent-rgb) / 0.95);
    box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 0.14), 0 0 18px rgb(var(--accent-rgb) / 0.18);
}

.story-btn:focus-visible {
    opacity: 1;
    transform: translateY(0);
}

.story-nav-link:focus-visible,
.story-nav-link.story-nav-archive:focus-visible {
    border-color: rgb(var(--story-accent-rgb, 43 255 0) / 0.48);
}

.story-btn.story-signal:focus-visible {
    outline-color: rgb(132 251 255 / 0.95);
    box-shadow: 0 0 0 4px rgb(132 251 255 / 0.14);
}

.story-btn.story-drift:focus-visible {
    outline-color: rgb(83 255 143 / 0.95);
    box-shadow: 0 0 0 4px rgb(83 255 143 / 0.14);
}

.story-btn.story-colony:focus-visible {
    outline-color: rgb(184 255 114 / 0.95);
    box-shadow: 0 0 0 4px rgb(184 255 114 / 0.14);
}

.story-btn.story-watcher:focus-visible {
    outline-color: rgb(154 247 201 / 0.95);
    box-shadow: 0 0 0 4px rgb(154 247 201 / 0.14);
}

.story-btn.story-echo:focus-visible {
    outline-color: rgb(114 255 226 / 0.95);
    box-shadow: 0 0 0 4px rgb(114 255 226 / 0.14);
}

.story-page h1 {
    color: var(--story-accent, var(--accent));
    text-shadow: 0 0 10px rgb(var(--story-accent-rgb, 43 255 0) / 0.75), 0 0 30px rgb(var(--story-accent-rgb, 43 255 0) / 0.28);
    font-size: 2rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 10px;
    line-height: 1.15;
}

.story-page .story-meta {
    color: rgb(var(--story-accent-rgb, 43 255 0) / 0.8);
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-bottom: 30px;
    text-transform: uppercase;
    padding-left: 12px;
    border-left: 2px solid rgb(var(--story-accent-rgb, 43 255 0) / 0.38);
}

.story-page p {
    line-height: 1.8;
    margin-bottom: 20px;
    color: #adb4af;
}

.story-page p:first-of-type {
    color: #d6ddd8;
}

.story-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 34px 0 30px;
    color: rgb(var(--story-accent-rgb, 43 255 0) / 0.6);
}

.story-divider::before,
.story-divider::after {
    content: "";
    width: 74px;
    max-width: 24%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgb(var(--story-accent-rgb, 43 255 0) / 0.45), transparent);
}

.story-divider span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgb(var(--story-accent-rgb, 43 255 0) / 0.28);
    border-radius: 50%;
    background: rgb(var(--story-accent-rgb, 43 255 0) / 0.08);
    box-shadow: inset 0 0 12px rgb(var(--story-accent-rgb, 43 255 0) / 0.08);
    font-size: 0.72rem;
    letter-spacing: 2px;
}

.back-link {
    display: inline-block;
    margin-bottom: 30px;
    color: var(--story-accent, var(--accent));
    text-decoration: none;
    letter-spacing: 2px;
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: text-shadow 0.3s ease;
}

.back-link:hover {
    text-shadow: 0 0 10px rgb(var(--story-accent-rgb, 43 255 0) / 0.6);
}

body.story-signal {
    --story-accent: #84fbff;
    --story-accent-rgb: 132 251 255;
    background:
        radial-gradient(circle at top, rgb(132 251 255 / 0.14), transparent 38%),
        linear-gradient(180deg, #071014 0%, #06090c 55%, #030506 100%);
}

body.story-drift {
    --story-accent: #53ff8f;
    --story-accent-rgb: 83 255 143;
    background:
        radial-gradient(circle at top, rgb(83 255 143 / 0.15), transparent 38%),
        linear-gradient(180deg, #09110c 0%, #050806 55%, #030403 100%);
}

body.story-colony {
    --story-accent: #b8ff72;
    --story-accent-rgb: 184 255 114;
    background:
        radial-gradient(circle at top, rgb(184 255 114 / 0.14), transparent 38%),
        linear-gradient(180deg, #12110a 0%, #090806 55%, #040403 100%);
}

body.story-watcher {
    --story-accent: #9af7c9;
    --story-accent-rgb: 154 247 201;
    background:
        radial-gradient(circle at top, rgb(154 247 201 / 0.14), transparent 38%),
        linear-gradient(180deg, #08100d 0%, #050806 55%, #030403 100%);
}

body.story-echo {
    --story-accent: #72ffe2;
    --story-accent-rgb: 114 255 226;
    background:
        radial-gradient(circle at top, rgb(114 255 226 / 0.14), transparent 38%),
        linear-gradient(180deg, #07110f 0%, #040807 55%, #030404 100%);
}

@media (max-width: 768px) {
    .story-footer-nav {
        flex-direction: column;
        flex-wrap: nowrap;
        margin-top: 30px;
    }

    .story-nav-link {
        display: block;
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 16px;
    }

    .story-nav-link.story-nav-archive {
        width: 100%;
    }

    .story-nav-link.story-nav-next {
        text-align: left;
        align-items: initial;
    }
}

@media (max-width: 640px) {
    header h1 {
        font-size: 2.3rem;
        letter-spacing: 5px;
    }

    .tagline {
        letter-spacing: 3px;
    }

    .story-btn {
        gap: 14px;
        padding: 18px 18px 18px 20px;
    }

    .skip-link {
        width: calc(100% - 32px);
        max-width: 320px;
        text-align: center;
    }

    .story-badge {
        min-width: 66px;
        padding: 10px 8px;
    }

    .story-number {
        font-size: 1rem;
    }

    .story-title {
        font-size: 1rem;
    }

    .story-teaser {
        font-size: 0.88rem;
    }

    .story-details {
        gap: 6px;
    }

    .story-tag {
        font-size: 0.66rem;
        letter-spacing: 1px;
    }

    .story-page {
        margin: 28px 16px;
        padding: 28px 20px 18px;
    }

    .story-header {
        padding: 16px;
        gap: 12px;
    }

    .story-header-top {
        flex-direction: column;
    }

    .story-header-details {
        gap: 6px;
    }

    .story-page .story-chip {
        font-size: 0.64rem;
        letter-spacing: 1px;
    }

    .story-divider {
        margin: 28px 0 24px;
    }

    .story-divider::before,
    .story-divider::after {
        width: 48px;
    }

    .story-divider span {
        width: 28px;
        height: 28px;
        font-size: 0.64rem;
    }

    .story-page h1 {
        font-size: 1.6rem;
        letter-spacing: 3px;
    }

    .story-footer-nav {
        flex-direction: column;
        margin-top: 30px;
    }

    .story-nav-link {
        min-height: 0;
        padding: 16px;
    }

    .story-nav-link.story-nav-archive {
        width: 100%;
    }

    .story-nav-link.story-nav-next {
        text-align: left;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .skip-link {
        transition: none;
    }

    .story-btn {
        opacity: 1;
        transform: none;
        animation: none;
        transition: none;
    }

    .story-btn::before {
        transition: none;
    }
}