/* rational.monster v2 - Sepia-nostalgic sci-fi monster guidebook */

:root {
    --c-dark: #2C241C;
    --c-dark-2: #3E342A;
    --c-gold: #C8A855;
    --c-sepia: #8B7355;
    --c-cream: #F5ECD8;
    --c-flare: #E8955A;
    --c-cosmic: #6B5B8B;
    --c-monster: #7BAF6B;

    --f-display: 'Fraunces', serif;
    --f-body: 'Nunito', sans-serif;
    --f-mono: 'Space Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--c-dark);
    color: var(--c-cream);
    font-family: var(--f-body);
    font-size: clamp(16px, 1.4vw, 18px);
    line-height: 1.7;
    overflow-x: hidden;
}

.section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    padding: 6vh 6vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-tag {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--c-gold);
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 22px;
    opacity: 0.85;
}

/* ============================================
   SECTION 1: OPENING
   ============================================ */

.section--opening {
    background: linear-gradient(160deg, #2C241C 0%, #3E342A 100%);
    flex-direction: column;
}

.parchment-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(200, 168, 85, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 168, 85, 0.04) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.star-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.star {
    position: absolute;
    background: var(--c-gold);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(200, 168, 85, 0.8);
    opacity: 0;
    animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.9; }
}

.constellation-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.constellation-line {
    stroke: var(--c-gold);
    stroke-width: 1;
    fill: none;
    opacity: 0;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1.5s ease, opacity 0.8s ease;
}

.constellation-line.is-drawn {
    opacity: 0.55;
    stroke-dashoffset: 0;
}

.star-dot {
    fill: var(--c-gold);
    opacity: 0;
    transition: opacity 0.6s ease;
    filter: drop-shadow(0 0 4px rgba(200, 168, 85, 0.6));
}

.star-dot.is-visible {
    opacity: 0.9;
}

.star-dot--bright {
    filter: drop-shadow(0 0 8px rgba(232, 149, 90, 0.9));
}

.star-dot--link {
    cursor: pointer;
    transition: opacity 0.3s ease, r 0.3s ease;
}

.star-dot--link:hover {
    opacity: 1;
    fill: var(--c-flare);
}

.lens-flare {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 1.2s ease, opacity 1.2s ease;
    opacity: 0;
}

.lens-flare.is-visible {
    transform: scale(1);
    opacity: 1;
}

.lens-flare--center {
    width: 480px;
    height: 480px;
    top: 50%;
    left: 50%;
    margin-top: -240px;
    margin-left: -240px;
    background: radial-gradient(circle,
        rgba(232, 149, 90, 0.28) 0%,
        rgba(200, 168, 85, 0.14) 30%,
        transparent 65%);
    z-index: 0;
}

.lens-flare--corner {
    width: 320px;
    height: 320px;
    top: -80px;
    right: -80px;
    background: radial-gradient(circle,
        rgba(200, 168, 85, 0.18) 0%,
        transparent 60%);
}

.lens-flare--right {
    width: 360px;
    height: 360px;
    top: 20%;
    right: -100px;
    background: radial-gradient(circle,
        rgba(232, 149, 90, 0.18) 0%,
        transparent 65%);
}

.lens-flare--left {
    width: 340px;
    height: 340px;
    bottom: 10%;
    left: -90px;
    background: radial-gradient(circle,
        rgba(200, 168, 85, 0.16) 0%,
        transparent 65%);
}

.lens-flare--bottom {
    width: 400px;
    height: 400px;
    bottom: -120px;
    left: 50%;
    margin-left: -200px;
    background: radial-gradient(circle,
        rgba(232, 149, 90, 0.16) 0%,
        transparent 60%);
}

.lens-flare--obs-tl {
    width: 280px;
    height: 280px;
    top: 0;
    left: 0;
    background: radial-gradient(circle,
        rgba(232, 149, 90, 0.22) 0%,
        transparent 65%);
}

.lens-flare--obs-br {
    width: 320px;
    height: 320px;
    bottom: -60px;
    right: -60px;
    background: radial-gradient(circle,
        rgba(200, 168, 85, 0.18) 0%,
        transparent 65%);
}

.coordinates {
    position: absolute;
    font-family: var(--f-mono);
    font-size: 11px;
    color: var(--c-sepia);
    letter-spacing: 0.1em;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.coordinates--top-left { top: 30px; left: 30px; }
.coordinates--top-right { top: 30px; right: 30px; text-align: right; }
.coordinates--bottom-left { bottom: 30px; left: 30px; }
.coordinates--bottom-right { bottom: 30px; right: 30px; text-align: right; }

.coord-label {
    color: var(--c-gold);
    opacity: 0.7;
    font-size: 9px;
    letter-spacing: 0.2em;
}

.coord-value {
    color: var(--c-cream);
    opacity: 0.65;
}

.opening-content {
    position: relative;
    z-index: 5;
    text-align: center;
    max-width: 900px;
}

.eyebrow {
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--c-sepia);
    text-transform: uppercase;
    margin-bottom: 32px;
    opacity: 0;
    animation: fadeIn 1s ease 0.6s forwards;
}

.eyebrow-mark {
    color: var(--c-gold);
    margin: 0 8px;
}

.wordmark {
    font-family: var(--f-display);
    font-size: clamp(40px, 7vw, 96px);
    font-weight: 200;
    line-height: 1;
    color: var(--c-cream);
    font-variation-settings: 'wght' 200, 'opsz' 144, 'SOFT' 50, 'WONK' 0;
    transition: font-variation-settings 0.8s ease, letter-spacing 0.8s ease;
    letter-spacing: 0.04em;
    margin-bottom: 28px;
    opacity: 0;
    animation: fadeIn 1s ease 1.2s forwards;
}

.wordmark.is-bold {
    font-variation-settings: 'wght' 700, 'opsz' 144, 'SOFT' 80, 'WONK' 1;
    letter-spacing: -0.005em;
}

.wordmark-piece {
    display: inline-block;
}

.wordmark-dot {
    color: var(--c-flare);
    display: inline-block;
    margin: 0 0.04em;
}

.opening-tagline {
    font-family: var(--f-display);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(16px, 1.6vw, 20px);
    color: var(--c-cream);
    opacity: 0;
    animation: fadeIn 1s ease 1.6s forwards;
    line-height: 1.6;
    max-width: 640px;
    margin: 0 auto 60px;
}

.opening-tagline {
    opacity: 0.85;
}

.scroll-hint {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--c-sepia);
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 1s ease 2s forwards, hintBounce 2.4s ease-in-out 3s infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.scroll-hint-arrow {
    font-size: 14px;
    color: var(--c-gold);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes hintBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ============================================
   GUIDE SECTIONS (Brain / Scale / Question)
   ============================================ */

.section--guide {
    background: linear-gradient(180deg, #2C241C 0%, #3A2F25 50%, #2C241C 100%);
    position: relative;
}

.section[data-section-index="01"] {
    background: linear-gradient(180deg, #2C241C 0%, #3D332A 50%, #322820 100%);
}

.section[data-section-index="02"] {
    background: linear-gradient(180deg, #322820 0%, #3E342A 50%, #2E261E 100%);
}

.section[data-section-index="03"] {
    background: linear-gradient(180deg, #2E261E 0%, #3A3026 50%, #2C241C 100%);
}

.guide-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(420px, 1.4fr);
    gap: 80px;
    align-items: center;
    max-width: 1180px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.guide-layout--reverse {
    grid-template-columns: minmax(420px, 1.4fr) minmax(280px, 1fr);
}

.guide-layout--reverse .guide-monster {
    order: 2;
}

.guide-layout--reverse .guide-content {
    order: 1;
}

.guide-monster {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    max-width: 380px;
    margin: 0 auto;
    width: 100%;
}

.monster-svg {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    animation: monsterFloat 5s ease-in-out infinite;
}

@keyframes monsterFloat {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

.monster-shape {
    fill: var(--c-monster);
    stroke: var(--c-sepia);
    stroke-width: 2;
    opacity: 0.95;
}

.monster-stroke {
    stroke: var(--c-gold);
    stroke-width: 2.5;
}

.monster-eye {
    fill: var(--c-cream);
    stroke: var(--c-dark);
    stroke-width: 1;
}

.monster-eye-large {
    fill: var(--c-cream);
    stroke: var(--c-gold);
    stroke-width: 2;
}

.monster-pupil {
    fill: var(--c-dark);
}

.monster-mouth {
    stroke: var(--c-dark);
    stroke-width: 2.5;
    stroke-linecap: round;
    fill: none;
}

.monster-antenna {
    stroke: var(--c-gold);
    stroke-width: 2;
    fill: none;
}

.monster-antenna-tip {
    fill: var(--c-flare);
    filter: drop-shadow(0 0 4px rgba(232, 149, 90, 0.8));
}

.monster-arm {
    stroke: var(--c-sepia);
    stroke-width: 2;
}

.monster-pan {
    fill: var(--c-gold);
    stroke: var(--c-sepia);
    stroke-width: 1.5;
    opacity: 0.85;
}

.monster-aura {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(123, 175, 107, 0.18) 0%,
        rgba(200, 168, 85, 0.08) 40%,
        transparent 70%);
    animation: auraPulse 4s ease-in-out infinite;
    z-index: 1;
}

@keyframes auraPulse {
    0%, 100% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.08); opacity: 1; }
}

.guide-content {
    position: relative;
    padding: 50px 50px 60px;
    min-height: 400px;
}

.frame-rect {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.frame-rect-stroke {
    fill: none;
    stroke: var(--c-sepia);
    stroke-width: 1.5;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease;
    opacity: 0.7;
}

.guide-content.is-visible .frame-rect-stroke {
    stroke-dashoffset: 0;
}

.guide-content > * {
    position: relative;
    z-index: 1;
}

.guide-headline {
    font-family: var(--f-display);
    font-size: clamp(36px, 4.5vw, 60px);
    font-weight: 300;
    line-height: 1.1;
    color: var(--c-cream);
    font-variation-settings: 'wght' 200, 'opsz' 144, 'SOFT' 60, 'WONK' 0;
    transition: font-variation-settings 0.8s ease;
    margin-bottom: 18px;
    letter-spacing: 0;
}

.guide-headline.is-bold {
    font-variation-settings: 'wght' 700, 'opsz' 144, 'SOFT' 80, 'WONK' 1;
}

.guide-meta {
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--c-gold);
    margin-bottom: 24px;
    opacity: 0.85;
}

.guide-meta span {
    color: var(--c-sepia);
    margin-right: 4px;
}

.guide-body {
    color: var(--c-cream);
    opacity: 0.88;
    margin-bottom: 26px;
    max-width: 540px;
}

.guide-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--c-cream);
    opacity: 0.92;
    font-size: 15px;
}

.bullet {
    color: var(--c-gold);
    font-size: 14px;
}

/* ============================================
   OBSERVATORY
   ============================================ */

.section--observatory {
    background: radial-gradient(ellipse at center, #1F1914 0%, #15110D 100%);
    position: relative;
}

.vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%,
        transparent 30%,
        rgba(15, 11, 8, 0.6) 70%,
        rgba(15, 11, 8, 1) 100%);
    pointer-events: none;
    z-index: 1;
}

.telescope-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid var(--c-sepia);
    pointer-events: none;
    opacity: 0.35;
    z-index: 1;
}

.telescope-ring--outer {
    width: 90vmin;
    height: 90vmin;
    margin-top: -45vmin;
    margin-left: -45vmin;
    border-color: var(--c-gold);
    opacity: 0.2;
}

.telescope-ring--inner {
    width: 70vmin;
    height: 70vmin;
    margin-top: -35vmin;
    margin-left: -35vmin;
    border-style: dashed;
    opacity: 0.25;
}

.observatory-content {
    position: relative;
    z-index: 3;
    max-width: 720px;
    width: 100%;
    text-align: center;
}

.obs-headline {
    font-family: var(--f-display);
    font-style: italic;
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 300;
    line-height: 1.25;
    color: var(--c-cream);
    font-variation-settings: 'wght' 200, 'opsz' 144;
    transition: font-variation-settings 0.8s ease;
    margin-bottom: 50px;
}

.obs-headline.is-bold {
    font-variation-settings: 'wght' 600, 'opsz' 144;
}

.obs-log {
    text-align: left;
    border-top: 1px solid rgba(139, 115, 85, 0.4);
    border-bottom: 1px solid rgba(139, 115, 85, 0.4);
    padding: 20px 0;
}

.log-entry {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px dashed rgba(139, 115, 85, 0.2);
    align-items: baseline;
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.log-time {
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--c-gold);
    letter-spacing: 0.05em;
}

.log-text {
    color: var(--c-cream);
    opacity: 0.88;
    font-size: 15px;
    line-height: 1.6;
}

.log-text em {
    color: var(--c-flare);
    font-style: italic;
    font-family: var(--f-display);
}

/* ============================================
   FOOTER
   ============================================ */

.section--footer {
    min-height: 60vh;
    background: linear-gradient(180deg, #2C241C 0%, #1F1914 100%);
    flex-direction: column;
    justify-content: center;
    padding: 80px 6vw 60px;
}

.constellation-svg--footer {
    position: absolute;
    inset: 0;
    height: 100%;
}

.footer-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.footer-mark {
    font-family: var(--f-display);
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 400;
    color: var(--c-cream);
    font-variation-settings: 'wght' 400, 'opsz' 144, 'SOFT' 70;
    margin-bottom: 28px;
    letter-spacing: 0.02em;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.footer-link {
    color: var(--c-gold);
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 4px 6px;
}

.footer-link:hover {
    color: var(--c-flare);
}

.footer-sep {
    color: var(--c-sepia);
}

.footer-coord {
    font-family: var(--f-mono);
    font-size: 11px;
    color: var(--c-sepia);
    letter-spacing: 0.1em;
    opacity: 0.7;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .guide-layout,
    .guide-layout--reverse {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .guide-layout--reverse .guide-monster {
        order: 1;
    }

    .guide-layout--reverse .guide-content {
        order: 2;
    }

    .guide-monster {
        max-width: 260px;
    }

    .guide-content {
        padding: 40px 30px;
        min-height: 360px;
    }

    .coordinates--top-left,
    .coordinates--top-right,
    .coordinates--bottom-left,
    .coordinates--bottom-right {
        font-size: 9px;
    }

    .coordinates--top-left,
    .coordinates--top-right { top: 16px; }
    .coordinates--bottom-left,
    .coordinates--bottom-right { bottom: 16px; }
    .coordinates--top-left,
    .coordinates--bottom-left { left: 16px; }
    .coordinates--top-right,
    .coordinates--bottom-right { right: 16px; }

    .log-entry {
        grid-template-columns: 50px 1fr;
        gap: 12px;
    }
}

@media (max-width: 600px) {
    .section {
        padding: 8vh 5vw;
    }

    .opening-tagline {
        font-size: 16px;
    }

    .footer-nav {
        gap: 8px;
        font-size: 11px;
    }
}
