/* ===========================================
   lunar.quest — Styles
   Honeyed Neutral Palette / Blobitecture / Field Journal
   =========================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.75;
    color: #3A3028;
    background-color: #F0E4D0;
    overflow-x: hidden;
}

/* --- Leather-like background texture --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(107, 80, 64, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(107, 80, 64, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(139, 115, 85, 0.02) 0%, transparent 40%);
}

/* --- CSS Noise texture overlay --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.035;
    background-image:
        radial-gradient(circle at 15% 25%, #6B5040 1px, transparent 1px),
        radial-gradient(circle at 75% 60%, #6B5040 1px, transparent 1px),
        radial-gradient(circle at 45% 85%, #8B7355 1px, transparent 1px),
        radial-gradient(circle at 90% 15%, #8B7355 1px, transparent 1px),
        radial-gradient(circle at 35% 45%, #6B5040 0.5px, transparent 0.5px),
        radial-gradient(circle at 60% 30%, #6B5040 0.5px, transparent 0.5px);
    background-size: 120px 120px, 150px 150px, 100px 100px, 130px 130px, 80px 80px, 90px 90px;
}

/* =========================================
   HERO SECTION
   ========================================= */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    overflow: hidden;
}

#hero-content {
    text-align: center;
    position: relative;
    z-index: 3;
}

#logotype {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: clamp(36px, 6vw, 72px);
    color: #3A3028;
    letter-spacing: 0.02em;
    opacity: 0;
    animation: fadeInLogotype 800ms ease-out 200ms forwards;
}

#hero-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(13px, 1.4vw, 18px);
    color: #8B7355;
    margin-top: 8px;
    letter-spacing: 0.04em;
    opacity: 0;
    animation: fadeInLogotype 800ms ease-out 600ms forwards;
}

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

/* --- Crescent Blob --- */
#crescent-blob {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    opacity: 0;
    animation: fadeInLogotype 600ms ease-out 400ms forwards;
}

#crescent-outline {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: drawOutline 1.5s ease-out 800ms forwards;
}

#crescent-fill {
    opacity: 0;
    animation: fillIn 800ms ease-out 1.8s forwards;
}

#crescent-cutout {
    opacity: 0;
    animation: fillIn 600ms ease-out 2.0s forwards;
}

@keyframes drawOutline {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes fillIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* --- Scroll Hint --- */
#scroll-hint {
    margin-top: 60px;
    opacity: 0;
    animation: fadeInLogotype 800ms ease-out 2.5s forwards;
}

#scroll-hint span {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.03em;
    color: #8B7355;
    text-transform: lowercase;
}

#scroll-arrow {
    margin-top: 8px;
    animation: bounceArrow 2s ease-in-out infinite;
}

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

/* --- Hero Leaf Decorations --- */
.leaf-decoration {
    position: absolute;
    pointer-events: none;
    z-index: 2;
}

.leaf-hero-1 {
    top: 15%;
    right: 12%;
    transform: rotate(25deg);
    opacity: 0.6;
}

.leaf-hero-2 {
    bottom: 18%;
    left: 8%;
    transform: rotate(-15deg);
    opacity: 0.6;
}

/* =========================================
   TIMELINE SECTION
   ========================================= */
#timeline {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
    padding: 80px 20px 120px;
    z-index: 2;
}

/* --- Timeline Spine --- */
#timeline-spine {
    position: absolute;
    left: calc(45% + 1px);
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #8B7355;
    z-index: 1;
}

/* --- Timeline Entry --- */
.timeline-entry {
    position: relative;
    margin-bottom: 80px;
    display: flex;
    align-items: flex-start;
}

.timeline-entry:last-of-type {
    margin-bottom: 0;
}

/* --- Timeline Node (circle on spine) --- */
.timeline-node {
    position: absolute;
    left: 45%;
    top: 28px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #F0E4D0;
    border: 3px solid #8B7355;
    z-index: 3;
    transform: translateX(-50%);
    background-image: radial-gradient(circle, #C8A050 30%, #F0E4D0 70%);
}

/* --- Entry positioning: alternating sides --- */
.entry-left {
    justify-content: flex-start;
    padding-right: 58%;
}

.entry-right {
    justify-content: flex-end;
    padding-left: 50%;
}

/* --- Journal Card --- */
.journal-card {
    position: relative;
    background-color: #FAF4E8;
    border-radius: 20px 4px 20px 4px;
    padding: 32px 28px 28px;
    max-width: 380px;
    width: 100%;
    box-shadow: 4px 6px 20px rgba(58, 48, 40, 0.1);
    transform-style: preserve-3d;
    transform: perspective(600px) rotateX(0deg) rotateY(0deg);
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
    will-change: transform;
    z-index: 2;
    /* Leather texture on card */
    background-image:
        radial-gradient(circle at 25% 25%, rgba(107, 80, 64, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(107, 80, 64, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 10%, rgba(139, 115, 85, 0.02) 0%, transparent 40%);
    /* Scroll-reveal initial state */
    opacity: 0;
    transform: perspective(600px) rotateX(0deg) rotateY(0deg) translateY(20px);
}

.journal-card.revealed {
    opacity: 1;
    transform: perspective(600px) rotateX(0deg) rotateY(0deg) translateY(0);
    transition: opacity 500ms ease-out, transform 500ms ease-out, box-shadow 0.15s ease-out;
}

/* --- Page-Fold Corner --- */
.journal-card.has-page-fold::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 28px 28px 0;
    border-color: transparent #F0E4D0 transparent transparent;
    border-bottom-left-radius: 4px;
    z-index: 5;
}

.journal-card.has-page-fold::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #E8D8C0 0%, #DDD0BA 100%);
    border-bottom-left-radius: 6px;
    z-index: 4;
}

/* --- Entry Date --- */
.entry-date {
    display: block;
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.03em;
    color: #8B7355;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* --- Entry Heading --- */
.entry-heading {
    font-family: 'Zilla Slab', serif;
    font-weight: 600;
    font-size: clamp(22px, 3vw, 38px);
    color: #3A3028;
    line-height: 1.3;
    margin-bottom: 12px;
}

/* --- Entry Body --- */
.entry-body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.75;
    color: #6B5040;
}

/* --- Leaf Accents on Cards --- */
.leaf-accent {
    position: absolute;
    pointer-events: none;
    opacity: 0.8;
    color: #7A8B60;
}

.leaf-oak {
    bottom: -12px;
    right: 16px;
    transform: rotate(15deg);
}

.leaf-maple {
    top: -10px;
    left: -8px;
    transform: rotate(-20deg);
}

.leaf-fern {
    bottom: 8px;
    right: -6px;
    transform: rotate(10deg);
}

/* --- Decorative Timeline Leaves --- */
.leaf-timeline-1 {
    top: 20%;
    left: calc(45% + 20px);
    transform: rotate(35deg);
}

.leaf-timeline-2 {
    top: 55%;
    left: calc(45% - 50px);
    transform: rotate(-25deg);
}

.leaf-timeline-3 {
    top: 80%;
    left: calc(45% + 15px);
    transform: rotate(10deg);
}

/* =========================================
   FOOTER
   ========================================= */
#footer {
    position: relative;
    z-index: 2;
    padding: 60px 20px 40px;
    text-align: center;
    border-top: 1px solid rgba(139, 115, 85, 0.2);
}

#footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#footer-logo {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 20px;
    color: #3A3028;
}

#footer-note {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.03em;
    color: #8B7355;
}

/* =========================================
   HOVER / INTERACTION STATES
   ========================================= */
.journal-card:hover {
    box-shadow: 6px 8px 28px rgba(58, 48, 40, 0.15);
}

.timeline-node {
    transition: transform 0.3s ease, background 0.3s ease;
}

.timeline-entry:hover .timeline-node {
    transform: translateX(-50%) scale(1.2);
    background-image: radial-gradient(circle, #C8A050 50%, #F0E4D0 90%);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    #timeline-spine {
        left: 24px;
    }

    .timeline-node {
        left: 24px;
    }

    .entry-left,
    .entry-right {
        padding-left: 52px;
        padding-right: 16px;
        justify-content: flex-start;
    }

    .journal-card {
        max-width: 100%;
    }

    .leaf-decoration {
        display: none;
    }

    .leaf-timeline-1,
    .leaf-timeline-2,
    .leaf-timeline-3 {
        display: none;
    }

    .leaf-hero-1,
    .leaf-hero-2 {
        display: none;
    }

    #timeline {
        padding: 40px 12px 80px;
    }

    .timeline-entry {
        margin-bottom: 50px;
    }
}

@media (max-width: 480px) {
    .journal-card {
        padding: 24px 20px 20px;
    }

    .entry-heading {
        font-size: clamp(18px, 5vw, 26px);
    }

    #hero {
        min-height: 90vh;
    }
}
