:root {
    --bg-color: #241f31;
    --text-color: #ffffff;
    --accent-color: #99c1f1;
    --btn-color: #99c1f1;
    --btn-text: #241f31;
    --font-serif: "DM Serif Display", serif;
    --font-sans: "DM Sans", sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 18px;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: 0.2s; }
a:hover { color: var(--accent-color); }

/* --- Global Container --- */
.container {
    max-width: 900px; /* Reduced width to keep the stack looking neat */
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Navigation --- */
header { padding: 40px 0; }

.nav-container {
    display: flex;
    flex-direction: column; /* Stack Logo and Nav */
    align-items: center;
    gap: 30px;
}

.logo {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    letter-spacing: 1px;
}

.main-nav { width: 100%; justify-content: center; }

.nav-list {
    display: flex;
    flex-wrap: wrap; /* Allows menu to wrap nicely on phones */
    justify-content: center;
    gap: 30px;
    list-style: none;
    font-weight: 500;
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%); /* Centers dropdown relative to parent */
    background: #1a1625;
    min-width: 240px;
    padding: 10px 0;
    list-style: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 100;
    text-align: center;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu li a { display: block; padding: 12px; font-size: 0.95rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.dropdown-menu .view-all { font-weight: 700; color: var(--accent-color); }

/* Hide Socials/Toggle for simplicity in this layout */
.nav-socials, .mobile-toggle { display: none; }


/* --- The "Universal Stack" Layout --- */
.grid-2-col {
    display: flex;
    flex-direction: column; /* Forces vertical stack everywhere */
    align-items: center;      /* Centers everything */
    text-align: center;       /* Centers text */
    gap: 50px;
    padding: 60px 0;
}

/* --- Hero Section --- */
.hero-text h1 {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1.1;
    margin-bottom: 30px;
}

.btn-primary {
    display: inline-block;
    background-color: var(--btn-color);
    color: var(--btn-text);
    padding: 14px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 6px;
    margin-bottom: 20px;
}

.hero-image {
    width: 100%;
    display: flex;
    justify-content: center;
}

.fan-art {
    width: 100%;
    max-width: 700px; /* Prevents it from getting too huge */
    height: auto;
}

/* --- Bio Section --- */
.bio-section { padding-bottom: 100px; }

.author-portrait {
    width: 280px;  /* Fixed reasonable size for the face */
    height: 280px;
    object-fit: cover;
    border-radius: 50%; /* Perfect circle */
    margin-bottom: 20px;
    border: 2px solid rgba(255,255,255,0.1);
}

.bio-text h2 {
    font-family: var(--font-serif);
    font-size: 3rem;
    margin-bottom: 20px;
}

.lead { font-size: 1.2rem; color: rgba(255,255,255,0.9); margin-bottom: 20px; }

.bio-text p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    max-width: 700px; /* Keeps text readable line length */
    margin: 0 auto 20px auto;
}

.bio-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 5px;
    margin-top: 30px;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 60px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}
.footer-content {
    flex-direction: column;
    gap: 20px;
}
.footer-links {
    justify-content: center;
}

/* FIX: Button Hover State */
.btn-primary:hover {
    color: var(--btn-text) !important; /* Forces text to stay Dark (#241f31) */
    background-color: white;           /* Optional: Lightens button to white for interaction */
    transform: translateY(-2px);       /* Restores the little "lift" animation */
    box-shadow: 0 5px 15px rgba(153, 193, 241, 0.4); /* Restores the glow */
}

/* --- Author Page Specifics --- */

.page-header-stack {
    text-align: center;
    margin-bottom: 50px;
    padding-top: 40px;
}

.page-header-stack h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 30px;
}

.author-portrait-large {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* The "Long Text" Reader
   Centers the block on the screen, but left-aligns the text 
   so your eyes don't get tired tracking lines. */
.long-text {
    max-width: 700px; /* Optimal reading width */
    margin: 0 auto;   /* Centers the block */
    text-align: left; /* Left-aligns the words */
    padding-bottom: 100px;
}

.long-text p {
    margin-bottom: 25px;
    font-size: 1.15rem;
    color: rgba(255,255,255,0.85);
}

.long-text .lead {
    font-size: 1.35rem;
    color: #ffffff;
    font-weight: 500;
    line-height: 1.5;
}

/* Subtle divider for the disambiguation note */
.divider {
    border: 0;
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 50px 0;
}

.disambiguation {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.5);
    font-style: italic;
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}

/* --- Influences Page --- */

.canon-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    padding-bottom: 100px;
}

.canon-category {
    text-align: center;
}

.canon-category h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;        /* Smaller (was 2rem) */
    color: #ffffff;           /* Pure white (was Blue/Accent) */
    margin-bottom: 15px;      /* Tighter spacing */
    font-weight: 400;         /* Lighter weight for a refined look */
    letter-spacing: 0.5px;
    opacity: 0.9;             /* Slight transparency to soften it */
}

.canon-category ul {
    list-style: none; /* Removes bullets */
    padding: 0;
    margin: 0;
}

.canon-category li {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #ffffff;
}

.canon-category .author {
    display: block; /* Forces author to new line on mobile, or keep inline */
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5); /* Dimmed color */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}


.update-stamp {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.3);
    font-style: italic;
    margin-top: 40px;
}
/* --- Works & Product Pages --- */

.book-preview-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 40px;
}

.book-cover-medium {
    width: 200px;
    height: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.book-cover-medium:hover {
    transform: scale(1.05);
}

.book-tagline {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    font-weight: 500;
}

/* Product Page Header */
.product-header-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 60px;
}

.book-cover-large {
    width: 280px; /* Big hero cover */
    height: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    margin-bottom: 30px;
}

.product-header-stack h1 {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 10px;
}

.book-subtitle {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 30px;
    font-family: var(--font-sans);
}

.buy-button-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Secondary Button (Wireframe style) */
.btn-secondary {
    display: inline-block;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 6px;
}

.btn-secondary:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

/* --- Raw Text Reader (The <pre> Tag Fix) --- */

pre.raw-reader {
    white-space: pre-wrap;       /* Crucial: Forces text to wrap at screen edge */
    word-wrap: break-word;       /* Prevents long words from breaking layout */
    font-family: var(--font-sans); /* Overrides the default 'code' font */
    font-size: 1.15rem;
    line-height: 1.8;            /* Extra breathing room for dense text */
    color: rgba(255,255,255,0.85);
    background: transparent;
    border: none;
    padding: 0;
    margin: 0 auto;
    max-width: 700px;            /* Keeps reading line length comfortable */
    text-align: left;
    display: block;
}

/* --- Contact Form Styling --- */
.form-stack {
    max-width: 600px;
    margin: 0 auto 80px auto;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--accent-color);
    letter-spacing: 0.5px;
}

/* Beautiful Dark Inputs */
.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    background-color: rgba(255,255,255,0.05); /* Very subtle transparent white */
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 15px;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: 0.2s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(255,255,255,0.1);
}

/* --- News Feed Styling --- */
.news-stack {
    max-width: 700px;
    margin: 0 auto 100px auto;
}

.news-item {
    background-color: rgba(255,255,255,0.03);
    padding: 40px;
    border-radius: 8px;
    margin-bottom: 40px;
    border-left: 3px solid var(--accent-color);
}

.news-meta {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 15px;
}

.news-item h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 15px;
    line-height: 1.2;
}

.news-item p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 20px;
}

.read-more {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 0.95rem;
}

/* --- Scroll to Top Button --- */

.scroll-top-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background-color: var(--accent-color);
    color: #241f31; /* Dark text on light button */
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 9999; /* Force it to the top layer */
    
    /* Animation State */
    opacity: 0;
    visibility: hidden; /* Prevents clicking when hidden */
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background-color: #ffffff;
    transform: scale(1.1);
}
    h1, 
    .hero-text h1, 
    .product-header-stack h1, 
    .page-header-stack h1,
    .bio-text h2 {
        /* !important forces this size over the desktop size */
        font-size: clamp(1.8rem, 8vw, 2.5rem) !important;
        line-height: 1.1;
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
        width: 100%;
    }

    /* 7. Safety Padding */
    .container { padding: 0 15px; }
}
