/* ============================================================
   entropy.root reference sheet styles
   Layout mirrors watchthelight.org/trestle 1:1.
   Recolored to Entropy palette (deep black + gold/copper/cream/
   rust/ichor). Typography: Turret Road throughout.
   ============================================================ */

:root {
    /* Entropy palette */
    --rust: #c45a28;
    --gold: #d4a84b;
    --cream: #e8dcc4;
    --tan: #c49a6c;
    --sienna: #a05a32;
    --chocolate: #7a4428;
    --olive: #b4a864;
    --bronze: #7a5c34;
    --ichor: #ecb442;
    --umber: #3d2820;

    /* Surface tones (deep black) */
    --t-bg: #000000;           /* outer page */
    --t-panel: #050505;        /* ref-sheet panel */
    --t-header: #0a0a0a;       /* header / hero / palette / lore strips */

    /* Semantic roles */
    --t-border: var(--chocolate);   /* dividers / borders */
    --t-accent: var(--gold);        /* primary accent */
    --t-accent-bright: var(--ichor);/* hover / strong accent */
    --t-muted: var(--sienna);       /* muted labels */
    --t-text: var(--cream);         /* body copy */

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;

    /* Layers */
    --overlay-z: 2;
}

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

html {
    background: var(--t-bg);
}

body {
    font-family: 'Turret Road', system-ui, sans-serif;
    background: transparent;
    color: var(--t-text);
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

/* ----- Skip link (a11y) ----- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--t-accent);
    color: #000;
    padding: 12px 16px;
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 4px;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* ----- Galaxy background ----- */
#galaxy-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}
#galaxy-bg canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* ----- Loading overlay ----- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--umber);
    border-top-color: var(--t-accent);
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
}
.loading-text {
    margin-top: 16px;
    color: var(--t-accent);
    font-family: 'Turret Road', sans-serif;
    font-size: 0.9em;
    letter-spacing: 2px;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }

/* ============================================================
   STICKY TOP NAV (glass)
   ============================================================ */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 90;
    margin: -20px -20px 20px -20px;
    padding: 0.8rem 1.5rem;
    background: rgba(0, 0, 0, 0.72);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--t-border);
    transition: transform 300ms cubic-bezier(0.2, 0.7, 0.25, 1);
}
.site-nav.nav-hidden { transform: translateY(-100%); }
.site-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.site-nav .brand {
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--t-accent);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.boyfriend-link {
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--t-border);
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--t-border);
    transition: color 200ms cubic-bezier(0.2, 0.7, 0.25, 1),
                border-color 200ms cubic-bezier(0.2, 0.7, 0.25, 1),
                background 200ms cubic-bezier(0.2, 0.7, 0.25, 1);
}
.boyfriend-link:hover {
    color: var(--t-accent);
    border-color: var(--t-accent);
    background: rgba(212, 168, 75, 0.08);
}

/* ============================================================
   REF-SHEET WRAPPER
   ============================================================ */
.ref-sheet {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--t-panel);
    border: 1px solid var(--t-border);
    position: relative;
    overflow: hidden;
}

/* LetterGlitch background container */
#letter-glitch-root {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ----- Corner decorations ----- */
.corner-decoration {
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: var(--t-border);
    border-style: solid;
    z-index: 10;
    pointer-events: none;
}
.corner-tl { top: 5px; left: 5px; border-width: 2px 0 0 2px; }
.corner-tr { top: 5px; right: 5px; border-width: 2px 2px 0 0; }
.corner-bl { bottom: 5px; left: 5px; border-width: 0 0 2px 2px; }
.corner-br { bottom: 5px; right: 5px; border-width: 0 2px 2px 0; }

/* ----- Coordinate markers (xkcd tribute) ----- */
.coord-marker {
    position: absolute;
    font-family: 'Courier New', monospace;
    font-size: 0.7em;
    color: var(--t-muted);
    letter-spacing: 2px;
    opacity: 0.55;
    pointer-events: none;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
    z-index: var(--overlay-z);
}
.coord-tl { display: none; }
.coord-tr { top: 12px; right: 48px; }
.coord-bl { bottom: 12px; left: 48px; }
.coord-br { bottom: 12px; right: 48px; }

/* ============================================================
   REF HEADER (title + gallery + effects toggle + species label)
   Background transparent → LetterGlitch chars show through.
   Padding-top == padding-left so "E" of Entropy aligns diagonally
   with the inner vertex of the corner-tl L-bracket.
   ============================================================ */
.ref-header {
    background: rgba(0, 0, 0, 0.45);
    padding: 30px 30px 24px 30px;
    border-bottom: 1px solid var(--t-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    z-index: 4;
}

.title-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 10;
    position: relative;
}

/* FuzzyText title canvas sizing */
/* Canvas has 50px horizontal internal margin; offset root -50px so
   the visible "E" top-left pixel lands exactly at header padding origin */
#fuzzy-title-root {
    margin-left: -50px;
    margin-top: 0;
    line-height: 0;
    min-height: 60px;
    contain: layout;
}
#fuzzy-title-root canvas {
    display: block;
    min-width: 380px;
    min-height: 60px;
}

.title-section .subtitle {
    font-family: 'Turret Road', sans-serif;
    font-size: 0.85em;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--t-muted);
    border-top: 1px solid var(--t-border);
    padding-top: 5px;
    margin-top: 5px;
    margin-left: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 10;
    position: relative;
}

/* Species label */
.species-label { text-align: right; }
.species-label .species-name {
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    font-size: 1.25em;
    color: var(--t-accent);
    letter-spacing: 2px;
    text-transform: uppercase;
}
.species-label .species-sub {
    font-size: 0.85em;
    color: var(--t-muted);
    font-style: italic;
}

/* OG entropy buttons: translucent bg, rounded, gold border on hover + glow + scanline sweep */
.gallery-link,
.nav-link,
.effects-toggle,
.boyfriend-link {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--t-border);
    border-radius: 4px;
    padding: 6px 14px;
    color: var(--t-accent);
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    font-size: 0.85em;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    transition: color 0.2s ease, border-color 0.2s ease,
                background 0.2s ease, box-shadow 0.25s ease,
                transform 0.15s ease;
}

/* Scanline-style sweep on hover */
.gallery-link::before,
.nav-link::before,
.effects-toggle::before,
.boyfriend-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(212, 168, 75, 0.18) 50%,
        transparent 100%
    );
    transform: translateX(-110%);
    transition: transform 420ms cubic-bezier(0.2, 0.7, 0.25, 1);
    pointer-events: none;
}
.gallery-link:hover::before,
.nav-link:hover::before,
.effects-toggle:hover::before,
.boyfriend-link:hover::before {
    transform: translateX(110%);
}

.gallery-link:hover,
.nav-link:hover,
.effects-toggle:hover,
.boyfriend-link:hover {
    color: var(--t-accent-bright);
    border-color: var(--t-accent);
    background: rgba(212, 168, 75, 0.10);
    box-shadow: 0 0 12px rgba(212, 168, 75, 0.35),
                inset 0 0 8px rgba(212, 168, 75, 0.08);
    transform: translateY(-1px);
}
.gallery-link:active,
.nav-link:active,
.effects-toggle:active,
.boyfriend-link:active {
    transform: translateY(0);
    box-shadow: 0 0 6px rgba(212, 168, 75, 0.25) inset;
}
.gallery-link:focus-visible,
.nav-link:focus-visible,
.effects-toggle:focus-visible,
.boyfriend-link:focus-visible {
    outline: 2px solid var(--t-accent);
    outline-offset: 2px;
}

/* Effects toggle disabled state */
.effects-toggle.disabled {
    color: var(--t-muted);
    border-color: var(--umber);
    background: rgba(0, 0, 0, 0.55);
}
.effects-toggle.disabled:hover {
    color: var(--t-accent);
    border-color: var(--t-border);
    box-shadow: none;
}
.effects-toggle .toggle-icon {
    font-size: 1.05em;
    transition: opacity 0.3s ease, text-shadow 0.3s ease;
}
.effects-toggle:not(.disabled) .toggle-icon {
    animation: sparkle 2s infinite;
    text-shadow: 0 0 6px rgba(212, 168, 75, 0.6);
}
.effects-toggle.disabled .toggle-icon { opacity: 0.5; }
@keyframes sparkle {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
    .effects-toggle:not(.disabled) .toggle-icon { animation: none; }
}

/* ============================================================
   REF TABS (sticky scroll-spy bar)
   ============================================================ */
.ref-tabs {
    position: sticky;
    top: 56px;
    z-index: 80;
    background: rgba(0, 0, 0, 0.82);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    backdrop-filter: blur(12px) saturate(140%);
    border-bottom: 1px solid var(--t-border);
}
.ref-tabs-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.ref-tabs-inner::-webkit-scrollbar { display: none; }
.ref-tab {
    position: relative;
    padding: 0.75rem 1.1rem;
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--t-border);
    text-decoration: none;
    white-space: nowrap;
    transition: color 180ms cubic-bezier(0.2, 0.7, 0.25, 1);
}
.ref-tab::after {
    content: '';
    position: absolute;
    left: 1.1rem;
    right: 1.1rem;
    bottom: 0;
    height: 1px;
    background: var(--t-accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 180ms cubic-bezier(0.2, 0.7, 0.25, 1);
}
.ref-tab:hover, .ref-tab.active {
    color: var(--t-accent);
    text-shadow: 0 0 8px rgba(212, 168, 75, 0.45);
}
.ref-tab:hover::after, .ref-tab.active::after { transform: scaleX(1); }
.ref-tab-spacer { flex: 1; }
.ref-tab-external { color: var(--t-muted); font-size: 0.74rem; }
.ref-tab-external:hover { color: var(--t-accent); }

/* ============================================================
   MAIN CONTENT GRID (4 columns at desktop)
   ============================================================ */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    position: relative;
    z-index: 2;
}

.column {
    padding: 24px;
    border-right: 1px solid var(--t-border);
}
.column:last-child { border-right: none; }

/* ----- Hero block (full-width, spans all columns) ----- */
.hero-block {
    grid-column: 1 / -1;
    padding: 28px 24px 22px;
    background: var(--t-header);
    border-bottom: 1px solid var(--t-border);
}

.hero-frame {
    position: relative;
    display: block;
    max-width: 1500px;
    margin: 0 auto;
}

.corner-hint {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--t-accent);
    border-style: solid;
    opacity: 0;
    transition: opacity 260ms cubic-bezier(0.2, 0.7, 0.25, 1);
    pointer-events: none;
    z-index: 3;
}
.corner-hint.tl { top: -8px; left: -8px; border-width: 1px 0 0 1px; }
.corner-hint.tr { top: -8px; right: -8px; border-width: 1px 1px 0 0; }
.corner-hint.bl { bottom: -8px; left: -8px; border-width: 0 0 1px 1px; }
.corner-hint.br { bottom: -8px; right: -8px; border-width: 0 1px 1px 0; }
.hero-frame:hover .corner-hint { opacity: 0.85; }

/* Frame brackets (corner accents inside hero) */
.frame-bracket {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--t-accent);
    border-style: solid;
    z-index: 4;
    opacity: 0.5;
    pointer-events: none;
}
.frame-bracket-tl { top: 8px; left: 8px; border-width: 1px 0 0 1px; }
.frame-bracket-tr { top: 8px; right: 8px; border-width: 1px 1px 0 0; }
.frame-bracket-bl { bottom: 8px; left: 8px; border-width: 0 0 1px 1px; }
.frame-bracket-br { bottom: 8px; right: 8px; border-width: 0 1px 1px 0; }

/* Hero image — ImageGlitch canvas inside #main-ref-glitch-root */
#main-ref-glitch-root {
    display: block;
    width: 100%;
}
#main-ref-glitch-root canvas,
.hero-frame .ref-image,
.hero-frame canvas {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--t-border);
    border-radius: 0;
    cursor: pointer;
    transition: border-color 260ms cubic-bezier(0.2, 0.7, 0.25, 1);
    image-rendering: auto;
}
.hero-frame:hover #main-ref-glitch-root canvas,
.hero-frame:hover .ref-image {
    border-color: var(--t-accent);
}

.hero-credit {
    text-align: center;
    font-size: 0.82em;
    color: var(--t-muted);
    font-style: italic;
    margin-top: 8px;
    letter-spacing: 1px;
}
.hero-credit a {
    color: var(--t-accent);
    text-decoration: none;
}
.hero-credit a:hover { color: var(--t-text); }

/* ============================================================
   SECTION BUILDING BLOCKS
   ============================================================ */
.section-box { margin-bottom: 22px; }
.section-box:last-child { margin-bottom: 0; }

.section-title {
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    font-size: 1em;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--t-accent);
    border-bottom: 1px solid var(--t-border);
    padding-bottom: 6px;
    margin-bottom: 12px;
}

/* Plain prose */
.section-text {
    color: var(--t-text);
    line-height: 1.7;
    font-size: 1.05em;
}

/* Overview / specs table */
.overview-table {
    width: 100%;
    border-collapse: collapse;
}
.overview-table tr {
    border-bottom: 1px solid var(--umber);
}
.overview-table td {
    padding: 7px 0;
    font-size: 1.05em;
}
.overview-table td:first-child {
    color: var(--t-muted);
    width: 95px;
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    font-size: 0.82em;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.overview-table td:last-child { color: var(--t-text); }

/* Feature lists with ▸ bullet */
.feature-section { margin-bottom: 16px; }
.section-box:last-child .feature-section:last-child { margin-bottom: 0; }
.feature-section h4 {
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    font-size: 0.95em;
    color: var(--t-accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.feature-section ul,
.feature-list {
    list-style: none;
    color: var(--t-text);
    line-height: 1.7;
    padding: 0;
    margin: 0;
    font-size: 1.05em;
}
.feature-section ul li,
.feature-list li {
    padding-left: 14px;
    margin-left: 0;
    position: relative;
    list-style-position: outside;
}
.feature-section ul li::before,
.feature-list li::before {
    content: '▸';
    color: var(--t-muted);
    position: absolute;
    left: 0;
}

/* Notes / pull-quote box */
.notes-box {
    background: rgba(122, 68, 40, 0.12);
    border: 1px solid var(--t-border);
    border-left: 3px solid var(--t-accent);
    border-radius: 0;
    padding: 14px 16px;
    color: var(--t-text);
    line-height: 1.7;
    font-size: 1.05em;
}
.notes-box p { color: var(--t-text); margin-bottom: 10px; }
.notes-box p:last-child { margin-bottom: 0; }
.notes-box .note-head {
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    font-size: 0.8em;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--t-accent);
    margin-bottom: 6px;
}

/* ============================================================
   INLINE ART FIGURES (small images in columns)
   ============================================================ */
.art-figure { margin: 14px 0 4px; }
.art-figure-frame {
    position: relative;
    border: 1px solid var(--t-border);
    background: transparent;
    overflow: hidden;
    transition:
        border-color 260ms cubic-bezier(0.2, 0.7, 0.25, 1),
        box-shadow 260ms cubic-bezier(0.2, 0.7, 0.25, 1);
}
.art-figure-frame:hover {
    border-color: var(--t-accent);
    box-shadow: inset 0 0 0 1px var(--t-accent);
}

#entropy-icon-glitch-root,
#artwork-3-glitch-root,
#artwork-bottom-glitch-root {
    display: block;
    width: 100%;
}
#entropy-icon-glitch-root canvas,
#artwork-3-glitch-root canvas,
#artwork-bottom-glitch-root canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: pointer;
}

.art-figure-caption {
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--t-muted);
    text-align: center;
    margin-top: 8px;
    display: block;
    text-decoration: none;
}
.art-figure:hover .art-figure-caption { color: var(--t-accent); }

/* ============================================================
   PALETTE STRIP
   ============================================================ */
.palette-strip {
    grid-column: 1 / -1;
    padding: 24px;
    border-bottom: 1px solid var(--t-border);
    background: var(--t-header);
}
.palette-heading {
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    font-size: 0.95em;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--t-accent);
    text-align: center;
    margin-bottom: 14px;
}
/* Original Entropy strip: skewed swatches abutting, no gaps, hex tooltip on hover */
.palette-row {
    display: flex;
    height: 56px;
    max-width: 1200px;
    margin: 0 auto;
    border: 2px solid var(--t-border);
    overflow: hidden;
}
.color-chip {
    flex: 1;
    cursor: pointer;
    position: relative;
}
.color-chip:hover, .color-chip:focus-visible { z-index: 10; }
.color-chip:hover .swatch,
.color-chip:focus-visible .swatch {
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.8);
}
.color-chip:active .swatch {
    box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.9);
}
.color-chip:focus-visible {
    outline: 2px solid var(--t-accent);
    outline-offset: 2px;
}
.color-chip::after {
    content: attr(data-hex);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: rgba(0, 0, 0, 0.9);
    color: var(--t-text);
    font-family: monospace;
    font-size: 0.72em;
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid var(--t-border);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 11;
}
.color-chip:hover::after,
.color-chip:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}
.color-chip .swatch {
    height: 100%;
    width: calc(100% + 25px);
    transform: skewX(-20deg);
    margin-left: -12px;
    transition: box-shadow 0.2s ease;
}
.color-chip:first-child .swatch {
    margin-left: -30px;
    width: calc(100% + 55px);
}
.color-chip:last-child .swatch {
    width: calc(100% + 55px);
}
.color-chip .hex { display: none; }
.color-chip.copied::after {
    content: attr(data-hex) ' ✓';
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
    color: var(--t-accent);
}

.palette-hint {
    text-align: center;
    font-family: 'Turret Road', sans-serif;
    font-size: 0.72em;
    color: var(--t-muted);
    letter-spacing: 1.5px;
    margin-top: 12px;
    font-style: italic;
    text-transform: uppercase;
}
@keyframes copy-check {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   LORE SECTION (book-page prose with drop cap + ornaments)
   ============================================================ */
.lore-section {
    padding: 48px 24px 56px;
    border-top: 1px solid var(--t-border);
    background:
        radial-gradient(ellipse at top, rgba(212, 168, 75, 0.04), transparent 60%),
        var(--t-header);
    position: relative;
    z-index: 2;
}
.lore-heading {
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    font-size: 0.95em;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--t-accent);
    text-align: center;
    margin-bottom: 20px;
}
.lore-book {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    font-family: 'Turret Road', system-ui, sans-serif;
    font-size: 1.12rem;
    line-height: 1.85;
    color: var(--t-text);
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
}
.lore-book p {
    margin: 0 0 1.1em 0;
    text-indent: 2.2em;
}
.lore-book p:first-of-type { text-indent: 0; }
.lore-book p:first-of-type::first-letter {
    font-family: 'Turret Road', sans-serif;
    font-weight: 700;
    float: left;
    font-size: 5.2em;
    line-height: 0.85;
    padding: 0.05em 0.12em 0 0;
    margin: 0.05em 0.08em 0 0;
    color: var(--t-accent);
    text-shadow: 0 0 24px rgba(212, 168, 75, 0.25);
}
.lore-book em {
    font-style: italic;
    color: var(--t-accent);
}
.lore-ornament {
    text-align: center;
    color: var(--t-muted);
    font-size: 1.1rem;
    letter-spacing: 1.4em;
    margin: 1.4em 0 1.6em 0;
    padding-left: 1.4em;
    user-select: none;
}

/* ============================================================
   FOOTER
   ============================================================ */
.ref-footer {
    display: block;
    width: 100%;
    background: #0a0a0a;
    border-top: 1px solid var(--t-border);
    padding: 14px 24px;
    font-size: 0.78em;
    color: var(--t-muted);
    text-align: center !important;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 5;
}
.ref-footer span { color: var(--t-accent); }
.ref-footer a { color: var(--t-accent); text-decoration: none; }
.ref-footer a:hover { color: var(--t-text); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .main-content { grid-template-columns: 1fr 1fr; }
    .column { border-right: 1px solid var(--t-border); border-bottom: 1px solid var(--t-border); }
    .column:nth-child(2n) { border-right: none; }
}
@media (max-width: 1200px) {
    .palette-row { height: 50px; }
}
@media (max-width: 720px) {
    .main-content { grid-template-columns: 1fr; }
    .column { border-right: none; border-bottom: 1px solid var(--t-border); }
    .column:last-child { border-bottom: none; }
    .hero-block { border-bottom: 1px solid var(--t-border); }
    .palette-row { height: 44px; }
    .lore-book {
        font-size: 1.0rem;
        padding: 0 6px;
        text-align: left;
        hyphens: manual;
    }
    .lore-book p { text-indent: 1.4em; }
    .lore-book p:first-of-type::first-letter { font-size: 4.2em; }
}
@media (max-width: 520px) {
    .palette-row { grid-template-columns: repeat(2, 1fr); }
    .ref-header { flex-direction: column; text-align: center; }
    .header-right { flex-direction: column; }
    .species-label { text-align: center; }
    .title-section h1 { font-size: 1.9em; }
}
