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

:root {
    /* Overdrive Ascent palette — mirrors css/style.css in the game */
    --primary: #ffc93c;        /* --gold */
    --primary-dark: #b8860b;
    --bg-dark: #0d1220;        /* --ink */
    --bg-darker: #070b16;
    --text-light: #f2efe6;     /* --paper */
    --text-muted: #9aa8bf;
    --accent: #ff5a3c;         /* --hot */
    --accent-dark: #c93a22;    /* --hot-dark */
    --accent-blue: #4fc3f7;    /* --cool */

    /* Fibonacci spacing scale (8 13 21 34 55 89 144px) */
    --space-1: 0.5rem;    /* 8px */
    --space-2: 0.813rem;  /* 13px */
    --space-3: 1.313rem;  /* 21px */
    --space-4: 2.125rem;  /* 34px */
    --space-5: 3.438rem;  /* 55px */
    --space-6: 5.563rem;  /* 89px */
    --space-7: 9rem;      /* 144px */

    /* Golden ratio type scale (φ = 1.618, base 1rem) */
    --text-xs:  0.618rem;
    --text-sm:  0.854rem;
    --text-base: 1rem;
    --text-md:  1.618rem;
    --text-lg:  2.618rem;
    --text-xl:  4.236rem;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Chakra Petch', 'Trebuchet MS', Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-3);
}

/* Navigation */
.navbar {
    background-color: rgba(13, 18, 32, 0.95);
    backdrop-filter: blur(10px);
    padding: var(--space-2) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 201, 60, 0.2);
    box-shadow: 0 4px 30px rgba(255, 201, 60, 0.12);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-brand img {
    height: var(--space-3);  /* wordmark is wide; keep nav height at 13+21+13 */
    width: auto;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--text-light);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: var(--text-sm);
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    padding: var(--space-6) 0;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 80% 15%, rgba(79, 195, 247, 0.10) 0%, transparent 55%),
        linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 90, 60, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: var(--text-xl);
    font-weight: 800;
    margin-bottom: var(--space-2);
    line-height: 1.1;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-style: italic;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-wordmark {
    display: block;
    width: 100%;
    max-width: 520px;
    height: auto;
    margin-bottom: var(--space-3);
    filter: drop-shadow(0 8px 24px rgba(255, 90, 60, 0.35));
}

.hero-subtitle {
    font-size: var(--text-md);
    color: var(--accent-blue);
    margin-bottom: var(--space-2);
    font-weight: 600;
}

.hero-description {
    font-size: var(--text-base);
    color: var(--text-muted);
    margin-bottom: var(--space-4);
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-4);
    flex-wrap: wrap;
}

.hero-stat strong {
    display: block;
    font-size: var(--text-md);
    color: var(--primary);
    line-height: 1.2;
}

.hero-stat span {
    font-size: var(--text-xs);
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-base);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary);
    color: #2a1a00;
    box-shadow: 0 10px 30px rgba(255, 201, 60, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(255, 201, 60, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-secondary:hover {
    background-color: var(--accent);
    color: var(--bg-dark);
    transform: translateY(-2px);
}

.game-preview {
    position: relative;
    height: auto;
    min-height: 320px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* A real frame from the game, landscape 16:9 like the game itself. Sized by
 * width so it scales down without squashing; a fixed height would distort it
 * as soon as the column got narrower than the image. */
.gameplay-screenshot {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
    border: 2px solid var(--primary);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(255, 201, 60, 0.25);
    animation: float 3s ease-in-out infinite;
}

/* Illustrated stand-in used until a real gameplay PNG is dropped in */
.hero-art {
    width: 100%;
    max-width: 560px;
    height: auto;
    border: 2px solid rgba(255, 201, 60, 0.5);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(255, 90, 60, 0.25);
    animation: float 3s ease-in-out infinite;
    background: #070b16;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .gameplay-screenshot,
    .hero-art { animation: none; }
}

/* Features Section */
.features {
    padding: var(--space-6) 0;
    background-color: rgba(7, 11, 22, 0.6);
    border-top: 1px solid rgba(255, 201, 60, 0.1);
    border-bottom: 1px solid rgba(255, 201, 60, 0.1);
    box-shadow: 0 -4px 30px rgba(255, 201, 60, 0.1), 0 4px 30px rgba(255, 201, 60, 0.1);
}

.features h2,
.gameplay h2,
.download h2 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-5);
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    /* min(): on a phone narrower than 300px plus the gutters, one column as
     * wide as there is room for, instead of a 300px card poking off the edge. */
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: var(--space-4);
}

.feature-card {
    background: linear-gradient(135deg, rgba(255, 201, 60, 0.05) 0%, rgba(79, 195, 247, 0.05) 100%);
    border: 1px solid rgba(255, 201, 60, 0.2);
    padding: var(--space-4);
    border-radius: 15px;
    transition: all 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(255, 201, 60, 0.1) 0%, rgba(79, 195, 247, 0.1) 100%);
    transform: translateY(-10px);
}

.feature-icon {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
    display: inline-block;
}

.feature-card h3 {
    font-size: var(--text-md);
    margin-bottom: var(--space-1);
    color: var(--primary);
    letter-spacing: 1px;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.8;
}

/* Gameplay Section */
.gameplay {
    padding: var(--space-6) 0;
    box-shadow: 0 -4px 30px rgba(255, 201, 60, 0.1), 0 4px 30px rgba(255, 201, 60, 0.1);
}

.gameplay-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
}

.step {
    text-align: center;
    padding: var(--space-4);
}

.step-number {
    width: var(--space-6);
    height: var(--space-6);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-md);
    font-weight: 800;
    margin: 0 auto var(--space-3);
    color: var(--bg-dark);
}

.step h3 {
    font-size: var(--text-md);
    margin-bottom: var(--space-1);
    color: var(--primary);
    letter-spacing: 1px;
}

.step p {
    color: var(--text-muted);
    line-height: 1.8;
}

.controls-note {
    margin-top: var(--space-5);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.controls-note kbd {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 2px;
    border: 1px solid rgba(255, 201, 60, 0.35);
    border-bottom-width: 3px;
    border-radius: 6px;
    background: rgba(255, 201, 60, 0.08);
    color: var(--primary);
    font-family: inherit;
    font-size: var(--text-sm);
}

/* Download Section */
.download {
    padding: var(--space-6) 0;
    background: linear-gradient(135deg, rgba(255, 201, 60, 0.1) 0%, rgba(255, 90, 60, 0.1) 100%);
    border-top: 1px solid rgba(255, 201, 60, 0.2);
    text-align: center;
    box-shadow: 0 -4px 30px rgba(255, 201, 60, 0.12), 0 4px 30px rgba(255, 201, 60, 0.12);
}

.download-subtitle {
    font-size: var(--text-base);
    color: var(--text-muted);
    margin-bottom: var(--space-5);
}

/* Stacked and centred on a phone; side by side from 520px, where both fit
 * (2 x 232px plus the gap, inside the container's 21px gutters). */
.download-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);        /* the badges' own padding is the clear space */
    margin-bottom: var(--space-4);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 2px solid rgba(255, 201, 60, 0.3);
    border-radius: 15px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    text-align: left;
}

.download-btn:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(255, 201, 60, 0.2) 0%, rgba(255, 90, 60, 0.2) 100%);
    transform: translateY(-5px);
}

/* The official store badges. Each carries its own black fill and grey rule, so
 * nothing is drawn around them - a border or glow here would sit in the clear
 * space both Apple and Google require. Only the lift on hover. */
.store-badge {
    display: block;
    padding: 15px;              /* a quarter of the badges' 60px height */
    transition: transform 0.3s ease;
}

.store-badge img {
    display: block;
    height: 60px;
    width: auto;
}

.store-badge:hover {
    transform: translateY(-5px);
}

/* Side by side, the GAP is centred under the heading, not the pair. The badges
 * are different widths (179px and 202px at 60px tall), so centring the pair put
 * the gap 11px off the heading's centre, which is the line the eye checks.
 * Two equal columns meet at the centre and each badge leans on that line. */
@media (min-width: 520px) {
    .download-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .store-badge:first-child { justify-self: end; }
    .store-badge:last-child { justify-self: start; }
}

.download-btn.pending {
    cursor: default;
    opacity: 0.75;
}

.download-btn.pending:hover {
    transform: none;
    border-color: rgba(255, 201, 60, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.download-icon {
    font-size: var(--text-md);
}

.download-btn small {
    color: var(--text-muted);
    display: block;
}

.download-btn strong {
    font-size: var(--text-base);
    letter-spacing: 1px;
}

.download-note {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* Footer */
.footer {
    background-color: var(--bg-darker);
    border-top: 1px solid rgba(255, 201, 60, 0.2);
    padding: var(--space-5) 0 var(--space-2);
    box-shadow: 0 -4px 30px rgba(255, 201, 60, 0.12);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.footer-section h4 {
    color: var(--primary);
    margin-bottom: var(--space-2);
    font-size: var(--text-base);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.footer-section p {
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--space-1);
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: var(--text-sm);
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 201, 60, 0.1);
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* Legal pages (privacy, terms) */
.policy-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-3);
}

.policy-container h1 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-3);
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.policy-container h2 {
    font-size: var(--text-md);
    color: var(--primary);
    margin-top: var(--space-4);
    margin-bottom: var(--space-2);
}

.policy-container h3 {
    font-size: 1.2rem;
    color: var(--accent-blue);
    margin-top: var(--space-3);
    margin-bottom: var(--space-1);
}

.policy-container p,
.policy-container ul,
.policy-container ol {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: var(--space-2);
}

.policy-container ul,
.policy-container ol {
    margin-left: var(--space-3);
}

.policy-container li {
    margin-bottom: var(--space-1);
}

.policy-container strong {
    color: var(--text-light);
}

.policy-container a {
    color: var(--primary);
}

.policy-container table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-3) 0;
    color: var(--text-muted);
}

.policy-container th {
    background: rgba(255, 201, 60, 0.1);
    color: var(--primary);
    padding: 0.75rem;
    text-align: left;
    border: 1px solid rgba(255, 201, 60, 0.2);
}

.policy-container td {
    padding: 0.75rem;
    border: 1px solid rgba(255, 201, 60, 0.2);
    vertical-align: top;
}

/* A three-column table cannot be narrower than its longest words plus padding,
 * which on a small phone is wider than the screen. There, each row becomes a
 * card: the first cell (who) as its title, the others under their column name,
 * taken from the cell's data-label. The header row is hidden from sight only,
 * so screen readers still announce it. */
@media (max-width: 480px) {
    .policy-container thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .policy-container table,
    .policy-container tbody,
    .policy-container tr,
    .policy-container td {
        display: block;
    }

    .policy-container tr {
        border: 1px solid rgba(255, 201, 60, 0.2);
        border-radius: 10px;
        background: rgba(255, 201, 60, 0.04);
        padding: 0.75rem;
        margin-bottom: var(--space-2);
    }

    .policy-container td {
        border: none;
        padding: 0.25rem 0;
    }

    .policy-container td:first-child {
        color: var(--text-light);
        font-weight: 600;
    }

    .policy-container td + td::before {
        content: attr(data-label);
        display: block;
        color: var(--primary);
        font-size: 0.8em;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }
}

.policy-container .updated {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}

.back-link {
    display: inline-block;
    margin-bottom: var(--space-3);
    color: var(--primary);
    text-decoration: none;
    font-size: var(--text-sm);
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--accent);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero .container {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .game-preview {
        height: auto;
    }

    .gameplay-screenshot {
        height: auto;
        width: 100%;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-darker);
        border-bottom: 1px solid rgba(255, 201, 60, 0.2);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        border-bottom: 1px solid rgba(242, 239, 230, 0.05);
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links a::after {
        display: none;
    }

    .navbar .container {
        position: relative;
    }

    .features h2,
    .gameplay h2,
    .download h2 {
        font-size: 2rem;
    }

    .download-buttons {
        flex-direction: column;
    }

    .download-btn {
        justify-content: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}
