@font-face {
    font-family: 'Overseer';
    src: url('assets/fonts/overseer.otf') format('opentype');
    font-display: swap;
}

:root {
    --bg: #0d0c0a;
    --surface: #15130f;
    --surface-2: #1c1a15;
    --line: rgba(236, 230, 218, 0.09);
    --line-strong: rgba(236, 230, 218, 0.18);
    --text: #ece6da;
    --soft: #d2cbbd;
    --muted: #a39c8f;
    --faint: #6f695f;
    --accent: #ffb642;
    --accent-hover: #ffc566;
    --accent-ink: #1b1305;
    --red: #e5432f;
    --wrap: 1120px;
    --gutter: 24px;
    --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
    --display: 'Overseer', var(--sans);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 17px/1.6 var(--sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; }

h1, h2, h3 { text-wrap: balance; }

p { text-wrap: pretty; }

.hidden { display: none !important; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.brand {
    font-family: var(--display);
    font-size: 26px;
    line-height: 1;
    letter-spacing: 0.04em;
    text-decoration: none;
    white-space: nowrap;
}

.brand-nv { color: var(--accent); }

.brand-o { color: var(--red); }

.topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.topbar-inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 22px var(--gutter);
    display: flex;
    align-items: center;
    gap: 36px;
}

.topnav {
    display: flex;
    gap: 26px;
}

.topnav a {
    color: var(--muted);
    font-size: 15px;
    text-decoration: none;
    transition: color 0.15s;
}

.topnav a:hover { color: var(--text); }

.account { margin-left: auto; }

.account-login,
.account-action {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: rgba(13, 12, 10, 0.45);
    color: var(--text);
    font: 500 14px/1 var(--sans);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s;
}

.account-login:hover,
.account-action:hover { border-color: var(--accent); }

.account-in {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-who {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.3;
    margin-right: 4px;
}

#display-username {
    font-size: 15px;
    font-weight: 600;
}

.account-id {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--faint);
}

.hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: flex-end;
    min-height: min(92vh, 820px);
    background: var(--bg) url('assets/images/nvo_thumbnail.png') no-repeat 72% center / cover;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(13, 12, 10, 0.95) 0%, rgba(13, 12, 10, 0.8) 36%, rgba(13, 12, 10, 0.2) 72%, rgba(13, 12, 10, 0.05) 100%),
        linear-gradient(0deg, var(--bg) 0%, rgba(13, 12, 10, 0) 32%),
        linear-gradient(180deg, rgba(13, 12, 10, 0.7) 0%, rgba(13, 12, 10, 0) 22%);
    transition: background-color 1.5s;
}

.hero-inner {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 150px var(--gutter) 76px;
}

.eyebrow {
    margin: 0 0 18px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.title {
    margin: 0;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(52px, 9vw, 118px);
    line-height: 0.92;
    letter-spacing: 0.01em;
}

#dynamic-title,
.title-accent { display: inline-block; }

.title-accent { color: var(--accent); }

.lede {
    max-width: 33em;
    margin: 26px 0 0;
    color: var(--soft);
    font-size: 19px;
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: rgba(13, 12, 10, 0.4);
    color: var(--text);
    font: 600 15px/1 var(--sans);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.button:hover { border-color: var(--text); }

.button-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
}

.button-primary:hover {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.facts {
    display: flex;
    flex-wrap: wrap;
    margin: 52px 0 0;
    padding: 0;
    list-style: none;
}

.facts li {
    display: flex;
    flex-direction: column;
    padding: 2px 30px;
    border-left: 1px solid var(--line-strong);
}

.facts li:first-child {
    padding-left: 0;
    border-left: 0;
}

.facts strong {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.facts span {
    color: var(--muted);
    font-size: 14px;
}

.section {
    padding: 92px 0;
    border-top: 1px solid var(--line);
}

.section h2 {
    margin: 0 0 36px;
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 48px;
}

.split > h2 { margin: 0; }

.prose p {
    max-width: 40em;
    margin: 0 0 16px;
    color: var(--soft);
}

.prose .byline {
    margin-top: 24px;
    color: var(--muted);
}

.byline strong { color: var(--text); }

.muted {
    margin: 0 0 20px;
    color: var(--muted);
}

.features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px 48px;
}

.feature {
    padding-top: 22px;
    border-top: 1px solid var(--line-strong);
}

.feature h3 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.feature p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
}

.tag {
    padding: 3px 7px;
    border: 1px solid rgba(255, 182, 66, 0.35);
    border-radius: 4px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.link-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    text-decoration: none;
    transition: border-color 0.15s, background-color 0.15s;
}

.link-card:hover {
    border-color: rgba(255, 182, 66, 0.5);
    background: var(--surface-2);
}

.link-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 17px;
    font-weight: 600;
}

.link-title::after {
    content: "\2192";
    color: var(--accent);
    transition: transform 0.15s;
}

.link-card:hover .link-title::after { transform: translateX(3px); }

.link-text {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
}

.steps {
    display: grid;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 18px;
    counter-increment: step;
}

.steps li::before {
    content: counter(step);
    grid-row: span 2;
    width: 32px;
    height: 32px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    color: var(--accent);
    font: 600 14px/30px var(--sans);
    text-align: center;
}

.steps h3 {
    margin: 4px 0;
    font-size: 18px;
    font-weight: 600;
}

.steps p {
    margin: 0;
    color: var(--muted);
}

.steps a,
.prose a {
    color: var(--accent);
    text-underline-offset: 3px;
}

.section-quiet { background: #100f0c; }

.secrets {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 260px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.ach-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 182, 66, 0.12);
    color: var(--accent);
    font-weight: 700;
}

.ach-name { font-weight: 600; }

.ach-desc {
    color: var(--muted);
    font-size: 14px;
}

.achievement-card.locked .ach-icon {
    background: rgba(236, 230, 218, 0.06);
    color: var(--faint);
}

.achievement-card.locked .ach-name { color: var(--faint); }

.footer {
    padding: 40px 0 34px;
    border-top: 1px solid var(--line);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px 32px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.footer-links a {
    color: var(--muted);
    font-size: 15px;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-links a:hover { color: var(--text); }

.legal {
    margin-top: 28px;
    margin-bottom: 0;
    color: var(--faint);
    font-size: 13px;
}

#youtube-player {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.music {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 20;
    padding: 10px 15px 10px 31px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(21, 19, 15, 0.92);
    color: var(--muted);
    font: 600 13px/1 var(--sans);
    cursor: pointer;
}

.music::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 14px;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-radius: 50%;
    background: var(--faint);
}

.music.playing { color: var(--text); }

.music.playing::before { background: var(--accent); }

#achievement-popup {
    position: fixed;
    left: 50%;
    bottom: 76px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border: 1px solid rgba(255, 182, 66, 0.45);
    border-radius: 10px;
    background: var(--surface-2);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: opacity 0.3s, transform 0.3s;
}

#achievement-popup.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.popup-icon {
    color: var(--accent);
    font-size: 26px;
}

.popup-header {
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.popup-title { font-weight: 600; }

.popup-desc {
    color: var(--muted);
    font-size: 14px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(5, 5, 4, 0.75);
}

.modal-box {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 30px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
}

.modal-box h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 650;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    background: var(--surface-2);
    color: var(--text);
}

.modal-box label {
    display: block;
    margin: 18px 0 6px;
    color: var(--soft);
    font-size: 14px;
    font-weight: 600;
}

.modal-box input,
.modal-box select,
.modal-box textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font: 400 15px/1.4 var(--sans);
}

.modal-box textarea { resize: vertical; }

.modal-box input:focus,
.modal-box select:focus,
.modal-box textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-box .button {
    width: 100%;
    margin-top: 22px;
}

.status-panel {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    font-size: 14px;
}

.status-panel p { margin: 0; }

.status-panel p + p { margin-top: 6px; }

.status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(236, 230, 218, 0.08);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.status-pending { color: var(--accent); }

.status-accepted { color: #7fce7a; }

.status-declined { color: var(--red); }

body.sierra-madre {
    --accent: #e5432f;
    --accent-hover: #f0604d;
    --accent-ink: #1a0503;
}

body.sierra-madre .hero::before { background-color: rgba(60, 6, 4, 0.45); }

body.sierra-madre #dynamic-title { color: #f0604d; }

.sm-glitch { animation: sm-flicker 2.5s ease-out forwards; }

@keyframes sm-flicker {
    0% { opacity: 1; transform: none; }
    5% { opacity: 0; transform: skewX(-10deg); }
    16% { opacity: 1; transform: skewX(12deg); }
    18% { opacity: 0; transform: none; }
    26% { opacity: 0.5; transform: translate(-3px, 2px); }
    30% { opacity: 0; }
    40% { opacity: 1; transform: translate(3px, -2px); }
    45% { opacity: 0.4; transform: none; }
    60% { opacity: 0.85; }
    100% { opacity: 1; transform: none; }
}

@media (max-width: 960px) {
    .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
}

@media (max-width: 720px) {
    :root { --gutter: 16px; }
    body { font-size: 16px; }
    .topbar-inner {
        flex-wrap: wrap;
        gap: 14px 20px;
        padding-top: 16px;
        padding-bottom: 16px;
    }
    .topnav {
        order: 3;
        width: 100%;
        gap: 22px;
        overflow-x: auto;
    }
    .account-who { display: none; }
    .hero {
        min-height: 0;
        background-position: 88% top;
        background-size: auto 400px;
    }
    .hero::before {
        background:
            linear-gradient(0deg, var(--bg) 0%, var(--bg) 58%, rgba(13, 12, 10, 0.25) 82%, rgba(13, 12, 10, 0.55) 100%);
    }
    .hero-inner { padding: 300px var(--gutter) 56px; }
    .lede { font-size: 17px; }
    .facts {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
        margin-top: 40px;
    }
    .facts li,
    .facts li:first-child {
        padding: 0;
        border-left: 0;
    }
    .facts strong { font-size: 19px; }
    .facts span {
        font-size: 13px;
        line-height: 1.35;
    }
    .section { padding: 64px 0; }
    .section h2 { margin-bottom: 28px; }
    .features,
    .links { grid-template-columns: minmax(0, 1fr); }
    .features { gap: 28px; }
    .achievement-card { min-width: 0; width: 100%; }
    .music {
        right: 12px;
        bottom: 12px;
    }
    #achievement-popup {
        width: calc(100% - 32px);
        bottom: 64px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
