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

:root {
    --color-fire: #d35400;
    --color-ember: #e74c3c;
    --color-earth: #5d4e37;
    --color-wheat: #f4e4ba;
    --color-sky: #2c3e50;
    --color-smoke: #7f8c8d;
    --color-dark: #1a1a1a;
    --color-light: #fefefe;
}

body {
    font-family: 'Georgia', serif;
    line-height: 1.8;
    color: var(--color-dark);
    background: var(--color-light);
}

/* Navigation */
.site-nav {
    background: var(--color-dark);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-nav .nav-brand {
    color: var(--color-wheat);
    font-weight: bold;
    font-size: 1.1rem;
    text-decoration: none;
}

.site-nav .nav-brand:hover {
    color: var(--color-fire);
}

.site-nav .nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.site-nav .nav-links a {
    color: var(--color-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.site-nav .nav-links a:hover {
    color: var(--color-fire);
}

.site-nav .nav-links a.active {
    color: var(--color-fire);
    border-bottom: 2px solid var(--color-fire);
    padding-bottom: 2px;
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-earth) 50%, var(--color-fire) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-light);
    padding-top: 60px; /* Account for fixed nav */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="90" opacity="0.03">🔥</text></svg>');
    background-size: 100px;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 2rem;
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 20px rgba(0,0,0,0.5);
}

.subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-style: italic;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.byline {
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Intro Section */
.intro {
    text-align: center;
    margin-bottom: 4rem;
}

.date-badge {
    display: inline-block;
    background: var(--color-fire);
    color: white;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

.lead {
    font-size: 1.4rem;
    color: var(--color-earth);
    margin-bottom: 1rem;
}

/* Stats Section */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    margin-bottom: 4rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-fire);
}

.stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-smoke);
}

/* Quote Section */
.quote-section {
    background: var(--color-wheat);
    padding: 3rem;
    margin: 4rem -2rem;
    text-align: center;
}

.quote-section blockquote {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--color-earth);
    margin-bottom: 1rem;
}

.quote-section cite {
    font-size: 1rem;
    color: var(--color-smoke);
}

/* Excerpt Section */
.excerpt {
    margin: 4rem 0;
    text-align: center;
}

.excerpt h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--color-earth);
}

.excerpt-content {
    background: #f9f9f9;
    padding: 2rem;
    text-align: left;
    margin-bottom: 2rem;
    border-left: 4px solid var(--color-fire);
}

.excerpt-content p {
    margin-bottom: 1rem;
}

.excerpt-fade {
    opacity: 0.5;
}

.btn {
    display: inline-block;
    background: var(--color-fire);
    color: white;
    padding: 1rem 2.5rem;
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background 0.3s;
}

.btn:hover {
    background: var(--color-ember);
}

.access-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--color-smoke);
    font-style: italic;
}

/* About Section */
.about {
    margin: 4rem 0;
}

.about h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--color-earth);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.about-card {
    background: #f9f9f9;
    padding: 2rem;
}

.about-card h3 {
    color: var(--color-fire);
    margin-bottom: 1rem;
}

/* Philosophy Section */
.philosophy {
    text-align: center;
    padding: 3rem 0;
    border-top: 1px solid #ddd;
    margin-top: 4rem;
}

.philosophy h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--color-earth);
}

.philosophy-quotes p {
    font-size: 1.3rem;
    font-style: italic;
    color: var(--color-smoke);
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background: var(--color-dark);
    color: var(--color-light);
    padding: 4rem 2rem;
    text-align: center;
}

.footer-quote {
    max-width: 700px;
    margin: 0 auto 2rem;
    font-style: italic;
    opacity: 0.9;
    line-height: 1.8;
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.6;
}

/* Manuscript Page Styles */
.password-gate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-earth) 100%);
    padding: 2rem;
}

.password-box {
    background: white;
    padding: 3rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.password-box h1 {
    font-size: 1.5rem;
    color: var(--color-earth);
    margin-bottom: 0.5rem;
}

.password-box p {
    color: var(--color-smoke);
    margin-bottom: 2rem;
}

.password-box input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    margin-bottom: 1rem;
    text-align: center;
}

.password-box input:focus {
    outline: none;
    border-color: var(--color-fire);
}

.password-box button {
    width: 100%;
    padding: 1rem;
    background: var(--color-fire);
    color: white;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.password-box button:hover {
    background: var(--color-ember);
}

.error-message {
    color: var(--color-ember);
    margin-top: 1rem;
    display: none;
}

.back-link {
    margin-top: 2rem;
}

.back-link a {
    color: var(--color-smoke);
    font-size: 0.9rem;
}

/* Manuscript Content */
.manuscript {
    display: none;
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.manuscript.visible {
    display: block;
}

.manuscript-header {
    text-align: center;
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--color-fire);
}

.manuscript-header h1 {
    font-size: 2.5rem;
    color: var(--color-earth);
    margin-bottom: 0.5rem;
}

.manuscript-header .subtitle {
    font-size: 1.3rem;
    color: var(--color-smoke);
    font-style: italic;
}

.manuscript-header .byline {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--color-dark);
}

.manuscript-header .draft-date {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-smoke);
}

.status-box {
    background: var(--color-wheat);
    padding: 1.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.status-box p {
    margin: 0.5rem 0;
}

.part-header {
    background: var(--color-dark);
    color: white;
    padding: 2rem;
    margin: 3rem 0 2rem;
    text-align: center;
}

.part-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.part-header p {
    opacity: 0.8;
    font-style: italic;
}

.chapter {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #ddd;
}

.chapter h3 {
    color: var(--color-fire);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.chapter-meta {
    color: var(--color-smoke);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.chapter-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.status-drafted {
    background: #27ae60;
    color: white;
}

.status-outline {
    background: #f39c12;
    color: white;
}

.status-needed {
    background: #e74c3c;
    color: white;
}

.draft-content {
    background: #f9f9f9;
    padding: 2rem;
    border-left: 4px solid var(--color-fire);
    margin-top: 1rem;
}

.draft-content h4 {
    color: var(--color-earth);
    margin: 1.5rem 0 1rem;
}

.draft-content h4:first-child {
    margin-top: 0;
}

.draft-content p {
    margin-bottom: 1rem;
}

.scene-beats {
    background: #fff;
    padding: 1rem;
    margin-top: 1rem;
}

.scene-beats h4 {
    font-size: 1rem;
    color: var(--color-earth);
    margin-bottom: 0.5rem;
}

.scene-beats ul {
    margin-left: 1.5rem;
}

.scene-beats li {
    margin-bottom: 0.5rem;
}

.key-people-table,
.reference-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.key-people-table th,
.key-people-table td,
.reference-table th,
.reference-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.key-people-table th,
.reference-table th {
    background: var(--color-earth);
    color: white;
}

.key-lines {
    margin: 2rem 0;
}

.key-lines h4 {
    color: var(--color-fire);
    margin: 1.5rem 0 0.5rem;
}

.key-lines p {
    font-style: italic;
    padding-left: 1rem;
    border-left: 3px solid var(--color-wheat);
    margin-bottom: 0.5rem;
}

.needs-section {
    background: #fef5e7;
    padding: 2rem;
    margin: 2rem 0;
    border: 2px dashed var(--color-fire);
}

.needs-section h3 {
    color: var(--color-fire);
    margin-bottom: 1rem;
}

.needs-section ol {
    margin-left: 1.5rem;
}

.needs-section li {
    margin-bottom: 0.5rem;
}

.verified-facts {
    background: #e8f6e8;
    padding: 2rem;
    margin: 2rem 0;
}

.verified-facts h3 {
    color: #27ae60;
    margin-bottom: 1rem;
}

.verified-facts ul {
    list-style: none;
}

.verified-facts li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.verified-facts li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #27ae60;
}

.closing-quote {
    text-align: center;
    padding: 3rem;
    background: var(--color-wheat);
    margin-top: 3rem;
}

.closing-quote blockquote {
    font-size: 1.3rem;
    font-style: italic;
    color: var(--color-earth);
    margin-bottom: 1rem;
}

.closing-quote cite {
    color: var(--color-smoke);
}

.manuscript-nav {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    z-index: 100;
}

.admin-link {
    background: var(--color-flame);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 3px;
}

.admin-link:hover {
    background: var(--color-dark);
}

.logout-btn {
    background: var(--color-smoke);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.8rem;
    border-radius: 3px;
}

.logout-btn:hover {
    background: var(--color-dark);
}

/* Timeline Styles */
.timeline-section {
    margin: 4rem 0;
}

.timeline-section h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--color-earth);
}

.timeline-section .section-subtitle {
    text-align: center;
    color: var(--color-smoke);
    font-style: italic;
    margin-bottom: 2rem;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--color-fire), var(--color-ember));
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.35rem;
    top: 0.3rem;
    width: 12px;
    height: 12px;
    background: var(--color-fire);
    border-radius: 50%;
    border: 3px solid var(--color-light);
    box-shadow: 0 0 0 2px var(--color-fire);
}

.timeline-item.highlight::before {
    background: var(--color-ember);
    width: 16px;
    height: 16px;
    left: -2.45rem;
    top: 0.2rem;
}

.timeline-time {
    font-weight: bold;
    color: var(--color-fire);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timeline-title {
    font-weight: bold;
    color: var(--color-earth);
    margin: 0.25rem 0;
}

.timeline-desc {
    color: var(--color-smoke);
    font-size: 0.95rem;
    line-height: 1.5;
}

.timeline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.timeline-column h3 {
    color: var(--color-fire);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-wheat);
}

/* Broad timeline - horizontal style */
.timeline-broad {
    background: var(--color-wheat);
    padding: 3rem 2rem;
    margin: 4rem -2rem;
}

.timeline-broad h2 {
    color: var(--color-earth);
    margin-bottom: 0.5rem;
}

.timeline-broad .section-subtitle {
    margin-bottom: 2rem;
}

.timeline-phases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.timeline-phase {
    background: white;
    padding: 1.5rem;
    border-left: 4px solid var(--color-fire);
}

.timeline-phase h4 {
    color: var(--color-fire);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.timeline-phase h3 {
    color: var(--color-earth);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.timeline-phase ul {
    list-style: none;
    font-size: 0.9rem;
    color: var(--color-smoke);
}

.timeline-phase li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.timeline-phase li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-fire);
}

/* Responsive */
@media (max-width: 768px) {
    .site-nav {
        flex-direction: column-reverse;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .site-nav .nav-brand {
        font-size: 1rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        width: 100%;
        text-align: center;
    }

    .site-nav .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem 1rem;
        width: 100%;
    }

    .site-nav .nav-links a {
        font-size: 0.85rem;
    }

    .site-nav .nav-links li a[style*="background"] {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.8rem !important;
    }
}

@media (max-width: 600px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .container {
        padding: 2rem 1rem;
    }

    .quote-section {
        margin: 2rem -1rem;
        padding: 2rem 1rem;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .timeline-broad {
        margin: 2rem -1rem;
        padding: 2rem 1rem;
    }
}

/* Share Section Styles */
.share-section {
    background: var(--color-dark);
    color: var(--color-light);
    padding: 3rem 2rem;
    text-align: center;
}

.share-section h2 {
    color: var(--color-wheat);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.share-section .share-subtitle {
    color: var(--color-smoke);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.share-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

/* QR Code Section */
.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.qr-section h3 {
    color: var(--color-wheat);
    font-size: 1rem;
    font-weight: normal;
    margin: 0;
}

#qrcode {
    background: white;
    padding: 10px;
    border-radius: 8px;
    display: inline-block;
}

#qrcode img,
#qrcode canvas {
    display: block;
}

.download-qr-btn {
    background: transparent;
    border: 1px solid var(--color-smoke);
    color: var(--color-smoke);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.download-qr-btn:hover {
    border-color: var(--color-wheat);
    color: var(--color-wheat);
}

/* Share Buttons Section */
.share-buttons-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.share-buttons-section h3 {
    color: var(--color-wheat);
    font-size: 1rem;
    font-weight: normal;
    margin: 0;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-family: inherit;
}

.share-btn svg {
    flex-shrink: 0;
}

/* Copy Link Button */
.share-btn.copy-link {
    background: var(--color-fire);
    color: white;
}

.share-btn.copy-link:hover {
    background: var(--color-ember);
}

.share-btn.copy-link.copied {
    background: #27ae60;
}

/* Native Share Button */
.share-btn.native-share {
    background: var(--color-wheat);
    color: var(--color-earth);
    display: none;
}

.share-btn.native-share:hover {
    background: #e5d5a5;
}

/* Facebook Button */
.share-btn.facebook {
    background: #1877f2;
    color: white;
}

.share-btn.facebook:hover {
    background: #166fe5;
}

/* Twitter/X Button */
.share-btn.twitter {
    background: #000000;
    color: white;
}

.share-btn.twitter:hover {
    background: #333333;
}

/* Email Button */
.share-btn.email {
    background: var(--color-smoke);
    color: white;
}

.share-btn.email:hover {
    background: #6c7a7d;
}

/* WhatsApp Button */
.share-btn.whatsapp {
    background: #25d366;
    color: white;
}

.share-btn.whatsapp:hover {
    background: #20bd5a;
}

/* URL Display */
.share-url {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.share-url code {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--color-wheat);
    user-select: all;
}

/* Responsive Share Section */
@media (max-width: 600px) {
    .share-section {
        padding: 2rem 1rem;
    }

    .share-container {
        flex-direction: column;
        gap: 2rem;
    }

    .share-buttons {
        flex-direction: column;
        width: 100%;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }
}
