@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600&family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Core Monochrome Palette */
    --bg: #fafadf;
    --bg-alt: #f2f2d2;
    --bg-cream: #f5f0e4;
    --fg: #1a1a16;
    --fg-2: #5e5e54;
    
    /* Legacy variables mapping to prevent inline style breakage */
    --bg-obsidian: var(--bg);
    --bg-purple: var(--bg-alt);
    --bg-surface: var(--bg-cream);
    --gold-gradient: var(--fg);
    --gold-glow: transparent;
    --purple-gradient: var(--fg);
    --purple-glow: transparent;
    --amber-gradient: var(--fg);
    --amber-glow: transparent;
    --premium-blend: var(--fg);
    
    /* Disabling glassmorphism in favor of stark ledger lines */
    --glass-bg: transparent;
    --glass-border: 1px solid var(--fg);
    --glass-shadow: none;

    /* Text */
    --text-primary: var(--fg);
    --text-secondary: var(--fg-2);
    --text-muted: var(--fg-2);
    
    /* Typography */
    --font-heading: 'Lora', serif;
    --font-body: 'Jost', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing & Layout */
    --container-width: 1000px; /* Narrower, more focused ledger layout */
    --game-width: 1000px;
    --spacing-desktop: 100px;
    --spacing-tablet: 70px;
    --spacing-mobile: 40px;
    
    /* Radii (Sharpened to zero for a structured look) */
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text-secondary);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
    font-size: 18px;
}

/* Remove decorative background noise */
body::before, .particles {
    display: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

p {
    margin-bottom: 1.5rem;
}

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

.section-spacing {
    padding: var(--spacing-desktop) 0;
}

/* Grayscale all images to fit the ink-and-paper aesthetic */
img, iframe {
    filter: grayscale(100%) contrast(1.1);
}

/* Typography Classes */
.text-gold {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    color: var(--fg);
    font-style: italic;
    font-family: var(--font-heading);
    font-weight: 600;
}

.h-mega {
    font-size: clamp(2.5rem, 4vw, 4rem);
    text-shadow: none;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.h-section {
    font-size: clamp(2rem, 3vw, 2.5rem);
    text-shadow: none;
    margin-bottom: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--fg);
    padding-bottom: 15px;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 650px;
    font-family: var(--font-body);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 0;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--fg);
    outline: none;
    position: relative;
    z-index: 1;
}

.btn-primary {
    background: var(--fg);
    color: var(--bg);
    box-shadow: none;
}

.btn-primary::before {
    display: none;
}

.btn-primary:hover {
    transform: none;
    box-shadow: 4px 4px 0 var(--fg);
    background: var(--bg);
    color: var(--fg);
}

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

.btn-secondary:hover {
    background: var(--fg);
    color: var(--bg);
    box-shadow: 4px 4px 0 var(--fg);
}

/* Header Navigation (Improved Layout) */
.header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    background: var(--bg);
    border-bottom: 1px solid var(--fg);
    height: 80px; /* Fixed height for clean layout */
}

.nav-glass {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: var(--container-width);
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: 1px;
    text-transform: uppercase;
    flex: 1; /* Match nav-right flex to center links perfectly */
    min-width: 0; /* Prevents overflow issues */
}

.logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    animation: none;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    list-style: none;
    flex: none;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--fg-2);
    position: relative;
    padding: 8px 0;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--fg);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    box-shadow: none;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--fg);
}

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

.nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    flex: 1; /* Match logo flex */
    min-width: 0;
}

.nav-btn {
    padding: 10px 24px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--fg);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Hero Section */
.hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 60px;
    background: var(--bg);
}

.hero::before {
    display: none;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-text {
    width: 100%;
}

.hero-actions {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    justify-content: center;
}

.hero-disclaimer {
    margin-top: 30px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--fg-2);
    border: 1px dashed var(--fg);
    background: var(--bg-alt);
    padding: 8px 15px;
    display: inline-block;
}

/* Game Section */
.game-section {
    position: relative;
    z-index: 2;
    background: var(--bg-cream);
    border-top: 1px solid var(--fg);
    border-bottom: 1px solid var(--fg);
}

.game-header {
    text-align: center;
    margin-bottom: 40px;
}

.game-wrapper {
    max-width: var(--game-width);
    margin: 0 auto;
    background: var(--bg);
    border-radius: 0;
    padding: 10px;
    border: 1px solid var(--fg);
    box-shadow: 6px 6px 0 var(--fg);
    position: relative;
    transition: none;
}

.game-wrapper:hover {
    box-shadow: 8px 8px 0 var(--fg);
    transform: translateY(-2px);
    border-color: var(--fg);
}

.game-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 0;
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--fg);
}

.game-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-alt);
    border: 1px solid var(--fg);
    border-top: none;
    border-radius: 0;
    margin-top: 0;
    position: relative;
    z-index: 3;
}

.game-controls button {
    background: none;
    border: none;
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
    text-transform: uppercase;
}

.game-controls button:hover {
    color: var(--fg);
    text-shadow: none;
    text-decoration: underline;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--fg);
    border-radius: 0;
    padding: 40px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 4px 4px 0 var(--fg);
}

.feature-card::before {
    display: none;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 0 var(--fg);
    background: var(--bg-alt);
}

.fc-1 { grid-column: span 8; }
.fc-2 { grid-column: span 4; }
.fc-3 { grid-column: span 4; }
.fc-4 { grid-column: span 4; }
.fc-5 { grid-column: span 4; }

.feature-icon {
    font-size: 2rem;
    margin-bottom: 20px;
    display: inline-block;
    filter: none;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-family: var(--font-heading);
}

/* Stats Section */
.stats-section {
    background: var(--bg-alt);
    border-top: 1px solid var(--fg);
    border-bottom: 1px solid var(--fg);
    position: relative;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    text-align: center;
    border-left: 1px solid var(--fg);
    border-right: 1px solid var(--fg);
}

.stat-item {
    padding: 40px 20px;
    border-right: 1px solid var(--fg);
}
.stat-item:last-child {
    border-right: none;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 400;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    color: var(--fg);
    margin-bottom: 10px;
    filter: none;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--fg-2);
}

/* Forms (Contact Page) */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--fg);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-alt);
    border: 1px solid var(--fg);
    border-radius: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--fg);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    background: var(--bg);
    box-shadow: 3px 3px 0 var(--fg);
}

/* Footer */
.footer {
    background: var(--bg);
    border-top: 1px solid var(--fg);
    padding: 80px 0 30px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    display: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-brand .logo {
    margin-bottom: 20px;
    color: var(--fg);
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-title {
    font-family: var(--font-mono);
    color: var(--fg);
    font-size: 1rem;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: -8px; left: 0;
    width: 40px; height: 1px;
    background: var(--fg);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--fg);
    text-decoration: underline;
    padding-left: 0;
}

.footer-contact p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px dashed var(--fg);
}

.footer-disclaimer {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 20px;
    line-height: 1.8;
}

.copyright {
    font-size: 0.85rem;
    color: var(--fg-2);
    font-family: var(--font-mono);
}

/* Legal Pages Styling */
.page-header {
    padding: 100px 0 60px;
    text-align: center;
    background: var(--bg-cream);
    border-bottom: 1px solid var(--fg);
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg);
    border: 1px solid var(--fg);
    border-radius: 0;
    padding: 60px;
    box-shadow: 8px 8px 0 var(--fg);
    margin-top: -30px;
    position: relative;
    z-index: 10;
    margin-bottom: var(--spacing-desktop);
}

.legal-content h2 {
    font-size: 1.8rem;
    margin: 40px 0 20px;
    color: var(--fg);
    border-bottom: 1px dashed var(--fg);
    padding-bottom: 10px;
}

.legal-content h3 {
    font-size: 1.3rem;
    margin: 30px 0 15px;
    color: var(--fg);
}

.legal-content p, .legal-content li {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.8;
}

.legal-content ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

/* Nullify Old Animations */
@keyframes floatingSand {}
@keyframes floatImage {}
@keyframes pulseGlow {}
@keyframes softPulse {}

/* Media Queries */
@media (max-width: 1024px) {
    :root {
        --spacing-desktop: var(--spacing-tablet);
    }
    
    .nav-links {
        gap: 20px;
    }
    
    .logo {
        font-size: 1.2rem;
    }

    .hero-content {
        padding-top: 40px;
    }

    .hero-text {
        margin: 0 auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .fc-1, .fc-2, .fc-3, .fc-4, .fc-5 {
        grid-column: span 1;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        border: none;
    }
    
    .stat-item {
        border-bottom: 1px solid var(--fg);
    }
    .stat-item:nth-child(even) {
        border-right: none;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-desktop: var(--spacing-mobile);
    }

    .header {
        height: 70px;
    }

    .nav-glass {
        padding: 0 20px;
    }

    .logo {
        flex: auto;
    }

    .nav-right {
        flex: auto;
    }

    .nav-links, .nav-btn {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .h-mega {
        font-size: 2.2rem;
    }

    .h-section {
        font-size: 1.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        border-right: none !important;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .game-controls {
        flex-direction: column;
        gap: 15px;
    }

    .legal-content {
        padding: 30px 20px;
        margin-left: 20px;
        margin-right: 20px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}