/* ===========================
GLOBAL STYLESHEET
============================ */
/* Mobile First Design */
/* Resposive for tablets/ipads/computers lower in the page */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Lora:ital,wght@0,400;0,500;1,400&display=swap');

/* ===========================
GLOBAL STYLES
============================ */
:root {
    /* Light theme (default) */
    --bg: #f5efe0;
    --bg-alt: #ede5ce;

     /* ── Text ── */
    --text: #2b2017;
    --text-muted: #7a6a52;
    --text-soft: #5a4a38;

    /* ── Accent colors ── */
    --accent: #5c7a4e;
    --accent-hover: #486040;
    --primary-green: #123223;
    --logo-light-green: #7dbf8e;
    --secondary-green: #6e8b5b;
    --accent-gold: #d4b06a;
    --accent-rose: #b77a6b;

    /*-- Borders and Shadows --*/
    --border: rgba(43, 32, 23, 0.14);
    --border-gold: rgba(212, 176, 106, 0.45);
    --divider: rgba(43, 32, 23, 0.14);
    --shadow-sm: 0 10px 24px rgba(43, 32, 23, 0.08);
    --shadow-md: 0 18px 40px rgba(43, 32, 23, 0.12);
    --shadow-lg: 0 24px 60px rgba(43, 32, 23, 0.16);
    --glow-gold: 0 0 18px rgba(212, 176, 106, 0.45);
    
    /* Nav */
    --nav-bg: rgba(245, 239, 224, 0.96);

    /* Error color for forms */
    --error: #a83232;

    /* ── Typography ── */
    --font-heading: 'Cinzel', serif;
    --font-body: 'Lora', serif;
    --font-subheading: 'Lora', serif;

    /* ── Scale ── */
    --text-xs: 0.75rem;
    --text-sm: 0.95rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.5rem;
    --text-2xl: 2.25rem;
    --leading-relaxed: 1.75;

    /* ── Spacing ── */
    --space-xs: 0.4rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;

    /* ── Radius ── */
    --radius-sm: 4px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 30px;

    /* ── Motion ── */
    --transition-fast: 160ms ease;
    --transition-normal: 240ms ease;

    /* ── Parchment texture opacity ── */
    --parchment-body-opacity: 0.17;
    }

    /* Dark theme overrides */
    [data-theme="dark"] {
    --bg: #1b1812;
    --bg-alt: #232019;
    --text: #e6dcc8;
    --text-primary: #ebe1d2;
    --text-muted: #9b8c74;
    --text-soft: #d8cfbf;
    --accent: #8aaa76;
    --accent-hover: #a2c28e;
    --primary-green: #8aaa76;
    --border: rgba(230, 220, 200, 0.11);
    --border-gold: rgba(212, 176, 106, 0.3);
    --divider: rgba(212, 176, 106, 0.18);
    --nav-bg: rgba(27, 24, 18, 0.96);
    --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.34);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.4);
    --error: #d16060;

    --parchment-body-opacity: 0.08;
}

/* -- -----------------------------
Global Resets and Base Styles 
-------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.75;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("../assets/parchment-texture.jpg");
    background-size: cover;
    opacity: var(--parchment-body-opacity);
    pointer-events: none;
    z-index: -1;
}

body.has-custom-cursor {
    cursor: none;
}

body.has-custom-cursor,
body.has-custom-cursor * {
    cursor: none !important;
}

main {
    flex: 1;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

p {
    font-family: var(--font-body);
    line-height: var(--leading-relaxed);
    color: var(--text-primary);
    margin: 0 0 1rem;
    max-width: 70ch;
}

body.characters .page-header,
body.preview .page-header {
    background:
        linear-gradient(rgba(10, 10, 10, 0.52), rgba(10, 10, 10, 0.68)),
        url('../assets/forest-bg.jpg') center 35%/cover no-repeat;
}


/* -- -----------------------------
Headings and Typography 
-------------------------------- */
.page-header {
    background:
        linear-gradient(rgba(10, 10, 10, 0.42), rgba(10, 10, 10, 0.7)),
        url("../assets/forest-bg.jpg") center 36%/cover no-repeat;
}

/* Large display titles */
.title-display {
    font-size: clamp(1.9rem, 5vw, 3rem); /* clamp(min, preferred, max) Responsive font size that scales between 1.9rem and 3rem based on viewport width */
    letter-spacing: 0.01em;
}

/* Section headings */
.title-heading {
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    font-weight: 600;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin: 0 0 var(--space-sm);
    line-height: 1.15;
}

/* Base h2 style used across all sections */
h2 {
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    color: var(--primary-green);
}

/* h3 used in cards and sub-sections */
h3 {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--primary-green);
}

[data-theme="dark"] h2,
[data-theme="dark"] h3 {
    color: var(--logo-light-green);
}

.section-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Crown divider: three stars used between sections */
.crown-divider {
    margin: 0 auto var(--space-xl);
    text-align: center;
    color: var(--accent-gold);
    letter-spacing: 0.6rem;
    font-size: 1rem;
    text-shadow: 0 0 18px rgba(212, 176, 106, 0.6);
    display: block;
}

.section-title {
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-intro {
    text-align: center;
    color: var(--text-muted);
    max-width: 40rem;
    margin: 0 auto 2rem;
}

.section-intro,
.page-header p,
.section-sub,
.newsletter-sub,
.footer-tagline,
.hero-email-form label {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.text-center { text-align: center; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--accent); }
.text-moss { color: var(--secondary-green); }
.text-gold { color: var(--accent-gold); }
.text-nature { color: var(--logo-light-green); }
.text-dusk { color: #8c5a91; }
.text-purple { color: #9b8bc4; }
.text-teal { color: #4a9e8a; }
.text-red { color: #b05555; }
.mb-xl { margin-bottom: var(--space-xl); }
.mt-lg { margin-top: var(--space-lg); }

/* -- -----------------------------
Layout
-------------------------------- */
.container {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* -- -----------------------------
Navigation - mobile hamburger design first, inline on desktop
-------------------------------- */

/* --  Nav -- */
#navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-green);
    flex-shrink: 0;
}

.nav-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 1.35rem;
    color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(212, 176, 106, 0.25);
}

[data-theme="dark"] .nav-logo {
    color: var(--logo-light-green);
}

/* Nav links — hidden on mobile by default.
    On mobile: drops down when .open is added by JS.*/
.nav-links {
    display: none;
}

.nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-gold);
    padding: 8px 20px 16px;
    z-index: 99;
}

.nav-links.open a {
    display: block;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.nav-links a {
    font-family: var(--font-subheading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
}

/* hover/active indicator*/
.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-green);
}

[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active {
    color: var(--logo-light-green);
}

/* Right-side nav controls */
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Theme toggle */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-gold);
    background: transparent;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.theme-toggle:hover {
    background: rgba(212, 176, 106, 0.12);
    transform: translateY(-1px);
}

/* Hamburger button — three stacked lines */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}


/* -- -----------------------------
Page Header
--------------------------------*/
.page-header {
    text-align: center;
    padding: 64px 20px 52px;
    border-bottom: 1px solid var(--border);
}

.page-header p {
    max-width: 480px;
    font-size: 15px;
    font-style: italic;
    color: var(--text-muted);
    margin: 16px auto 0;
}

body.preview .page-header,
body.world .page-header,
body.characters .page-header {
    background:
        linear-gradient(rgba(10, 10, 10, 0.52), rgba(10, 10, 10, 0.68)),
        url('../assets/forest-bg.jpg') center 35%/cover no-repeat;
}

body.preview .page-header h1,
body.world .page-header h1,
body.characters .page-header h1,
body.preview .page-header h3,
body.world .page-header h2,
body.characters .page-header h3 {
    color: var(--accent-gold);
    text-shadow: 0 0 12px rgba(212, 176, 106, 0.3);
}

body.preview .page-header p,
body.world .page-header p,
body.characters .page-header p {
    color: rgba(230, 220, 200, 0.85);
}

.page-shell {
    width: min(900px, calc(100% - 2rem));
    margin: 0 auto;
    padding: var(--space-2xl) 0;
}

.page-section,
.story.container {
    width: min(900px, calc(100% - 2rem));
    margin: 0 auto var(--space-xl);
    padding: var(--space-xl);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(212, 176, 106, 0.08));
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .page-section,
[data-theme="dark"] .story.container {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(212, 176, 106, 0.07));
}

.page-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-soft);
}

.page-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-gold);
    box-shadow: var(--glow-gold);
}

/* ===========================
COMPONENTS
============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-subheading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    border: 1px solid var(--border-gold);
    border-radius: 999px;
    background: rgba(212, 176, 106, 0.14);
    color: var(--text);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-primary,
.btn-light {
    background: linear-gradient(135deg, #d4b06a, #b68c47);
    border-color: #d4b06a;
    color: #1d160f;
}

.btn-primary:hover,
.btn-light:hover {
    background: linear-gradient(135deg, #e0be78, #c09850);
    border-color: #e0be78;
    color: #1d160f;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
    color: #f0e6d4;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

body.home .btn,
body.home .btn-light,
body.home .btn-outline {
    background: linear-gradient(135deg, #d4b06a, #b68c47);
    border-color: #d4b06a;
    color: #1d160f;
}

body.home .btn:hover,
body.home .btn-light:hover,
body.home .btn-outline:hover {
    background: linear-gradient(135deg, #e0be78, #c09850);
    border-color: #e0be78;
    color: #1d160f;
}



/* ===========================
CARDS
=========================== */
.card {
    position: relative;
    padding: var(--space-lg);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(212, 176, 106, 0.08));
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(212, 176, 106, 0.07));
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    margin: var(--space-md) 0;
}

/* ===========================
Cursor
=========================== */
#cursor {
    pointer-events: none;
}

#cursor-dot,
#cursor-ring {
    position: fixed;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
}

#cursor-dot {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #17120d;
    text-shadow: 0 0 8px rgba(23, 18, 13, 0.18);
}

#cursor-ring {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(200, 169, 110, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition:
        width 0.3s cubic-bezier(0.19, 1, 0.22, 1),
        height 0.3s cubic-bezier(0.19, 1, 0.22, 1),
        border-color 0.3s,
        opacity 0.2s;
}

body.cursor-hover #cursor-ring {
    width: 45px;
    height: 45px;
    border-color: #b77a6b;
    box-shadow:
        0 0 14px rgba(183, 122, 107, 0.4),
        0 0 26px rgba(183, 122, 107, 0.22);
}

body.cursor-hover #cursor-dot {
    transform: translate(-50%, -50%) scale(1.08);
    color: #b77a6b;
    text-shadow:
        0 0 12px rgba(183, 122, 107, 0.65),
        0 0 22px rgba(183, 122, 107, 0.32);
}

body.cursor-active #cursor-ring {
    width: 54px;
    height: 54px;
    border-color: rgba(212, 176, 106, 0.95);
    box-shadow:
        0 0 18px rgba(212, 176, 106, 0.45),
        0 0 34px rgba(212, 176, 106, 0.25);
}

body.cursor-active #cursor-dot {
    transform: translate(-50%, -50%) scale(1.32);
    text-shadow:
        0 0 16px rgba(212, 176, 106, 0.75),
        0 0 26px rgba(212, 176, 106, 0.4);
}

#cursor-dot::before {
    content: "☽";
    line-height: 1;
}

[data-theme="dark"] #cursor-dot::before {
    content: "☀";
}

[data-theme="dark"] #cursor-dot {
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(212, 176, 106, 0.45);
}


/* ===========================
Back To Top Button
============================ */
#backToTop {
    position: fixed;
    bottom: 28px;
    right: 22px;
    width: 42px;
    height: 42px;
    border: none;
    background: linear-gradient(135deg, #d4b06a, #b68c47);
    color: #1d160f;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background 0.2s ease;
    z-index: 90;
}

#backToTop.visible {
    opacity: 0.5;
    pointer-events: auto;
}

/* =====================
FADE-IN 
   ===================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================
FOOTER 
============================= */
.site-footer {
    margin-top: auto;
    padding: 56px 30px 36px;
    border-top: 1px solid var(--border-gold);
    background: var(--bg-alt);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--primary-green);
}

[data-theme="dark"] .footer-logo {
    color: var(--logo-light-green);
}

.footer-tagline {
    font-style: italic;
    font-size: 13px;
    color: var(--text-muted);
    max-width: 380px;
    line-height: 1.65;
}

/*Footer nav links*/
.footer-nav {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.footer-nav a {
    font-family: var(--font-subheading);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.footer-nav a:hover,
.footer-email a:hover,
.footer-legal a:hover,
.social-link:hover {
    color: var(--accent-gold);
}

/* Thin divider between nav and socials */
.footer-nav::after {
    content: "";
    display: block;
    width: 40px;
    height: 1px;
    background: var(--border-gold);
    margin: 8px auto 0;
}

/* ── Social media icons ── */
.footer-socials {
    display: flex;
    justify-content: center;
    gap: 28px;
}

/* Each social link: icon above label */
.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

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

.social-link svg {
    width: 22px;
    height: 22px;
}

/* Label text below the icon */
.social-link span {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: var(--font-subheading);
}

.footer-email,
.footer-legal {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-email a,
.footer-legal a {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
}

/* ============================
RESPONSIVE DESIGN 
============================= */
/* Styles for tablets and larger screens */
@media (min-width: 768px) {

    /* Nav links become inline, hamburger hidden */
    .nav-links {
        display: flex;
        flex-direction: row;
        position: static;
        width: auto;
        background: none;
        border: none;
        padding: 0;
        gap: 30px;
        align-items: center;
    }

    .nav-links.open {
        flex-direction: row;
        position: static;
        width: auto;
        background: none;
        border: none;
        padding: 0;
    }

    .nav-links.open a {
        display: inline;
        padding: 0;
        border-bottom: 2px solid transparent;
    }

    .hamburger {
        display: none;
    }

    /* Footer nav: row */
    .footer-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (min-width: 1024px) {
    #navbar {
        padding: 16px 48px;
    }
}

