:root {
    --gold: #c5a05b;
    --gold-bright: #f3d692;
    --gold-dim: rgba(197, 160, 89, 0.55);
    --dark-deep: #05070a;
    --surface: rgba(10, 14, 22, 0.88);
    --surface-card: rgba(13, 18, 29, 0.84);
    --border-gold: rgba(197, 160, 89, 0.32);
    --ink: #e8e4dc;
    --muted: #9ca3b5;
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--dark-deep);
}

body {
    min-height: 100vh;
    color: var(--ink);
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.65;
    background:
        url('/home/the-lord-archmage-fondo.webp') no-repeat center center fixed,
        url('/home/the-lord-archmage-fondo-low.webp') no-repeat center center fixed;
    background-color: var(--dark-deep);
    background-size: cover;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 50% 18%, rgba(197, 160, 89, 0.08) 0%, rgba(5, 7, 10, 0.82) 55%, rgba(3, 4, 8, 0.94) 100%);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

h1, h2, h3, h4 {
    font-family: 'Cinzel', Georgia, serif;
    color: var(--gold-bright);
    letter-spacing: 1.8px;
}

a {
    color: var(--gold-bright);
    text-decoration: none;
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #8a6d3b 0%, var(--gold) 50%, var(--gold-bright) 100%);
    box-shadow: 0 0 12px rgba(243, 214, 146, 0.65);
    z-index: 300;
    transition: width 0.08s linear;
}

/* Top Glassmorphism Navbar */
.arcane-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(5, 7, 10, 0.84);
    border-bottom: 1px solid var(--border-gold);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.65);
}

.arcane-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--gold-bright);
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.nav-brand:hover {
    color: #ffffff;
}

.nav-brand-logo {
    height: 34px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(197, 160, 89, 0.45));
}

.nav-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    min-width: 36px;
    border-radius: 999px;
    border: 1px solid rgba(197, 160, 89, 0.24);
    background: rgba(15, 21, 34, 0.55);
    color: var(--ink);
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.nav-pill:hover {
    border-color: var(--gold-bright);
    color: #ffffff;
    background: rgba(197, 160, 89, 0.16);
    transform: translateY(-1px);
}

.nav-pill.is-active {
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.34), rgba(138, 109, 59, 0.24));
    border-color: var(--gold-bright);
    color: var(--gold-bright);
    box-shadow: 0 0 14px rgba(197, 160, 89, 0.28);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--gold) 0%, #8a6d3b 100%);
    color: #0b0f19;
    border: 1px solid var(--gold-bright);
    box-shadow: 0 4px 14px rgba(197, 160, 89, 0.28);
    flex-shrink: 0;
}

.nav-cta:hover {
    color: #05070a;
    background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(197, 160, 89, 0.48);
}

/* Anthology Index Hero */
.anthology-hero {
    max-width: 960px;
    margin: 0 auto;
    padding: 64px 20px 36px;
    text-align: center;
}

.hero-eyebrow {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--border-gold);
    border-radius: 999px;
    background: rgba(10, 14, 22, 0.72);
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 2.6px;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.anthology-hero h1 {
    font-size: clamp(2.1rem, 5vw, 3.6rem);
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.9), 0 0 36px rgba(197, 160, 89, 0.25);
    margin-bottom: 14px;
}

.anthology-lead {
    max-width: 680px;
    margin: 0 auto 24px;
    color: #cbd0dc;
    font-size: clamp(0.98rem, 2vw, 1.12rem);
    font-weight: 400;
    line-height: 1.75;
}

.anthology-rule {
    width: 180px;
    height: 1px;
    margin: 0 auto;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Anthology Grid & Chronicle Cards */
.chronicles-section {
    max-width: 1120px;
    margin: 0 auto;
    padding: 20px 20px 80px;
}

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

.chronicle-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px 30px;
    border-radius: 10px;
    background: var(--surface-card);
    border: 1px solid var(--border-gold);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
    color: var(--ink);
}

.chronicle-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.45;
    transition: opacity 0.25s ease;
}

.chronicle-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold-bright);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.8), 0 0 28px rgba(197, 160, 89, 0.16);
}

.chronicle-card:hover::before {
    opacity: 1;
}

.chronicle-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.chronicle-id {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.chronicle-orb {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid var(--border-gold);
    padding: 3px;
    box-shadow: 0 0 12px rgba(197, 160, 89, 0.25);
}

.chronicle-badge {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
}

.chronicle-stats {
    font-size: 0.76rem;
    color: var(--muted);
    letter-spacing: 0.4px;
}

.chronicle-card h2 {
    font-size: 1.32rem;
    margin-bottom: 4px;
    text-transform: none;
    letter-spacing: 1px;
}

.chronicle-author {
    font-family: 'Crimson Pro', Georgia, serif;
    font-style: italic;
    font-size: 1.04rem;
    color: var(--gold);
    margin-bottom: 14px;
}

.chronicle-author strong {
    font-style: normal;
    color: #f3efe6;
    font-weight: 600;
}

.chronicle-excerpt {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.08rem;
    line-height: 1.65;
    color: #c8cdd8;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chronicle-read {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--gold-bright);
}

.chronicle-card:hover .chronicle-read span {
    transform: translateX(4px);
}

.chronicle-read span {
    display: inline-block;
    transition: transform 0.25s ease;
}

/* Tome Story Reader */
.tome-container {
    max-width: 820px;
    margin: 42px auto 72px;
    padding: 0 20px;
}

.tome-card {
    background: var(--surface);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    padding: clamp(28px, 5vw, 56px) clamp(22px, 5vw, 60px);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.85),
        inset 0 0 0 1px rgba(197, 160, 89, 0.08),
        0 0 42px rgba(197, 160, 89, 0.08);
    position: relative;
}

.tome-card::before,
.tome-card::after {
    content: '';
    position: absolute;
    left: 22px;
    right: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.tome-card::before {
    top: 12px;
}

.tome-card::after {
    bottom: 12px;
}

.tome-header {
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(197, 160, 89, 0.22);
}

.tome-orb {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-gold);
    padding: 6px;
    margin: 0 auto 14px;
    display: block;
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.25);
}

.tome-eyebrow {
    font-family: 'Cinzel', serif;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 10px;
}

.tome-header h1 {
    font-size: clamp(1.85rem, 4.2vw, 2.75rem);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 8px;
}

.tome-subtitle {
    font-family: 'Cinzel', serif;
    font-size: clamp(0.95rem, 2vw, 1.14rem);
    color: #dfd3ba;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
}

.tome-byline {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.12rem;
    color: var(--muted);
    font-style: italic;
}

.tome-byline strong {
    color: var(--gold-bright);
    font-style: normal;
    font-weight: 600;
}

.tome-meta {
    margin-top: 10px;
    font-size: 0.78rem;
    letter-spacing: 0.8px;
    color: var(--muted);
    text-transform: uppercase;
}

/* Literary Prose */
.tome-prose {
    font-family: 'Crimson Pro', Georgia, 'Times New Roman', serif;
    font-size: clamp(1.12rem, 2vw, 1.26rem);
    line-height: 1.88;
    color: var(--ink);
}

.tome-prose p {
    margin-bottom: 1.35em;
    text-align: left;
    overflow-wrap: break-word;
}

.tome-prose p:last-child {
    margin-bottom: 0;
}

.tome-prose p.lead-para::first-letter {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 3.35em;
    line-height: 0.84;
    float: left;
    padding: 0.08em 0.16em 0 0;
    color: var(--gold-bright);
    font-weight: 700;
    text-shadow: 0 2px 14px rgba(197, 160, 89, 0.45);
}

.tome-prose p.dialogue {
    padding-left: 1.15em;
    border-left: 2px solid rgba(197, 160, 89, 0.4);
    color: #f4f0e8;
}

.scene-divider {
    text-align: center;
    color: var(--gold);
    letter-spacing: 0.55em;
    margin: 2em 0;
    font-size: 1.05rem;
    opacity: 0.88;
    user-select: none;
}

.chapter-heading {
    font-family: 'Cinzel', Georgia, serif;
    color: var(--gold-bright);
    font-size: 1.35rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 1.75em 0 0.8em;
    padding-bottom: 0.35em;
    border-bottom: 1px solid rgba(197, 160, 89, 0.24);
}

/* Prev / Index / Next Navigation Pager */
.story-pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    margin-top: 28px;
    align-items: stretch;
}

.pager-link,
.pager-spacer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 18px;
    border-radius: 8px;
    background: var(--surface-card);
    border: 1px solid var(--border-gold);
    backdrop-filter: blur(10px);
}

.pager-spacer {
    opacity: 0.35;
    pointer-events: none;
}

.pager-link:hover {
    border-color: var(--gold-bright);
    background: rgba(197, 160, 89, 0.12);
    transform: translateY(-2px);
}

.pager-link.pager-prev {
    text-align: left;
}

.pager-link.pager-index {
    text-align: center;
    justify-content: center;
    padding: 14px 24px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.pager-link.pager-next {
    text-align: right;
}

.pager-dir {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--muted);
    margin-bottom: 3px;
}

.pager-title {
    font-family: 'Cinzel', serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--gold-bright);
}

/* Footer */
.arcane-footer {
    border-top: 1px solid rgba(197, 160, 89, 0.16);
    background: rgba(3, 4, 8, 0.92);
    padding: 32px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.arcane-footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 22px;
    margin-bottom: 12px;
}

.arcane-footer-links a {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 1.2px;
    color: var(--gold);
}

.arcane-footer-links a:hover {
    color: #ffffff;
}

/* Mobile Responsive */
@media (max-width: 820px) {
    .arcane-nav-inner {
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 10px 14px;
    }

    .nav-pills {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .nav-pills::-webkit-scrollbar {
        display: none;
    }

    .nav-pill {
        flex-shrink: 0;
        padding: 6px 11px;
    }

    .chronicles-grid {
        grid-template-columns: 1fr;
    }

    .story-pager {
        grid-template-columns: 1fr;
    }

    .pager-link.pager-next {
        text-align: left;
    }
}
