/* thethird.quest - Pastoral Romantic Futurism */

/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
    --deep-base: #1a1a2e;
    --primary-blue: #4a90d9;
    --warm-offwhite: #f5f0e8;
    --accent-gold: #e8b84b;
    --muted-gray: #6c757d;
    --deep-base-light: #252542;
    --deep-base-dark: #12121f;
    --neon-glow-blue: rgba(74, 144, 217, 0.4);
    --neon-glow-gold: rgba(232, 184, 75, 0.4);
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

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

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

body {
    font-family: var(--font-body);
    background-color: var(--deep-base);
    color: var(--warm-offwhite);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   Grain Overlay
   ======================================== */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ========================================
   Header
   ======================================== */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(74, 144, 217, 0.15);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-glyph {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--accent-gold);
    letter-spacing: 0.05em;
}

.logo-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1rem;
    color: var(--warm-offwhite);
    letter-spacing: 0.1em;
}

.header-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--muted-gray);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--warm-offwhite);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-gold);
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-text {
    font-size: 0.75rem;
    color: var(--muted-gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--neon-glow-gold); }
    50% { opacity: 0.6; box-shadow: 0 0 12px 4px var(--neon-glow-gold); }
}

/* ========================================
   Hero Section
   ======================================== */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 72px 2rem 2rem;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at 30% 50%, rgba(74, 144, 217, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 60%, rgba(232, 184, 75, 0.06) 0%, transparent 50%),
                var(--deep-base);
}

.hero-content {
    max-width: 600px;
    z-index: 2;
    text-align: left;
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border: 1px solid rgba(232, 184, 75, 0.3);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 2rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(3rem, 7vw, 5.5rem);
    line-height: 1.05;
    color: var(--warm-offwhite);
    margin-bottom: 1.5rem;
}

.hero-title-accent {
    color: var(--accent-gold);
    font-style: italic;
    display: inline-block;
    text-shadow: 0 0 40px var(--neon-glow-gold);
}

.hero-subtitle {
    font-size: 1.125rem;
    font-weight: 300;
    color: var(--muted-gray);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--deep-base);
    box-shadow: 0 0 20px var(--neon-glow-gold);
}

.btn-primary:hover {
    background: #d4a63e;
    box-shadow: 0 0 40px var(--neon-glow-gold);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--primary-blue);
    border: 1px solid rgba(74, 144, 217, 0.4);
}

.btn-ghost:hover {
    border-color: var(--primary-blue);
    background: rgba(74, 144, 217, 0.1);
    box-shadow: 0 0 20px var(--neon-glow-blue);
    transform: translateY(-2px);
}

/* Hero Visual - Orb */
.hero-visual {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    height: 400px;
}

.hero-orb {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orb-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    animation: orb-rotate 20s linear infinite;
}

.orb-ring-1 {
    width: 300px;
    height: 300px;
    border-color: rgba(74, 144, 217, 0.3);
    animation-duration: 20s;
}

.orb-ring-2 {
    width: 220px;
    height: 220px;
    border-color: rgba(232, 184, 75, 0.25);
    animation-duration: 15s;
    animation-direction: reverse;
}

.orb-ring-3 {
    width: 140px;
    height: 140px;
    border-color: rgba(74, 144, 217, 0.2);
    animation-duration: 10s;
}

.orb-core {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-gold) 0%, rgba(232, 184, 75, 0) 70%);
    animation: orb-pulse 4s ease-in-out infinite;
}

@keyframes orb-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes orb-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
}

.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--primary-blue);
    opacity: 0;
    animation: float-particle 6s ease-in-out infinite;
}

@keyframes float-particle {
    0% { opacity: 0; transform: translateY(0) scale(0); }
    20% { opacity: 0.8; }
    80% { opacity: 0.3; }
    100% { opacity: 0; transform: translateY(-120px) scale(1); }
}

/* ========================================
   Section Common
   ======================================== */
section {
    padding: 6rem 2rem;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--warm-offwhite);
    margin-bottom: 0.75rem;
}

.section-desc {
    font-size: 1rem;
    color: var(--muted-gray);
    font-weight: 300;
}

/* ========================================
   Dashboard Section
   ======================================== */
#dashboard {
    background: linear-gradient(180deg, var(--deep-base) 0%, var(--deep-base-light) 50%, var(--deep-base) 100%);
}

.dashboard-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.quest-panel {
    background: rgba(37, 37, 66, 0.6);
    border: 1px solid rgba(74, 144, 217, 0.12);
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.quest-panel:hover {
    border-color: rgba(74, 144, 217, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 20px var(--neon-glow-blue);
}

.quest-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.quest-panel:hover::before {
    opacity: 1;
}

.panel-primary .panel-icon { color: var(--primary-blue); }
.panel-secondary .panel-icon { color: var(--accent-gold); }
.panel-accent .panel-icon { color: var(--accent-gold); }

.panel-icon {
    margin-bottom: 1.25rem;
}

.panel-svg {
    width: 48px;
    height: 48px;
}

.panel-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.375rem;
    color: var(--warm-offwhite);
    margin-bottom: 1rem;
}

.panel-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(108, 117, 125, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
    width: 0;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--neon-glow-blue);
}

.progress-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-gold);
    min-width: 40px;
    text-align: right;
}

.panel-desc {
    font-size: 0.875rem;
    color: var(--muted-gray);
    line-height: 1.6;
}

.panel-morph {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(74, 144, 217, 0.1);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.quest-panel:hover .panel-morph {
    border-radius: 4px;
    background: rgba(232, 184, 75, 0.15);
    transform: rotate(45deg) scale(1.2);
}

.panel-wide {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.panel-wide .panel-icon {
    margin-bottom: 0;
    flex-shrink: 0;
}

.panel-wide-content {
    flex: 1;
}

.panel-wide .panel-progress {
    flex-shrink: 0;
    width: 200px;
    margin-bottom: 0;
}

.panel-stats {
    grid-column: 1 / -1;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 2.5rem;
    color: var(--accent-gold);
    text-shadow: 0 0 20px var(--neon-glow-gold);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ========================================
   Chapters Section
   ======================================== */
#chapters {
    background: var(--deep-base);
}

.chapters-timeline {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    padding-left: 60px;
}

.timeline-line {
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-blue), var(--accent-gold), var(--muted-gray));
}

.chapter-card {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.6s ease;
}

.chapter-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.chapter-marker {
    position: absolute;
    left: -60px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--muted-gray);
    background: var(--deep-base);
    flex-shrink: 0;
    transition: all 0.4s ease;
    z-index: 1;
}

.marker-number {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--muted-gray);
    transition: color 0.4s ease;
}

.chapter-card.completed .chapter-marker {
    border-color: var(--primary-blue);
    box-shadow: 0 0 15px var(--neon-glow-blue);
}

.chapter-card.completed .marker-number {
    color: var(--primary-blue);
}

.chapter-card.active .chapter-marker {
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px var(--neon-glow-gold);
    animation: marker-pulse 3s ease-in-out infinite;
}

.chapter-card.active .marker-number {
    color: var(--accent-gold);
}

.chapter-card.locked .chapter-marker {
    border-color: rgba(108, 117, 125, 0.3);
}

.chapter-card.locked .marker-number {
    color: rgba(108, 117, 125, 0.4);
}

@keyframes marker-pulse {
    0%, 100% { box-shadow: 0 0 15px var(--neon-glow-gold); }
    50% { box-shadow: 0 0 30px var(--neon-glow-gold); }
}

.chapter-body {
    background: rgba(37, 37, 66, 0.4);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: 12px;
    padding: 1.75rem;
    flex: 1;
    transition: all 0.4s ease;
}

.chapter-card.active .chapter-body {
    border-color: rgba(232, 184, 75, 0.2);
    background: rgba(37, 37, 66, 0.6);
}

.chapter-card.locked .chapter-body {
    opacity: 0.5;
}

.chapter-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--warm-offwhite);
    margin-bottom: 0.75rem;
}

.chapter-text {
    font-size: 0.9rem;
    color: var(--muted-gray);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.chapter-status {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    background: rgba(74, 144, 217, 0.1);
    color: var(--primary-blue);
}

.chapter-card.active .chapter-status {
    background: rgba(232, 184, 75, 0.15);
    color: var(--accent-gold);
}

.chapter-card.locked .chapter-status {
    background: rgba(108, 117, 125, 0.1);
    color: var(--muted-gray);
}

/* ========================================
   Archive Section
   ======================================== */
#archive {
    background: linear-gradient(180deg, var(--deep-base) 0%, var(--deep-base-light) 100%);
}

.archive-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.archive-card {
    background: rgba(37, 37, 66, 0.5);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.4s ease;
    cursor: pointer;
}

.archive-card:hover {
    border-color: rgba(232, 184, 75, 0.3);
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.archive-visual {
    margin-bottom: 1.25rem;
    position: relative;
}

.archive-svg {
    width: 100%;
    max-width: 160px;
    height: auto;
    transition: transform 0.6s ease;
}

.archive-card:hover .archive-svg {
    transform: rotate(10deg) scale(1.05);
}

.archive-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--warm-offwhite);
    margin-bottom: 0.5rem;
}

.archive-desc {
    font-size: 0.8rem;
    color: var(--muted-gray);
    line-height: 1.6;
}

/* ========================================
   About Section
   ======================================== */
#about {
    background: var(--deep-base);
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.about-text .section-title {
    text-align: left;
    margin-bottom: 2rem;
}

.about-paragraph {
    font-size: 1.05rem;
    color: var(--muted-gray);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.about-paragraph:first-of-type {
    color: var(--warm-offwhite);
    font-size: 1.15rem;
}

.about-visual {
    position: relative;
    height: 400px;
}

.geo-shape {
    position: absolute;
    border: 1px solid;
    transition: all 0.6s ease;
}

.geo-shape-1 {
    width: 200px;
    height: 200px;
    top: 20%;
    left: 20%;
    border-color: rgba(74, 144, 217, 0.3);
    border-radius: 50%;
    animation: geo-float-1 8s ease-in-out infinite;
}

.geo-shape-2 {
    width: 150px;
    height: 150px;
    top: 10%;
    right: 15%;
    border-color: rgba(232, 184, 75, 0.25);
    transform: rotate(45deg);
    animation: geo-float-2 10s ease-in-out infinite;
}

.geo-shape-3 {
    width: 100px;
    height: 100px;
    bottom: 15%;
    left: 35%;
    border-color: rgba(74, 144, 217, 0.2);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    animation: geo-float-3 12s ease-in-out infinite;
}

.geo-shape-4 {
    width: 120px;
    height: 120px;
    bottom: 25%;
    right: 25%;
    border-color: rgba(232, 184, 75, 0.2);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    animation: geo-float-4 9s ease-in-out infinite;
}

@keyframes geo-float-1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(15px, -20px); }
}

@keyframes geo-float-2 {
    0%, 100% { transform: rotate(45deg) translate(0, 0); }
    50% { transform: rotate(45deg) translate(-10px, 15px); }
}

@keyframes geo-float-3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(20px, -10px) rotate(10deg); }
}

@keyframes geo-float-4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-15px, -15px) rotate(-8deg); }
}

/* ========================================
   Footer
   ======================================== */
#site-footer {
    background: var(--deep-base-dark);
    border-top: 1px solid rgba(74, 144, 217, 0.1);
    padding: 3rem 2rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--muted-gray);
    font-size: 0.9rem;
}

.footer-brand .logo-glyph {
    font-size: 1.2rem;
}

.footer-tagline {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1rem;
    color: rgba(245, 240, 232, 0.4);
    margin-bottom: 1.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: var(--muted-gray);
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-gold);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .hero-visual {
        display: none;
    }

    .hero-content {
        text-align: center;
        max-width: 100%;
    }

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

    .hero-actions {
        justify-content: center;
    }

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

    .panel-wide {
        grid-column: 1 / -1;
    }

    .panel-stats {
        grid-column: 1 / -1;
    }

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

    .about-container {
        grid-template-columns: 1fr;
    }

    .about-visual {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .header-nav {
        display: none;
    }

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

    .panel-wide {
        flex-direction: column;
    }

    .panel-wide .panel-progress {
        width: 100%;
    }

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

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

    .chapters-timeline {
        padding-left: 50px;
    }

    .chapter-marker {
        left: -50px;
        width: 40px;
        height: 40px;
    }

    .timeline-line {
        left: 19px;
    }
}

/* ========================================
   Animation utilities
   ======================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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