:root {
    --bg-primary: #0a0f0d;
    --bg-mid: #131a16;
    --fg-primary: #c8d0c5;
    --fg-muted: #6b7a6e;
    --accent-moss: #2d6b4f;
    --accent-glow: #3aefb0;
    --accent-amber: #c49a3a;
    --rule-color: #1e2b24;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--fg-primary);
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: 1.15rem;
    line-height: 1.85;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ===== Scroll Progress ===== */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 0%;
    background: var(--accent-moss);
    z-index: 1000;
    transition: height 0.1s linear;
    box-shadow: 0 0 8px var(--accent-glow);
}

#scroll-progress.pulsing {
    animation: progressPulse 6s ease-in-out infinite 3s;
}

@keyframes progressPulse {
    0%, 100% { box-shadow: 0 0 8px var(--accent-glow); opacity: 0.8; }
    50% { box-shadow: 0 0 16px var(--accent-glow); opacity: 1; }
}

/* ===== Background Blobs ===== */
#blob-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    mix-blend-mode: screen;
    opacity: 0.04;
}

.blob-1 {
    width: 600px;
    height: 600px;
    top: -10%;
    left: -5%;
    animation: blobMorph1 45s ease-in-out infinite, blobPulse 6s ease-in-out infinite;
}

.blob-2 {
    width: 500px;
    height: 500px;
    top: 30%;
    right: -10%;
    animation: blobMorph2 38s ease-in-out infinite, blobPulse 6s ease-in-out infinite 1.5s;
}

.blob-3 {
    width: 700px;
    height: 700px;
    bottom: 10%;
    left: -15%;
    animation: blobMorph3 55s ease-in-out infinite, blobPulse 6s ease-in-out infinite 3s;
}

.blob-4 {
    width: 400px;
    height: 400px;
    top: 60%;
    right: 5%;
    animation: blobMorph4 42s ease-in-out infinite, blobPulse 6s ease-in-out infinite 4.5s;
    opacity: 0.05;
}

.blob-focus {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.12;
    animation: blobPulse 6s ease-in-out infinite;
    transition: top 2s ease-out, left 2s ease-out;
}

@keyframes blobMorph1 {
    0%, 100% { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; transform: translate(0, 0) rotate(0deg); }
    25% { border-radius: 70% 30% 50% 50% / 30% 70% 30% 70%; transform: translate(30px, -20px) rotate(5deg); }
    50% { border-radius: 30% 70% 40% 60% / 55% 30% 70% 45%; transform: translate(-20px, 30px) rotate(-3deg); }
    75% { border-radius: 55% 45% 60% 40% / 40% 60% 35% 65%; transform: translate(15px, 15px) rotate(7deg); }
}

@keyframes blobMorph2 {
    0%, 100% { border-radius: 50% 50% 40% 60% / 60% 40% 60% 40%; transform: translate(0, 0) rotate(0deg); }
    33% { border-radius: 35% 65% 55% 45% / 45% 55% 35% 65%; transform: translate(-25px, 15px) rotate(-4deg); }
    66% { border-radius: 65% 35% 45% 55% / 55% 45% 65% 35%; transform: translate(20px, -25px) rotate(6deg); }
}

@keyframes blobMorph3 {
    0%, 100% { border-radius: 60% 40% 55% 45% / 50% 50% 45% 55%; transform: translate(0, 0) rotate(0deg); }
    25% { border-radius: 40% 60% 35% 65% / 65% 35% 55% 45%; transform: translate(20px, 30px) rotate(3deg); }
    50% { border-radius: 55% 45% 65% 35% / 35% 65% 40% 60%; transform: translate(-30px, -15px) rotate(-5deg); }
    75% { border-radius: 45% 55% 50% 50% / 55% 45% 60% 40%; transform: translate(10px, -20px) rotate(4deg); }
}

@keyframes blobMorph4 {
    0%, 100% { border-radius: 45% 55% 60% 40% / 55% 45% 50% 50%; transform: rotate(0deg); }
    50% { border-radius: 55% 45% 40% 60% / 45% 55% 50% 50%; transform: rotate(180deg); }
}

@keyframes blobPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* ===== Dot Grid ===== */
#dot-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
    background-image: radial-gradient(circle, var(--fg-muted) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ===== Cursor Trail ===== */
#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.trail-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-moss);
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease-out;
}

/* ===== Main Content ===== */
#content {
    position: relative;
    z-index: 1;
}

.section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
    padding: 10vh 1.5rem;
}

.section-void {
    min-height: 80vh;
}

.section-inner {
    max-width: 560px;
    width: 100%;
}

.offset-left {
    transform: translateX(-25px);
}

.offset-right {
    transform: translateX(25px);
}

/* ===== Typography ===== */
.heading {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    letter-spacing: 0.04em;
    color: var(--fg-primary);
    margin-bottom: 2rem;
    line-height: 1.2;
}

.title-undo {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 8vw, 7rem);
    letter-spacing: 0.06em;
    color: var(--fg-primary);
    text-align: center;
    opacity: 0;
    animation: titleFadeIn 3s ease-out 2s forwards;
}

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

.body-text {
    color: var(--fg-primary);
    margin-bottom: 1.5rem;
}

.meta-text {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--fg-muted);
    display: block;
    margin-top: 2rem;
}

.closing-text {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 8vw, 7rem);
    letter-spacing: 0.06em;
    color: var(--fg-primary);
    text-align: center;
}

/* ===== Reveal Animation ===== */
.reveal-element {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1200ms ease-out, transform 1200ms ease-out;
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Dividers ===== */
.divider {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8vh 0;
}

.undo-arrow {
    width: 40px;
    height: 40px;
    animation: undoSpin 12s linear infinite reverse;
    opacity: 0.6;
}

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

.divider-line {
    max-width: 560px;
    height: 1px;
    margin: 4vh auto;
    background: linear-gradient(to right, transparent, var(--rule-color), transparent);
}

/* ===== Menu Items ===== */
.menu-item {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--rule-color);
}

.menu-item:last-of-type {
    border-bottom: none;
}

.menu-name {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 0.04em;
    color: var(--accent-moss);
    margin-bottom: 0.8rem;
    transition: color 600ms ease;
}

.menu-item:hover .menu-name {
    color: var(--accent-glow);
}

.menu-haiku {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--fg-muted);
}

/* ===== Ritual Steps ===== */
.ritual-step {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 2.5rem;
    align-items: baseline;
}

.ritual-number {
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent-amber);
    flex-shrink: 0;
    min-width: 2rem;
}

/* ===== Typing backward effect ===== */
.typing-backward {
    color: var(--accent-amber);
    position: relative;
}

/* ===== Spacing between sections ===== */
.section-breath {
    margin-top: 10vh;
}

.section-philosophy {
    margin-top: 5vh;
}

.section-menu {
    margin-top: 5vh;
}

.section-ritual {
    margin-top: 5vh;
}

.section-closing {
    margin-top: 10vh;
    margin-bottom: 20vh;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .offset-left {
        transform: translateX(-10px);
    }
    .offset-right {
        transform: translateX(10px);
    }
    .section {
        padding: 8vh 1.2rem;
    }
    .ritual-step {
        gap: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blob {
        animation: none !important;
    }
    .undo-arrow {
        animation: none !important;
    }
    .reveal-element {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .title-undo {
        opacity: 1;
        animation: none;
    }
    #scroll-progress {
        animation: none !important;
    }
}
