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

:root {
    /* Palette. Take these from the game's own CSS or theme config -
       a site in the game's colors reads as part of the game. */
    --primary: #e8c468;      /* brand color: buttons, headings, links */
    --primary-dark: #c9962b;
    --bg-dark: #0c0f19;           /* page background */
    --bg-darker: #070911;
    --text-light: #efedf8;       /* body text */
    --text-muted: #b9c0d8;
    --accent: #e0803a;        /* second accent: outline buttons, gradients */
    --accent-dark: #c2641c;   /* shadows and pressed states */
    --accent-blue: #8fe8ff;          /* cool accent: subtitles, step gradients */

    /* 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: 'Alegreya Sans', Georgia, 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(12, 15, 25, 0.95);
    backdrop-filter: blur(10px);
    padding: var(--space-2) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(232, 196, 104, 0.2);
    box-shadow: 0 4px 30px rgba(232, 196, 104, 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(143, 232, 255, 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(224, 128, 58, 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(224, 128, 58, 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: #2a1e08;
    box-shadow: 0 10px 30px rgba(232, 196, 104, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(232, 196, 104, 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;
}

.gameplay-screenshot {
    max-width: 100%;
    width: auto;
    height: 560px;
    border: 2px solid var(--primary);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(232, 196, 104, 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(232, 196, 104, 0.5);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(224, 128, 58, 0.25);
    animation: float 3s ease-in-out infinite;
    background: #070911;
}

@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, 9, 17, 0.6);
    border-top: 1px solid rgba(232, 196, 104, 0.1);
    border-bottom: 1px solid rgba(232, 196, 104, 0.1);
    box-shadow: 0 -4px 30px rgba(232, 196, 104, 0.1), 0 4px 30px rgba(232, 196, 104, 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;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-4);
}

.feature-card {
    background: linear-gradient(135deg, rgba(232, 196, 104, 0.05) 0%, rgba(143, 232, 255, 0.05) 100%);
    border: 1px solid rgba(232, 196, 104, 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(232, 196, 104, 0.1) 0%, rgba(143, 232, 255, 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(232, 196, 104, 0.1), 0 4px 30px rgba(232, 196, 104, 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(232, 196, 104, 0.35);
    border-bottom-width: 3px;
    border-radius: 6px;
    background: rgba(232, 196, 104, 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(232, 196, 104, 0.1) 0%, rgba(224, 128, 58, 0.1) 100%);
    border-top: 1px solid rgba(232, 196, 104, 0.2);
    text-align: center;
    box-shadow: 0 -4px 30px rgba(232, 196, 104, 0.12), 0 4px 30px rgba(232, 196, 104, 0.12);
}

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

.download-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    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(232, 196, 104, 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(232, 196, 104, 0.2) 0%, rgba(224, 128, 58, 0.2) 100%);
    transform: translateY(-5px);
}

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

.download-btn.pending:hover {
    transform: none;
    border-color: rgba(232, 196, 104, 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(232, 196, 104, 0.2);
    padding: var(--space-5) 0 var(--space-2);
    box-shadow: 0 -4px 30px rgba(232, 196, 104, 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(232, 196, 104, 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(232, 196, 104, 0.1);
    color: var(--primary);
    padding: 0.75rem;
    text-align: left;
    border: 1px solid rgba(232, 196, 104, 0.2);
}

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

.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(232, 196, 104, 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(239, 237, 248, 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;
    }
}

/* Text wordmark in the nav, for games without a logo image.
   With an image brand, use `.nav-brand img` above and delete this rule. */
.nav-brand {
    font-weight: 700;
    font-size: var(--text-base);
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary);
    text-decoration: none;
}

/* Ragnarök Cycle: titles in Cinzel, the game's own heading face */
h1, h2, h3, .nav-brand, .hero-title, .footer h4 {
    font-family: 'Cinzel', Georgia, serif;
    letter-spacing: 0.02em;
}
