/* ============================================================
   NINJA SCROLLS - DESIGN SYSTEM (SHINOBI ARC)
   Premium dark theme with Naruto Orange / Chakra Blue accents
   Premium dark theme with shinobi-inspired orange / chakra blue accents
   ============================================================ */

:root {
    /* Surfaces - Sleek Charcoal and Ninja Gear Black */
    --bg-deepest: #05080e;
    --bg-deep: #0a0e16;
    --bg-surface: #0f1522;
    --bg-card: rgba(15, 21, 34, 0.92);
    --bg-elevated: #1a2233;

    /* Accents - Fiery Nine-Tails Orange & Pure Chakra Blue */
    --accent: #ff6a00;
    --accent-strong: #ff983d;
    --accent-rgb: 255, 106, 0;
    --chakra: #0088ff;
    --chakra-strong: #4da6ff;
    --chakra-rgb: 0, 136, 255;
    
    /* Semantic Colors - Kurama Red / Alliance Sky */
    --ally: #38bdf8;
    --conflict: #f43f5e;
    --complex: #a855f7;

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Borders - Precision metal and chakra strokes */
    --border: rgba(255, 106, 0, 0.12);
    --border-strong: rgba(var(--accent-rgb), 0.32);
    --border-metal: #576574;

    /* Effects */
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 16px rgba(var(--accent-rgb), 0.08);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(var(--accent-rgb), 0.15);

    /* Typography */
    --font-heading: 'Teko', 'Noto Sans JP', 'Noto Sans', sans-serif;
    --font-body: 'Noto Sans JP', 'Noto Sans', sans-serif;
    
    /* Layout */
    --container-max: 1360px;
    --section-pad: 96px;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-deep);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 120% 80% at 50% -10%, rgba(var(--chakra-rgb), 0.18), transparent 60%),
        radial-gradient(circle at 10% 40%, rgba(var(--accent-rgb), 0.04), transparent 25%),
        linear-gradient(180deg, #0a0e16 0%, #05080e 45%, #030408 100%);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: 
        linear-gradient(rgba(255, 255, 255, 0.008) 50%, rgba(0, 0, 0, 0.012) 50%),
        radial-gradient(rgba(var(--accent-rgb), 0.015) 1px, transparent 0),
        radial-gradient(rgba(var(--chakra-rgb), 0.015) 1px, transparent 0);
    background-size: 100% 4px, 24px 24px, 32px 32px;
    background-position: 0 0, 0 0, 8px 8px;
    opacity: 0.85;
    z-index: -1;
}

body::before {
    content: "";
    position: fixed;
    inset: -8vh -8vw;
    pointer-events: none;
    background:
        radial-gradient(ellipse 62vw 92vh at 15% 70%, rgba(var(--accent-rgb), 0.14), transparent 72%),
        radial-gradient(ellipse 58vw 88vh at 85% 75%, rgba(var(--chakra-rgb), 0.13), transparent 72%);
    z-index: -2;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { border: 0; background: none; cursor: pointer; }

:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 3px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), .5); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.accent { color: var(--accent); }
.hidden { display: none !important; }

/* ---------- SITE SWITCHER TOAST ---------- */
.site-switcher-toast {
    position: fixed;
    left: 50%;
    top: 50%;
    max-width: calc(100vw - 24px);
    padding: 12px 20px;
    border: 2px solid var(--border-strong);
    border-radius: 2px;
    background: linear-gradient(180deg, #1e272e, #0f1522);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(var(--accent-rgb), 0.15);
    backdrop-filter: blur(8px);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -44%);
    transition:
        opacity 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
        visibility 0s linear 0.2s;
}

.site-switcher-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
    transition-delay: 0s;
}

/* ---------- LOADING SCREEN ---------- */
#loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb), 0.18) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(var(--chakra-rgb), 0.1) 0%, transparent 70%),
        #05080e;
    z-index: 10000;
    transition: opacity .45s ease, visibility .45s ease;
}
#loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-content { display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; }

.loader-seal-container {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.loader-seal-ring {
    position: absolute;
    inset: 0;
    border: 2px dashed var(--accent);
    border-radius: 50%;
    animation: loaderSealRotate 10s linear infinite;
    filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.45));
}

.loader-seal-ring::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1.5px solid rgba(var(--chakra-rgb), 0.35);
    border-radius: 50%;
    border-left-color: transparent;
    border-right-color: transparent;
    animation: loaderSealRotateInverse 6s linear infinite;
    filter: drop-shadow(0 0 8px rgba(var(--chakra-rgb), 0.3));
}

.loader-logo { 
    width: 76px; 
    height: 76px; 
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(var(--accent-rgb), .65)); 
    animation: loaderFloat 2.2s ease-in-out infinite; 
}
.loader-text { font-family: var(--font-heading); font-weight: 600; font-size: 1.45rem; letter-spacing: .2rem; color: var(--accent-strong); text-shadow: 0 0 12px rgba(var(--accent-rgb), 0.4); text-transform: uppercase; }
.loader-bar { width: 280px; height: 4px; border-radius: 0; overflow: hidden; background: rgba(255, 255, 255, .05); border: 1px solid rgba(var(--accent-rgb), 0.2); }
.loader-bar-fill { width: 0; height: 100%; background: linear-gradient(90deg, transparent 0%, var(--accent) 30%, var(--accent-strong) 70%, transparent 100%); animation: loaderSweep 1.8s ease-out forwards; }
@keyframes loaderFloat { 0%, 100% { transform: translateY(0) scale(1) } 50% { transform: translateY(-8px) scale(1.03) } }
@keyframes loaderSweep { 0% { width: 0; transform: translateX(-15%) } 100% { width: 100%; transform: translateX(0) } }

@keyframes loaderSealRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes loaderSealRotateInverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

/* ---------- HERO SECTION ---------- */
#hero {
    position: relative;
    min-height: 100vh;
    padding: 108px 28px 68px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}

#hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(5, 8, 14, .66) 0%, rgba(5, 8, 14, .36) 25%, rgba(5, 8, 14, .08) 52%, rgba(5, 8, 14, 0) 78%),
        linear-gradient(180deg, rgba(5, 8, 14, .44) 0%, rgba(5, 8, 14, .04) 38%, rgba(5, 8, 14, .42) 100%);
    pointer-events: none;
    z-index: 1;
}

#hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 140px;
    background: linear-gradient(to bottom, transparent, rgba(5, 8, 14, .85) 60%, var(--bg-deepest));
    pointer-events: none;
    z-index: 1;
}

.hero-banner-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    animation: ninjaBannerDrift 28s ease-in-out infinite alternate;
}

.hero-banner-art {
    position: absolute;
    top: 0;
    left: 50%;
    bottom: 0;
    width: 110%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    object-position: 50% 56%;
    transform: translateX(-50%);
    transform-origin: center center;
    opacity: .92;
    filter: saturate(.98) contrast(1.05) brightness(.82);
}

.hero-banner-fade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 56% 68%, rgba(255, 152, 61, .11), transparent 34%),
        linear-gradient(90deg, rgba(5, 8, 14, .62) 0%, rgba(5, 8, 14, .34) 32%, rgba(5, 8, 14, .06) 60%, rgba(5, 8, 14, .12) 100%),
        linear-gradient(180deg, rgba(5, 8, 14, .08) 0%, rgba(5, 8, 14, .04) 48%, rgba(5, 8, 14, .58) 100%);
}

@keyframes ninjaBannerDrift { 0% { transform: translate3d(0, 0, 0) scale(1) } 100% { transform: translate3d(0, -3px, 0) scale(1.01) } }

.hero-bg-effects { position: absolute; inset: 0; pointer-events: none; }

/* ---------- NAVIGATION ---------- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: clamp(18px, 2.4vw, 34px);
    padding: 20px clamp(34px, 2.1vw, 60px);
    background: rgba(5, 8, 14, .97);
    border-bottom: 1px solid var(--border);
}

.nav-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
}

.nav-logo { display: inline-flex; align-items: center; gap: 12px; position: relative; z-index: 1202; }
.nav-logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 0; /* Sharp geometric seal */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), .2), rgba(var(--chakra-rgb), .05));
    border: 2px solid var(--accent);
    box-shadow: 0 0 15px rgba(var(--accent-rgb), .15);
}
.nav-logo-icon { width: 100%; height: 100%; object-fit: contain; }
.nav-logo-text { font-family: var(--font-heading); font-weight: 700; font-size: clamp(1rem, 4vw, 1.3rem); letter-spacing: 2px; white-space: nowrap; }

.site-switcher {
    position: relative;
    display: flex;
    align-items: center;
}
.site-switcher-toggle {
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    min-height: 38px;
    gap: 12px;
}
.site-switcher-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 6px;
    border-radius: 2px;
}
.site-switcher-caret {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -2px;
    opacity: 0.8;
    transition: transform 0.25s ease, color 0.25s ease;
}
.site-switcher.open .site-switcher-caret {
    transform: rotate(-135deg) translateY(-1px);
    color: var(--accent);
    opacity: 1;
}
.site-switcher-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    min-width: 260px;
    width: max-content;
    padding: 10px;
    border-radius: 2px; /* Sharp corners */
    background: rgba(5, 8, 14, 0.98);
    border: 2px solid var(--border-strong);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(18px);
    z-index: 1205;
}
.site-switcher-menu[hidden] { display: none; }
.site-switcher-link {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 0; /* Sharp layout */
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-primary);
    transition: background 0.25s ease;
    text-decoration: none;
    transform: translateZ(0);
}
.site-switcher-link-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.site-switcher-link-icon img { width: 100%; height: 100%; object-fit: contain; }
.site-switcher-link-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}
.site-switcher-link-accent {
    font-size: 0.95rem;
    letter-spacing: 1.4px;
    color: var(--text-primary);
    transition: color 0.25s ease;
}
.site-switcher-link:hover,
.site-switcher-link:focus-visible {
    background: rgba(var(--accent-rgb), 0.14);
}
.site-switcher-link:hover .site-switcher-link-label { color: rgba(255,255,255,0.7); }
.site-switcher-link:hover .site-switcher-link-accent { color: var(--accent-strong); }

.site-switcher-link.ow-link .site-switcher-link-accent { color: #d28cff; text-shadow: 0 0 10px rgba(187, 41, 255, 0.55); }
.site-switcher-link.ow-link:hover, .site-switcher-link.ow-link:focus-visible { background: rgba(187, 41, 255, 0.16); }
.site-switcher-link.mr-link .site-switcher-link-accent { color: #ff6b8b; text-shadow: 0 0 10px rgba(255, 107, 139, 0.55); }
.site-switcher-link.mr-link:hover, .site-switcher-link.mr-link:focus-visible { background: rgba(255, 107, 139, 0.16); }
.site-switcher-link.cp-link .site-switcher-link-accent { color: #fcee0a; text-shadow: 0 0 12px rgba(252, 238, 10, 0.55); }
.site-switcher-link.cp-link:hover, .site-switcher-link.cp-link:focus-visible { background: rgba(252, 238, 10, 0.14); }
.site-switcher-link.lol-link .site-switcher-link-accent { color: #c8aa6e; text-shadow: 0 0 12px rgba(200, 170, 110, 0.4); }
.site-switcher-link.lol-link:hover, .site-switcher-link.lol-link:focus-visible { background: rgba(200, 170, 110, 0.15); }
.site-switcher-link.ymir-link .site-switcher-link-accent { color: #ff9a3c; text-shadow: 0 0 12px rgba(255, 154, 60, 0.55); }
.site-switcher-link.ymir-link:hover, .site-switcher-link.ymir-link:focus-visible { background: rgba(255, 154, 60, 0.16); }
.site-switcher-link.wf-link .site-switcher-link-accent { color: #22d3ee; text-shadow: 0 0 12px rgba(34, 211, 238, 0.5); }
.site-switcher-link.wf-link:hover, .site-switcher-link.wf-link:focus-visible { background: rgba(34, 211, 238, 0.14); }

.nav-hub-link-center {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    transition: opacity 0.2s ease;
    z-index: 1201;
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
}
.nav-hub-link-center:hover { opacity: 0.75; }
.nav-hub-icon { width: 38px; height: 38px; }

.nav-links { display: flex; align-items: center; grid-column: 3; grid-row: 1; justify-self: end; gap: clamp(14px, 1.7vw, 24px); min-width: 0; }
.nav-link {
    position: relative;
    color: var(--text-secondary);
    font-size: .9rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 700;
    transition: color .24s ease, text-shadow .24s ease;
}
.nav-link::after {
    display: none;
}
.nav-link:hover, .nav-link:focus-visible, .nav-link.active { color: var(--accent-strong); text-shadow: none; }

/* Geometric angled buttons */
.nav-kofi-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid var(--accent);
    border-radius: 0; /* Sharp */
    background: rgba(var(--accent-rgb), .08);
    color: var(--text-primary);
    font-size: .9rem;
    letter-spacing: 1.5px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.nav-kofi-btn:hover, .nav-kofi-btn:focus-visible {
    transform: translateY(-2px);
    background: rgba(var(--accent-rgb), .2);
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), .25);
    color: var(--accent-strong);
}
.kofi-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: currentColor;
}
.kofi-icon svg {
    width: 100%;
    height: 100%;
}

.mobile-menu-toggle {
    width: 44px;
    height: 44px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 2px solid var(--accent);
    border-radius: 0;
    background: rgba(var(--accent-rgb), .08);
    position: relative;
    z-index: 1202;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
}
.menu-bar { width: 20px; height: 2px; background: var(--accent); transition: transform .24s ease, opacity .24s ease; }
.mobile-menu-toggle.active .menu-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle.active .menu-bar:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active .menu-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- HERO LAYOUT ---------- */
.hero-layout { 
    position: relative; 
    z-index: 2; 
    width: 100%; 
    max-width: var(--container-max); 
    margin: 0 auto; 
    min-height: calc(100vh - 176px); 
    padding-top: clamp(12px, 4vh, 52px); 
    text-align: center; 
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.hero-content {
    position: relative;
    z-index: 2;
    width: min(820px, 92vw);
    max-width: min(820px, 92vw);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    isolation: isolate;
    transform: translateY(clamp(38px, 5vh, 58px));
}
.hero-content::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 38%;
    width: min(920px, 96vw);
    height: min(330px, 42vh);
    transform: translate(-50%, -50%);
    border-radius: 2px; /* Sharp layout panel */
    pointer-events: none;
    z-index: -1;
    border: 1px solid rgba(var(--accent-rgb), .13);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .34);
    backdrop-filter: blur(3px);
    background:
        radial-gradient(ellipse at 50% 42%, rgba(5, 8, 14, .72) 0%, rgba(5, 8, 14, .42) 58%, rgba(5, 8, 14, 0) 100%),
        linear-gradient(180deg, rgba(5, 8, 14, .1), rgba(5, 8, 14, .2));
}

/* Metallic Forehead Protector Badges */
.hero-badge, .section-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 24px;
    border-radius: 2px;
    border: 1px solid var(--border-metal);
    background: linear-gradient(180deg, #576574 0%, #2f3640 50%, #1e272e 100%);
    color: #f5f6fa;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    position: relative;
    text-transform: uppercase;
    margin-bottom: 20px;
}
.hero-badge::before, .hero-badge::after,
.section-badge::before, .section-badge::after {
    content: "";
    position: absolute;
    width: 4px;
    height: 4px;
    background: #95a5a6;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: inset 1px 1px 1px rgba(0,0,0,0.8), 0 1px 0 rgba(255,255,255,0.2);
}
.hero-badge::before, .section-badge::before { left: 8px; }
.hero-badge::after, .section-badge::after { right: 8px; }

.hero-title {
    font-family: var(--font-heading); 
    font-weight: 700;
    font-size: clamp(3.4rem, 6.1vw, 5rem); 
    margin-bottom: 16px; 
    letter-spacing: .035rem;
    line-height: 1; 
    text-shadow: 0 12px 30px rgba(0, 0, 0, 0.75); 
}
.hero-title-line {
    display: inline-block;
}
.hero-title-line + .hero-title-line {
    margin-left: .16em;
}
.accent-line { 
    color: transparent; 
    background: linear-gradient(180deg, #f8fafc 0%, #ff983d 48%, var(--accent) 100%); 
    -webkit-background-clip: text; 
    background-clip: text; 
    filter: drop-shadow(0 4px 16px rgba(var(--accent-rgb), 0.42)); 
    position: relative; 
}
.accent-line { text-shadow: 0 0 28px rgba(var(--chakra-rgb), .32); }
.accent-line::after { display: none; }

.hero-subtitle { width: 100%; max-width: 48ch; font-size: 1.04rem; color: var(--text-secondary); text-shadow: 0 4px 12px rgba(0, 0, 0, 0.9); margin-bottom: 22px; }

.hero-actions { margin: 0 0 24px; gap: 18px; display: flex; align-items: center; justify-content: center; }

/* Sharp cut cta button */
.hero-cta { 
    min-height: 54px; 
    display: inline-flex; 
    align-items: center; 
    padding: 0 28px; 
    border-radius: 2px; 
    font-size: .88rem; 
    letter-spacing: .16rem; 
    background: linear-gradient(135deg, rgba(var(--accent-rgb), .25), rgba(var(--chakra-rgb), .05)), rgba(0, 0, 0, .6); 
    border: 2px solid var(--accent); 
    color: #ffffff; 
    font-weight: 700;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); 
    text-transform: uppercase;
}
.hero-cta:hover { 
    background: linear-gradient(135deg, rgba(var(--accent-rgb), .45), rgba(var(--chakra-rgb), .15)); 
    transform: translateY(-3px); 
    border-color: var(--accent-strong); 
    color: var(--accent-strong);
    box-shadow: 0 12px 28px rgba(var(--accent-rgb), .35); 
}
.hero-secondary-link { font-size: .84rem; letter-spacing: .12rem; text-transform: uppercase; color: var(--text-secondary); font-weight: 700; }
.hero-secondary-link:hover { color: var(--accent-strong); }

#hero .hero-language-control {
    min-height: 42px;
    padding: 6px 10px 6px 16px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(5, 8, 14, 0.86), rgba(17, 24, 39, 0.62));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 0 16px rgba(var(--accent-rgb), 0.08);
    backdrop-filter: blur(12px);
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

#hero .hero-language-control select {
    width: 132px;
    min-height: 32px;
    padding: 6px 10px;
}

.hero-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; max-width: 560px; }
.stat-item { 
    min-width: 126px; 
    padding: 12px 14px 11px; 
    border-radius: 2px; /* Sharp styling */
    background: linear-gradient(180deg, rgba(var(--accent-rgb), .08), transparent), rgba(15, 21, 34, .64); 
    border: 1px solid rgba(var(--accent-rgb), .24); 
    backdrop-filter: blur(16px); 
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5); 
}
.stat-number { display: block; font-family: var(--font-heading); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: .92; color: var(--accent-strong); margin-bottom: 5px; text-shadow: 0 4px 12px rgba(var(--accent-rgb), .32); }
.stat-label { display: block; color: var(--text-muted); font-size: .66rem; letter-spacing: .13rem; text-transform: uppercase; font-weight: 700; }

.scroll-indicator { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 2; opacity: .7; }
.scroll-track { width: 2px; height: 54px; background: linear-gradient(180deg, var(--accent), rgba(var(--accent-rgb), 0)); }
.scroll-arrow { width: 14px; height: 14px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg); animation: scrollBounce 1.9s ease-in-out infinite; }
@keyframes scrollBounce { 0%, 100% { transform: translateY(0) rotate(45deg) } 50% { transform: translateY(8px) rotate(45deg) } }

/* ---------- SECTIONS ---------- */
.section-shell { position: relative; width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 96px 28px 0; }
.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    max-width: 820px;
    margin: 0 auto 38px;
}

.section-header .section-badge {
    margin-bottom: 0;
}

.section-title { position: relative; display: inline-block; font-family: var(--font-heading); font-weight: 700; font-size: clamp(2.2rem, 4vw, 3.25rem); line-height: .98; text-transform: uppercase; margin: 0 0 12px; }

/* Scroll cylinder motif divider */
.section-title::after {
    content: "";
    position: absolute;
    left: 15%;
    right: 15%;
    bottom: -12px;
    height: 4px;
    background: linear-gradient(90deg, #78350f 0%, var(--accent) 15%, var(--accent) 85%, #78350f 100%);
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.6);
    border-radius: 2px;
}
.section-desc { font-size: 1.05rem; color: var(--text-secondary); margin: 0; }

/* Dossier panel base slab */
.section-slab { 
    position: relative; 
    padding: 36px 24px; 
    border-radius: 2px; /* Sharp corners */
    border: 1px solid rgba(var(--accent-rgb), .22); 
    background: linear-gradient(180deg, rgba(var(--accent-rgb), .03), rgba(255, 255, 255, .005)), rgba(10, 14, 22, .96); 
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(var(--accent-rgb), 0.05); 
    overflow: hidden; 
}
.section-slab::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(var(--accent-rgb), .08), transparent 30%), radial-gradient(circle at bottom right, rgba(var(--chakra-rgb), .08), transparent 24%); opacity: .72; pointer-events: none; }

/* ---------- NETWORK MAP ---------- */
.map-toolbar { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.map-controls { display: flex; flex-wrap: wrap; gap: 10px; }

.map-btn, .faction-filter-btn { 
    position: relative;
    min-height: 38px;
    padding: 0 20px;
    border-radius: 3px;
    border: 1px solid rgba(148, 163, 184, .26);
    background: rgba(15, 23, 42, .68);
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.08rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    cursor: pointer; 
    transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.map-btn::before, .map-btn::after,
.faction-filter-btn::before, .faction-filter-btn::after {
    display: none;
}

.map-btn:hover, .faction-filter-btn:hover {
    background: rgba(30, 41, 59, .76);
    border-color: rgba(var(--accent-rgb), .5);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}
.map-btn.active, .faction-filter-btn.active { 
    background: rgba(var(--accent-rgb), .14);
    border-color: rgba(var(--accent-rgb), .78);
    color: var(--accent-strong);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.map-hint, .faction-results { color: var(--text-muted); font-size: .92rem; font-weight: 600; letter-spacing: 0.02rem; }

.map-container { 
    position: relative; 
    z-index: 1; 
    width: 100%; 
    height: clamp(540px, 72vh, 820px); 
    min-height: 540px;
    max-height: 820px;
    border-radius: 2px; 
    overflow: hidden; 
    background: var(--bg-deep);
    border: 1px solid rgba(var(--accent-rgb), 0.28);
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.58);
    cursor: grab;
    contain: layout paint;
}

.map-container:active {
    cursor: grabbing;
}

.map-container.fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

#network-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#network-canvas:focus-visible {
    box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 4px rgba(var(--accent-rgb), 0.22);
}

.map-zoom-controls { position: absolute; left: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.zoom-btn { 
    width: 36px; 
    height: 36px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 0; 
    border: 1px solid rgba(var(--accent-rgb), 0.3); 
    background: rgba(5, 8, 14, 0.85); 
    color: var(--text-secondary); 
    font-size: 1.25rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); 
    transition: all .2s ease; 
}
.zoom-btn:hover { 
    transform: scale(1.05);
    border-color: var(--accent); 
    background: rgba(var(--accent-rgb), 0.16); 
    color: var(--accent-strong); 
    box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.25);
}

.map-base-legend { 
    position: relative; 
    z-index: 1; 
    display: flex; 
    justify-content: center; 
    flex-wrap: wrap; 
    gap: 12px 30px; 
    margin-top: 24px; 
    padding: 14px;
    background: rgba(255, 255, 255, 0.015);
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.legend-item { display: inline-flex; align-items: center; gap: 12px; color: var(--text-secondary); font-size: 0.82rem; letter-spacing: 0.06rem; text-transform: uppercase; font-weight: 700; }
.legend-line { width: 32px; height: 3px; border-radius: 0; box-shadow: 0 0 10px currentColor; }
.legend-line-alliance { background: var(--ally); color: var(--ally); }
.legend-line-conflict { background: var(--conflict); color: var(--conflict); }
.legend-line-complex { background: var(--complex); color: var(--complex); }

/* ---------- FACTION CARDS ---------- */
.faction-controls { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.search-box { position: relative; width: min(100%, 420px); }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-box input { width: 100%; min-height: 48px; padding: 0 16px 0 48px; border-radius: 0; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .02); color: var(--text-primary); transition: all 0.25s ease; }
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), .15); background: rgba(255, 255, 255, .04); }
.faction-filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1 1 520px;
}
.faction-filter-btn {
    min-height: 36px;
    padding-inline: 20px;
    font-size: 0.7rem;
    letter-spacing: 0.075rem;
}

.factions-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

.faction-card { 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
    padding: 24px; 
    border-radius: 8px; 
    border: 1px solid rgba(255, 255, 255, .06); 
    background:
        radial-gradient(circle at 92% 12%, rgba(var(--accent-rgb), .045), transparent 34%),
        linear-gradient(180deg, rgba(20, 27, 42, 0.95), rgba(12, 17, 26, 0.98));
    box-shadow: var(--shadow-sm); 
    cursor: pointer; 
    transition: all .28s cubic-bezier(0.2, 0.8, 0.2, 1); 
    text-align: left; 
    content-visibility: auto;
    contain-intrinsic-size: auto 330px;
}
.faction-card::before { 
    content: ""; 
    position: absolute; 
    left: 0; 
    top: 0; 
    bottom: 0;
    width: 3px; 
    background: var(--card-accent, var(--accent)); 
    opacity: .9; 
    transition: width 0.25s ease;
}
.faction-card:hover { 
    transform: translateY(-6px); 
    border-color: var(--card-accent, rgba(var(--accent-rgb), .45)); 
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), 0 0 30px var(--card-accent, rgba(var(--accent-rgb), .15)); 
}
.faction-card:hover::before {
    width: 6px;
}

.faction-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.08) 0%, transparent 62%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 5;
}
.faction-card:hover::after {
    animation: smokePoof 0.8s ease-out forwards;
}

@keyframes smokePoof {
    0% { transform: scale(0.92); opacity: 0; filter: blur(2px); }
    40% { opacity: 0.7; filter: blur(5px); }
    100% { transform: scale(1.12); opacity: 0; filter: blur(12px); }
}

.card-eyebrow { color: var(--text-muted); font-size: .74rem; letter-spacing: .14rem; text-transform: uppercase; font-weight: 700; }
.card-header { display: flex; align-items: flex-start; gap: 14px; }
.card-icon { 
    width: 54px; 
    height: 54px; 
    border-radius: 0; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0; 
    border: 1px solid rgba(255, 255, 255, .08); 
    background: rgba(255, 255, 255, .02); 
    box-shadow: inset 0 0 10px rgba(255,255,255,0.02);
}
.card-title { font-family: var(--font-heading); font-weight: 600; font-size: 1.6rem; line-height: .98; margin-bottom: 4px; letter-spacing: 0.02rem; }
.card-alignment {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-rgb), 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: 0.09rem;
    text-transform: uppercase;
}
.card-desc { color: var(--text-secondary); font-size: .95rem; flex-grow: 1; line-height: 1.5; }

.card-members-row { display: flex; align-items: center; flex-wrap: wrap; margin: 4px 0; }

/* Dynamic Sharingan rotation effect on portrait hovers */
.card-member-avatar { 
    width: 42px; 
    height: 42px; 
    border-radius: 50%; 
    border: 2px solid var(--bg-deepest); 
    margin-left: -10px; 
    background: var(--bg-elevated); 
    position: relative; 
    z-index: 1; 
    transition: all .2s ease; 
    overflow: hidden; 
}
.card-member-avatar img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease, filter 0.25s ease; }
.card-member-avatar:first-child { margin-left: 0; }
.card-member-avatar:hover { 
    transform: scale(1.15) translateY(-2px); 
    border-color: var(--conflict); 
    z-index: 4; 
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}
.card-member-avatar:hover img {
    transform: scale(1.18);
    filter: saturate(1.3) brightness(1.05);
}
/* Subtle dashed crimson circle behind hover avatar replicating eye spin */
.card-member-avatar::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 50%;
    border: 1px dashed rgba(244, 63, 94, 0);
    pointer-events: none;
    z-index: 3;
    transition: border-color 0.2s ease;
}
.card-member-avatar:hover::after {
    border-color: rgba(244, 63, 94, 0.85);
    animation: sharinganSpin 2.5s linear infinite;
}
@keyframes sharinganSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.card-member-extra { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--accent-strong); border-radius: 50%; border: 2px solid var(--border-strong) !important; background: rgba(var(--accent-rgb), 0.15) !important; }
.card-member-node { border-radius: 0; background: rgba(255, 255, 255, .03); border: 1px solid rgba(var(--accent-rgb), .22); display: flex; align-items: center; justify-content: center; }
.card-member-node .card-node-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--accent-strong); }
.card-member-node .card-node-icon svg { width: 100%; height: 100%; }
.card-member-node .card-node-icon img { width: 100%; height: 100%; object-fit: contain; }
.card-member-node .card-node-icon .node-mini-sigil,
.rel-faction-btn .btn-icon .node-mini-sigil {
    font-size: .62rem;
    line-height: 1;
    letter-spacing: .03rem;
    text-align: center;
}
.node-mini-media { width: 100%; height: 100%; display: inline-flex; align-items: center; justify-content: center; }
.node-mini-media > img { width: 100%; height: 100%; display: block; object-fit: contain; margin: 0 auto; }
.node-mini-media > .node-mini-fallback { width: 100%; height: 100%; display: inline-flex; align-items: center; justify-content: center; }
.node-mini-media > .node-mini-fallback[hidden] { display: none; }
.node-mini-media svg { width: 100%; height: 100%; }
.node-mini-sigil { font-size: 11px; font-weight: 800; letter-spacing: .05rem; color: var(--accent-strong); font-family: var(--font-heading); }
.card-icon .node-mini-sigil { color: currentColor; font-family: var(--font-heading); font-size: 1.15rem; letter-spacing: .04rem; line-height: 1; text-align: center; }
.card-icon .node-mini-sigil--card {
    color: var(--text-primary);
    font-size: 1.25rem;
    letter-spacing: .035rem;
    text-shadow: 0 0 12px rgba(var(--accent-rgb), .35);
}
.faction-card .entity-logo-img--card { width: 90%; height: 90%; object-fit: contain; display: block; margin: 0 auto; transform: none; }
.faction-card .entity-logo-img--card.entity-logo-img--cover,
.entity-logo-img--cover { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.faction-card .entity-logo-img--card.entity-logo-img--white { filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.entity-logo-img--white { filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.card-member-node .entity-logo-img,
.rel-faction-btn .entity-logo-img,
.rel-mini-icon .entity-logo-img,
.rel-focus-icon .entity-logo-img { width: 100%; height: 100%; object-fit: contain; }

.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; border-top: 1px solid rgba(255,255,255,0.04); padding-top: 12px; }
.card-stat { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.card-view-btn { color: var(--accent-strong); font-weight: 700; text-transform: uppercase; letter-spacing: .08rem; font-size: .82rem; transition: color 0.2s ease; }
.faction-card:hover .card-view-btn { color: #ffffff; text-shadow: 0 0 12px rgba(var(--accent-rgb), .35); }

/* ---------- INFLUENCE EXPLORER ---------- */
.rel-interface { position: relative; z-index: 1; display: grid; grid-template-columns: 280px 1fr; gap: 22px; min-height: 520px; }
.rel-selector-sidebar { border-right: 1px solid rgba(255, 255, 255, .06); padding-right: 18px; display: flex; flex-direction: column; }
.rel-selector-header { margin-bottom: 14px; }
.rel-selector-header h3 { font-size: .88rem; letter-spacing: .08rem; text-transform: uppercase; color: var(--text-secondary); font-weight: 700; }
.rel-faction-list { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; padding-right: 8px; }
.rel-faction-list::-webkit-scrollbar { width: 4px; }
.rel-faction-list::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), .4); }

.rel-faction-btn { 
    width: 100%; 
    display: grid; 
    grid-template-columns: 30px 1fr auto; 
    align-items: center; 
    gap: 10px; 
    padding: 10px 14px; 
    border-radius: 0; 
    border: 1px solid rgba(255, 255, 255, .05); 
    background: rgba(255, 255, 255, .01); 
    color: var(--text-secondary); 
    text-align: left; 
    transition: all .25s ease; 
}
.rel-faction-btn:hover { 
    border-color: rgba(var(--accent-rgb), .35); 
    background: rgba(var(--accent-rgb), .08); 
    color: var(--text-primary); 
    transform: translateX(4px); 
}
.rel-faction-btn.active { 
    border-color: var(--accent); 
    background: rgba(var(--accent-rgb), .16); 
    color: var(--accent-strong); 
    box-shadow: inset 3px 0 0 var(--accent);
}
.rel-faction-btn .btn-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--accent-strong); }
.rel-faction-btn .btn-icon svg { width: 100%; height: 100%; }
.rel-faction-btn .btn-icon img { width: 100%; height: 100%; object-fit: contain; }
.rel-faction-btn .btn-name { font-size: .95rem; font-weight: 700; line-height: 1.2; }
.rel-faction-btn .btn-kind { font-size: .66rem; letter-spacing: .08rem; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.rel-mini-icon .node-mini-sigil {
    font-size: .54rem;
    line-height: 1;
    letter-spacing: .03rem;
    text-align: center;
}

.rel-focus-display { display: flex; flex-direction: column; }
.rel-results { display: block; }
.rel-focus-header { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.rel-focus-icon { 
    width: 56px; 
    height: 56px; 
    border-radius: 0; 
    border: 1px solid rgba(var(--accent-rgb), .32); 
    background: rgba(255, 255, 255, .02); 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    color: var(--accent-strong); 
}
.rel-focus-icon svg { width: 28px; height: 28px; }
.rel-focus-icon img { width: 100%; height: 100%; object-fit: contain; }
.rel-focus-icon .node-mini-sigil {
    font-size: 1rem;
    line-height: 1;
    letter-spacing: .04rem;
    text-align: center;
}
.rel-focus-info h3 { font-family: var(--font-heading); font-weight: 600; font-size: 2.1rem; line-height: .98; margin-bottom: 5px; letter-spacing: 0.02rem; }
.rel-focus-info p { color: var(--text-secondary); font-size: .95rem; line-height: 1.4; }

.rel-categories { display: grid; gap: 20px; }
.rel-cat-section h4 { display: flex; align-items: center; gap: 10px; font-size: .75rem; letter-spacing: .12rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; font-weight: 700; }

/* Tactical wire lines */
.rel-cat-section h4::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(var(--accent-rgb), .35), transparent 85%); }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

/* Subtly textured relationship logs */
.rel-mini-card { 
    border: 1px solid rgba(255, 255, 255, .05); 
    background: rgba(255, 255, 255, .015); 
    border-radius: 2px; 
    padding: 14px; 
    text-align: left; 
    display: grid; 
    gap: 10px; 
    transition: all .2s ease; 
}
.rel-mini-card:hover { 
    border-color: rgba(var(--accent-rgb), .35); 
    background: rgba(var(--accent-rgb), .08); 
    transform: translateY(-2px); 
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.rel-mini-target { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text-primary); font-size: 0.95rem; }
.rel-mini-icon { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; color: var(--rel-card-accent, var(--accent-strong)); }
.rel-mini-icon svg { width: 100%; height: 100%; }
.rel-mini-icon img { width: 100%; height: 100%; object-fit: contain; }
.rel-mini-type-text { display: inline-flex; align-items: center; }
.rel-mini-desc { color: var(--text-secondary); font-size: .88rem; line-height: 1.45; }
.rel-empty-state { padding: 24px; border: 1px dashed rgba(255, 255, 255, .1); border-radius: 2px; text-align: center; color: var(--text-secondary); }
.rel-type-icon { width: 13px; height: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rel-type-icon svg { width: 100%; height: 100%; display: block; }
.rel-type-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 0; border: 1px solid currentColor; font-size: .63rem; letter-spacing: .09rem; font-weight: 700; text-transform: uppercase; line-height: 1; }
.rel-type-structure { color: #d1ab73; }
.rel-type-alliance { color: #93c5fd; }
.rel-type-conflict { color: #ff8f8f; }
.rel-type-fracture { color: #aab8ff; }
.rel-type-badge.rel-type-structure { background: rgba(185, 143, 86, .12); }
.rel-type-badge.rel-type-alliance { background: rgba(var(--chakra-rgb), .15); }
.rel-type-badge.rel-type-conflict { background: rgba(179, 57, 57, .16); }
.rel-type-badge.rel-type-fracture { background: rgba(86, 103, 167, .16); }
.rel-cat-section h4 .rel-type-icon { width: 14px; height: 14px; }

/* ---------- FOOTER ---------- */
#footer {
    padding: 42px 20px;
    background: var(--bg-deep);
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-content {
    max-width: 900px;
    margin: 0 auto;
}
.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: .06rem;
}
.footer-logo-img {
    height: 30px;
    width: auto;
    opacity: 0.82;
    filter: opacity(0.9) drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.35));
    transition: all 0.2s ease;
}
.footer-logo:hover .footer-logo-img {
    opacity: 1;
    filter: opacity(1) drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.45));
}
.footer-logo span:last-child { opacity: 0.88; }
.footer-logo span:last-child .accent { color: var(--accent); }
.footer-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 7px auto 0;
    max-width: 780px;
    font-weight: 500;
}
.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 10px;
}
.footer-separator {
    color: rgba(255, 255, 255, .3);
    margin: 0 2px;
}
.footer-credit-link,
.kofi-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--accent-strong);
    font-weight: 700;
    transition: all .2s ease;
    font-size: 0.8rem;
    letter-spacing: 0;
    text-decoration: none;
    padding: 2px 5px;
    border-radius: 4px;
}
.footer-credit-link:hover,
.footer-credit-link:focus-visible,
.kofi-link:hover,
.kofi-link:focus-visible {
    color: #05080e;
    background: var(--accent-strong);
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.28);
}
.footer-links .kofi-icon,
.footer-links .kofi-link > svg {
    width: 14px;
    height: 14px;
    display: inline-flex;
    flex-shrink: 0;
    margin-right: 0 !important;
}

/* ---------- MODALS ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(3, 5, 8, .92);
    backdrop-filter: blur(8px);
    z-index: 1600;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .28s ease, visibility 0s linear .28s;
}
.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

/* Sharp geometric Dossiers Modals */
.modal { 
    position: relative; 
    width: min(960px, 100%); 
    max-height: min(92vh, 960px); 
    overflow-y: auto; 
    border-radius: 2px; 
    background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .005)), rgba(8, 12, 20, .98); 
    border: 2px solid var(--border-strong); 
    box-shadow: 0 40px 90px rgba(0, 0, 0, .8), inset 0 0 50px rgba(var(--accent-rgb), 0.05); 
    padding: 0 30px 30px; 
    transform: translateY(22px) scale(.98); 
    transition: transform .3s cubic-bezier(0.2, 0.8, 0.2, 1); 
}
.modal-overlay.visible .modal { transform: translateY(0) scale(1); }

/* headband cloth design */
.modal-accent-bar { height: 5px; margin: 0 -30px 18px; border-radius: 0; background: linear-gradient(90deg, rgba(var(--accent-rgb), .3) 0%, var(--accent) 50%, rgba(var(--chakra-rgb), .4) 100%); }

.modal-close { 
    position: absolute; 
    top: 24px; 
    right: 24px; 
    width: 40px; 
    height: 40px; 
    border-radius: 0; 
    border: 1px solid rgba(255, 255, 255, .08); 
    background: rgba(255, 255, 255, .02); 
    color: var(--text-secondary); 
    font-size: 1.6rem; 
    line-height: 1; 
    cursor: pointer; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease; 
}
.modal-close:hover { color: var(--accent-strong); border-color: var(--accent); background: rgba(var(--accent-rgb), .12); }

.modal-header { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; padding: 42px 58px 0 0; }
.modal-icon, .hero-modal-portrait { 
    width: 88px; 
    height: 88px; 
    border-radius: 0; 
    flex-shrink: 0; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    background: rgba(255, 255, 255, .02); 
    border: 2px solid rgba(var(--accent-rgb), .28); 
    overflow: hidden; 
}
.modal-header > .modal-icon {
    width: 82px;
    height: 82px;
    padding: 10px;
    border-radius: 6px;
    background:
        linear-gradient(180deg, rgba(var(--accent-rgb), .07), rgba(var(--chakra-rgb), .025)),
        rgba(255, 255, 255, .02);
    border-color: rgba(var(--accent-rgb), .36);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .035),
        0 10px 24px rgba(0, 0, 0, .28);
}
.modal-header > .modal-icon svg,
.modal-header > .modal-icon .entity-logo-img,
.modal-header > .modal-icon .node-mini-media,
.modal-header > .modal-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.modal-header > .modal-icon .node-mini-sigil {
    font-size: 1.35rem;
    line-height: 1;
    text-align: center;
}
.hero-modal-portrait { border-radius: 50%; box-shadow: 0 0 0 6px rgba(var(--accent-rgb), .06); border: 2px solid var(--accent); }
.hero-modal-portrait img { width: 100%; height: 100%; object-fit: cover; }

.modal-title { font-family: var(--font-heading); font-weight: 700; font-size: clamp(2.35rem, 4.5vw, 3.55rem); line-height: .96; margin-bottom: 6px; }
.modal-title-wrap {
    min-width: 0;
}
.modal-alignment, .hero-modal-subtitle { 
    display: inline-flex; 
    align-items: center; 
    min-height: 30px; 
    padding: 0 16px; 
    border-radius: 2px; 
    background: linear-gradient(180deg, #576574 0%, #2f3640 50%, #1e272e 100%); 
    border: 1px solid var(--border-metal); 
    color: #f5f6fa; 
    font-size: .8rem; 
    letter-spacing: .14rem; 
    text-transform: uppercase; 
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.modal-body { display: grid; gap: 24px; }
.modal-section h3 { font-family: var(--font-heading); font-weight: 600; font-size: 1.6rem; line-height: 1; color: var(--accent-strong); margin-bottom: 10px; letter-spacing: 0.02rem; }
.modal-section p { color: var(--text-secondary); line-height: 1.58; margin: 0; }
.modal-description {
    display: grid;
    gap: 12px;
}
.modal-description p {
    margin: 0;
}
.modal-overview-lead {
    color: var(--text-primary);
    font-size: 1.03rem;
    line-height: 1.72;
}
.modal-overview-context {
    color: var(--text-secondary);
    font-size: .95rem;
    line-height: 1.64;
}
.modal-overview-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}
.modal-overview-fact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid rgba(var(--accent-rgb), .18);
    background: rgba(255, 255, 255, .025);
    color: var(--text-secondary);
    font-size: .78rem;
    line-height: 1.2;
    letter-spacing: .02rem;
}
.modal-overview-fact-label {
    color: var(--accent-strong);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .075rem;
    font-size: .64rem;
}
.modal-overview-fact-value {
    color: var(--text-primary);
    font-weight: 700;
}
.modal-overview-inline-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 20px;
    padding: 1px 7px 1px 1px;
    margin: 0 1px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .025);
    color: var(--text-primary);
    vertical-align: baseline;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.modal-overview-inline-pill:hover,
.modal-overview-inline-pill:focus-visible {
    border-color: rgba(var(--accent-rgb), .35);
    background: rgba(var(--accent-rgb), .09);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
}
.modal-overview-inline-pill--character {
    border-color: rgba(255, 255, 255, .12);
}
.modal-overview-inline-pill-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(var(--accent-rgb), .18);
    color: var(--accent-strong);
}
.modal-overview-inline-pill--character .modal-overview-inline-pill-icon {
    background: rgba(7, 11, 20, .88);
    border-color: rgba(var(--accent-rgb), .28);
}
.modal-overview-inline-pill--group .modal-overview-inline-pill-icon {
    border-radius: 2px;
    background: rgba(255, 255, 255, .03);
}
.modal-overview-inline-pill-icon svg,
.modal-overview-inline-pill-icon img,
.modal-overview-inline-pill-icon .node-mini-media {
    width: 100%;
    height: 100%;
}
.modal-overview-inline-pill-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.modal-overview-inline-pill-label {
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: .02rem;
    color: var(--text-primary);
}

.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.member-chip { 
    display: flex; 
    align-items: center; 
    gap: 14px; 
    width: 100%; 
    padding: 14px; 
    border-radius: 2px; 
    background: rgba(255, 255, 255, 0.02); 
    border: 1px solid rgba(255, 255, 255, 0.05); 
    color: var(--text-primary); 
    transition: all .2s ease; 
    cursor: pointer; 
}
.member-chip:hover { 
    transform: translateY(-3px); 
    border-color: rgba(var(--accent-rgb), .35); 
    background: rgba(var(--accent-rgb), .08); 
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); 
}
.member-chip-img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid rgba(var(--accent-rgb), .25); box-shadow: 0 0 12px rgba(0, 0, 0, 0.4); }
.member-chip > div,
.member-chip > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; }
.member-name { font-weight: 700; font-size: 0.98rem; color: var(--text-primary); letter-spacing: 0.02rem; }
.member-role { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08rem; }
.member-role--rel { text-transform: none; letter-spacing: 0; }
.member-role--rel .rel-type-badge { font-size: .62rem; }
.modal-empty-note {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: .92rem;
    line-height: 1.5;
}

.relationship-list { display: grid; gap: 18px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .06); }
.modal-rel-groups { display: grid; gap: 16px; }
.modal-rel-group { display: grid; gap: 10px; }
.modal-rel-heading { display: flex; align-items: center; gap: 8px; font-size: .72rem; letter-spacing: .11rem; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.modal-rel-heading .rel-type-icon { width: 14px; height: 14px; }
.modal-rel-chip-row { display: flex; flex-wrap: wrap; gap: 10px; }

.modal-rel-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, .06);
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 700;
    transition: all .2s ease;
}
.modal-rel-chip:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), .12);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.modal-rel-chip-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: var(--accent-strong); }
.modal-rel-chip-icon svg { width: 100%; height: 100%; }
.modal-rel-chip-icon img { width: 100%; height: 100%; object-fit: contain; }
.modal-rel-chip-name { font-size: .88rem; font-weight: 700; line-height: 1.1; }
.modal-rel-cta-row { margin-top: 2px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .06); }

.modal-rel-open-explorer {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 0;
    border: 2px solid var(--accent);
    background: rgba(var(--accent-rgb), .12);
    color: var(--text-primary);
    font-size: .75rem;
    letter-spacing: .12rem;
    text-transform: uppercase;
    font-weight: 700;
    clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
    cursor: pointer;
    transition: all .2s ease;
}
.modal-rel-open-explorer::after { content: "\2197"; margin-left: 8px; font-size: .8rem; }
.modal-rel-open-explorer:hover {
    background: rgba(var(--accent-rgb), .22);
    border-color: var(--accent-strong);
    color: var(--accent-strong);
    transform: translateY(-1px);
}

/* ---------- TIMELINE ---------- */
.timeline-slab {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 8px 4px;
    overflow: visible;
}
.timeline-slab::before { display: none; }
.timeline-container {
    --timeline-content-x: 66px;
    --timeline-line-x: 23px;
    --timeline-dot-left: -50px;
    --timeline-dot-size: 13px;
    --timeline-dot-top: 29px;
    position: relative;
    max-width: 1040px;
    margin: 0 auto;
    padding: 12px 0 8px var(--timeline-content-x);
    display: grid;
    gap: 18px;
}

/* Timeline Scroll Ribbon Line */
.timeline-container::before {
    content: "";
    position: absolute;
    left: var(--timeline-line-x);
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(var(--accent-rgb), .85) 8%,
        rgba(var(--accent-rgb), .65) 88%,
        transparent 100%
    );
    z-index: 1;
}

.timeline-era {
    position: relative;
    display: grid;
    gap: 16px;
}
.timeline-era + .timeline-era {
    margin-top: 22px;
}
.timeline-era-header {
    position: relative;
    padding: 18px 22px 18px;
    border: 1px solid rgba(var(--accent-rgb), .2);
    border-left: 3px solid var(--accent);
    border-radius: 2px;
    background:
        linear-gradient(90deg, rgba(var(--accent-rgb), .12), transparent 46%),
        rgba(7, 11, 20, .82);
    box-shadow: 0 18px 34px rgba(0, 0, 0, .34);
}
.timeline-era-header::before {
    content: "";
    position: absolute;
    left: var(--timeline-dot-left);
    top: 28px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--accent);
    background: var(--bg-deepest);
    transform: rotate(45deg);
    box-shadow: 0 0 0 6px rgba(7, 11, 20, .92), 0 0 18px rgba(var(--accent-rgb), .34);
    z-index: 4;
}
.timeline-era-kicker {
    color: var(--accent-strong);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .14rem;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.timeline-era-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(1.5rem, 2.6vw, 2.35rem);
    line-height: 1;
    letter-spacing: .02rem;
    margin: 0 0 8px;
    text-transform: uppercase;
}
.timeline-era-desc {
    color: var(--text-secondary);
    max-width: 74ch;
    font-size: .95rem;
    line-height: 1.55;
    margin: 0;
}
.timeline-era-count {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-top: 12px;
    padding: 2px 12px;
    border: 1px solid rgba(var(--accent-rgb), .28);
    background: rgba(var(--accent-rgb), .08);
    color: var(--text-muted);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .1rem;
    text-transform: uppercase;
}
.timeline-era-events {
    display: grid;
    gap: 18px;
}

.timeline-item {
    position: relative;
    padding: 20px 24px 18px;
    border-radius: 2px; /* Sharp corners */
    border: 1px solid rgba(255, 255, 255, .06);
    background: 
        radial-gradient(circle at 90% 10%, rgba(var(--accent-rgb), .05), transparent 35%),
        linear-gradient(180deg, rgba(20, 27, 42, 0.95), rgba(12, 17, 26, 0.98));
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateX(28px);
    transition: opacity .56s cubic-bezier(.16, 1, .3, 1), transform .56s cubic-bezier(.16, 1, .3, 1), border-color .2s ease;
    isolation: isolate;
}

/* Shuriken styled timeline knot node */
.timeline-item::before {
    content: "";
    position: absolute;
    left: var(--timeline-dot-left);
    top: var(--timeline-dot-top);
    width: var(--timeline-dot-size);
    height: var(--timeline-dot-size);
    border-radius: 0;
    background: var(--bg-deepest);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 5px rgba(7, 11, 20, .9);
    transform: rotate(45deg);
    z-index: 4;
}
.timeline-item::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    opacity: .9;
}
.timeline-item.visible { opacity: 1; transform: translateX(0); }
.timeline-item:hover {
    border-color: rgba(var(--accent-rgb), .35);
    box-shadow: 0 22px 38px rgba(0, 0, 0, .5);
}

.timeline-date {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 2px 14px;
    border-radius: 2px; /* Sharp plate */
    border: 1px solid var(--border-metal);
    background: linear-gradient(180deg, #576574 0%, #2f3640 50%, #1e272e 100%);
    color: #f5f6fa;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .13rem;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    margin-bottom: 10px;
}
.timeline-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.45rem;
    line-height: 1.14;
    margin-bottom: 7px;
    letter-spacing: 0.02rem;
}
.timeline-desc {
    color: var(--text-secondary);
    font-size: .95rem;
    line-height: 1.55;
}
.timeline-factions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.timeline-actors {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.timeline-tag,
.change-faction {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 0 12px 0 8px;
    border-radius: 0; /* Sharp tag */
    border: 1px solid rgba(var(--accent-rgb), .28);
    background: rgba(var(--accent-rgb), .08);
    color: var(--text-primary);
    font-size: .63rem;
    font-weight: 700;
    letter-spacing: .08rem;
    text-transform: uppercase;
    line-height: 1;
    transition: background .18s ease, border-color .18s ease;
}
.timeline-tag:hover,
.change-faction:hover {
    background: rgba(var(--accent-rgb), .2);
    border-color: var(--accent);
}
.timeline-chip-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-strong);
    background: transparent;
    border: 0;
    flex-shrink: 0;
}
.timeline-chip-icon svg,
.timeline-chip-icon img,
.timeline-chip-icon .entity-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.timeline-chip-icon .node-mini-sigil {
    font-size: .56rem;
    letter-spacing: .04rem;
}

.timeline-ripples,
.timeline-changes {
    margin-top: 12px;
    padding: 12px;
    border-radius: 2px; /* Sharp logs */
    border: 1px solid rgba(255, 255, 255, .05);
    background: linear-gradient(180deg, rgba(255, 255, 255, .015), rgba(255, 255, 255, .005));
}
.ripple-header,
.change-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .13rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.ripple-header::after,
.change-header::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), .3), transparent 85%);
}
.ripple-list,
.change-list {
    display: grid;
    gap: 7px;
}
.timeline-ripple-item {
    width: 100%;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, .06);
    background: rgba(255, 255, 255, .015);
    padding: 10px 12px;
    display: grid;
    gap: 6px;
    text-align: left;
    transition: border-color .18s ease, background .18s ease;
}
button.timeline-ripple-item:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), .1);
}
.ripple-faction {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-primary);
}
.ripple-impact {
    color: var(--text-secondary);
    font-size: .85rem;
    line-height: 1.4;
}
.timeline-change-item {
    --change-rgb: var(--accent-rgb);
    --change-color: var(--accent-strong);
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, .06);
    background: rgba(255, 255, 255, .01);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
}
.change-icon {
    width: 22px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--change-color);
    font-size: .95rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 10px rgba(var(--change-rgb), .34);
}
.change-copy {
    min-width: 0;
    display: grid;
    gap: 5px;
}
.change-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    font-size: .88rem;
    line-height: 1.4;
}
.change-actor-pill,
.timeline-actor-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 2px 12px 2px 2px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
    color: var(--text-primary);
    transition: background .18s ease, border-color .18s ease;
}
.change-actor-pill:hover,
.timeline-actor-pill:hover {
    background: rgba(var(--accent-rgb), .12);
    border-color: var(--accent);
}
.change-actor-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(var(--accent-rgb), .34);
    background: rgba(7, 11, 20, .86);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.change-actor-avatar .change-actor-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
}
.change-actor-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04rem;
    line-height: 1;
    white-space: nowrap;
}
.timeline-actor-pill .change-actor-label {
    font-size: .68rem;
    letter-spacing: .05rem;
}
.change-actor {
    color: var(--text-primary);
    font-weight: 700;
}
.change-action {
    color: var(--text-secondary);
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.change-faction {
    min-height: 28px;
    padding: 0 10px 0 6px;
    gap: 6px;
    font-size: .6rem;
    letter-spacing: .07rem;
}
.change-faction .timeline-chip-icon {
    width: 18px;
    height: 18px;
}
.timeline-change-item .change-faction {
    border-color: rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .02);
}
.timeline-change-item .change-faction:hover {
    border-color: rgba(var(--change-rgb), .36);
    background: rgba(var(--change-rgb), .1);
}
.change-impact {
    color: var(--text-muted);
    font-size: .78rem;
    line-height: 1.42;
}

.timeline-change-item.joined { --change-rgb: var(--chakra-rgb); --change-color: #bfdbfe; }
.timeline-change-item.defected { --change-rgb: 239, 68, 68; --change-color: #fecaca; }
.timeline-change-item.founded { --change-rgb: var(--chakra-rgb); --change-color: #bae6fd; }
.timeline-change-item.collapsed { --change-rgb: 245, 158, 11; --change-color: #fde68a; }
.timeline-change-item.reformed { --change-rgb: 168, 85, 247; --change-color: #e9d5ff; }

/* ---------- LANGUAGE SWITCHER ---------- */
.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 5px 8px 5px 12px;
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    border-radius: 4px;
    background: rgba(5, 8, 14, 0.76);
    color: var(--text-primary);
    box-shadow: inset 0 0 14px rgba(var(--accent-rgb), 0.08), 0 0 18px rgba(var(--accent-rgb), 0.08);
    flex-shrink: 0;
    transform: translateY(-1px);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.language-switcher:hover,
.language-switcher:focus-within {
    border-color: rgba(var(--accent-rgb), 0.6);
    background: rgba(5, 8, 14, 0.86);
    box-shadow: inset 0 0 14px rgba(var(--accent-rgb), 0.12), 0 0 18px rgba(var(--accent-rgb), 0.12);
}
.language-switcher label {
    color: var(--accent-strong);
    font-family: var(--font-heading);
    font-size: 0.58rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.35);
    white-space: nowrap;
}
.language-switcher select {
    width: 108px;
    min-width: 0;
    min-height: 28px;
    border: 1px solid rgba(var(--accent-rgb), 0.38);
    border-radius: 3px;
    background: rgba(5, 8, 14, 0.9);
    color: inherit;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    text-transform: uppercase;
    outline: 0;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 5px 8px;
}
.language-switcher select option {
    color: #111827;
    background: #ffffff;
}

.nav-language-control-top {
    margin-left: -6px;
}
.nav-language-control-top label {
    font-size: 0.58rem;
    letter-spacing: 1.4px;
}
.nav-language-control-top select {
    width: 108px;
    font-size: 0.72rem;
}

.nav-language-control-mobile {
    display: none;
}

/* ---------- BACK TO TOP ---------- */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: rgba(5, 8, 14, 0.85);
    border: 2px solid var(--accent);
    color: var(--accent-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0; /* Sharp */
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 100;
}
.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.back-to-top:hover {
    background: rgba(var(--accent-rgb), 0.16);
    color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.35);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1240px) {
    .factions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-layout { padding-top: 72px; }
}

@media (max-width: 1320px) {
    .mobile-menu-toggle {
        display: flex;
    }
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: min(82vw, 340px);
        height: 100vh;
        padding: 92px 28px 28px;
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        background: rgba(5, 8, 14, 0.98);
        border-left: 2px solid var(--border-strong);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
        transform: translateX(105%);
        transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1201;
    }
    .nav-links.active { transform: translateX(0); }
    .nav-link {
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 1rem;
        letter-spacing: 0.12rem;
    }
    .nav-language-control-mobile {
        display: inline-flex;
        width: 100%;
        justify-content: space-between;
    }
    .nav-language-control-mobile select {
        flex: 1;
        text-align: right;
    }
    .nav-kofi-btn {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
    .nav-kofi-btn .kofi-icon {
        width: 15px;
        height: 15px;
    }
}

@media (max-width: 768px) {
    body::before,
    body::after {
        display: none;
    }

    #main-nav {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        column-gap: 10px;
        padding: 12px 24px;
    }
    .nav-identity {
        justify-self: start;
        min-width: 0;
    }
    .nav-language-control-top {
        display: none;
    }
    .site-switcher-toggle {
        gap: 8px;
        min-width: 0;
    }
    .site-switcher-menu { left: 0; min-width: 220px; }
    .site-switcher-link { font-size: 0.72rem; letter-spacing: 1.2px; }
    .nav-logo { gap: 8px; min-width: 0; max-width: 100%; }
    .nav-logo-text {
        font-size: 0.84rem;
        letter-spacing: 1.05px;
        white-space: nowrap;
    }
    .nav-logo-mark { width: 32px; height: 32px; padding: 4px; }
    .nav-hub-link-center {
        position: static;
        transform: none;
        justify-self: center;
    }
    .nav-hub-icon { width: 32px; height: 32px; }
    .mobile-menu-toggle { justify-self: end; }
    #hero { padding-top: 104px; }
    .hero-banner-art { left: 50%; width: auto; min-width: 100%; transform: translateX(-50%); object-position: 50% 56%; }
    .hero-layout { padding-top: 36px; text-align: center; justify-content: center; }
    .hero-content { align-items: center; margin: 0 auto; max-width: min(860px, 92vw); transform: none; }
    .hero-content::before { left: 50%; width: calc(100vw - 20px); height: min(520px, 68vh); transform: translate(-50%, -50%); }
    .hero-title-line { display: block; margin-left: 0; }
    .hero-title-line + .hero-title-line { margin-left: 0; }
    .hero-subtitle { width: min(28ch, calc(100vw - 56px)); max-width: calc(100vw - 56px); }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-language-control { width: min(100%, 280px); justify-content: space-between; }
    .hero-language-control select { width: 132px; }
    .hero-stats { justify-content: center; }
    .stat-item { min-width: 140px; }
    .factions-grid { grid-template-columns: 1fr; }
    .rel-interface { grid-template-columns: 1fr; }
    .rel-selector-sidebar { border-right: none; border-bottom: 1px solid rgba(255, 255, 255, .08); padding-right: 0; padding-bottom: 12px; }
    .rel-faction-list { max-height: 180px; }
    .timeline-slab { padding: 2px; }
    .timeline-container {
        --timeline-content-x: 25px;
        --timeline-line-x: 8px;
        --timeline-dot-left: -22px;
        --timeline-dot-size: 10px;
        --timeline-dot-top: 24px;
        padding: 8px 0 4px var(--timeline-content-x);
        gap: 14px;
    }
    .timeline-container::before { left: var(--timeline-line-x); top: 0; bottom: 0; }
    .timeline-item { padding: 16px 14px 14px; border-radius: 0; transform: translateX(14px); }
    .timeline-item::before { border-radius: 0; }
    .timeline-item::after { left: 0; right: auto; }
    .timeline-title { font-size: 1.15rem; }
    .timeline-desc { font-size: .9rem; }
    .timeline-actors { margin-top: 9px; gap: 6px; }
    .timeline-factions { margin-top: 12px; gap: 6px; }
    .timeline-tag { min-height: 28px; padding: 0 9px 0 6px; font-size: .57rem; letter-spacing: .06rem; gap: 6px; }
    .timeline-chip-icon { width: 18px; height: 18px; }
    .timeline-ripples,
    .timeline-changes { margin-top: 10px; padding: 9px; }
    .timeline-ripple-item { padding: 8px 9px; }
    .timeline-change-item {
        grid-template-columns: 1fr;
        gap: 7px;
        padding: 10px 10px 10px 12px;
    }
    .change-icon { width: 16px; height: 18px; font-size: .9rem; }
    .change-main { font-size: .81rem; }
    .change-actor-pill,
    .timeline-actor-pill { min-height: 24px; padding: 1px 8px 1px 1px; gap: 6px; }
    .change-actor-avatar { width: 20px; height: 20px; }
    .change-actor-label { font-size: .65rem; }
    .timeline-actor-pill .change-actor-label { font-size: .62rem; }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: min(82vw, 340px);
        height: 100vh;
        padding: 92px 28px 28px;
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        background: rgba(5, 8, 14, 0.98);
        border-left: 2px solid var(--border-strong);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
        transform: translateX(105%);
        transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1201;
    }
    .nav-links.active { transform: translateX(0); }
    .nav-link {
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 1rem;
        letter-spacing: 0.12rem;
    }
    .section-slab { padding: 20px; }
    .modal { padding: 0 20px 20px; }
    .modal-accent-bar { margin-inline: -20px; }
    .modal-header {
        align-items: flex-start;
        gap: 14px;
        padding: 34px 44px 0 0;
        margin-bottom: 20px;
    }
    .modal-header > .modal-icon {
        width: 68px;
        height: 68px;
        padding: 8px;
    }
    .modal-title { font-size: clamp(2rem, 10vw, 2.75rem); }
}

@media (min-width: 769px) and (max-width: 1500px) {
    .nav-hub-link-center {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 480px) {
    #hero { padding-top: 98px; }
    .hero-banner-art { object-position: 50% 54%; }
    .hero-title { width: 100%; font-size: clamp(2.2rem, 13vw, 2.8rem); }
    .hero-subtitle { width: min(28ch, calc(100vw - 56px)); font-size: .98rem; }
    .hero-content { transform: none; }
    .hero-content::before { border-radius: 2px; height: min(470px, 58vh); }
    .hero-actions { flex-direction: column; align-items: center; width: 100%; }
    .hero-cta { justify-content: center; }
    .timeline-container {
        --timeline-content-x: 18px;
        --timeline-line-x: 5px;
        --timeline-dot-left: -18px;
        --timeline-dot-size: 10px;
        --timeline-dot-top: 24px;
        padding-left: var(--timeline-content-x);
    }
    .timeline-container::before { left: var(--timeline-line-x); }
    .timeline-date { min-height: 26px; padding: 3px 10px; font-size: .66rem; letter-spacing: .1rem; margin-bottom: 10px; }
    .change-actor-pill,
    .timeline-actor-pill { min-height: 22px; padding: 1px 7px 1px 1px; }
    .change-actor-avatar { width: 18px; height: 18px; }
    .change-actor-label { font-size: .6rem; }
    .timeline-actor-pill .change-actor-label { font-size: .58rem; }
    .section-header { gap: 12px; margin-bottom: 30px; }
    .section-badge { max-width: 100%; justify-content: center; padding: 0 18px; }
    .modal-header {
        flex-direction: column;
        padding-right: 44px;
    }
}

.site-switcher-menu {
    min-width: 300px;
    max-width: min(340px, calc(100vw - 32px));
    padding: 10px;
}

.site-switcher-link {
    position: relative;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    padding: 12px 14px 12px 16px;
    overflow: hidden;
}

.site-switcher-link::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 2px;
    background: var(--switcher-accent, var(--accent));
    opacity: 0.45;
}

.site-switcher-link:hover::before,
.site-switcher-link:focus-visible::before {
    opacity: 1;
    box-shadow: 0 0 14px var(--switcher-glow, rgba(255, 255, 255, 0.4));
}

.site-switcher-link-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
}

.site-switcher-link-label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
    line-height: 1.12;
    letter-spacing: 0;
}

.site-switcher-link-kicker {
    color: var(--text-muted, rgba(255, 255, 255, 0.58));
    font-size: 0.56rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.site-switcher-link-accent {
    font-size: 0.92rem;
    letter-spacing: 1.45px;
    text-transform: uppercase;
}

.site-switcher-link.ow-link { --switcher-accent: #d28cff; --switcher-glow: rgba(187, 41, 255, 0.55); }
.site-switcher-link.mr-link { --switcher-accent: #ff5c7a; --switcher-glow: rgba(255, 47, 96, 0.5); }
.site-switcher-link.cp-link { --switcher-accent: #fcee09; --switcher-glow: rgba(252, 238, 9, 0.55); }
.site-switcher-link.lol-link { --switcher-accent: #c8aa6e; --switcher-glow: rgba(200, 170, 110, 0.48); }
.site-switcher-link.ymir-link { --switcher-accent: #ff8a3d; --switcher-glow: rgba(255, 122, 48, 0.48); }
.site-switcher-link.shinobi-link { --switcher-accent: #ff9d3d; --switcher-glow: rgba(var(--accent-rgb), 0.55); }
.site-switcher-link.wf-link { --switcher-accent: #22d3ee; --switcher-glow: rgba(34, 211, 238, 0.55); }
.site-switcher-link.cod-link { --switcher-accent: #d8d7c4; --switcher-glow: rgba(216, 215, 196, 0.5); }
.site-switcher-link.tes-link { --switcher-accent: #d8b36a; --switcher-glow: rgba(216, 179, 106, 0.48); }

.site-switcher-link .site-switcher-link-accent {
    color: var(--switcher-accent, currentColor);
    text-shadow: 0 0 12px var(--switcher-glow, transparent);
}

.site-switcher-toggle .nav-logo-icon-container,
.site-switcher-toggle .nav-logo-mark {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.site-switcher-link[aria-disabled="true"] {
    opacity: 0.68;
    cursor: default;
}

.site-switcher-link[aria-disabled="true"]:hover,
.site-switcher-link[aria-disabled="true"]:focus-visible {
    opacity: 0.78;
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 640px) {
    .rel-interface {
        gap: 16px;
        min-height: 0;
    }
    .rel-selector-sidebar {
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
        padding-right: 0;
        padding-bottom: 14px;
    }
    .rel-selector-header {
        margin-bottom: 14px;
    }
    .rel-faction-list {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
    .rel-faction-btn {
        display: flex;
        min-width: 0;
        min-height: 70px;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        padding: 9px 5px;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .rel-faction-btn:hover {
        transform: translateY(-1px);
    }
    .rel-faction-btn .btn-icon {
        width: 24px;
        height: 24px;
    }
    .rel-faction-btn .btn-name {
        display: block;
        max-width: 100%;
        font-size: 0.68rem;
        font-weight: 800;
        line-height: 1.18;
        overflow-wrap: anywhere;
    }
    .rel-faction-btn .btn-kind {
        display: block;
        max-width: 100%;
        font-size: 0.52rem;
        line-height: 1.1;
        letter-spacing: 0.05rem;
        overflow-wrap: anywhere;
    }
}
