/* =========================================
   THE UNDERWORLD
   Dark faction archive + Royal Summit
========================================= */

:root {
    color-scheme: dark;

    --void: #08080c;
    --void-deep: #050509;

    --ash: #c0aeb0;
    --ash-muted: #8d8086;
    --ash-border: rgba(181, 147, 153, 0.22);
    --ash-glow: rgba(135, 64, 72, 0.12);

    --obsidian: #b7a7c8;
    --obsidian-muted: #8c7b9c;
    --obsidian-border: rgba(150, 120, 177, 0.24);
    --obsidian-glow: rgba(89, 47, 117, 0.15);

    --summit-gold: #d7c49a;
    --summit-blue: #14202d;
    --summit-border: rgba(215, 196, 154, 0.43);

    --text-main: #e8e1e5;
    --text-muted: #a59ba6;
}

/* RESET */

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

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;

    background: var(--void);
    color: var(--text-main);

    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
}

/* =========================================
   BACKGROUND
========================================= */

.underworld-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;

    background:
        radial-gradient(
            ellipse at 18% 20%,
            rgba(82, 32, 43, 0.15),
            transparent 44%
        ),
        radial-gradient(
            ellipse at 88% 52%,
            rgba(56, 35, 77, 0.12),
            transparent 43%
        ),
        linear-gradient(
            180deg,
            #101015 0%,
            #0a0a0f 40%,
            #07070b 75%,
            #040407 100%
        );
}

.void-glow {
    position: absolute;
    top: 8%;
    left: 50%;

    width: min(1000px, 140vw);
    aspect-ratio: 1;

    transform: translateX(-50%);
    border-radius: 50%;

    background: radial-gradient(
        circle,
        rgba(111, 66, 83, 0.09),
        rgba(66, 43, 78, 0.035) 42%,
        transparent 70%
    );
}

/* SUBTLE ASH-LIKE TEXTURE */

.ash-layer {
    position: absolute;
    inset: -50%;

    background-image:
        radial-gradient(
            circle,
            rgba(214, 195, 200, 0.32) 0 1px,
            transparent 1.5px
        ),
        radial-gradient(
            circle,
            rgba(169, 136, 157, 0.18) 0 1px,
            transparent 1.5px
        );

    background-size: 97px 113px, 151px 179px;
    background-position: 0 0, 42px 65px;

    opacity: 0.12;
    animation: ash-drift 65s linear infinite;
}

.ash-layer-two {
    background-size: 181px 137px, 223px 197px;
    background-position: 74px 31px, 11px 83px;

    opacity: 0.07;
    animation-duration: 95s;
    animation-direction: reverse;
}

@keyframes ash-drift {
    from {
        transform: translate3d(0, -3%, 0);
    }

    to {
        transform: translate3d(-2%, 3%, 0);
    }
}

/* ABSTRACT SHADOW RINGS */

.shadow-orbit {
    position: absolute;
    left: 50%;
    top: 21%;

    width: min(1100px, 135vw);
    height: 360px;

    transform: translateX(-50%) rotate(-14deg);

    border: 1px solid rgba(171, 133, 150, 0.055);
    border-radius: 50%;
}

.orbit-two {
    top: 28%;
    width: min(900px, 115vw);
    height: 270px;

    transform: translateX(-50%) rotate(12deg);
    border-color: rgba(137, 112, 169, 0.045);
}

.red-haze {
    position: absolute;
    left: -15%;
    bottom: -15%;

    width: 70%;
    height: 40%;

    border-radius: 50%;
    filter: blur(100px);

    background: rgba(87, 25, 39, 0.07);
}

/* =========================================
   PAGE LAYOUT
========================================= */

.page-container {
    position: relative;
    width: min(1080px, calc(100% - 36px));
    margin: 0 auto;
    padding-bottom: 25px;
}

/* NAVIGATION */

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 23px 0;
    border-bottom: 1px solid rgba(189, 165, 180, 0.12);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    color: #c4b7c0;
    text-decoration: none;

    font-family: Arial, sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.13em;

    transition: color 0.25s ease;
}

.back-link span:first-child {
    font-size: 1.1rem;
}

.back-link:hover {
    color: #fff;
}

.archive-label {
    color: #807780;
    font-family: Arial, sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-align: right;
}

/* =========================================
   SHARED FLOATING PANELS
========================================= */

.floating-panel {
    position: relative;
    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            rgba(29, 25, 33, 0.83),
            rgba(10, 10, 15, 0.91)
        );

    border: 1px solid rgba(185, 157, 178, 0.17);

    box-shadow:
        0 22px 70px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.018);

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.floating-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;

    width: 80%;
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(211, 190, 208, 0.19),
        transparent
    );

    pointer-events: none;
}

/* =========================================
   HERO
========================================= */

.hero-panel {
    margin-top: 38px;
    padding: clamp(35px, 7vw, 75px) 22px;

    text-align: center;

    background:
        radial-gradient(
            ellipse at 50% 0%,
            rgba(106, 61, 83, 0.15),
            transparent 65%
        ),
        linear-gradient(
            145deg,
            rgba(25, 21, 29, 0.9),
            rgba(7, 7, 11, 0.94)
        );

    border-color: rgba(184, 145, 164, 0.21);
}

.classified-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 8px 13px;

    border: 1px solid rgba(183, 151, 170, 0.2);

    color: #b8a6b4;
    font-family: Arial, sans-serif;
    font-size: 0.59rem;
    letter-spacing: 0.15em;
}

.status-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;
    background: #a16b79;

    box-shadow: 0 0 11px rgba(161, 107, 121, 0.65);
}

.hero-pretitle {
    margin-top: 34px;

    color: #a58b9b;
    font-family: Arial, sans-serif;
    font-size: 0.64rem;
    letter-spacing: 0.25em;
}

.hero-panel h1 {
    margin-top: 10px;

    color: #eee5eb;
    font-size: clamp(3rem, 10.5vw, 7.2rem);
    font-weight: 400;
    letter-spacing: 0.025em;
    line-height: 1.13;

    text-shadow: 0 8px 45px rgba(117, 67, 96, 0.12);
}

.mobile-break {
    display: none;
}

.hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;

    width: min(350px, 82%);
    margin: 24px auto 18px;
}

.hero-divider > span:not(.divider-symbol) {
    flex: 1;
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(185, 151, 172, 0.48)
    );
}

.hero-divider > span:last-child {
    transform: rotate(180deg);
}

.divider-symbol {
    color: #b99ba8;
    font-size: 1rem;
}

.hero-description {
    max-width: 590px;
    margin: 0 auto;

    color: #b8adb9;
    font-size: clamp(0.95rem, 2.5vw, 1.12rem);
    font-style: italic;
    line-height: 1.9;
}

.hero-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    max-width: 490px;
    margin: 35px auto 0;
    padding: 17px 20px;

    border-top: 1px solid rgba(185, 151, 172, 0.14);
    border-bottom: 1px solid rgba(185, 151, 172, 0.14);

    background: rgba(0, 0, 0, 0.12);
}

.note-mark {
    flex-shrink: 0;
    color: #a98b9e;
    font-size: 1.3rem;
}

.hero-note p {
    color: #a89da9;
    font-size: 0.83rem;
    line-height: 1.8;
    text-align: left;
}

/* =========================================
   SECTION HEADINGS
========================================= */

.factions-section {
    margin-top: 61px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;

    margin-bottom: 29px;
    text-align: center;
}

.heading-line {
    flex: 1;
    max-width: 140px;
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(184, 155, 174, 0.28)
    );
}

.heading-line:last-child {
    transform: rotate(180deg);
}

.section-kicker {
    color: #9b8194;
    font-family: Arial, sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.2em;
}

.section-heading h2 {
    margin-top: 5px;
    color: #e4d9e1;
    font-size: clamp(1.45rem, 4vw, 2rem);
    font-weight: 400;
}

/* =========================================
   FACTION CARDS
========================================= */

.faction-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.faction-card-link {
    display: block;
    min-width: 0;

    color: inherit;
    text-decoration: none;

    border-radius: 2px;
    outline-offset: 5px;
}

.faction-card {
    min-height: 405px;
    height: 100%;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    padding: 25px;

    transition:
        transform 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.ashen-card {
    background:
        radial-gradient(
            ellipse at 50% 38%,
            rgba(111, 49, 57, 0.13),
            transparent 62%
        ),
        linear-gradient(
            155deg,
            rgba(33, 25, 30, 0.94),
            rgba(10, 9, 13, 0.96)
        );

    border-color: rgba(171, 107, 111, 0.23);
}

.obsidian-card {
    background:
        radial-gradient(
            ellipse at 50% 38%,
            rgba(92, 57, 120, 0.15),
            transparent 62%
        ),
        linear-gradient(
            155deg,
            rgba(28, 23, 35, 0.95),
            rgba(8, 8, 13, 0.97)
        );

    border-color: rgba(143, 110, 168, 0.24);
}

.faction-card-link:hover .faction-card {
    transform: translateY(-5px);
}

.faction-card-link:hover .ashen-card {
    border-color: rgba(201, 129, 131, 0.5);
    box-shadow:
        0 25px 65px rgba(0, 0, 0, 0.34),
        0 0 35px rgba(135, 64, 72, 0.08);
}

.faction-card-link:hover .obsidian-card {
    border-color: rgba(177, 145, 205, 0.5);
    box-shadow:
        0 25px 65px rgba(0, 0, 0, 0.34),
        0 0 35px rgba(89, 47, 117, 0.1);
}

.faction-card-link:focus-visible {
    outline: 2px solid #b6a0bb;
}

.card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.record-number {
    color: #92848f;
    font-family: Arial, sans-serif;
    font-size: 0.56rem;
    letter-spacing: 0.16em;
}

.record-symbol {
    color: #aa929f;
    font-size: 1rem;
}

.faction-emblem {
    display: grid;
    place-items: center;

    width: 83px;
    height: 83px;
    margin: 35px auto 21px;

    border: 1px solid;
    border-radius: 50%;

    font-size: 2.1rem;
    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease;
}

.faction-card-link:hover .faction-emblem {
    transform: rotate(8deg);
}

.ashen-emblem {
    color: #c18c89;
    border-color: rgba(190, 117, 121, 0.33);

    background:
        radial-gradient(
            circle,
            rgba(129, 57, 65, 0.17),
            transparent 72%
        );

    box-shadow: inset 0 0 25px rgba(128, 50, 58, 0.07);
}

.obsidian-emblem {
    color: #b8a0cc;
    border-color: rgba(163, 126, 190, 0.35);

    background:
        radial-gradient(
            circle,
            rgba(100, 60, 133, 0.18),
            transparent 72%
        );

    box-shadow: inset 0 0 25px rgba(96, 56, 132, 0.08);
}

.faction-type {
    color: #978794;
    font-family: Arial, sans-serif;
    font-size: 0.54rem;
    letter-spacing: 0.16em;
    text-align: center;
}

.faction-card h3 {
    margin-top: 8px;

    color: #e7dfe7;
    font-size: clamp(1.45rem, 3.6vw, 2.05rem);
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.025em;
    text-align: center;
}

.ashen-card h3 {
    color: #eadcdd;
}

.obsidian-card h3 {
    color: #e0d8eb;
}

.card-divider {
    width: 54px;
    height: 1px;
    margin: 19px auto 15px;
    background: rgba(180, 146, 171, 0.35);
}

.faction-description {
    max-width: 300px;
    margin: 0 auto;

    color: #b1a5b2;
    font-size: 0.87rem;
    line-height: 1.85;
    text-align: center;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-top: auto;
    padding-top: 24px;

    color: #998a99;
    font-family: Arial, sans-serif;
    font-size: 0.52rem;
    letter-spacing: 0.1em;
}

.explore-arrow {
    color: #c1a6b9;
    font-size: 1.05rem;

    transition: transform 0.25s ease;
}

.faction-card-link:hover .explore-arrow {
    transform: translate(3px, -3px);
}

.faction-footnote {
    margin-top: 20px;

    color: #726b77;
    font-size: 0.76rem;
    font-style: italic;
    text-align: center;
}

/* =========================================
   SEPARATION BEFORE THE ROYAL SUMMIT
========================================= */

.alliance-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;

    margin: 68px auto 36px;
}

.alliance-separator > span {
    width: min(220px, 30%);
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(196, 172, 128, 0.45),
        transparent
    );
}

.separator-emblem {
    color: #b9a77e;
    font-size: 1.15rem;
}

/* =========================================
   ROYAL SUMMIT
   Independent alliance, different identity
========================================= */

.summit-section {
    margin-top: 0;
}

.summit-panel {
    position: relative;
    overflow: hidden;

    padding: clamp(30px, 6vw, 66px) 22px;

    border: 1px solid var(--summit-border);

    background:
        radial-gradient(
            ellipse at 50% 0%,
            rgba(160, 135, 83, 0.15),
            transparent 53%
        ),
        linear-gradient(
            145deg,
            rgba(25, 39, 53, 0.97),
            rgba(10, 17, 25, 0.98) 65%,
            rgba(12, 15, 22, 0.98)
        );

    box-shadow:
        0 25px 85px rgba(0, 0, 0, 0.32),
        inset 0 0 70px rgba(163, 140, 93, 0.025);
}

.summit-panel::before,
.summit-panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.summit-panel::before {
    inset: 9px;
    border: 1px solid rgba(215, 196, 154, 0.11);
}

.summit-panel::after {
    top: 0;
    left: 15%;
    width: 70%;
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(232, 213, 170, 0.65),
        transparent
    );
}

.summit-ornament {
    position: absolute;
    color: rgba(215, 196, 154, 0.52);
    font-size: 1.3rem;
}

.ornament-top {
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
}

.ornament-bottom {
    bottom: 17px;
    left: 50%;
    transform: translateX(-50%);
}

.summit-content {
    position: relative;
    z-index: 1;

    width: min(650px, 100%);
    margin: 0 auto;

    text-align: center;
}

.summit-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    color: #d2bf94;
    font-family: Arial, sans-serif;
    font-size: 0.56rem;
    letter-spacing: 0.14em;
}

.summit-label-line {
    width: 32px;
    height: 1px;
    background: rgba(215, 196, 154, 0.48);
}

.summit-emblem {
    position: relative;

    display: grid;
    place-items: center;

    width: 91px;
    height: 91px;
    margin: 29px auto 18px;

    border: 1px solid rgba(215, 196, 154, 0.48);
    border-radius: 50%;

    background: radial-gradient(
        circle,
        rgba(215, 196, 154, 0.1),
        transparent 75%
    );

    box-shadow:
        0 0 32px rgba(215, 196, 154, 0.045),
        inset 0 0 25px rgba(215, 196, 154, 0.035);
}

.crown-symbol {
    color: #e0d0a9;
    font-size: 2.5rem;
    line-height: 1;
}

.crown-ring {
    position: absolute;
    inset: -7px;

    border: 1px solid rgba(215, 196, 154, 0.13);
    border-radius: 50%;
}

.summit-pretitle {
    color: #c8b68c;
    font-family: Arial, sans-serif;
    font-size: 0.61rem;
    letter-spacing: 0.32em;
}

.summit-content h2 {
    margin-top: 8px;

    color: #f0e7d4;
    font-size: clamp(2.7rem, 8vw, 5rem);
    font-weight: 400;
    letter-spacing: 0.035em;
    line-height: 1.17;

    text-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
}

.summit-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;

    width: min(280px, 75%);
    margin: 23px auto 19px;

    color: #d2bd8e;
    font-size: 0.8rem;
}

.summit-divider span:not(:nth-child(2)) {
    flex: 1;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(215, 196, 154, 0.5)
    );
}

.summit-divider span:last-child {
    transform: rotate(180deg);
}

.summit-description {
    max-width: 530px;
    margin: 0 auto;

    color: #d0d2d3;
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    line-height: 1.9;
}

.summit-note {
    max-width: 480px;
    margin: 14px auto 0;

    color: #a9b0b8;
    font-size: 0.84rem;
    line-height: 1.9;
}

.summit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 22px;

    margin-top: 30px;
    padding: 14px 23px;

    border: 1px solid rgba(215, 196, 154, 0.53);
    background: rgba(215, 196, 154, 0.055);

    color: #e4d5b1;
    text-decoration: none;

    font-family: Arial, sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.14em;

    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.summit-link:hover {
    transform: translateY(-2px);
    background: rgba(215, 196, 154, 0.12);
    border-color: rgba(232, 213, 170, 0.8);
}

.summit-link:focus-visible {
    outline: 2px solid #e1d0a6;
    outline-offset: 4px;
}

.summit-arrow {
    font-size: 1rem;
    transition: transform 0.25s ease;
}

.summit-link:hover .summit-arrow {
    transform: translateX(4px);
}

.summit-record-status {
    margin-top: 23px;

    color: #918c80;
    font-family: Arial, sans-serif;
    font-size: 0.52rem;
    letter-spacing: 0.14em;
}

/* =========================================
   FOOTER
========================================= */

.page-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 13px;

    padding: 35px 10px 10px;

    color: #77717c;
    font-family: Arial, sans-serif;
    font-size: 0.55rem;
    letter-spacing: 0.14em;
    text-align: center;
}

.footer-diamond {
    color: #aa8d9e;
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 650px) {
    .page-container {
        width: calc(100% - 24px);
    }

    .top-bar {
        padding: 19px 0;
    }

    .back-link {
        font-size: 0.55rem;
        letter-spacing: 0.08em;
    }

    .archive-label {
        font-size: 0.5rem;
        letter-spacing: 0.07em;
    }

    .hero-panel {
        margin-top: 22px;
        padding: 38px 15px;
    }

    .hero-pretitle {
        margin-top: 28px;
        font-size: 0.53rem;
        letter-spacing: 0.14em;
    }

    .hero-panel h1 {
        font-size: clamp(2.6rem, 11.5vw, 4.2rem);
        line-height: 1.18;
        letter-spacing: 0;
        overflow-wrap: anywhere;
    }

    .mobile-break {
        display: block;
    }

    .hero-description {
        font-size: 0.92rem;
    }

    .hero-note {
        margin-top: 25px;
        padding: 14px 10px;
    }

    .factions-section {
        margin-top: 43px;
    }

    .section-heading {
        gap: 12px;
        margin-bottom: 22px;
    }

    .section-heading h2 {
        font-size: 1.4rem;
    }

    .heading-line {
        max-width: 48px;
    }

    .faction-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .faction-card {
        min-height: 375px;
        padding: 22px;
    }

    .faction-emblem {
        margin-top: 27px;
    }

    .faction-card h3 {
        font-size: 1.85rem;
    }

    .alliance-separator {
        margin: 48px auto 27px;
    }

    .summit-panel {
        padding: 45px 17px;
    }

    .summit-label {
        gap: 7px;
        font-size: 0.48rem;
        letter-spacing: 0.08em;
    }

    .summit-label-line {
        width: 17px;
    }

    .summit-content h2 {
        font-size: clamp(2.5rem, 10vw, 3.7rem);
    }

    .summit-description {
        font-size: 0.92rem;
    }

    .summit-link {
        gap: 14px;
        padding: 13px 16px;
        font-size: 0.58rem;
    }
}

/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}