@font-face {
    font-family: "Aquire";
    src: url("../assets/fonts/Aquire-BW0ox.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Aquire";
    src: url("../assets/fonts/AquireBold-8Ma60.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-0: #060606;
    --bg-1: #11100d;
    --bg-2: #18150f;
    --panel: rgba(18, 14, 9, 0.88);
    --panel-soft: rgba(26, 20, 14, 0.72);
    --stroke: rgba(218, 168, 79, 0.24);
    --stroke-strong: rgba(240, 203, 132, 0.5);
    --text: #f4ebd6;
    --muted: #cdbd98;
    --gold: #d9a84f;
    --ember: #b84e26;
    --wine: #6f2319;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --cutout-shape: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background:
        radial-gradient(circle at top, rgba(199, 130, 51, 0.08), transparent 28%),
        radial-gradient(circle at 15% 20%, rgba(120, 31, 20, 0.14), transparent 26%),
        radial-gradient(circle at 85% 8%, rgba(106, 24, 18, 0.16), transparent 24%),
        linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 38%, var(--bg-0) 100%);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Spectral", Georgia, serif;
    letter-spacing: 0.01em;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 24px 24px;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.mono {
    font-family: Consolas, "Courier New", monospace;
}

.hidden {
    display: none !important;
}

.page-shell {
    width: min(1440px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

.page-shell-home {
    display: grid;
    gap: 1.5rem;
    padding-bottom: 3.5rem;
}

.viewer-shell {
    width: min(1920px, calc(100% - 1rem));
    margin: 0 auto;
    padding: 1rem 0 2.5rem;
}

.panel-cutout {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(28, 22, 15, 0.92), rgba(14, 11, 7, 0.92));
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow);
    clip-path: var(--cutout-shape);
}

.panel-cutout::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255, 214, 137, 0.11), transparent 18%),
        linear-gradient(315deg, rgba(179, 66, 31, 0.1), transparent 20%);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--gold);
}

.eyebrow::before {
    content: "";
    width: 1.6rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, currentColor);
}

.site-hero,
.landing-banner,
.viewer-topbar,
.tree-hero,
.class-rail-panel,
.board-panel,
.section-block {
    padding: 1.5rem;
}

.site-hero {
    display: grid;
    gap: 1rem;
    min-height: 320px;
    align-content: center;
}

.landing-banner {
    position: relative;
    display: grid;
    gap: 1.5rem;
    min-height: 520px;
    background:
        radial-gradient(circle at 82% 18%, rgba(219, 174, 94, 0.24), transparent 18%),
        radial-gradient(circle at 18% 28%, rgba(118, 25, 19, 0.34), transparent 26%),
        linear-gradient(135deg, rgba(42, 26, 17, 0.94), rgba(9, 8, 7, 0.98));
    isolation: isolate;
}

.alien-invasion {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.alien-invasion::before,
.alien-invasion::after {
    content: "";
    position: absolute;
    inset: 0;
}

.alien-invasion::before {
    background:
        radial-gradient(circle at 78% 16%, rgba(103, 255, 213, 0.18), transparent 0 11%),
        radial-gradient(circle at 70% 24%, rgba(77, 197, 181, 0.22), transparent 0 18%),
        linear-gradient(180deg, rgba(7, 41, 40, 0.3), rgba(5, 18, 18, 0.12) 40%, rgba(0, 0, 0, 0.54));
    opacity: 0.96;
}

.alien-invasion::after {
    inset: 10% -18% -24% 18%;
    background:
        radial-gradient(circle at 52% 44%, rgba(113, 255, 224, 0.2), transparent 0 32%),
        radial-gradient(circle at 48% 50%, rgba(113, 255, 224, 0.08), transparent 34%),
        conic-gradient(from 120deg, rgba(120, 255, 224, 0.16), transparent 22%, rgba(120, 255, 224, 0.12) 38%, transparent 62%, rgba(120, 255, 224, 0.14) 82%, transparent);
    filter: blur(14px);
    opacity: 0.78;
    animation: storm-rotation 16s linear infinite;
}

.storm-front,
.storm-eye,
.ion-veil,
.contagion-stream,
.virus-flare {
    position: absolute;
}

.storm-front {
    inset: auto 36% -10% -16%;
    height: 68%;
    background:
        radial-gradient(circle at 28% 42%, rgba(81, 235, 208, 0.16), transparent 0 28%),
        radial-gradient(circle at 42% 56%, rgba(81, 235, 208, 0.1), transparent 0 38%),
        radial-gradient(circle at 60% 50%, rgba(81, 235, 208, 0.08), transparent 0 44%);
    filter: blur(24px);
    opacity: 0.88;
    animation: storm-drift 12s ease-in-out infinite;
}

.storm-front-primary {
    clip-path: ellipse(58% 52% at 42% 58%);
}

.storm-front-secondary {
    inset: -4% -16% auto 34%;
    height: 58%;
    opacity: 0.72;
    transform: scaleX(-1);
    clip-path: ellipse(52% 44% at 58% 42%);
    animation-duration: 15s;
}

.storm-eye {
    top: 8%;
    right: 6%;
    width: 24rem;
    height: 24rem;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, rgba(198, 255, 244, 0.5), rgba(127, 255, 225, 0.2) 9%, rgba(24, 62, 60, 0.9) 18%, rgba(10, 20, 21, 0.86) 34%, rgba(0, 0, 0, 0) 58%),
        conic-gradient(from 180deg, rgba(132, 255, 226, 0.22), transparent 18%, rgba(132, 255, 226, 0.14) 44%, transparent 70%, rgba(132, 255, 226, 0.18));
    filter: blur(2px);
    box-shadow: 0 0 42px rgba(76, 246, 214, 0.18);
    opacity: 0.84;
    animation: storm-rotation 18s linear infinite;
}

.storm-eye::before,
.storm-eye::after {
    content: "";
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    border: 1px solid rgba(118, 255, 227, 0.14);
    opacity: 0.8;
}

.storm-eye::before {
    inset: 22%;
    animation: contagion-pulse 4.8s ease-in-out infinite;
}

.storm-eye::after {
    inset: 4%;
    animation: contagion-pulse 7.2s ease-in-out infinite reverse;
}

.ion-veil {
    width: 36%;
    height: 112%;
    background:
        radial-gradient(circle at 32% 18%, rgba(180, 255, 238, 0.12) 0 5%, transparent 12%),
        radial-gradient(circle at 58% 26%, rgba(180, 255, 238, 0.1) 0 7%, transparent 14%),
        radial-gradient(circle at 46% 42%, rgba(123, 255, 222, 0.12) 0 18%, transparent 34%),
        radial-gradient(circle at 62% 64%, rgba(123, 255, 222, 0.1) 0 16%, transparent 30%),
        radial-gradient(circle at 34% 78%, rgba(123, 255, 222, 0.08) 0 12%, transparent 24%);
    border-radius: 46% 54% 40% 60% / 28% 34% 66% 72%;
    filter: blur(18px);
    opacity: 0.26;
    transform-origin: top center;
    mix-blend-mode: screen;
    animation: veil-surge 6.2s ease-in-out infinite;
    mask-image: radial-gradient(circle at 50% 46%, black 0 42%, transparent 76%);
}

.ion-veil-one {
    top: 14%;
    right: 7%;
    transform: rotate(6deg);
}

.ion-veil-two {
    top: 8%;
    right: 20%;
    width: 24%;
    opacity: 0.18;
    transform: rotate(12deg);
    animation-delay: -1.8s;
}

.contagion-stream {
    width: 18rem;
    height: 28rem;
    background:
        radial-gradient(circle at 50% 10%, rgba(178, 255, 236, 0.24) 0 4%, transparent 10%),
        radial-gradient(circle at 44% 24%, rgba(137, 255, 224, 0.2) 0 7%, transparent 14%),
        radial-gradient(circle at 58% 42%, rgba(137, 255, 224, 0.16) 0 9%, transparent 18%),
        radial-gradient(circle at 36% 64%, rgba(137, 255, 224, 0.14) 0 8%, transparent 17%),
        radial-gradient(circle at 60% 82%, rgba(137, 255, 224, 0.12) 0 10%, transparent 18%),
        linear-gradient(104deg, transparent 0 42%, rgba(137, 255, 224, 0.16) 44% 46%, transparent 48% 100%),
        linear-gradient(82deg, transparent 0 30%, rgba(137, 255, 224, 0.14) 32% 34%, transparent 36% 100%),
        linear-gradient(126deg, transparent 0 56%, rgba(137, 255, 224, 0.12) 58% 60%, transparent 62% 100%);
    border-radius: 48% 52% 50% 50% / 10% 10% 90% 90%;
    filter: blur(9px);
    opacity: 0.3;
    mix-blend-mode: screen;
    mask-image: radial-gradient(ellipse at 50% 8%, black 0 12%, rgba(0, 0, 0, 0.95) 20%, rgba(0, 0, 0, 0.62) 42%, transparent 78%);
    animation: contagion-fall 6.8s ease-in-out infinite;
}

.contagion-stream-one {
    top: 8%;
    right: 10%;
    transform: rotate(8deg);
}

.contagion-stream-two {
    top: 14%;
    right: 24%;
    width: 12rem;
    height: 20rem;
    opacity: 0.18;
    transform: rotate(14deg);
    animation-duration: 8.6s;
    animation-delay: -1.3s;
}

.virus-flare {
    width: var(--flare-size, 0.95rem);
    height: var(--flare-size, 0.95rem);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(229, 255, 249, 0.98) 0 20%, rgba(146, 255, 226, 0.92) 32%, rgba(99, 255, 214, 0.54) 52%, rgba(99, 255, 214, 0) 76%);
    box-shadow: 0 0 10px rgba(120, 255, 223, 0.55), 0 0 22px rgba(120, 255, 223, 0.28);
    mix-blend-mode: screen;
    opacity: 0.76;
}

.virus-flare::before,
.virus-flare::after {
    content: "";
    position: absolute;
}

.virus-flare::before {
    inset: -180%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(120, 255, 223, 0.22) 0 8%, rgba(120, 255, 223, 0.12) 20%, rgba(120, 255, 223, 0) 64%);
    filter: blur(8px);
    opacity: 0.38;
    animation: firefly-aura 4.6s ease-in-out infinite;
}

.virus-flare::after {
    inset: -60%;
    border-radius: 50%;
    border: 1px solid rgba(169, 255, 237, 0.2);
    opacity: 0.24;
    animation: firefly-ring 5.2s ease-in-out infinite;
}

.virus-flare-one {
    --flare-size: 1rem;
    top: 54%;
    left: 8%;
    animation: virus-float-one 14.5s ease-in-out infinite, firefly-glimmer 4.9s ease-in-out infinite;
}

.virus-flare-two {
    --flare-size: 0.78rem;
    top: 66%;
    left: 26%;
    opacity: 0.58;
    animation: virus-float-two 11.8s ease-in-out infinite, firefly-glimmer 4.2s ease-in-out infinite -1.6s;
}

.virus-flare-three {
    --flare-size: 0.86rem;
    top: 40%;
    left: 48%;
    opacity: 0.54;
    animation: virus-float-three 13.2s ease-in-out infinite, firefly-glimmer 5.4s ease-in-out infinite -2.4s;
}

.virus-flare-four {
    --flare-size: 0.68rem;
    top: 24%;
    left: 68%;
    opacity: 0.46;
    animation: virus-float-four 10.6s ease-in-out infinite, firefly-glimmer 3.9s ease-in-out infinite -0.8s;
}

.virus-flare-five {
    --flare-size: 0.92rem;
    top: 58%;
    left: 70%;
    opacity: 0.62;
    animation: virus-float-five 15.1s ease-in-out infinite, firefly-glimmer 5.7s ease-in-out infinite -3s;
}

.landing-banner::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 55%;
    background:
        linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.34)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: auto, 28px 28px;
    pointer-events: none;
    opacity: 0.9;
}

.landing-banner-top,
.landing-banner-body {
    position: relative;
    z-index: 1;
}

.landing-banner-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.home-nav-menu {
    position: relative;
    margin-left: auto;
}

.landing-brand-mark,
.landing-banner-title,
.home-tab {
    font-family: "Aquire", "Cinzel", Georgia, serif;
}

.landing-brand-mark {
    color: rgba(248, 230, 191, 0.88);
    font-size: clamp(0.88rem, 1.25vw, 1.05rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.home-menu-button {
    display: inline-grid;
    gap: 0.28rem;
    align-items: center;
    justify-items: center;
    width: 52px;
    min-height: 52px;
    padding: 0.8rem 0.7rem;
    border: 1px solid rgba(255, 235, 193, 0.18);
    background: rgba(13, 11, 9, 0.62);
    color: var(--text);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.home-menu-button:hover,
.home-menu-button[aria-expanded="true"] {
    transform: translateY(-2px);
    border-color: var(--stroke-strong);
    background: rgba(29, 20, 13, 0.82);
}

.home-menu-button-line {
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
}

.home-tabs {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    z-index: 4;
    display: grid;
    gap: 0.75rem;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.35rem);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.home-tabs.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.home-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(255, 235, 193, 0.18);
    background: rgba(13, 11, 9, 0.56);
    color: var(--text);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.landing-banner-body {
    display: grid;
    align-content: end;
    gap: 1rem;
    max-width: 900px;
    padding-top: clamp(2rem, 13vw, 8rem);
}

.landing-banner-title {
    margin: 0;
    max-width: 10ch;
    font-size: clamp(3rem, 7vw, 6.2rem);
    line-height: 1.02;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 0 26px rgba(255, 214, 143, 0.12);
}

.site-hero h1,
.tree-hero h1,
.selected-panel h2,
.section-heading h2 {
    margin: 0;
    font-family: "Cinzel", Georgia, serif;
    line-height: 0.95;
    letter-spacing: 0.02em;
}

.site-hero h1 {
    font-size: clamp(3rem, 8vw, 6.2rem);
    max-width: 8ch;
}

.hero-copy,
.tree-description,
.selected-description,
.section-copy {
    margin: 0;
    max-width: 70ch;
    color: var(--muted);
    font-size: 1.04rem;
    line-height: 1.6;
}

.section-copy-wide,
.about-lead {
    max-width: none;
}

.about-lead {
    color: var(--text);
    font-size: 1.1rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.hero-note,
.selected-rank-note,
.detail-item-muted,
.tree-stats,
.selected-node-type {
    color: var(--muted);
}

.button-ornate,
.button-ghost,
.ghost-link,
.class-chip,
.class-card-link {
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.button-ornate,
.button-ghost,
.ghost-link,
.class-chip,
.panel-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 46px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--stroke);
    color: var(--text);
    background: rgba(38, 26, 15, 0.66);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
    cursor: pointer;
}

.button-ornate {
    background: linear-gradient(135deg, rgba(217, 168, 79, 0.34), rgba(152, 53, 26, 0.44));
    border-color: var(--stroke-strong);
    box-shadow: inset 0 0 0 1px rgba(255, 225, 170, 0.08), 0 12px 28px rgba(0, 0, 0, 0.24);
}

.button-ghost,
.ghost-link {
    background: rgba(17, 13, 9, 0.64);
}

.button-ornate:hover,
.button-ghost:hover,
.ghost-link:hover,
.class-chip:hover,
.home-tab:hover,
.panel-actions button:hover,
.class-card:hover {
    transform: translateY(-2px);
    border-color: var(--stroke-strong);
}

.section-block {
    margin-top: 1.5rem;
}

.about-section {
    display: grid;
    gap: 1.5rem;
}

.section-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
}

.section-heading-stacked {
    align-items: start;
}

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

.lore-panel {
    display: grid;
    gap: 0.85rem;
    min-height: 100%;
    padding: 1.35rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 25%),
        linear-gradient(135deg, rgba(217, 168, 79, 0.12), rgba(111, 35, 25, 0.12)),
        rgba(12, 10, 8, 0.88);
}

.lore-panel h3 {
    margin: 0;
    font-family: "Cinzel", Georgia, serif;
    font-size: 1.4rem;
    line-height: 1.1;
}

.lore-panel p,
.lore-panel blockquote {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.lore-panel-quote {
    grid-column: 1 / -1;
}

.lore-panel-quote blockquote {
    padding-left: 1rem;
    border-left: 2px solid rgba(252, 224, 163, 0.42);
    color: var(--text);
    font-size: 1.08rem;
}

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

.class-card {
    position: relative;
    display: grid;
    gap: 0.9rem;
    min-height: 280px;
    padding: 1.25rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 28%),
        linear-gradient(135deg, rgba(217, 168, 79, 0.18), rgba(184, 78, 38, 0.12)),
        rgba(14, 11, 8, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.08);
    clip-path: var(--cutout-shape);
    overflow: hidden;
}

.class-card::after {
    content: "";
    position: absolute;
    inset: auto -15% 0 auto;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--accent-color, rgba(217, 168, 79, 0.26)), transparent 70%);
    opacity: 0.6;
}

.class-card-title {
    margin: 0;
    font-family: "Cinzel", Georgia, serif;
    font-size: 1.85rem;
    line-height: 1;
}

.class-card-summary {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.class-card-tags,
.tree-stats,
.class-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.class-tag,
.stat-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.viewer-topbar {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: center;
}

.viewer-controls {
    display: grid;
    gap: 0.75rem;
}

.viewer-controls-panel {
    margin-top: 0.2rem;
}

.viewer-level-panel {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.8rem 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(17, 13, 9, 0.64);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.viewer-level-label {
    margin: 0;
}

.viewer-level-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.viewer-level-input {
    width: 92px;
    min-height: 42px;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-family: "Cinzel", Georgia, serif;
    font-size: 1rem;
}

.viewer-level-input:focus {
    outline: 1px solid var(--stroke-strong);
    outline-offset: 0;
}

.viewer-points-pill {
    white-space: nowrap;
}

.viewer-controls-panel .button-ghost {
    width: 100%;
}

.viewer-level-note,
.node-tooltip-hint {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.viewer-branding {
    display: grid;
    gap: 0.25rem;
}

.viewer-brand-title {
    font-family: "Cinzel", Georgia, serif;
    font-size: 1.25rem;
}

.viewer-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin-top: 1rem;
}

.viewer-main {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    grid-template-areas:
        "class hero"
        "board board";
    align-items: stretch;
    gap: 1rem;
}

.class-rail-panel,
.tree-hero,
.board-panel {
    position: relative;
}

.board-panel {
    display: grid;
    grid-area: board;
    width: 100%;
    gap: 1rem;
    overflow: visible;
}

.viewer-class-panel {
    display: grid;
    gap: 0.8rem;
    grid-area: class;
    width: 100%;
}

.tree-hero {
    grid-area: hero;
    width: 100%;
}

.class-chip {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.class-chip.is-active {
    border-color: var(--stroke-strong);
    background: linear-gradient(135deg, rgba(217, 168, 79, 0.2), rgba(184, 78, 38, 0.16));
}

.tree-hero {
    display: grid;
    gap: 0.9rem;
}

.tree-stats {
    gap: 0.65rem;
}

.board-scroll {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 0.25rem;
}

.board-fit {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: start;
    width: 100%;
}

.talent-board {
    flex: 0 0 auto;
    position: relative;
    width: var(--board-width, 1760px);
    height: var(--board-height, 1820px);
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background:
        radial-gradient(circle at top, rgba(255, 219, 155, 0.05), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(180deg, rgba(23, 17, 12, 0.98), rgba(7, 5, 4, 0.98));
    background-size: auto, auto, 52px 52px, 52px 52px, auto;
    border-radius: 20px;
    transform-origin: top center;
}

.talent-board::before {
    content: "";
    position: absolute;
    inset: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.connection-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: visible;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.connection-path {
    fill: none;
    stroke: rgba(216, 170, 82, 0.18);
    stroke-width: 3;
    stroke-linecap: round;
}

.connection-path.is-energized {
    stroke: rgba(241, 202, 129, 0.36);
}

.branch-label {
    position: absolute;
    z-index: 2;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.9rem;
    background: rgba(7, 6, 4, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: "Cinzel", Georgia, serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.82rem;
}

.talent-node {
    position: absolute;
    z-index: 3;
    transform: translate(-50%, -50%);
    width: 146px;
    min-height: 154px;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 24%),
        linear-gradient(180deg, rgba(26, 22, 17, 0.95), rgba(8, 6, 4, 0.94));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.26);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.talent-node.is-active {
    border-color: rgba(224, 143, 70, 0.56);
}

.talent-node.is-signature {
    background:
        linear-gradient(180deg, rgba(255, 213, 140, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(35, 24, 15, 0.96), rgba(10, 8, 6, 0.98));
    border-color: rgba(235, 196, 115, 0.48);
}

.talent-node.is-ranked {
    box-shadow: 0 14px 36px rgba(217, 168, 79, 0.12), 0 10px 28px rgba(0, 0, 0, 0.26);
}

.talent-node.is-selected {
    border-color: rgba(252, 224, 163, 0.75);
    box-shadow: 0 0 0 1px rgba(252, 224, 163, 0.15), 0 20px 40px rgba(0, 0, 0, 0.32);
}

.talent-node.is-placeholder {
    width: 98px;
    min-height: 98px;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
    cursor: default;
    opacity: 0.28;
    pointer-events: none;
}

.talent-node:hover {
    transform: translate(-50%, calc(-50% - 4px));
}

.node-tooltip {
    position: absolute;
    z-index: 6;
    width: min(340px, calc(100% - 2rem));
    max-width: 340px;
}

.node-tooltip-body {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
}

.node-tooltip-header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: start;
}

.node-tooltip-heading {
    display: grid;
    gap: 0.35rem;
}

.node-tooltip-title {
    margin: 0;
    font-family: "Cinzel", Georgia, serif;
    font-size: 1.35rem;
    line-height: 1.05;
}

.node-tooltip-close {
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.node-tooltip-description {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.node-tooltip-rank-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.node-tooltip-rank-value {
    font-family: "Cinzel", Georgia, serif;
    letter-spacing: 0.04em;
}

.node-tooltip-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.node-tooltip-hint {
    margin: 0;
}

.node-tooltip-actions button:disabled,
.node-tooltip-close:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.node-tooltip-detail-block {
    display: grid;
    gap: 0.45rem;
}

.node-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.45rem;
    align-items: start;
}

.node-icon-wrap {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.node-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.node-fallback-icon {
    font-family: "Cinzel", Georgia, serif;
    font-size: 1.15rem;
    color: var(--gold);
}

.node-kind {
    justify-self: end;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.node-title {
    margin: 0.65rem 0 0;
    font-family: "Cinzel", Georgia, serif;
    font-size: 1rem;
    line-height: 1.15;
}

.node-pips {
    display: flex;
    gap: 0.28rem;
    margin-top: auto;
    padding-top: 0.85rem;
}

.node-pip {
    width: 100%;
    height: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.node-pip.is-filled {
    background: linear-gradient(90deg, rgba(217, 168, 79, 0.95), rgba(250, 218, 163, 0.95));
    border-color: rgba(255, 231, 182, 0.32);
}

.panel-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.panel-actions button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.detail-list-block {
    display: grid;
    gap: 0.4rem;
}

.detail-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gold);
}

.detail-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.detail-item,
.detail-item-muted {
    padding: 0.4rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
}

.state-message {
    margin-top: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(184, 78, 38, 0.42);
    background: rgba(111, 35, 25, 0.28);
    line-height: 1.6;
}

.reveal-up {
    animation: reveal-up 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes reveal-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes storm-drift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(2rem, -1rem, 0) scale(1.08);
    }

    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes storm-rotation {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.06);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes veil-surge {
    0% {
        opacity: 0.12;
        transform: rotate(6deg) scale(0.9, 0.88);
    }

    50% {
        opacity: 0.3;
        transform: rotate(10deg) scale(1.06, 1.08);
        filter: blur(22px);
    }

    100% {
        opacity: 0.12;
        transform: rotate(6deg) scale(0.9, 0.88);
    }
}

@keyframes contagion-fall {
    0% {
        transform: translate3d(0, -1.4rem, 0) rotate(8deg) scale(0.92);
        opacity: 0.08;
    }

    40% {
        opacity: 0.34;
    }

    100% {
        transform: translate3d(-1.2rem, 2.4rem, 0) rotate(12deg) scale(1.08);
        opacity: 0.04;
    }
}

@keyframes firefly-glimmer {
    0%,
    100% {
        opacity: 0.22;
        filter: saturate(0.95);
    }

    18% {
        opacity: 0.86;
    }

    34% {
        opacity: 0.38;
    }

    58% {
        opacity: 0.94;
    }

    72% {
        opacity: 0.3;
    }

    88% {
        opacity: 0.72;
    }
}

@keyframes virus-float-one {
    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(-4deg);
    }

    23% {
        transform: translate3d(1.2rem, -1rem, 0) rotate(2deg);
    }

    57% {
        transform: translate3d(2.1rem, 0.6rem, 0) rotate(6deg);
    }

    81% {
        transform: translate3d(0.7rem, 1.1rem, 0) rotate(1deg);
    }
}

@keyframes virus-float-two {
    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(3deg);
    }

    28% {
        transform: translate3d(-0.8rem, -1.3rem, 0) rotate(-4deg);
    }

    62% {
        transform: translate3d(1.5rem, -0.2rem, 0) rotate(5deg);
    }

    84% {
        transform: translate3d(0.3rem, 1rem, 0) rotate(-1deg);
    }
}

@keyframes virus-float-three {
    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(-2deg);
    }

    19% {
        transform: translate3d(-1rem, 0.4rem, 0) rotate(4deg);
    }

    48% {
        transform: translate3d(1.4rem, -1.2rem, 0) rotate(-6deg);
    }

    76% {
        transform: translate3d(2rem, 0.8rem, 0) rotate(2deg);
    }
}

@keyframes virus-float-four {
    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(2deg);
    }

    34% {
        transform: translate3d(-1.4rem, 0.7rem, 0) rotate(-5deg);
    }

    58% {
        transform: translate3d(0.6rem, 1.4rem, 0) rotate(6deg);
    }

    86% {
        transform: translate3d(1.8rem, -0.6rem, 0) rotate(-1deg);
    }
}

@keyframes virus-float-five {
    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(-3deg);
    }

    26% {
        transform: translate3d(-1.1rem, -0.9rem, 0) rotate(4deg);
    }

    51% {
        transform: translate3d(-2rem, 0.4rem, 0) rotate(-4deg);
    }

    79% {
        transform: translate3d(0.8rem, 1.2rem, 0) rotate(3deg);
    }
}

@keyframes firefly-aura {
    0%,
    100% {
        transform: scale(0.74);
        opacity: 0.12;
    }

    50% {
        transform: scale(1.22);
        opacity: 0.34;
    }
}

@keyframes firefly-ring {
    0%,
    100% {
        transform: scale(0.82);
        opacity: 0.08;
    }

    50% {
        transform: scale(1.16);
        opacity: 0.26;
    }
}

@keyframes contagion-pulse {
    0%,
    100% {
        transform: scale(0.92);
        opacity: 0.26;
    }

    50% {
        transform: scale(1.06);
        opacity: 0.54;
    }
}

@media (max-width: 820px) {
    .lore-grid {
        grid-template-columns: 1fr;
    }

    .viewer-main {
        grid-template-columns: 1fr;
        grid-template-areas:
            "class"
            "hero"
            "board";
    }

    .panel-actions {
        grid-template-columns: 1fr;
    }

    .node-tooltip-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .page-shell,
    .viewer-shell {
        width: min(100%, calc(100% - 1rem));
        padding-top: 0.75rem;
    }

    .viewer-topbar {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .viewer-controls {
        width: 100%;
    }

    .viewer-level-panel {
        width: 100%;
    }

    .site-hero,
    .landing-banner,
    .viewer-topbar,
    .tree-hero,
    .class-rail-panel,
    .board-panel,
    .section-block {
        padding: 1.1rem;
    }

    .site-hero h1,
    .landing-banner-title {
        font-size: clamp(2.6rem, 16vw, 4.2rem);
    }

    .landing-banner {
        min-height: auto;
    }

    .alien-invasion {
        inset: 0 -14% 0 -6%;
    }

    .storm-eye {
        width: 16rem;
        height: 16rem;
        right: 2%;
    }

    .ion-veil-one {
        width: 42%;
        right: 2%;
    }

    .ion-veil-two {
        width: 30%;
        right: 18%;
    }

    .contagion-stream-one {
        right: 0;
        width: 10rem;
        height: 18rem;
    }

    .contagion-stream-two {
        right: 20%;
        width: 7rem;
        height: 14rem;
    }

    .virus-flare-one {
        top: 58%;
        left: 4%;
    }

    .virus-flare-two {
        top: 68%;
        left: 24%;
    }

    .virus-flare-three {
        top: 46%;
        left: 44%;
    }

    .virus-flare-four {
        top: 24%;
        left: 64%;
    }

    .virus-flare-five {
        top: 62%;
        left: 66%;
    }

    .landing-banner-top {
        flex-direction: column;
        align-items: start;
    }

    .home-tabs {
        min-width: min(240px, calc(100vw - 2.5rem));
    }

    .home-tab {
        width: 100%;
    }

    .landing-banner-body {
        padding-top: 1rem;
    }

    .viewer-shell {
        width: calc(100% - 0.5rem);
        padding-top: 0.75rem;
    }

    .viewer-main {
        grid-template-columns: 1fr;
        grid-template-areas:
            "class"
            "hero"
            "board";
    }

    .node-tooltip {
        width: min(320px, calc(100% - 1rem));
    }

}