/* === continuum.quest styles === */
/* Colors: #18140E, #6A5A40, #C8B080, #2ADA8A, #2A5A4A, #B08070, #3A3028, #1ABA7A */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #18140E;
    color: #C8B080;
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.15vw, 1.1rem);
    line-height: 1.85;
    overflow-x: hidden;
    position: relative;
}

/* Paper Texture */
#paper-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.08;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='t'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23t)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* === Navigation === */
#nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    padding: 0 48px;
}

.nav-line {
    position: absolute;
    top: 24px;
    left: 0;
    width: 100%;
    height: 4px;
}

.nav-links {
    position: relative;
    display: flex;
    gap: 32px;
    margin-left: auto;
}

.nav-link {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 14px;
    color: #C8B080;
    text-decoration: none;
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

.nav-link:hover {
    text-shadow: 0 0 8px #2ADA8A;
    color: #2ADA8A;
}

/* === Hero / Homestead === */
#hero {
    width: 100%;
    min-height: 120vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 96px 48px;
}

.rustic-frame {
    position: relative;
    border: 8px solid #6A5A40;
    box-shadow: inset 2px 2px 8px rgba(26,20,14,0.5);
    padding: 64px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.rustic-frame.visible {
    opacity: 1;
}

.frame-corner {
    position: absolute;
    z-index: 5;
}

.corner-tl { top: -4px; left: -4px; }
.corner-tr { top: -4px; right: -4px; }
.corner-bl { bottom: -4px; left: -4px; }
.corner-br { bottom: -4px; right: -4px; }

.botanical-circuit {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin: 0 auto 32px;
}

.botanical-path {
    transition: stroke-dashoffset 3s ease;
}

.botanical-path.drawn {
    stroke-dashoffset: 0;
}

.neon-junction {
    transition: opacity 0.4s ease;
    filter: drop-shadow(0 0 6px #2ADA8A);
}

.neon-junction.lit {
    opacity: 1;
}

#hero-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.1em;
    color: #C8B080;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#hero-title.visible {
    opacity: 1;
}

.hero-sub {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 14px;
    color: #B08070;
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-sub.visible {
    opacity: 1;
}

/* === Circuit Traces === */
.circuit-trace {
    width: 100px;
    height: 80px;
    margin: 0 auto;
}

.circuit-trace svg {
    width: 100%;
    height: 100%;
}

.glow-dot {
    opacity: 0.8;
    filter: drop-shadow(0 0 6px #2ADA8A);
}

/* === Main Content === */
#content {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 32px 96px;
}

/* === Chapter Sections === */
.chapter {
    position: relative;
    min-height: 60vh;
    padding: 96px 0 96px 80px;
    display: flex;
    align-items: flex-start;
}

.chapter-number {
    position: absolute;
    left: 0;
    top: 80px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: 6rem;
    color: #2A5A4A;
    opacity: 0.15;
    line-height: 1;
}

.chapter-body {
    position: relative;
    width: 100%;
}

/* Skeleton Loader */
.skeleton-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.skeleton-loader.active {
    opacity: 1;
}

.skeleton-bar {
    height: 16px;
    border-radius: 4px;
    background: linear-gradient(90deg, #3A3028, #4A4038, #3A3028);
    background-size: 200% 100%;
    animation: shimmerSkeleton 1.5s linear infinite;
}

.skeleton-bar.wide { width: 60%; }
.skeleton-bar.medium { width: 45%; }
.skeleton-bar.full { width: 100%; }
.skeleton-bar.short { width: 30%; }

@keyframes shimmerSkeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Chapter Content */
.chapter-content {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chapter-content.visible {
    opacity: 1;
}

.chapter-content h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #C8B080;
    margin-bottom: 24px;
    line-height: 1.2;
}

.chapter-content p {
    margin-bottom: 16px;
    color: #C8B080;
}

.chapter-content p:last-child {
    margin-bottom: 0;
}

/* === Footer === */
#footer {
    border-top: 1px solid rgba(42, 90, 74, 0.3);
    padding: 32px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-tech {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: #2ADA8A;
}

.footer-brand {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: 16px;
    letter-spacing: 0.1em;
    color: #C8B080;
}

/* === Responsive === */
@media (max-width: 768px) {
    .chapter {
        padding: 64px 0 64px 48px;
    }

    .chapter-number {
        font-size: 4rem;
    }

    #hero {
        padding: 64px 24px;
    }

    .rustic-frame {
        padding: 32px;
    }

    #nav-bar {
        padding: 0 16px;
    }

    .nav-links {
        gap: 16px;
    }

    #footer {
        flex-direction: column;
        gap: 8px;
        padding: 24px;
    }
}
