:root {
    /* Color Palette - Industrial Steampunk & Grimdark */
    --bg-mud: #11100f; /* darker oily sludge */
    --bg-rust: #2A1A12;
    --bg-dark: #050505; /* soot black */
    --wood-panel: #171513; /* burnt iron hue */
    --dried-blood: #2d0f0f; 
    
    --text-primary: #D1C8B4;
    --text-muted: #8A8174;
    
    --aether-blue: #00FFCC; /* Stable industrial aether */
    --aether-magenta: #FF00FF; /* Raw resonant aether */
    --rust-orange: #B7410E;

    /* Typography */
    /* Typography */
    --font-header: 'Cinzel', serif; /* Classical, grimdark header */
    --font-sub: 'Oswald', sans-serif;
    --font-body: 'Cormorant Garamond', serif; /* Ornate, grimdark serif */
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
}

body {
    position: relative;
    overflow-x: hidden;
}

/* Grime Overlay */
.grime-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.15;
    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='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

h1, h2, h3 {
    text-transform: uppercase;
    letter-spacing: 2px;
}

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

.divider {
    width: 60px;
    height: 4px;
    background: var(--rust-orange);
    margin: 1rem 0 3rem 0;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    position: absolute;
    width: 100%;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: var(--font-header);
    font-size: 2rem;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

nav a {
    margin-left: 2rem;
    font-family: var(--font-sub);
    font-size: 1.1rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.back-link {
    color: var(--rust-orange);
    border: 1px solid var(--rust-orange);
    padding: 0.4rem 1rem;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background: radial-gradient(circle at center, var(--bg-rust) 0%, var(--bg-dark) 90%);
    overflow: hidden;
    box-shadow: inset 0 0 100px 50px rgba(0,0,0,0.8);
}

.aether-pulse {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0,255,204,0.05) 0%, rgba(0,0,0,0) 70%); /* Significantly dimmed */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 4s infinite alternate;
    z-index: 1;
    pointer-events: none;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

/* Harnessed Aether (Blue-White) Highlight */
.harnessed-aether {
    transition: all 0.4s ease;
}

/* Idle animation for buttons */
.btn.harnessed-aether {
    animation: harnessed-btn-idle 3s infinite alternate;
}

.btn.harnessed-aether:hover {
    animation: none;
    border-color: var(--aether-blue);
    color: var(--aether-blue); /* Was #e6fffa (near white) */
    text-shadow: 0 0 5px rgba(0,255,204,0.5); /* Dimmed */
    box-shadow: 0 0 10px rgba(0,255,204,0.2) inset, 0 0 15px rgba(0,255,204,0.2); /* Dimmed and spread out */
    background: rgba(0,255,204,0.05);
}

@keyframes harnessed-btn-idle {
    0% { border-color: rgba(0,255,204,0.1); box-shadow: 0 0 5px rgba(0,255,204,0.05) inset; }
    100% { border-color: rgba(0,255,204,0.3); box-shadow: 0 0 10px rgba(0,255,204,0.1) inset; color: rgba(209, 200, 180, 1); }
}

/* Idle animation for text (like Logo) */
.logo.harnessed-aether {
    animation: harnessed-text-idle 4s infinite alternate;
}

.logo.harnessed-aether:hover {
    animation: none;
    color: var(--aether-blue); /* Was #e6fffa (near white) */
    text-shadow: 0 0 8px var(--aether-blue), 0 0 15px rgba(0, 255, 204, 0.5); /* Dimmed */
}

@keyframes harnessed-text-idle {
    0% { text-shadow: 0 0 5px rgba(0,255,204,0.1); }
    100% { text-shadow: 0 0 10px rgba(0,255,204,0.3); }
}

/* Raw Aether (Magenta) Crackle Animation */
.raw-aether {
    position: relative;
}
.raw-aether::before, .raw-aether::after {
    content: '';
    position: absolute;
    top: -6px; left: -6px; right: -6px; bottom: -6px;
    background: transparent;
    border: 2px solid var(--aether-magenta);
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: screen;
}
.raw-aether::before { animation: crackle-1 0.7s infinite; filter: drop-shadow(0 0 5px var(--aether-magenta)); }
.raw-aether::after { animation: crackle-2 0.5s infinite reverse; filter: blur(3px) drop-shadow(0 0 8px var(--aether-magenta)); }

@keyframes crackle-1 {
    0%, 20%, 40%, 60%, 80%, 100% { opacity: 0; transform: scale(1) translate(0, 0); clip-path: inset(0 0 0 0); }
    10% { opacity: 1; transform: scale(1.05) skewX(10deg) translate(-2px, 3px); clip-path: inset(10% 0 20% 0); }
    30% { opacity: 0.8; transform: scale(0.95) skewY(-15deg) translate(4px, -1px); clip-path: inset(80% 0 5% 0); }
    50% { opacity: 1; transform: scale(1.1) skewX(-20deg) translate(-3px, -4px); clip-path: inset(40% 0 40% 0); }
    70% { opacity: 0.9; transform: scale(0.9) skewY(5deg) translate(5px, 2px); clip-path: inset(5% 0 70% 0); }
    90% { opacity: 1; transform: scale(1.08) skewX(8deg) translate(-1px, -5px); clip-path: inset(60% 0 10% 0); }
}

@keyframes crackle-2 {
    0%, 25%, 50%, 75%, 100% { opacity: 0; transform: scale(1) translate(0, 0); clip-path: inset(0 0 0 0); }
    12% { opacity: 0.9; transform: scale(1.1) skewY(15deg) translate(3px, -3px); clip-path: inset(20% 0 60% 0); }
    37% { opacity: 1; transform: scale(0.9) skewX(-10deg) translate(-4px, 4px); clip-path: inset(50% 0 30% 0); }
    62% { opacity: 0.8; transform: scale(1.15) skewY(-8deg) translate(2px, 5px); clip-path: inset(5% 0 80% 0); }
    87% { opacity: 1; transform: scale(0.95) skewX(25deg) translate(-5px, -2px); clip-path: inset(70% 0 15% 0); }
}

.hero-content {
    position: relative;
    z-index: 10;
}

.title-aether-flare {
    font-family: var(--font-header);
    font-size: 5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    position: relative;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.1);
    animation: aether-breathe 4s ease-in-out infinite alternate;
}

@keyframes aether-breathe {
    0% {
        text-shadow: 2px 2px 5px rgba(0,0,0,0.8), 0 0 10px rgba(0, 0, 0, 0.5);
        color: var(--text-primary);
    }
    100% {
        text-shadow: 2px 2px 5px rgba(0,0,0,0.8), 0 0 15px rgba(0, 255, 204, 0.15); /* Very subtle pop */
        color: #f0ebe1;
    }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-family: var(--font-sub);
    font-size: 1.1rem;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    border: 1px solid;
    border-radius: 2px;
}

.primary-btn {
    background: transparent;
    border-color: var(--text-muted);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(0,0,0,0.5) inset;
}

.primary-btn:hover {
    background: var(--text-primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(209, 200, 180, 0.2);
}

.secondary-btn {
    background: rgba(45, 15, 15, 0.4); /* Dried blood tint */
    border-color: var(--rust-orange);
    color: #df9e7d;
    margin-left: 1rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.secondary-btn:hover {
    background: rgba(183, 65, 14, 0.2);
}

/* About Section */
.about-section {
    background: 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='1.2' 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"), var(--bg-mud);
    border-top: 2px solid var(--dried-blood);
    border-bottom: 2px solid var(--dried-blood);
    box-shadow: inset 0 20px 50px rgba(0,0,0,0.5), inset 0 -20px 50px rgba(0,0,0,0.5);
}

.about-section h2 {
    font-family: var(--font-header);
    font-size: 2.5rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.about-text h3 {
    font-family: var(--font-sub);
    color: var(--aether-blue);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.about-image-placeholder {
    width: 100%;
    height: 350px;
    background: #111;
    border: 3px solid #333;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-label {
    font-family: var(--font-sub);
    color: #444;
    z-index: 2;
}

.static-noise {
    position: absolute;
    inset: -20%;
    width: 140%;
    height: 140%;
    opacity: 0.08;
    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.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    animation: static-subtle 8s steps(10) infinite;
}

@keyframes static-subtle {
    0% { transform: translate(0,0) }
    10% { transform: translate(-1%,-1%) }
    20% { transform: translate(-2%,1%) }
    30% { transform: translate(1%,-2%) }
    40% { transform: translate(-1%,3%) }
    50% { transform: translate(-2%,1%) }
    60% { transform: translate(3%,0) }
    70% { transform: translate(0,3%) }
    80% { transform: translate(1%,5%) }
    90% { transform: translate(-2%,2%) }
    100% { transform: translate(0,0) }
}

/* Classes Section */
.classes-section h2 {
    font-family: var(--font-header);
    font-size: 2.5rem;
    text-align: center;
}

.classes-section .divider {
    margin: 1rem auto 3rem auto;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.class-card {
    background: var(--wood-panel);
    border: 1px solid var(--bg-dark);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), inset 0 0 30px rgba(0,0,0,0.4);
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    border-radius: 4px; /* Slight organic rounding */
}

.class-card:hover {
    transform: translateY(-10px);
    border-color: var(--text-muted);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.temp-icon {
    width: 60px;
    height: 60px;
    background: #222;
    border: 2px solid var(--rust-orange);
    border-radius: 50%;
    margin: 0 auto 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-header);
    font-size: 1.5rem;
    color: var(--aether-blue);
}

.class-card h3 {
    font-family: var(--font-sub);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

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

/* CTA */
.cta-section {
    text-align: center;
    background: radial-gradient(circle, var(--wood-panel) 0%, var(--bg-dark) 100%);
    padding: 8rem 2rem;
    border-top: 1px solid var(--dried-blood);
}

.cta-section h2 {
    font-family: var(--font-header);
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--rust-orange);
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.newsletter-form {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    max-width: 600px;
    margin: 0 auto;
    height: 60px; /* Fixed height guarantees perfect alignment */
}

.newsletter-form input {
    flex-grow: 1;
    height: 100%;
    padding: 0 1.5rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--dried-blood);
    border-right: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.1rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
    margin: 0;
}

.newsletter-form input::placeholder {
    color: var(--text-muted);
}

/* Fix for Chrome autofill white background */
.newsletter-form input:-webkit-autofill,
.newsletter-form input:-webkit-autofill:hover, 
.newsletter-form input:-webkit-autofill:focus, 
.newsletter-form input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0D0C0A inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--rust-orange);
}

.newsletter-form button {
    height: 100%;
    border-radius: 0;
    margin: 0;
    padding: 0 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    border-top: 3px solid #111;
    font-size: 0.9rem;
    color: #444;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .title-glitch {
        font-size: 3rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav a {
        margin: 0 0.5rem;
        font-size: 0.9rem;
    }
}
