:root {
    /* Default to Helldivers 2 red/black palette */
    --bg: #0b0b0b;
    /* near-black */
    --surface: #121212;
    /* dark surface */
    --surface-2: #191919;
    /* alt surface */
    --text: #f3f3f3;
    /* light text */
    --muted: #bdbdbd;
    /* muted text */
    --primary: #e10f17;
    /* safety red */
    --primary-700: #b60c12;
    /* deeper red */
    --accent: #ff2929;
    /* accent red */
    --danger: #ff6b6b;
    /* keep for warnings */
    --stripe: #111;
    /* dark stripe base */
    --stripe-alt: #e10f17;
    /* red stripe */
    --radius: 10px;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 6px 22px rgba(0, 0, 0, 0.55);
}

/* CSS reset (small, opinionated) */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    height: 100%;
}

/* Layout: make footer stick to bottom on short pages */
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    padding-left: 1.25rem;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: -999px;
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    z-index: 1000;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    backdrop-filter: saturate(140%) blur(8px);
    background: color-mix(in oklab, var(--bg) 85%, transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 50;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.brand .logo {
    width: 28px;
    height: 28px;
}

.brand-name {
    font-size: 1.05rem;
    color: var(--text);
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-nav a {
    color: var(--muted);
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
}

.site-nav a:not(.btn):hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.site-nav a:not(.btn).active {
    color: #fff;
    background: rgba(225, 15, 23, 0.2);
    border: 1px solid rgba(225, 15, 23, 0.5);
}

/* Normalize nav 'Get started' button to match other nav items */
.site-nav a.btn {
    background: transparent !important;
    color: var(--muted);
    border: 1px solid transparent;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    padding: 0.5rem 0.6rem;
}

.site-nav a.btn:hover {
    color: #fff;
    background: rgba(225, 15, 23, 0.12) !important;
    border-color: rgba(225, 15, 23, 0.35);
    transform: none;
    box-shadow: none;
}

.site-nav a.btn.active {
    color: #fff;
    background: rgba(225, 15, 23, 0.2) !important;
    border: 1px solid rgba(225, 15, 23, 0.5);
}

.site-nav a.btn:active {
    transform: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary), var(--primary-700));
    color: #fff;
    box-shadow: var(--shadow-1);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
}

.btn:active {
    transform: translateY(0);
}

.btn--ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn--small {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

/* Links */
.muted-link {
    color: var(--muted);
}

.muted-link:hover {
    color: var(--text);
}

/* Hero */
.hero {
    padding: clamp(3rem, 6vw, 6rem) 0;
    background: radial-gradient(800px 400px at 90% 10%, rgba(124, 156, 255, 0.15), transparent 60%), radial-gradient(600px 300px at 20% 30%, rgba(77, 230, 196, 0.12), transparent 65%);
}

.hero-inner {
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    margin: 0 0 0.75rem;
}

.hero .lede {
    color: var(--muted);
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    margin: 0 0 1.25rem;
}

.cta {
    display: inline-flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Sections */
.section {
    padding: 3rem 0;
}

.section--alt {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
    border-block: 1px solid rgba(255, 255, 255, 0.06);
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.feature-list li {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
}

.feature-list h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

/* Ensure sticky footer layout persists with final body overrides */
.feature-list p {
    margin: 0;
    color: var(--muted);
}

.site-header {
    position: sticky;
    top: 0;
    backdrop-filter: saturate(140%) blur(8px);
    background: color-mix(in oklab, #000 80%, transparent);
    border-bottom: 2px solid rgba(255, 255, 255, 0.06);
    z-index: 50;
}

.site-nav a:not(.btn):hover {
    color: #fff;
    background: rgba(225, 15, 23, 0.12);
    border-color: rgba(225, 15, 23, 0.35);
}

.card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
}

.site-nav a {
    color: var(--muted);
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    border: 1px solid transparent;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary), var(--primary-700));
    color: #fff;
    box-shadow: var(--shadow-1);
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.steps {
    margin-top: 0.5rem;
}

.steps li {
    margin: 0.4rem 0;
}

.btn--ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(225, 15, 23, 0.35);
}

/* Footer */
.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: color-mix(in oklab, var(--bg) 92%, transparent);
    margin-top: auto;
}

.hero {
    padding: clamp(3rem, 6vw, 6rem) 0;
    background:
        linear-gradient(180deg, rgba(225, 15, 23, 0.08), rgba(0, 0, 0, 0) 60%),
        radial-gradient(700px 300px at 90% 10%, rgba(225, 15, 23, 0.2), transparent 60%);
}

.hero--sub {
    padding: clamp(2rem, 4vw, 4rem) 0;
    background:
        linear-gradient(180deg, rgba(225, 15, 23, 0.05), rgba(0, 0, 0, 0) 60%),
        radial-gradient(600px 260px at 90% 10%, rgba(225, 15, 23, 0.15), transparent 60%);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    color: var(--muted);
}

.back-to-top {
    color: var(--accent);
}

.feature-list li {
    background: var(--surface-2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
}

/* Feature media */
.feature-media {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-1);
    margin: 0 0 0.5rem;
    background: #000;
}

/* Alternating feature rows */
.feature-rows {
    display: grid;
    gap: 2rem;
}

.feature-row {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 1.25rem;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    padding: 1rem;
}

.feature-row:nth-child(even) {
    grid-template-columns: 1fr 1.1fr;
}

.feature-row .feature-media {
    margin: 0;
}

.feature-row .feature-copy h3 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
}

.feature-row .feature-copy p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 820px) {
    .feature-row {
        grid-template-columns: 1fr;
    }

    .feature-row:nth-child(even) {
        grid-template-columns: 1fr;
    }
}

/* Small utilities */
code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Hazard stripe motif */
.hazard {
    position: relative;
    background: repeating-linear-gradient(135deg, var(--stripe) 0 14px, var(--stripe-alt) 14px 28px);
    border: 0;
    min-height: 10px;
}

.hazard--bar {
    height: 8px;
    width: 100%;
}

.hazard-section {
    background: linear-gradient(180deg, rgba(225, 15, 23, 0.06), rgba(0, 0, 0, 0));
    border-top: 2px solid rgba(225, 15, 23, 0.35);
}

@media (max-width: 520px) {
    .site-nav ul {
        gap: 0.25rem;
    }

    .site-nav a {
        padding: 0.4rem 0.5rem;
    }

    .brand-name {
        display: none;
    }
}

/* Visually hidden utility for screen readers */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Hamburger button */
.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 0.5rem;
    margin-left: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
}
.nav-toggle:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.nav-toggle .bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    margin: 4px 0;
    border-radius: 2px;
}

.nav-toggle {
    /* keep alignment helpers but don't set display here; display is controlled in the mobile media query */
    align-items: center;
    justify-content: center;
}
.nav-toggle .bar {
    transition: transform 180ms ease, opacity 160ms ease;
    transform-origin: center;
}
.nav-toggle .bar:nth-child(1) { transform-origin: left top; }
.nav-toggle .bar:nth-child(3) { transform-origin: left bottom; }
.nav-toggle.is-open .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.nav-toggle.is-open .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav-toggle.is-open .bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Mobile: hide nav by default and show toggle */
@media (max-width: 820px) {
    .nav-toggle {
        display: inline-block;
    }

    /* Ensure external SVG icon fits similarly to the previous three-bar layout */
    .nav-toggle .hamburger {
        width: 26px;
        height: auto;
        display: block;
        transition: transform 180ms ease, opacity 160ms ease;
        filter: brightness(0) invert(1); /* make sure white icon shows on dark bg; adjust if your SVG already has colors */
    }

    /* Optional slight rotation when open to indicate state change */
    .nav-toggle.is-open .hamburger {
        transform: rotate(90deg) scale(0.98);
    }

    .site-nav {
        /* use fixed so the nav sits in the root stacking context and is not clipped by transformed ancestors */
        position: fixed;
        /* safe offset under the header; ok to tweak if header height changes */
        top: 56px;
        right: 0;
        left: 0;
        background: color-mix(in oklab, var(--bg) 95%, transparent);
        border-bottom: 1px solid rgba(255,255,255,0.04);
        transform-origin: top right;
        transform: scaleY(0);
        transition: transform 180ms ease-in-out, opacity 180ms ease-in-out;
        opacity: 0;
        z-index: 9999; /* ensure nav sits above other page layers */
        pointer-events: none; /* not interactive when closed */
    }

    .site-nav[data-open="true"] {
        transform: scaleY(1);
        opacity: 1;
        pointer-events: auto; /* allow taps/clicks when open */
    }

    /* Visible surface for the open mobile nav */
    .site-nav[data-open="true"] {
        background: linear-gradient(180deg, color-mix(in oklab, var(--bg) 96%, transparent), color-mix(in oklab, var(--bg) 98%, transparent));
        backdrop-filter: blur(6px) saturate(120%);
        -webkit-backdrop-filter: blur(6px) saturate(120%);
        box-shadow: 0 10px 30px rgba(0,0,0,0.6);
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
        padding-top: 0.5rem;
    }

    .site-nav ul {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 1rem 0.75rem;
    }

    .site-nav li {
        border-top: 1px solid rgba(255,255,255,0.02);
    }

    .site-nav a {
        display: block;
        padding: 0.8rem 0.5rem;
    }

    /* Improve touch behaviour for mobile links */
    .site-nav a {
        -webkit-tap-highlight-color: rgba(0,0,0,0.15);
        touch-action: manipulation;
    }

    /* Make header inner use relative positioning so absolute nav positions correctly */
    .header-inner {
        position: relative;
        overflow: visible; /* ensure the dropdown is not clipped */
    }
}

/* Remove spin buttons on number inputs (if any) */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Full-page blurred photographic background (non-intrusive) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;

    /* ensure the image is rendered as a fixed background and can be blurred */
    background-image: url("data/images/assets/blurback.png");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    /* apply blur and force hardware acceleration for more consistent results */
    filter: blur(8px);
    -webkit-filter: blur(8px);
    transform: scale(1.04) translateZ(0);
    -webkit-transform: scale(1.04) translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform, filter;
}

/* Center overlay to preserve original solid background under main content. */
body::after {
    content: "";
    position: fixed;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: min(1100px, calc(100% - 2rem));
    height: 100vh;
    background-color: var(--bg);
    pointer-events: none;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6) inset;
    /* subtle inner vignette so gutters read as separate */
}

/* Ensure main stacking is above the centered overlay */
main,
.site-header,
.site-footer {
    position: relative;
    z-index: 1;
}

/* On very small screens, let the overlay be full-width so layout remains consistent */
@media (max-width: 1160px) {
    body::after {
        width: 100%;
        transform: none;
        left: 0;
    }
}