/* === MEDIOEVO.SPACE === */
:root {
    --bg: #0a0a0f;
    --bg2: #0f0f1a;
    --cyan: #00d4ff;
    --gold: #c9a84c;
    --white: #e8e8e8;
    --gray: #888;
    --dark-gray: #1a1a2e;
    --red: #ff3344;
    --font-head: 'Space Grotesk', sans-serif;
    --font-body: 'Crimson Pro', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    overflow-x: hidden;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
img { max-width: 100%; height: auto; }

/* NAV */
#nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 32px;
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,212,255,0.1);
    transition: all 0.3s;
}
#nav.scrolled { padding: 10px 32px; background: rgba(10,10,15,0.95); }
.nav-logo {
    font-family: var(--font-head); font-size: 24px; font-weight: 700;
    color: var(--cyan); text-decoration: none; letter-spacing: 4px;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a {
    font-family: var(--font-head); font-size: 14px; font-weight: 400;
    color: var(--gray); text-decoration: none; letter-spacing: 2px;
    text-transform: uppercase; transition: color 0.3s;
}
.nav-links a:hover { color: var(--cyan); }
.nav-toggle { display: none; background: none; border: none; color: var(--white); font-size: 28px; cursor: pointer; }

/* HERO */
#hero {
    position: relative; min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
#stars { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.hero-content { position: relative; z-index: 1; text-align: center; padding: 120px 24px 60px; }
.hero-title {
    font-family: var(--font-head); font-size: clamp(48px, 10vw, 120px);
    font-weight: 700; letter-spacing: 12px; color: var(--white);
    text-shadow: 0 0 60px rgba(0,212,255,0.3);
    margin-bottom: 16px;
}
.hero-pre, .hero-post { color: var(--cyan); font-weight: 400; opacity: 0.6; }
.hero-tagline {
    font-family: var(--font-head); font-size: clamp(16px, 2.5vw, 24px);
    color: var(--gray); letter-spacing: 3px; margin-bottom: 8px;
}
.hero-sub {
    font-family: var(--font-body); font-size: 18px; font-style: italic;
    color: var(--gold); margin-bottom: 40px;
}
.hero-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 60px; }

/* BUTTONS */
.btn {
    font-family: var(--font-head); font-size: 14px; font-weight: 600;
    padding: 14px 32px; border-radius: 4px; text-decoration: none;
    letter-spacing: 2px; text-transform: uppercase; transition: all 0.3s;
    display: inline-block; cursor: pointer;
}
.btn-primary { background: var(--cyan); color: var(--bg); border: 2px solid var(--cyan); }
.btn-primary:hover { background: transparent; color: var(--cyan); }
.btn-secondary { background: transparent; color: var(--gold); border: 2px solid var(--gold); }
.btn-secondary:hover { background: var(--gold); color: var(--bg); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid var(--gray); }
.btn-outline:hover { border-color: var(--white); }
.btn-small { font-size: 12px; padding: 8px 20px; }
.btn-free { background: var(--gold); color: var(--bg); border: 2px solid var(--gold); }
.btn-free:hover { background: transparent; color: var(--gold); }

/* STATS */
.hero-stats { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-num {
    display: block; font-family: var(--font-head); font-size: 36px;
    font-weight: 700; color: var(--cyan);
}
.stat-label { font-size: 12px; color: var(--gray); letter-spacing: 2px; text-transform: uppercase; }

/* SCROLL INDICATOR */
.scroll-indicator {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    text-align: center; z-index: 1;
}
.scroll-indicator span { font-size: 12px; color: var(--gray); letter-spacing: 3px; text-transform: uppercase; }
.scroll-arrow {
    width: 2px; height: 40px; background: linear-gradient(to bottom, var(--cyan), transparent);
    margin: 8px auto 0; animation: scrollPulse 2s infinite;
}
@keyframes scrollPulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

/* SECTIONS */
section { padding: 100px 0; }
section:nth-child(even) { background: var(--bg2); }
.section-title {
    font-family: var(--font-head); font-size: clamp(32px, 5vw, 56px);
    font-weight: 700; text-align: center; margin-bottom: 12px;
    letter-spacing: 4px; color: var(--white);
}
.section-subtitle {
    text-align: center; color: var(--gray); font-size: 18px;
    max-width: 600px; margin: 0 auto 48px; font-style: italic;
}

/* READER */
#read-free { background: var(--bg); }

.reader-controls {
    display: flex; justify-content: center; gap: 16px;
    margin-bottom: 32px; flex-wrap: wrap;
}
.reader-select {
    font-family: var(--font-head); font-size: 14px;
    padding: 10px 20px; border: 1px solid var(--gray);
    background: var(--bg2); color: var(--white);
    border-radius: 4px; cursor: pointer; letter-spacing: 1px;
    min-width: 280px; max-width: 100%;
}
.reader-select:focus { border-color: var(--cyan); outline: none; }

.reader-container {
    max-width: 720px; margin: 0 auto;
    background: var(--bg2); border: 1px solid var(--dark-gray);
    border-radius: 8px; overflow: hidden;
}
.reader-header {
    padding: 20px 32px; border-bottom: 1px solid var(--dark-gray);
    background: rgba(0,212,255,0.03);
}
.reader-chapter-label {
    font-family: var(--font-head); font-size: 20px;
    color: var(--cyan); letter-spacing: 2px;
}
.reader-content {
    padding: 40px 32px; max-height: 70vh; overflow-y: auto;
    font-family: var(--font-body); font-size: 18px;
    line-height: 1.8; color: var(--white);
    scrollbar-width: thin; scrollbar-color: var(--dark-gray) transparent;
}
.reader-content::-webkit-scrollbar { width: 6px; }
.reader-content::-webkit-scrollbar-track { background: transparent; }
.reader-content::-webkit-scrollbar-thumb { background: var(--dark-gray); border-radius: 3px; }

.reader-content p { margin-bottom: 1.2em; }
.reader-content p.dialogue {
    padding-left: 1.5em; color: var(--gold);
    border-left: 2px solid rgba(201,168,76,0.2);
}
.reader-content hr {
    border: none; border-top: 1px solid var(--dark-gray);
    margin: 2em auto; width: 40%;
}
.reader-content em { font-style: italic; }
.reader-content strong { color: var(--cyan); font-weight: 600; }

.reader-loading {
    text-align: center; color: var(--gray); font-style: italic;
    padding: 60px 0;
}

.reader-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 32px; border-top: 1px solid var(--dark-gray);
    background: rgba(0,212,255,0.03);
}
.reader-btn { font-size: 12px; padding: 8px 20px; }
.reader-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.reader-progress {
    font-family: var(--font-head); font-size: 13px;
    color: var(--gray); letter-spacing: 2px;
}

.reader-download {
    display: flex; gap: 16px; justify-content: center;
    margin-top: 32px; flex-wrap: wrap;
}
.reader-yt-note {
    text-align: center; color: var(--gray); font-size: 15px;
    margin-top: 16px; font-style: italic;
}

@media (max-width: 768px) {
    .reader-content { padding: 24px 20px; font-size: 17px; max-height: 60vh; }
    .reader-header { padding: 16px 20px; }
    .reader-nav { padding: 12px 20px; }
    .reader-select { min-width: 100%; }
}

/* SEASON FILTERS */
.season-filters {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center; margin-bottom: 40px;
}
.filter-btn {
    font-family: var(--font-head); font-size: 12px;
    padding: 8px 16px; border: 1px solid var(--gray);
    background: transparent; color: var(--gray);
    cursor: pointer; letter-spacing: 1px; transition: all 0.3s;
    border-radius: 2px;
}
.filter-btn:hover, .filter-btn.active { border-color: var(--cyan); color: var(--cyan); background: rgba(0,212,255,0.05); }

/* BOOKS GRID */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}
.book-card {
    position: relative; cursor: pointer; transition: transform 0.3s, box-shadow 0.3s;
    border-radius: 4px; overflow: hidden;
}
.book-card:hover { transform: translateY(-8px); box-shadow: 0 12px 40px rgba(0,212,255,0.15); }
.book-card img {
    width: 100%; aspect-ratio: 2/3; object-fit: cover;
    border-radius: 4px; display: block;
}
.book-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.95));
    padding: 40px 12px 12px; opacity: 0; transition: opacity 0.3s;
}
.book-card:hover .book-overlay { opacity: 1; }
.book-overlay h4 {
    font-family: var(--font-head); font-size: 13px;
    color: var(--white); letter-spacing: 1px; margin-bottom: 4px;
}
.book-overlay p { font-size: 12px; color: var(--gray); line-height: 1.4; }
.book-badge {
    position: absolute; top: 8px; right: 8px;
    background: var(--gold); color: var(--bg);
    font-family: var(--font-head); font-size: 10px;
    padding: 4px 8px; letter-spacing: 1px; font-weight: 700;
    border-radius: 2px;
}

/* MODAL */
.modal {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9); z-index: 2000;
    align-items: center; justify-content: center; padding: 24px;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--bg2); border: 1px solid var(--dark-gray);
    border-radius: 8px; max-width: 800px; width: 100%;
    max-height: 90vh; overflow-y: auto; position: relative;
}
.modal-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; color: var(--white);
    font-size: 32px; cursor: pointer; z-index: 1;
}
.modal-body { display: flex; gap: 32px; padding: 32px; }
.modal-cover { width: 250px; border-radius: 4px; flex-shrink: 0; }
.modal-info { flex: 1; }
.modal-info h3 {
    font-family: var(--font-head); font-size: 28px;
    color: var(--cyan); margin-bottom: 16px; letter-spacing: 2px;
}
.modal-desc { color: var(--gray); margin-bottom: 24px; line-height: 1.7; font-size: 16px; }
.modal-links { display: flex; flex-wrap: wrap; gap: 12px; }

/* AUDIO GRID */
.audio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.audio-card {
    background: var(--dark-gray); border-radius: 8px; padding: 20px;
    display: flex; align-items: center; gap: 16px;
    border: 1px solid rgba(255,255,255,0.05); transition: border-color 0.3s;
}
.audio-card:hover { border-color: var(--cyan); }
.audio-thumb { width: 60px; height: 60px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.audio-info { flex: 1; }
.audio-info h4 { font-family: var(--font-head); font-size: 14px; margin-bottom: 4px; letter-spacing: 1px; }
.audio-info p { font-size: 13px; color: var(--gray); }
.audio-buttons { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.btn-yt { background: #c00; color: #fff; border: 2px solid #c00; }
.btn-yt:hover { background: transparent; color: #c00; }

/* BANDS */
.bands-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.band-card {
    background: var(--dark-gray); border-radius: 8px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05); transition: transform 0.3s;
}
.band-card:hover { transform: translateY(-4px); }
.band-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.band-info { padding: 20px; }
.band-info h3 { font-family: var(--font-head); font-size: 20px; color: var(--cyan); margin-bottom: 8px; }
.band-info p { font-size: 14px; color: var(--gray); margin-bottom: 16px; line-height: 1.5; }
.band-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* UNIVERSE */
.universe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 32px; margin-bottom: 60px; }
.universe-card {
    background: var(--dark-gray); border-radius: 8px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}
.universe-card img { width: 100%; }
.universe-card h3 { font-family: var(--font-head); padding: 20px 20px 8px; color: var(--gold); }
.universe-card p { padding: 0 20px 20px; color: var(--gray); font-size: 15px; }

/* TIMELINE */
.universe-timeline h3 {
    font-family: var(--font-head); text-align: center; color: var(--white);
    font-size: 24px; margin-bottom: 32px; letter-spacing: 2px;
}
.timeline {
    display: flex; justify-content: space-between; align-items: flex-start;
    position: relative; padding: 0 20px; flex-wrap: wrap; gap: 16px;
}
.timeline::before {
    content: ''; position: absolute; top: 12px; left: 0; right: 0;
    height: 2px; background: linear-gradient(to right, var(--cyan), var(--gold), var(--red));
}
.timeline-item {
    text-align: center; position: relative; z-index: 1;
    flex: 1; min-width: 120px;
}
.timeline-item::before {
    content: ''; display: block; width: 12px; height: 12px;
    background: var(--cyan); border-radius: 50%;
    margin: 6px auto 12px; box-shadow: 0 0 12px var(--cyan);
}
.year {
    display: block; font-family: var(--font-head); font-size: 12px;
    color: var(--cyan); letter-spacing: 2px; margin-bottom: 4px;
}
.event { font-size: 13px; color: var(--gray); }

/* STORE */
.store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.store-card {
    background: var(--dark-gray); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px; padding: 40px 24px; text-align: center;
    text-decoration: none; color: var(--white); transition: all 0.3s;
}
.store-card:hover { border-color: var(--cyan); transform: translateY(-4px); }
.store-icon { font-size: 48px; margin-bottom: 16px; }
.store-card h3 { font-family: var(--font-head); font-size: 20px; margin-bottom: 12px; color: var(--cyan); }
.store-card p { font-size: 14px; color: var(--gray); line-height: 1.5; }

/* BLOG / SOCIAL FEEDS */
.social-feeds { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.feed-card {
    background: var(--dark-gray); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px; padding: 32px 24px; text-align: center;
    transition: all 0.3s;
}
.feed-card:hover { border-color: var(--cyan); transform: translateY(-4px); }
.feed-card h3 { font-family: var(--font-head); font-size: 20px; color: var(--cyan); margin-bottom: 12px; }
.feed-card p { font-size: 14px; color: var(--gray); margin-bottom: 20px; line-height: 1.5; }

/* GUESTBOOK */
#guestbook { background: var(--bg2); }
.giscus { max-width: 800px; margin: 0 auto; }
.guestbook-alt {
    text-align: center; color: var(--gray); font-size: 14px;
    margin-top: 24px; max-width: 800px; margin-left: auto; margin-right: auto;
}

/* AUTHOR */
#author { background: var(--bg); }
.author-content { max-width: 700px; margin: 0 auto; }
.author-text h3 {
    font-family: var(--font-head); font-size: 28px;
    color: var(--white); margin-bottom: 4px; letter-spacing: 2px;
}
.author-location {
    font-family: var(--font-head); font-size: 14px;
    color: var(--cyan); letter-spacing: 2px; margin-bottom: 24px;
}
.author-text p {
    color: var(--gray); margin-bottom: 16px; line-height: 1.8;
    font-size: 17px;
}
.author-dedication {
    color: var(--gold) !important; font-style: italic;
    border-left: 3px solid var(--gold); padding-left: 20px;
    margin: 32px 0 !important;
}
.author-social {
    display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px;
}
.social-link {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px; border: 1px solid var(--dark-gray);
    border-radius: 4px; color: var(--gray); text-decoration: none;
    font-family: var(--font-head); font-size: 14px;
    transition: all 0.3s; letter-spacing: 1px;
}
.social-link:hover { border-color: var(--cyan); color: var(--cyan); }
.social-icon { font-size: 18px; }

/* FOOTER */
footer {
    background: var(--bg); border-top: 1px solid var(--dark-gray);
    padding: 60px 0 40px;
}
.footer-content { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-brand { flex: 2; min-width: 200px; }
.footer-brand h3 {
    font-family: var(--font-head); font-size: 20px;
    color: var(--cyan); letter-spacing: 4px; margin-bottom: 8px;
}
.footer-brand p { color: var(--gray); font-size: 14px; }
.footer-copy { margin-top: 16px; font-size: 12px; color: #555; }
.footer-links { flex: 1; min-width: 150px; }
.footer-links h4 {
    font-family: var(--font-head); font-size: 14px;
    color: var(--white); letter-spacing: 2px; margin-bottom: 16px;
}
.footer-links a {
    display: block; color: var(--gray); text-decoration: none;
    font-size: 14px; margin-bottom: 8px; transition: color 0.3s;
}
.footer-links a:hover { color: var(--cyan); }

/* BUY ME A COFFEE FLOATING BUTTON */
.bmac-float {
    position: fixed; bottom: 24px; right: 24px; z-index: 999;
    background: var(--gold); color: var(--bg);
    font-family: var(--font-head); font-size: 14px; font-weight: 700;
    padding: 14px 24px; border-radius: 50px;
    text-decoration: none; letter-spacing: 1px;
    box-shadow: 0 4px 20px rgba(201,168,76,0.4);
    transition: all 0.3s; animation: bmacPulse 3s infinite;
}
.bmac-float:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(201,168,76,0.6);
}
@keyframes bmacPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(201,168,76,0.4); }
    50% { box-shadow: 0 4px 30px rgba(201,168,76,0.7); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex; flex-direction: column;
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--bg); padding: 16px 32px; gap: 16px;
        border-bottom: 1px solid var(--dark-gray);
    }
    .nav-toggle { display: block; }
    .hero-stats { gap: 20px; }
    .stat-num { font-size: 28px; }
    .books-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; }
    .modal-body { flex-direction: column; }
    .modal-cover { width: 100%; max-width: 300px; }
    .universe-grid { grid-template-columns: 1fr; }
    .timeline { flex-direction: column; }
    .timeline::before { display: none; }
    .footer-content { flex-direction: column; gap: 32px; }
}

/* ANIMATIONS */
.fade-in { opacity: 0; transform: translateY(30px); transition: all 0.6s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
