/* ============================================================
   Aloysius Q. Snodgrass, III — Storybook Styles
   Warm parchment tones, fairy-tale typography, magical feel
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --parchment:      #fdf6e3;
    --parchment-dark:  #f5ead0;
    --ink:            #3d2b1f;
    --ink-light:      #6b5344;
    --ink-faint:      #a08c7a;
    --gold:           #c8a951;
    --gold-glow:      #e8c84a;
    --fairy-pink:     #e8a0bf;
    --fairy-lavender: #b8a9d4;
    --fairy-green:    #7eb89a;
    --creek-blue:     #6ba3be;
    --warmth:         #d4926a;
    --shadow:         rgba(61, 43, 31, 0.08);
    --font-display:   'Courier Prime', monospace;
    --font-typewriter: 'Courier Prime', monospace;
    --font-body:      'Crimson Pro', Georgia, serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-typewriter);
    color: var(--ink);
    background: var(--parchment);
    line-height: 1.7;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

/* --- LANDING PAGE --- */
.landing {
    position: fixed;
    inset: 0;
    background: #fffdf7;
    z-index: 1000;
    overflow: hidden;
}

.landing canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.landing-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100vh;
    text-align: center;
    pointer-events: none;
    padding-bottom: 3rem;
}

.title-block {
    margin-bottom: 1rem;
}

.title-pre {
    font-family: var(--font-typewriter);
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 0.5rem;
}

.title-main {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    color: var(--ink);
    line-height: 1.2;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(61, 43, 31, 0.1);
}

.title-author {
    font-family: var(--font-typewriter);
    font-size: 0.95rem;
    color: var(--ink-light);
    letter-spacing: 0.05em;
}

.title-author em {
    font-style: italic;
    color: var(--ink-faint);
}

.enter-hint {
    margin-top: 1rem;
    animation: hintPulse 3s ease-in-out infinite;
}

.enter-hint span {
    font-family: var(--font-typewriter);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: lowercase;
    color: var(--ink-faint);
    opacity: 0.6;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Character name whisper — positioned dynamically by JS (left/right) */
.character-whisper {
    position: fixed;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--ink-faint);
    opacity: 0;
    transition: opacity 0.8s ease, left 0.6s ease;
    z-index: 11;
    pointer-events: none;
    white-space: nowrap;
}

.character-whisper.visible {
    opacity: 0.55;
}

/* Landing page cursor — indicate clickable */
.landing {
    cursor: pointer;
}

/* --- STORYBOOK (Inside) --- */
.storybook {
    min-height: 100vh;
}

/* Navigation */
.book-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 2rem;
    background: rgba(253, 246, 227, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(200, 169, 81, 0.2);
}

.nav-brand {
    cursor: pointer;
}

.nav-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--ink);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    font-family: var(--font-typewriter);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-light);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--gold);
}

/* Hero Section */
.book-hero {
    padding: 4rem 2rem;
    background: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-dark) 100%);
}

.hero-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 3rem;
}

.hero-portrait {
    width: 280px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(61, 43, 31, 0.15), 0 0 0 1px rgba(200, 169, 81, 0.2);
    flex-shrink: 0;
}

.hero-text {
    flex: 1;
}

.hero-quote {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--ink);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.hero-subtitle {
    font-family: var(--font-typewriter);
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--ink-light);
    max-width: 500px;
}

/* Section Titles */
.section-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    text-align: center;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-family: var(--font-typewriter);
    font-size: 0.85rem;
    text-align: center;
    color: var(--ink-faint);
    letter-spacing: 0.08em;
    margin-bottom: 2.5rem;
}

/* Chapter Grid */
.chapter-grid-section {
    padding: 4rem 2rem;
}

.chapter-grid {
    max-width: 1200px;
    margin: 2rem auto 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.chapter-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--ink);
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid rgba(200, 169, 81, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.chapter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(61, 43, 31, 0.12), 0 0 0 1px var(--gold);
}

.card-image-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--parchment-dark);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.chapter-card:hover .card-image {
    transform: scale(1.05);
}

.card-body {
    padding: 1.2rem 1.4rem;
}

.card-number {
    font-family: var(--font-typewriter);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--gold);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin: 0.3rem 0 0.5rem;
    color: var(--ink);
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--ink-light);
    line-height: 1.5;
}

/* Character Gallery */
.characters-section {
    padding: 4rem 2rem;
    background: var(--parchment-dark);
}

.character-gallery {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.character-card {
    text-align: center;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--shadow);
    transition: transform 0.25s ease;
}

.character-card:hover {
    transform: translateY(-4px);
}

.character-card img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    object-position: top;
    border-radius: 50%;
    border: 3px solid var(--gold);
    margin-bottom: 1rem;
}

.character-card h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--ink);
    margin-bottom: 0.3rem;
}

.character-real {
    font-family: var(--font-typewriter);
    font-size: 0.75rem;
    color: var(--ink-faint);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.character-desc {
    font-size: 0.9rem;
    color: var(--ink-light);
    line-height: 1.5;
}

/* About Section */
.about-section {
    padding: 4rem 2rem;
}

.about-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.about-photo {
    width: 360px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(61, 43, 31, 0.15);
    flex-shrink: 0;
}

.about-text h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.about-name {
    font-family: var(--font-typewriter);
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 0.2rem;
}

.about-aka {
    font-style: italic;
    color: var(--ink-faint);
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
}

.about-text p {
    margin-bottom: 1rem;
    color: var(--ink-light);
}

.about-dedication {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(200, 169, 81, 0.08);
    border-left: 3px solid var(--gold);
    border-radius: 0 6px 6px 0;
    color: var(--ink) !important;
}

/* Footer */
.book-footer {
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--ink);
    color: rgba(253, 246, 227, 0.5);
    font-family: var(--font-typewriter);
    font-size: 0.8rem;
}

.footer-tagline {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--gold);
    margin-top: 0.5rem;
}

/* --- Hub Page (index.html after screensaver) --- */
.hub-hero {
    padding: 3rem 2rem;
    background: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-dark) 100%);
}

.hub-hero-inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.hub-portrait {
    width: 220px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(61, 43, 31, 0.15);
    flex-shrink: 0;
}

.hub-hero-text {
    font-family: var(--font-typewriter);
}

.hub-hero-text h2 {
    font-family: var(--font-typewriter);
    font-size: 1.5rem;
    color: var(--ink);
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.hub-hero-text .hub-subtitle {
    font-size: 0.9rem;
    color: var(--gold);
    margin-bottom: 1rem;
    letter-spacing: 0.08em;
}

.hub-hero-text p {
    font-size: 0.95rem;
    color: var(--ink-light);
    line-height: 1.6;
}

.hub-sections {
    padding: 3rem 2rem;
}

.hub-grid {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}

.hub-card {
    padding: 1.8rem 1.5rem;
    background: #fff;
    border: 1px solid rgba(200, 169, 81, 0.15);
    border-radius: 8px;
    text-decoration: none;
    color: var(--ink);
    box-shadow: 0 2px 10px rgba(61, 43, 31, 0.06);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    font-family: var(--font-typewriter);
}

.hub-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(61, 43, 31, 0.1);
    border-color: var(--gold);
}

.hub-card-icon {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    line-height: 1;
}

.hub-card h3 {
    font-family: var(--font-typewriter);
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    color: var(--ink);
}

.hub-card p {
    font-size: 0.8rem;
    color: var(--ink-light);
    line-height: 1.5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-inner {
        flex-direction: column;
        text-align: center;
    }

    .hero-portrait {
        width: 200px;
    }

    .hero-description {
        max-width: 100%;
    }

    .about-inner {
        flex-direction: column;
    }

    .about-photo {
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
    }

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

    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .title-main {
        font-size: 2rem;
    }

    .book-nav {
        padding: 0.6rem 1rem;
    }
}
