/* --- Variables & Reset --- */
:root {
    --primary: #d97706;
    /* Ochre/Gold */
    --primary-glow: #fbbf24;
    --secondary: #0f766e;
    /* Deep Teal */
    --bg-dark: #1c1917;
    /* Stone Dark Grey */
    --bg-card: #292524;
    --text-light: #e7e5e4;
    /* Warm Grey */
    --text-muted: #a8a29e;
    --accent: #ef4444;
    /* Ruby Red */

    --font-heading: 'VT323', monospace;
    --font-body: 'Inter', sans-serif;

    --container-width: 1200px;
    --header-height: 80px;

    --scanline-color: rgba(0, 0, 0, 0.5);
    --gold-border: 2px solid var(--primary);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    /* scroll-snap-type moved to desktop media query */
}

body {
    background-color: var(--bg-dark);
    background-image: url('assets/slate.png');
    /* background-blend-mode: multiply; Removed to make texture visible */
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-light);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Typography --- */
h1,
h2,
h3,
.logo {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1;
    margin-bottom: 1rem;
    color: var(--text-light);
    text-shadow: 2px 2px 0px #000;
}

h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.8rem;
    color: var(--text-light);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* --- Layout Utils --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.center {
    text-align: center;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #0c0a09;
    border-left: 1px solid #444;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border: 2px solid #0c0a09;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-glow);
}

/* --- Scanlines Overlay --- */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.2) 50%,
            rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.15;
    /* Reduced from 0.6 for better visibility */
}

/* --- Header --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: transparent;
    backdrop-filter: none;
    border-bottom: 1px solid transparent;
    z-index: 999;
    display: flex;
    align-items: center;
    transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
}

.site-header.scrolled {
    background: rgba(28, 25, 23, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.8rem;
    color: var(--primary);
    text-shadow: 2px 2px 0 #000, 0 0 20px rgba(0, 0, 0, 0.8);
    /* Strong shadow for contrast */
    font-weight: bold;
}

/* .logo-img removed as requested */

.desktop-nav a {
    margin-left: 2rem;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-light);
    text-shadow: 1px 1px 0 #000;
    /* Added shadow for readability */
}

.desktop-nav a:hover {
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary);
}

.desktop-nav .highlight-link {
    color: var(--primary-glow);
    border-bottom: 2px solid var(--accent);
}

.mobile-menu-toggle {
    display: none;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
}

.mobile-nav {
    display: none;
    /* JS will toggle */
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--bg-dark);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--primary);
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav a {
    padding: 1rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding-top: var(--header-height);
    scroll-snap-align: start;
    /* Snap to top of this section */
}

.hero-bg-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Dark low-poly forest render */
    background: url('assets/world.png') no-repeat center center/cover;
    z-index: -1;
}

/* Use a Pseudo-element for pattern to simulate texture AND darken image */
.hero-bg-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Subtle gradient to let art show through but keep text readable */
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    animation: fadeIn 1s ease-out;
}

.subtitle {
    font-size: 1.2rem;
    color: #fff;
    /* Brighter than text-muted */
    margin-bottom: 2.5rem;
    letter-spacing: 0.05em;
    text-shadow: 1px 1px 2px #000;
    /* Shadow for readability */
}

.cta-button {
    display: inline-block;
    background-color: var(--accent);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    padding: 1rem 2.5rem;
    border: 4px solid #7f1d1d;
    /* Dark red border for 3D effect */
    border-right-color: #7f1d1d;
    border-bottom-color: #7f1d1d;
    border-left-color: #ef4444;
    border-top-color: #ef4444;
    box-shadow: 4px 4px 0px #000;
    transition: transform 0.1s, box-shadow 0.1s;
    text-transform: uppercase;
}

.cta-button:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px #000;
}

.cta-button:hover {
    filter: brightness(1.1);
}

/* --- Vision Section --- */
.vision-section {
    padding: 6rem 0;
    min-height: 100vh;
    /* Ensure it takes at least full viewport */
    display: flex;
    align-items: center;
    background: rgba(23, 23, 23, 0.75);
    /* Reduced opacity */
    /* Semi-transparent to show slate texture */
    overflow: hidden;
    position: relative;
    /* Ensure z-index works with texture behind */
    scroll-snap-align: start;
}

.vision-container {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.vision-text {
    flex: 1;
}

.vision-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.vision-text strong {
    color: var(--primary);
}

.vision-image {
    flex: 1;
    /* height: 300px; Remove fixed height to let image dictate or constrain max-width */
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-asset {
    max-width: 100%;
    height: auto;
    /* Removed border, shadow, and filter */
    transition: transform 0.3s;
}

.feature-asset:hover {
    transform: scale(1.02);
}

/* --- Mechanics Section --- */
.mechanics-section {
    padding: 6rem 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(23, 23, 23, 0.5);
    /* Reduced opacity */
    /* Slightly lighter/different alpha */
    position: relative;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    scroll-snap-align: start;
}

.mechanics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    /* lowered to 200px */
    gap: 2rem;
    margin-top: 3rem;
}

.mechanic-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 1.5rem;
    /* reduced padding */
    border: 1px solid #444;
    transition: transform 0.3s ease;
    text-align: center;
}

.mechanic-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.mechanic-item .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    /* Optional: filter to align emoji colors if needed, but default is fine */
}

.mechanic-item h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.mechanic-item p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* --- Careers Section --- */
.careers-section {
    padding: 6rem 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(28, 25, 23, 0.75);
    /* Reduced opacity */
    scroll-snap-align: start;
}

.section-subtitle {
    margin-bottom: 2rem;
    font-family: var(--font-heading);
    color: var(--text-muted);
}

.hiring-notice {
    text-align: center;
    margin-bottom: 3rem;
}

.hiring-notice p {
    display: inline-block;
    background: rgba(0, 0, 0, 0.6);
    border: 1px dashed var(--primary);
    padding: 0.8rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-light);
}

.hiring-notice a {
    color: var(--primary);
    border-bottom: 1px solid var(--primary);
}

.hiring-notice a:hover {
    color: var(--primary-glow);
    border-bottom-color: var(--primary-glow);
    text-shadow: 0 0 5px var(--primary);
}

.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    /* lowered to 200px */
    gap: 1.5rem;
}

.quest-card {
    position: relative;
    background: var(--bg-card);
    padding: 1.5rem;
    /* reduced padding */
    border: 1px solid #444;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Ensure all cards are same height */
    /* Parchment texture simulation */
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' opacity='0.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
}

.card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Pixel corners using pseudo-elements */
.quest-card::before,
.quest-card::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary);
    transition: background 0.3s;
}

.quest-card::before {
    top: -1px;
    left: -1px;
}

.quest-card::after {
    bottom: -1px;
    right: -1px;
}

.quest-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(217, 119, 6, 0.2);
    transform: translateY(-5px);
}

.quest-card h3 {
    margin-bottom: 0.5rem;
}

.tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.5);
    color: var(--primary);
    /* Gold text for readability */
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--primary);
    /* Gold border */
    font-family: var(--font-body);
    /* Changed to body font for readability */
    font-weight: 600;
    /* Bold */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quest-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.quest-view {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--primary);
    border-bottom: 1px dashed var(--primary);
    margin-top: auto;
    align-self: flex-start;
}

/* --- Modal --- */
.quest-modal {
    margin: auto;
    background: transparent;
    border: none;
    padding: 0;
    max-width: 600px;
    width: 90%;
    color: var(--text-light);
}

.quest-modal::backdrop {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-inner {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    padding: 2rem;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--primary);
}

.modal-body {
    margin-top: 1.5rem;
    text-align: left;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 1rem;
    /* Space for scrollbar */
}

/* Custom Scrollbar for Modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

#modal-desc {
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 1rem;
}

.modal-body h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.2rem;
}

.modal-body ul {
    list-style: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-body strong {
    color: var(--text-light);
}

.modal-actions {
    text-align: right;
    border-top: 1px solid #333;
    padding-top: 1rem;
    margin-top: 1rem;
}

/* --- Footer --- */
.site-footer {
    padding: 2rem 0;
    border-top: 1px solid #333;
    font-family: var(--font-heading);
    color: var(--text-light);
    /* Lighter text */
    background: rgba(0, 0, 0, 0.8);
    /* Dark background for contrast */
    scroll-snap-align: start;
    /* Snap to footer too */
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links a {
    margin-left: 1rem;
    color: var(--text-light);
    /* Visible white text */
}

.social-links a:hover {
    color: var(--primary);
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    transform: translateX(-50px);
    opacity: 0;
    transition: all 0.8s ease-out;
}

.slide-in-right {
    transform: translateX(50px);
    opacity: 0;
    transition: all 0.8s ease-out;
}

.fade-section.visible .slide-in-left,
.fade-section.visible .slide-in-right {
    transform: translateX(0);
    opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .header-inner {
        padding: 0 1rem;
    }

    .desktop-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    h1 {
        font-size: 3rem;
    }

    .vision-container {
        flex-direction: column;
    }

    .vision-image {
        width: 100%;
    }
}

@media (min-width: 1100px) {

    .jobs-grid,
    .mechanics-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Enable Scroll Snap ONLY on Desktop */
    html {
        scroll-snap-type: y mandatory;
        height: 100%;
    }

    .hero-section,
    .vision-section,
    .mechanics-section,
    .careers-section,
    .site-footer {
        scroll-snap-align: start;
    }
}