/* ============================================================================
   Infinity Nest News — base stylesheet
   Design tokens mirror the main site (resources/css/app.css) — keep in sync.
   ========================================================================== */

@font-face {
    font-family: 'Rajdhani';
    src: url('../fonts/rajdhani-400.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Rajdhani';
    src: url('../fonts/rajdhani-500.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Rajdhani';
    src: url('../fonts/rajdhani-600.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Rajdhani';
    src: url('../fonts/rajdhani-700.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter Variable';
    src: url('../fonts/inter-variable.woff2') format('woff2-variations');
    font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
    --color-bg-deep:        #0a0a0f;
    --color-bg-surface:     #12121a;
    --color-bg-card:        rgba(255, 255, 255, 0.08);
    --color-purple:         #7c3aed;
    --color-purple-light:   #9f5bf7;
    --color-purple-glow:    rgba(124, 58, 237, 0.6);
    --color-cyan:           #06b6d4;
    --color-cyan-light:     #22d3ee;
    --color-cyan-glow:      rgba(6, 182, 212, 0.6);
    --color-gold:           #f59e0b;
    --color-gold-light:     #fbbf24;
    --color-news-indigo:    #818cf8;
    --color-news-rose:      #f472b6;
    --color-border:         rgba(255, 255, 255, 0.10);
    --color-text-primary:   #ffffff;
    --color-text-secondary: #d1d5db;
    --color-text-tertiary:  #9ca3af;

    --font-display: 'Rajdhani', sans-serif;
    --font-body:    'Inter Variable', 'Inter', system-ui, sans-serif;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

/* Lock background scroll while the post quicknav drawer is open on mobile. */
body.in-quicknav-open {
    overflow: hidden;
}

html {
    -webkit-text-size-adjust: 100%;
    scrollbar-color: #1f6f80 #14141d;
}

body {
    margin: 0;
    background: var(--color-bg-deep);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#in-particles {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

.in-main,
.in-header,
.in-footer {
    position: relative;
    z-index: 1;
}

a { color: inherit; }

img { max-width: 100%; height: auto; display: block; }

/* Layout containers */
.in-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Glass card primitive */
.in-glass {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
}

/* Scrollbar — Chrome/WebKit only. Firefox uses scrollbar-color above (system width with arrows). */
html::-webkit-scrollbar { width: 12px; }
html::-webkit-scrollbar-track { background: #14141d; }
html::-webkit-scrollbar-thumb { background: #1f6f80; border-radius: 3px; border: 2px solid #14141d; }
html::-webkit-scrollbar-thumb:hover { background: #2a8c9f; }

/* Tag pill colour map (per spec §5.3) */
.in-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
}
.in-tag--patch-notes { background: rgba(124,58,237,0.18); color: #c4b5fd; border: 1px solid rgba(124,58,237,0.4); }
.in-tag--events      { background: rgba(245,158,11,0.18); color: #fbbf24; border: 1px solid rgba(245,158,11,0.4); }
.in-tag--pve-guides  { background: rgba(6,182,212,0.18);  color: #22d3ee; border: 1px solid rgba(6,182,212,0.4); }
.in-tag--news        { background: rgba(129,140,248,0.18);color: #a5b4fc; border: 1px solid rgba(129,140,248,0.4); }
.in-tag--dev-blogs   { background: rgba(244,114,182,0.18);color: #f9a8d4; border: 1px solid rgba(244,114,182,0.4); }
.in-tag--default     { background: rgba(255,255,255,0.06);color: #d1d5db; border: 1px solid rgba(255,255,255,0.12); }

/* Header */
.in-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(18, 18, 26, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}
.in-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.in-header__logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-cyan-light);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    text-shadow: 0 0 8px var(--color-cyan-glow);
}
.in-header__logo img {
    height: 32px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(124,58,237,0.3));
}
.in-header__nav {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.in-header__nav a {
    display: block;
    padding: 0.5rem 0.85rem;
    color: var(--color-text-tertiary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}
.in-header__nav a:hover {
    color: var(--color-cyan-light);
}

.in-header__hamburger {
    display: none;
    background: none;
    border: 0;
    padding: 0.5rem;
    cursor: pointer;
}
.in-header__hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text-primary);
    margin: 5px 0;
    transition: transform 0.2s, opacity 0.2s;
}

@media (max-width: 768px) {
    .in-header__hamburger { display: block; }
    .in-header__nav {
        display: none;
        position: absolute;
        top: 64px; left: 0; right: 0;
        flex-direction: column;
        background: rgba(18,18,26,0.98);
        border-bottom: 1px solid var(--color-border);
        padding: 0.5rem 1.5rem;
    }
    .in-header__nav.open { display: flex; }
}

/* Footer */
.in-footer {
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    background: var(--color-bg-surface);
    margin-top: 4rem;
}
.in-footer__inner {
    text-align: center;
}
.in-footer__logo img {
    height: 28px;
    margin: 0 auto 0.75rem;
    filter: drop-shadow(0 0 8px rgba(124,58,237,0.25));
}
.in-footer p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}
.in-footer a {
    color: var(--color-cyan-light);
    text-decoration: none;
}
.in-footer a:hover { text-decoration: underline; }

/* Home + post cards */
.in-home {
    padding: 2rem 0 3rem;
}
.in-home__feed {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 768px) {
    .in-home__feed {
        grid-template-columns: repeat(3, 1fr);
    }
    .in-home__feed > .in-post-card--featured {
        grid-column: 1 / -1;
    }
}

.in-post-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.in-post-card:hover {
    border-color: rgba(6,182,212,0.45);
    box-shadow: 0 0 20px rgba(6,182,212,0.15);
}
.in-post-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.in-post-card__image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(6,182,212,0.3));
}
.in-post-card--featured .in-post-card__image {
    aspect-ratio: 21 / 9;
}
.in-post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.in-post-card:hover .in-post-card__image img {
    transform: scale(1.04);
}
.in-post-card__body {
    padding: 1rem 1.1rem 1.25rem;
}
.in-post-card__title {
    margin: 0.5rem 0 0.4rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
    color: var(--color-text-primary);
}
.in-post-card--featured .in-post-card__title {
    font-size: 1.7rem;
    line-height: 1.15;
}
.in-post-card__meta {
    font-size: 0.78rem;
    color: var(--color-text-tertiary);
}
.in-post-card__dot {
    margin: 0 0.4rem;
}

/* Pagination (Ghost default helper renders <nav class="pagination">…</nav>) */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0 0;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
}
.pagination a {
    color: var(--color-cyan-light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}
.pagination a:hover {
    background: rgba(6,182,212,0.1);
}

/* Tag archive page */
.in-tag-page {
    padding: 2.5rem 0 3rem;
}
.in-tag-page__header {
    text-align: center;
    margin-bottom: 2rem;
}
.in-tag-page__title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    margin: 0.75rem 0 0.4rem;
    color: var(--color-text-primary);
}
.in-tag-page__description {
    color: var(--color-text-tertiary);
    font-size: 1rem;
    margin: 0;
}

/* Static page */
.in-static-page {
    max-width: 720px;
    padding: 3rem 1.5rem 4rem;
}
.in-static-page__header {
    margin-bottom: 1.5rem;
}
.in-static-page__title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    line-height: 1.15;
    margin: 0;
}
.in-static-page__body {
    background: var(--color-bg-surface);
    padding: 1.75rem 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

/* Error pages */
.in-error {
    text-align: center;
    padding: 6rem 1.5rem;
}
.in-error__code {
    font-family: var(--font-display);
    font-size: 6rem;
    margin: 0;
    color: var(--color-cyan-light);
    text-shadow: 0 0 20px var(--color-cyan-glow);
    line-height: 1;
}
.in-error__message {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin: 1rem 0 2rem;
}
.in-error__cta {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background: var(--color-cyan);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 0 12px rgba(6,182,212,0.4);
    transition: background 0.2s, box-shadow 0.2s;
}
.in-error__cta:hover {
    background: var(--color-cyan-light);
    box-shadow: 0 0 18px rgba(6,182,212,0.6);
}

/* Koenig card width modifiers — required by gscan. The content card is
   already 960px wide, so both modifiers fill the available content width.
   The figure layout in post.css handles centring. */
.kg-width-wide,
.kg-width-full {
    width: 100%;
}

/* ============================================================================
   Class archive pages — per-class history view + alphabetical roster
   ========================================================================== */

.in-class-archive {
    padding: 2.5rem 0 3rem;
}
.in-class-archive__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
    margin-bottom: 2.5rem;
}
.in-class-archive__back {
    display: inline-block;
    margin-left: 0.5rem;
    color: var(--color-cyan-light);
    text-decoration: none;
    border-bottom: 1px dashed rgba(6,182,212,0.4);
}
.in-class-archive__back:hover {
    border-bottom-color: var(--color-cyan-light);
}
.in-class-archive__feed {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.in-class-archive__feed .in-post-card { backdrop-filter: blur(16px); }
.in-class-archive__feed .in-post-card__image {
    width: 100%;
    aspect-ratio: 21 / 7;
}
.in-class-archive__feed .in-post-card__title { font-size: 1.35rem; }
@media (min-width: 1024px) {
    .in-class-archive__feed { max-width: 960px; margin: 0 auto; }
}

.in-post-card__class-excerpt {
    border-top: 1px solid var(--color-border);
    padding: 0.85rem 1.1rem 1.25rem;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.55;
}
.in-post-card__class-excerpt > * + * {
    margin-top: 0.6rem;
}
.in-post-card__class-excerpt h1,
.in-post-card__class-excerpt h2,
.in-post-card__class-excerpt h3,
.in-post-card__class-excerpt h4 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-cyan-light);
    margin: 0.85rem 0 0.3rem;
    text-shadow: 0 0 4px rgba(6,182,212,0.3);
}
.in-post-card__class-excerpt h3 strong,
.in-post-card__class-excerpt h4 strong {
    font-weight: inherit;
}
.in-post-card__class-excerpt ul,
.in-post-card__class-excerpt ol {
    padding-left: 1.25rem;
    margin: 0.4rem 0;
}
.in-post-card__class-excerpt li {
    margin-top: 0.25rem;
}
.in-post-card__class-excerpt li::marker {
    color: var(--color-cyan-light);
}
.in-post-card__class-excerpt p {
    margin: 0.4rem 0;
}
.in-post-card__class-excerpt blockquote {
    border-left: 3px solid var(--color-cyan);
    padding-left: 0.85rem;
    margin: 0.6rem 0 0.6rem 0;
    color: var(--color-text-tertiary);
    font-style: italic;
}
.in-post-card__class-excerpt table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.6rem 0;
    font-size: 0.85rem;
}
.in-post-card__class-excerpt th,
.in-post-card__class-excerpt td {
    border: 1px solid var(--color-border);
    padding: 0.4rem 0.55rem;
    text-align: left;
}
.in-post-card__class-excerpt th {
    background: rgba(255,255,255,0.04);
}
.in-post-card__class-excerpt img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 0.4rem 0;
}
.in-post-card__class-excerpt hr {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 0.85rem 0;
}
.in-post-card.has-excerpt .in-post-card__link {
    cursor: default;
}
.in-post-card.has-excerpt .in-post-card__class-excerpt a {
    color: var(--color-cyan-light);
}
.in-class-archive__icon {
    width: 76px;
    height: 76px;
    min-height: 0;
    line-height: 0;
}
.in-class-archive__icon::after {
    width: 76px;
    height: 76px;
    position: static;
    filter: drop-shadow(0 0 14px var(--color-cyan-glow));
}
.in-class-archive__title {
    font-family: var(--font-display);
    font-size: 2.6rem;
    margin: 0;
    color: var(--color-cyan-light);
    text-shadow: 0 0 14px var(--color-cyan-glow);
}
.in-class-archive__description {
    color: var(--color-text-tertiary);
    font-size: 1rem;
    margin: 0;
}

.in-classes-page {
    max-width: 840px;
    margin: 0 auto;
    padding: 2.5rem 0 3rem;
}
.in-classes-page__header {
    text-align: center;
    margin-bottom: 2rem;
}
.in-classes-page__title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    margin: 0.5rem 0 0.4rem;
    color: var(--color-text-primary);
}
.in-classes-page__description {
    color: var(--color-text-tertiary);
    font-size: 1rem;
    margin: 0;
}
.in-classes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .in-classes-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
    .in-classes-grid { grid-template-columns: repeat(4, 1fr); }
}
.in-classes-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.95rem;
    min-height: 68px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-text-secondary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    transition: border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
@media (max-width: 480px) {
    .in-classes-card {
        font-size: 0.85rem;
        padding: 0.65rem 0.75rem;
        gap: 0.55rem;
    }
}
.in-classes-card:hover {
    z-index: 2;
    border-color: rgba(6,182,212,0.45);
    color: var(--color-cyan-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(6,182,212,0.18);
}
.in-classes-card .class-icon {
    width: 44px;
    height: 44px;
    min-height: 0;
    line-height: 0;
    flex-shrink: 0;
}
.in-classes-card .class-icon::after {
    position: static;
    width: 44px;
    height: 44px;
}
.in-classes-card__name {
    flex: 1;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* Search input above the trees */
.in-classes-search {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 2rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}
.in-classes-search::placeholder { color: var(--color-text-tertiary); }
.in-classes-search:focus {
    outline: none;
    border-color: rgba(6,182,212,0.6);
    box-shadow: 0 0 14px rgba(6,182,212,0.25);
}

/* Class tree section — neon-glow accent comes from --tree-accent set per base.
   Default is the Warrior orange; override per base with .in-class-tree--<slug>. */
.in-class-tree {
    --tree-accent:       #ff6b3a;
    --tree-accent-light: #ff8c5a;
    --tree-accent-glow:  rgba(255, 107, 58, 0.55);
    margin: 2rem 0 3rem;
    padding: 1.5rem 1.5rem 1.75rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--tree-accent);
    border-radius: var(--radius-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.in-class-tree__header { margin-bottom: 1.25rem; }
.in-class-tree__title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
    color: var(--tree-accent-light);
    text-shadow:
        0 0 10px var(--tree-accent-glow),
        0 0 24px var(--tree-accent-glow);
}
.in-class-tree__tier { margin-top: 1.1rem; }
.in-class-tree__tier:first-of-type { margin-top: 0; }
.in-class-tree__tier-label {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--tree-accent-light) 55%, var(--color-text-tertiary));
    margin-bottom: 0.55rem;
}
.in-class-tree__cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .in-class-tree__cards { grid-template-columns: repeat(3, 1fr); }
}
/* Desktop: inline tier labels — each tier becomes a 2-col row with the label
   anchored on the left and tiles flowing to the right. Single-tile tiers no
   longer drift centred in empty space; tier labels read as row anchors next
   to their cards. Cards become denser square tiles (icon top, name below).
   Mobile/tablet keep the existing pill+grid layout (already reads well there). */
@media (min-width: 1024px) {
    .in-class-tree__tier {
        display: grid;
        grid-template-columns: 108px 1fr;
        column-gap: 1.1rem;
        align-items: start;
        margin-top: 1.2rem;
    }
    .in-class-tree__tier-label {
        margin-bottom: 0;
        padding-top: 0.9rem;
        text-align: right;
    }
    .in-class-tree__cards {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.7rem;
    }
    .in-class-tree .in-classes-card {
        flex: 0 0 142px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 0.75rem 0.55rem 0.65rem;
        min-height: 116px;
        gap: 0.5rem;
    }
    .in-class-tree .in-classes-card .class-icon,
    .in-class-tree .in-classes-card .class-icon::after {
        width: 44px;
        height: 44px;
    }
    .in-class-tree .in-classes-card__name {
        font-size: 0.85rem;
        line-height: 1.25;
    }
    /* Spinoff/exclusive sections — drop horizontal padding so their tier-label
       column aligns with the parent tree's grid. Header stays inset for
       breathing room; cards container gets a trailing pad so the rightmost tile
       doesn't kiss the section's right border. */
    .in-class-tree__spinoff,
    .in-class-tree__exclusive {
        padding-left: 0;
        padding-right: 0;
    }
    .in-class-tree__spinoff-header,
    .in-class-tree__exclusive-header {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    .in-class-tree__spinoff .in-class-tree__cards,
    .in-class-tree__exclusive .in-class-tree__cards {
        padding-right: 1rem;
    }
}


/* Per-tree hover accent — overrides the default cyan hover inside trees. */
.in-class-tree .in-classes-card:hover {
    border-color: var(--tree-accent);
    color: var(--tree-accent-light);
    box-shadow: 0 4px 16px var(--tree-accent-glow);
}

/* Per-base accent overrides. */
.in-class-tree--archer {
    --tree-accent:       #4ade80;
    --tree-accent-light: #86efac;
    --tree-accent-glow:  rgba(74, 222, 128, 0.55);
}
.in-class-tree--sorceress {
    --tree-accent:       #a855f7;
    --tree-accent-light: #d8b4fe;
    --tree-accent-glow:  rgba(168, 85, 247, 0.55);
}
.in-class-tree--cleric {
    --tree-accent:       #38bdf8;
    --tree-accent-light: #bae6fd;
    --tree-accent-glow:  rgba(56, 189, 248, 0.55);
}
.in-class-tree--academic {
    --tree-accent:       #eab308;
    --tree-accent-light: #fde047;
    --tree-accent-glow:  rgba(234, 179, 8, 0.55);
}
.in-class-tree--kali {
    --tree-accent:       #818cf8;
    --tree-accent-light: #c7d2fe;
    --tree-accent-glow:  rgba(129, 140, 248, 0.55);
}
.in-class-tree--assassin {
    --tree-accent:       #10b981;
    --tree-accent-light: #6ee7b7;
    --tree-accent-glow:  rgba(16, 185, 129, 0.55);
}
.in-class-tree--lencea {
    --tree-accent:       #e879f9;
    --tree-accent-light: #f5d0fe;
    --tree-accent-glow:  rgba(232, 121, 249, 0.55);
}
.in-class-tree--machina {
    --tree-accent:       #22d3ee;
    --tree-accent-light: #a5f3fc;
    --tree-accent-glow:  rgba(34, 211, 238, 0.55);
}
.in-class-tree--vandar {
    --tree-accent:       #ec4899;
    --tree-accent-light: #f9a8d4;
    --tree-accent-glow:  rgba(236, 72, 153, 0.55);
}
.in-class-tree--arta {
    --tree-accent:       #2dd4bf;
    --tree-accent-light: #99f6e4;
    --tree-accent-glow:  rgba(45, 212, 191, 0.55);
}

/* Reusable noise dither SVG — pixel-level grain that masks gradient banding on
   the spinoff/exclusive bg layers. Tiled at 200×200, 5% alpha grayscale. */
.in-class-tree {
    --in-noise-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='1'/%3E%3CfeColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Spinoff sub-section — same accent as base, dashed border + muted bg.
   Per-base overrides further down replace the bg/border with a 3-layer
   gradient frame (dashed gradient stroke + noise dither + linear-gradient bg)
   that matches each spinoff's lore palette. */
.in-class-tree__spinoff {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem 1.25rem;
    background: color-mix(in srgb, var(--tree-accent) 6%, transparent);
    border: 1px dashed var(--tree-accent);
    border-radius: var(--radius-sm);
}
.in-class-tree__spinoff-header {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--tree-accent-light);
    margin-bottom: 0.85rem;
    text-shadow: 0 0 8px var(--tree-accent-glow);
}
/* Mute the bright auras on spinoff icons (Plaga, Phantom, etc. have loud
   sprite versions). Slight desaturation + lower brightness on the icon
   sprite only — text + glow on the card border are unaffected. */
.in-class-tree__spinoff .class-icon::after {
    filter: saturate(0.7) brightness(0.92);
}

/* Exclusive sub-section — Infinity Nest custom jobs, contrasting fuchsia accent
   that pops against any base tree colour. Solid border, gradient bg, glow. */
.in-class-tree__exclusive {
    --excl-accent:       #d946ef;
    --excl-accent-light: #f0abfc;
    --excl-accent-glow:  rgba(217, 70, 239, 0.55);
    margin-top: 1.5rem;
    padding: 1.1rem 1.25rem 1.25rem;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--excl-accent) 12%, transparent),
        color-mix(in srgb, var(--excl-accent) 4%, transparent)
    );
    border: 2px solid var(--excl-accent);
    border-radius: var(--radius-sm);
    box-shadow:
        0 0 18px var(--excl-accent-glow),
        inset 0 0 24px color-mix(in srgb, var(--excl-accent) 6%, transparent);
}
.in-class-tree__exclusive-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
    font-family: var(--font-display);
}
.in-class-tree__exclusive-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--excl-accent);
    color: #14041a;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border-radius: 999px;
    box-shadow: 0 0 12px var(--excl-accent-glow);
}
.in-class-tree__exclusive-label {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--excl-accent-light);
    text-shadow: 0 0 10px var(--excl-accent-glow);
}
.in-class-tree__exclusive .in-classes-card:hover {
    border-color: var(--excl-accent);
    color: var(--excl-accent-light);
    box-shadow: 0 4px 18px var(--excl-accent-glow);
}

/* Per-base exclusive accents — pick a colour that COMPLEMENTS the base tree
   instead of fighting it. Default fuchsia stays as the catch-all for trees that
   don't have a specific override. */
/* Cleric (sky blue) → cursed crimson: Squire/Searing Knight's actual flame
   palette is blue/black/red (arcane fire), not gold holy flame. Deep blood-red
   captures the "dark fire inside the holy order" mood; sky-blue base above
   provides the blue half of the lore visually via contrast. */
.in-class-tree--cleric .in-class-tree__exclusive {
    --excl-accent:       #b91c1c;
    --excl-accent-light: #fca5a5;
    --excl-accent-glow:  rgba(185, 28, 28, 0.55);
}
/* Archer (green) → frost cyan: pale ice for Arctic Ranger's frost-transformation
   lore + nature-healer support role. Cool blue-green analogue complements the
   warm-green base without fighting it. */
.in-class-tree--archer .in-class-tree__exclusive {
    --excl-accent:       #67e8f9;
    --excl-accent-light: #cffafe;
    --excl-accent-glow:  rgba(103, 232, 249, 0.55);
}

/* ============================================================
   ICONIC SPINOFF / EXCLUSIVE GRADIENT FRAMES
   Each section gets a hand-picked palette matching its lore.
   3-layer bg: dashed/solid gradient stroke + noise dither tile +
   linear-gradient fill (oklab interpolated for smoothness).
   Cards inside stay default grey so icons stay readable — only
   the FRAME carries the gradient flow.

   SVG dashed-stroke trick: stroke-width 2px, half clipped at SVG
   viewport edge → 1px visible dashed line, with gradient stroke
   running corner-to-corner. CSS border-image can't preserve
   dashed + border-radius together, hence the SVG approach.
   Exclusive sections use stroke-width 4px (2px visible) without
   stroke-dasharray for solid emphasis.
   ============================================================ */

/* Warrior · Spinoff — Avenger / Dark Avenger: cursed dark warrior, blood-pact */
.in-class-tree--warrior .in-class-tree__spinoff {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23fca5a5'/%3E%3Cstop offset='0.5' stop-color='%23dc2626'/%3E%3Cstop offset='1' stop-color='%237f1d1d'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' rx='6' ry='6' fill='none' stroke='url(%23g)' stroke-width='2' stroke-dasharray='6 4'/%3E%3C/svg%3E"),
        var(--in-noise-svg),
        linear-gradient(135deg in oklab,
            rgba(220, 38, 38, 0.10),
            rgba(20, 5, 5, 0.16)
        );
    background-size: 100% 100%, 200px 200px, 100% 100%;
    background-repeat: no-repeat, repeat, no-repeat;
    border: none;
}

/* Archer · Spinoff — Hunter / Silver Hunter: silvery moonlit ranger */
.in-class-tree--archer .in-class-tree__spinoff {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23bbf7d0'/%3E%3Cstop offset='0.5' stop-color='%234ade80'/%3E%3Cstop offset='1' stop-color='%23064e3b'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' rx='6' ry='6' fill='none' stroke='url(%23g)' stroke-width='2' stroke-dasharray='6 4'/%3E%3C/svg%3E"),
        var(--in-noise-svg),
        linear-gradient(135deg in oklab,
            rgba(74, 222, 128, 0.10),
            rgba(20, 40, 30, 0.16)
        );
    background-size: 100% 100%, 200px 200px, 100% 100%;
    background-repeat: no-repeat, repeat, no-repeat;
    border: none;
}

/* Sorceress · Spinoff — Mara / Black Mara: void-soul sorceress */
.in-class-tree--sorceress .in-class-tree__spinoff {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23d8b4fe'/%3E%3Cstop offset='0.5' stop-color='%239333ea'/%3E%3Cstop offset='1' stop-color='%231e0a3e'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' rx='6' ry='6' fill='none' stroke='url(%23g)' stroke-width='2' stroke-dasharray='6 4'/%3E%3C/svg%3E"),
        var(--in-noise-svg),
        linear-gradient(135deg in oklab,
            rgba(168, 85, 247, 0.11),
            rgba(20, 5, 30, 0.16)
        );
    background-size: 100% 100%, 200px 200px, 100% 100%;
    background-repeat: no-repeat, repeat, no-repeat;
    border: none;
}

/* Cleric · Spinoff — Heretic / Arch Heretic: fallen cleric, dark holy magic */
.in-class-tree--cleric .in-class-tree__spinoff {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23bae6fd'/%3E%3Cstop offset='0.5' stop-color='%233b82f6'/%3E%3Cstop offset='1' stop-color='%231e3a8a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' rx='6' ry='6' fill='none' stroke='url(%23g)' stroke-width='2' stroke-dasharray='6 4'/%3E%3C/svg%3E"),
        var(--in-noise-svg),
        linear-gradient(135deg in oklab,
            rgba(56, 189, 248, 0.10),
            rgba(15, 30, 80, 0.16)
        );
    background-size: 100% 100%, 200px 200px, 100% 100%;
    background-repeat: no-repeat, repeat, no-repeat;
    border: none;
}

/* Academic · Spinoff — Mechanic / Ray Mechanic: tech mecha, golden gears */
.in-class-tree--academic .in-class-tree__spinoff {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23fef08a'/%3E%3Cstop offset='0.5' stop-color='%23eab308'/%3E%3Cstop offset='1' stop-color='%2378350f'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' rx='6' ry='6' fill='none' stroke='url(%23g)' stroke-width='2' stroke-dasharray='6 4'/%3E%3C/svg%3E"),
        var(--in-noise-svg),
        linear-gradient(135deg in oklab,
            rgba(250, 204, 21, 0.10),
            rgba(60, 30, 5, 0.16)
        );
    background-size: 100% 100%, 200px 200px, 100% 100%;
    background-repeat: no-repeat, repeat, no-repeat;
    border: none;
}

/* Kali · Spinoff — Oracle / Oracle Elder: ethereal mystic seer */
.in-class-tree--kali .in-class-tree__spinoff {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23c7d2fe'/%3E%3Cstop offset='0.5' stop-color='%236366f1'/%3E%3Cstop offset='1' stop-color='%231e1b4b'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' rx='6' ry='6' fill='none' stroke='url(%23g)' stroke-width='2' stroke-dasharray='6 4'/%3E%3C/svg%3E"),
        var(--in-noise-svg),
        linear-gradient(135deg in oklab,
            rgba(129, 140, 248, 0.10),
            rgba(25, 20, 70, 0.16)
        );
    background-size: 100% 100%, 200px 200px, 100% 100%;
    background-repeat: no-repeat, repeat, no-repeat;
    border: none;
}

/* Assassin · Spinoff — Phantom / Bleed Phantom: shadow assassin */
.in-class-tree--assassin .in-class-tree__spinoff {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23a7f3d0'/%3E%3Cstop offset='0.5' stop-color='%2310b981'/%3E%3Cstop offset='1' stop-color='%23022c22'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' rx='6' ry='6' fill='none' stroke='url(%23g)' stroke-width='2' stroke-dasharray='6 4'/%3E%3C/svg%3E"),
        var(--in-noise-svg),
        linear-gradient(135deg in oklab,
            rgba(16, 185, 129, 0.10),
            rgba(2, 30, 30, 0.16)
        );
    background-size: 100% 100%, 200px 200px, 100% 100%;
    background-repeat: no-repeat, repeat, no-repeat;
    border: none;
}

/* Lencea · Spinoff — Plaga / Vena Plaga: arcane purple, void-eye prophets */
.in-class-tree--lencea .in-class-tree__spinoff {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23f0abfc'/%3E%3Cstop offset='0.5' stop-color='%23c084fc'/%3E%3Cstop offset='1' stop-color='%237e22ce'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' rx='6' ry='6' fill='none' stroke='url(%23g)' stroke-width='2' stroke-dasharray='6 4'/%3E%3C/svg%3E"),
        var(--in-noise-svg),
        linear-gradient(135deg in oklab,
            rgba(168, 85, 247, 0.12),
            rgba(15, 5, 30, 0.16)
        );
    background-size: 100% 100%, 200px 200px, 100% 100%;
    background-repeat: no-repeat, repeat, no-repeat;
    border: none;
}

/* Machina · Spinoff — Beastia / Beastia Reina: primal mecha cyan */
.in-class-tree--machina .in-class-tree__spinoff {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23cffafe'/%3E%3Cstop offset='0.5' stop-color='%2306b6d4'/%3E%3Cstop offset='1' stop-color='%230e3a47'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' rx='6' ry='6' fill='none' stroke='url(%23g)' stroke-width='2' stroke-dasharray='6 4'/%3E%3C/svg%3E"),
        var(--in-noise-svg),
        linear-gradient(135deg in oklab,
            rgba(34, 211, 238, 0.11),
            rgba(15, 50, 70, 0.16)
        );
    background-size: 100% 100%, 200px 200px, 100% 100%;
    background-repeat: no-repeat, repeat, no-repeat;
    border: none;
}

/* Cleric · Exclusive — Squire / Searing Knight: cursed crimson flame.
   Solid (non-dashed) gradient stroke at 4px width (2px visible after clip)
   for the heavier exclusive emphasis. */
.in-class-tree--cleric .in-class-tree__exclusive {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23fca5a5'/%3E%3Cstop offset='0.5' stop-color='%23dc2626'/%3E%3Cstop offset='1' stop-color='%237f1d1d'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' rx='6' ry='6' fill='none' stroke='url(%23g)' stroke-width='4'/%3E%3C/svg%3E"),
        var(--in-noise-svg),
        linear-gradient(135deg in oklab,
            rgba(220, 38, 38, 0.12),
            rgba(15, 5, 5, 0.18)
        );
    background-size: 100% 100%, 200px 200px, 100% 100%;
    background-repeat: no-repeat, repeat, no-repeat;
    background-color: transparent;
    border: none;
    box-shadow: 0 0 18px rgba(185, 28, 28, 0.30);
}

/* Archer · Exclusive — Ranger / Arctic Ranger: nature-healer with frost form */
.in-class-tree--archer .in-class-tree__exclusive {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23cffafe'/%3E%3Cstop offset='0.5' stop-color='%2306b6d4'/%3E%3Cstop offset='1' stop-color='%230c4a6e'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' rx='6' ry='6' fill='none' stroke='url(%23g)' stroke-width='4'/%3E%3C/svg%3E"),
        var(--in-noise-svg),
        linear-gradient(135deg in oklab,
            rgba(103, 232, 249, 0.11),
            rgba(15, 50, 80, 0.16)
        );
    background-size: 100% 100%, 200px 200px, 100% 100%;
    background-repeat: no-repeat, repeat, no-repeat;
    background-color: transparent;
    border: none;
    box-shadow: 0 0 18px rgba(103, 232, 249, 0.30);
}

/* "Other Classes" header below the trees. */
.in-classes-other-header {
    margin: 3rem 0 1rem;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}
.in-classes-other-header[hidden] { display: none; }
