/*
 * ╔══════════════════════════════════════════════════════════════════╗
 * ║       ᚱ  YGGDRASIL NEON — BASE16 THEME  ᚱ                       ║
 * ║  A fusion of Norse rune-logic and neon forge-light.              ║
 * ║  Palette derived from the World Tree's glowing circuitry.        ║
 * ╚══════════════════════════════════════════════════════════════════╝
 */

/* == BASE16 COLOUR SYSTEM == */
:root {
    /* -- Backgrounds -- */
    --base00: #0a0e14;  /* Background — near-black with blue tint */
    --base01: #111923;  /* Lighter background — card surfaces */
    --base02: #1a2332;  /* Selection / hover states */
    --base03: #2d3b4f;  /* Comments / muted text */

    /* -- Foregrounds -- */
    --base04: #4a5567;  /* Dark foreground — labels */
    --base05: #b0bec5;  /* Default foreground text */
    --base06: #d0dce4;  /* Light foreground */
    --base07: #eceff1;  /* Brightest foreground */

    /* -- Accents -- */
    --base08: #ed4245;  /* Red — errors, stop-loss */
    --base09: #eb459e;  /* Pink/magenta — sweep events */
    --base0A: #fee75c;  /* Yellow — warnings, Thor's lightning */
    --base0B: #57f287;  /* Green — success, Njord's growth */
    --base0C: #00e5ff;  /* Cyan — circuits, Odin's eye */
    --base0D: #5865f2;  /* Blue — Discord blurple, info */
    --base0E: #b388ff;  /* Purple — Loki, Jormungandr */
    --base0F: #ff6e40;  /* Orange — Brokkr's forge fire */

    /* -- Derived values -- */
    --glass-bg: rgba(17, 25, 35, 0.65);
    --glass-border: rgba(176, 190, 197, 0.12);
    --glass-blur: 16px;
    --card-radius: 12px;
    --glow-spread: 20px;
}

/* == RESET & BASE == */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
    background-color: var(--base00);
    color: var(--base05);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* == BACKDROP IMAGE == */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/img/backdrop.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

.backdrop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(10, 14, 20, 0.55) 0%,
        rgba(10, 14, 20, 0.70) 30%,
        rgba(10, 14, 20, 0.80) 60%,
        rgba(10, 14, 20, 0.92) 100%
    );
    z-index: -1;
}

/* == HERO SECTION == */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
}

.hero-content {
    max-width: 800px;
}

.rune-divider {
    font-size: 1.2rem;
    color: var(--base0C);
    letter-spacing: 0.5em;
    margin-bottom: 1rem;
    text-shadow: 0 0 12px var(--base0C);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    color: var(--base07);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-shadow:
        0 0 20px rgba(0, 229, 255, 0.4),
        0 0 60px rgba(0, 229, 255, 0.15);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--base06);
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.hero-tagline {
    font-size: 0.95rem;
    color: var(--base04);
    font-style: italic;
}

/* == REALM SECTIONS == */
.realm-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.realm-header {
    text-align: center;
    margin-bottom: 3rem;
}

.realm-schwab {
    margin-top: 5rem;
}

.section-title {
    font-size: 1.4rem;
    color: var(--base0C);
    letter-spacing: 0.3em;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--base04);
}

/* == GLASSMORPHISM CARDS == */
.component-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.component-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
}

.component-card:hover {
    transform: translateY(-4px);
}

/* -- Accent variants -- */
.accent-cyan { border-color: rgba(0, 229, 255, 0.25); }
.accent-cyan::before { background: linear-gradient(90deg, transparent, var(--base0C), transparent); }
.accent-cyan:hover { box-shadow: 0 0 var(--glow-spread) rgba(0, 229, 255, 0.2); }

.accent-green { border-color: rgba(87, 242, 135, 0.25); }
.accent-green::before { background: linear-gradient(90deg, transparent, var(--base0B), transparent); }
.accent-green:hover { box-shadow: 0 0 var(--glow-spread) rgba(87, 242, 135, 0.2); }

.accent-yellow { border-color: rgba(254, 231, 92, 0.25); }
.accent-yellow::before { background: linear-gradient(90deg, transparent, var(--base0A), transparent); }
.accent-yellow:hover { box-shadow: 0 0 var(--glow-spread) rgba(254, 231, 92, 0.2); }

.accent-purple { border-color: rgba(179, 136, 255, 0.25); }
.accent-purple::before { background: linear-gradient(90deg, transparent, var(--base0E), transparent); }
.accent-purple:hover { box-shadow: 0 0 var(--glow-spread) rgba(179, 136, 255, 0.2); }

.accent-orange { border-color: rgba(255, 110, 64, 0.25); }
.accent-orange::before { background: linear-gradient(90deg, transparent, var(--base0F), transparent); }
.accent-orange:hover { box-shadow: 0 0 var(--glow-spread) rgba(255, 110, 64, 0.2); }

.accent-pink { border-color: rgba(235, 69, 158, 0.25); }
.accent-pink::before { background: linear-gradient(90deg, transparent, var(--base09), transparent); }
.accent-pink:hover { box-shadow: 0 0 var(--glow-spread) rgba(235, 69, 158, 0.2); }

/* -- Card internals -- */
.card-sigil {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 6px currentColor);
}

.accent-cyan .card-sigil { color: var(--base0C); }
.accent-green .card-sigil { color: var(--base0B); }
.accent-yellow .card-sigil { color: var(--base0A); }
.accent-purple .card-sigil { color: var(--base0E); }
.accent-orange .card-sigil { color: var(--base0F); }
.accent-pink .card-sigil { color: var(--base09); }

.card-title {
    font-size: 1.2rem;
    color: var(--base07);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-patron {
    font-size: 0.8rem;
    color: var(--base04);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.card-allocation {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--base07);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

.card-description {
    font-size: 0.85rem;
    color: var(--base05);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.card-strategy {
    font-size: 0.75rem;
    color: var(--base0C);
    font-weight: 500;
    padding: 0.3rem 0;
    border-top: 1px solid var(--glass-border);
}

.card-sweep {
    font-size: 0.7rem;
    color: var(--base09);
    margin-top: 0.5rem;
    padding-top: 0.3rem;
    border-top: 1px dashed rgba(235, 69, 158, 0.25);
}

/* == WATERFALL LAYOUT == */
.waterfall {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.waterfall-tier {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.waterfall-top .component-card,
.waterfall-bottom .component-card {
    max-width: 480px;
    width: 100%;
}

.waterfall-middle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 760px;
    width: 100%;
}

/* -- Flow lines -- */
.waterfall-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0;
}

.flow-line {
    width: 2px;
    height: 24px;
    background: linear-gradient(180deg, var(--base0C), rgba(0, 229, 255, 0.2));
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.flow-split {
    display: flex;
    justify-content: center;
    gap: 0;
    width: 300px;
    position: relative;
}

.flow-branch {
    width: 2px;
    height: 24px;
    background: linear-gradient(180deg, rgba(0, 229, 255, 0.3), var(--base0C));
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.flow-left {
    position: absolute;
    left: 25%;
}

.flow-right {
    position: absolute;
    right: 25%;
}

.flow-split::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--base0C);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

/* == SCHWAB GRID == */
.schwab-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

/* == RAVENS HERALD BADGE == */
.herald-section {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
}

.herald-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 60px;
    padding: 1rem 2rem;
    transition: box-shadow 0.3s ease;
}

.herald-badge:hover {
    box-shadow: 0 0 var(--glow-spread) rgba(88, 101, 242, 0.25);
}

.herald-sigil {
    font-size: 2rem;
    color: var(--base0D);
    filter: drop-shadow(0 0 8px var(--base0D));
}

.herald-info h3 {
    font-size: 1rem;
    color: var(--base07);
    font-weight: 600;
}

.herald-info p {
    font-size: 0.8rem;
    color: var(--base04);
}

/* == FOOTER == */
.site-footer {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 2rem;
}

.site-footer .rune-divider {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.site-footer p {
    font-size: 0.8rem;
    color: var(--base04);
}

.footer-meta {
    margin-top: 0.25rem;
    font-size: 0.7rem !important;
    color: var(--base03) !important;
}

/* == ANIMATIONS == */
@keyframes glow-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.rune-divider {
    animation: glow-pulse 3s ease-in-out infinite;
}

/* -- Card entrance animation -- */
.component-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.component-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.herald-badge {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.herald-badge.visible {
    opacity: 1;
    transform: translateY(0);
}

/* == RESPONSIVE == */
@media (max-width: 768px) {
    .waterfall-middle {
        grid-template-columns: 1fr;
    }

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

    .flow-split {
        width: 100px;
    }

    .flow-left {
        left: 10%;
    }

    .flow-right {
        right: 10%;
    }

    .herald-badge {
        flex-direction: column;
        text-align: center;
        border-radius: var(--card-radius);
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        letter-spacing: 0.08em;
    }

    .realm-section {
        padding: 0 1rem 3rem;
    }

    .component-card {
        padding: 1.2rem;
    }
}
