/* EPIC / GRIMDARK THEME VARIABLES */
:root {
    --color-blood: #8a1c1c;
    --color-blood-dark: #450a0a;
    --color-gold: #c5a059;
    --color-gold-dim: #856a35;
    --color-obsidian: #0a0a0af0;
    --color-mist: rgba(200, 210, 220, 0.05);

    --shadow-inner-glow: inset 0 0 20px rgba(197, 160, 89, 0.1);
    --shadow-blood-glow: 0 0 15px rgba(138, 28, 28, 0.5);
}

/* BACKGROUND TEXTURES */
.bg-grimdark {
    background-color: #050505;
    background-image:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.9)),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
    background-attachment: fixed;
}

/* TYPOGRAPHY */
.font-epic {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.text-gold-gradient {
    background: linear-gradient(180deg, #ebdcb2 0%, #c5a059 50%, #856a35 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px rgba(197, 160, 89, 0.3);
}

/* COMPONENTS */

/* 1. Epic Button (The Forge) */
.btn-epic-forge {
    position: relative;
    background: linear-gradient(180deg, #2a0a0a 0%, #450a0a 100%);
    border: 1px solid #c5a059;
    color: #ebdcb2;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.8);
    z-index: 10;
}

.btn-epic-forge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(197, 160, 89, 0.4) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn-epic-forge:hover {
    border-color: #ffe6a0;
    box-shadow: 0 0 25px rgba(138, 28, 28, 0.6), inset 0 0 10px rgba(197, 160, 89, 0.2);
    transform: translateY(-2px);
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 200, 100, 0.8);
}

.btn-epic-forge:hover::before {
    opacity: 1;
    animation: pulse-glow 2s infinite;
}

/* 2. Glass Cards (Grimdark Variant) */
.card-grim {
    background: rgba(10, 8, 8, 0.85);
    border: 1px solid rgba(197, 160, 89, 0.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.card-grim:hover {
    border-color: rgba(138, 28, 28, 0.5);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(138, 28, 28, 0.1);
    transform: translateY(-5px);
}

.card-grim::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.03) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s;
    /* Aquest degradat és només decoratiu i cobreix tota la targeta. Sense
       aquesta línia s'empassava els clics de qualsevol botó o enllaç de
       dins: per això els desplegables de les FAQ no s'obrien. */
    pointer-events: none;
}

.card-grim:hover::after {
    opacity: 1;
}

/* 3. Fog Animation */
.fog-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

/* Simple fog implementation using pure CSS gradient animation if image fails, but logic implies overlay */
.fog-layer {
    position: absolute;
    width: 200%;
    height: 100%;
    /* Subtle fog texture via CSS gradient noise simulation */
    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='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.4'/%3E%3C/svg%3E");
    mask-image: linear-gradient(to bottom, transparent, black, transparent);
    animation: fog-drift 60s linear infinite;
    opacity: 0.1;
}

@keyframes fog-drift {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }
}

/* 4. Section Dividers */
.divider-rune {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4rem 0;
    opacity: 0.8;
}

.divider-rune::before,
.divider-rune::after {
    content: '';
    height: 1px;
    width: 20%;
    min-width: 40px;
    max-width: 15vh;
    background: linear-gradient(90deg, transparent, #c5a059, transparent);
    margin: 0 1.5rem;
}

.divider-icon {
    color: #c5a059;
    font-size: 2rem;
    filter: drop-shadow(0 0 8px rgba(197, 160, 89, 0.6));
    animation: pulse-glow 3s infinite ease-in-out;
}

/* 5. Values / History Section (Stone Tablet) */
.bg-stone-tablet {
    background-color: #151212;
    /* Noise texture overlay */
    background-image:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.6)),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    border: 1px solid #5a4a42;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.9),
        inset 0 0 60px rgba(0, 0, 0, 0.8),
        inset 0 0 10px #3a2a22;
    position: relative;
    border-radius: 4px;
}

.bg-stone-tablet::before {
    /* Inner border effect */
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(197, 160, 89, 0.15);
    pointer-events: none;
    z-index: 1;
}

.text-rune-glow {
    color: #ebdcb2;
    text-shadow: 0 0 10px rgba(197, 160, 89, 0.5);
    font-weight: 700;
    transition: all 0.3s ease;
}

.text-rune-glow:hover {
    color: #fff;
    text-shadow: 0 0 15px rgba(197, 160, 89, 0.8), 0 0 30px rgba(197, 160, 89, 0.4);
    cursor: default;
}

/* 6. Language Switcher */
.lang-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: 1.5rem;
    padding-left: 1.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    filter: grayscale(80%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
}

.lang-btn:hover {
    opacity: 0.8;
    filter: grayscale(0%);
    border-color: #8a1c1c;
}

.lang-btn.active {
    opacity: 1;
    filter: grayscale(0%);
    border-color: #c5a059;
    box-shadow: 0 0 10px rgba(197, 160, 89, 0.4);
    transform: scale(1.1);
}

.lang-btn svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}