:root {
    --bg-primary: #F4F1EC;
    --bg-secondary: #EBE7E0;
    --text-primary: #3A424A;
    --text-secondary: #5E6B78;
    --text-tertiary: #9BA8B4;
    --accent-rose: #E8C4C8;
    --accent-blue: #C4D4E8;
    --accent-lavender: #D4C4E8;
    --accent-sage: #C4DCC8;
    --scroll-indicator: #B8C4D0;
    --font-mono: 'Share Tech Mono', monospace;
    --font-accent: 'Inter', sans-serif;
}

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

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-mono);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Frames */
.frame {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.frame-light {
    background-color: var(--bg-primary);
}

.frame-dark {
    background-color: var(--bg-secondary);
}

.frame-content {
    max-width: 480px;
    width: 100%;
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* Breath fields - subtle radial gradient tints */
.breath-field {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.breath-lavender {
    background: radial-gradient(circle, rgba(212, 196, 232, 0.04) 0%, transparent 70%);
}

.breath-blue {
    background: radial-gradient(circle, rgba(196, 212, 232, 0.04) 0%, transparent 70%);
}

.breath-sage {
    background: radial-gradient(circle, rgba(196, 220, 200, 0.04) 0%, transparent 70%);
}

.breath-rose {
    background: radial-gradient(circle, rgba(232, 196, 200, 0.04) 0%, transparent 70%);
}

/* Typography */
.title {
    font-family: var(--font-mono);
    font-size: clamp(1.4rem, 3.5vw, 1.6rem);
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: lowercase;
    color: var(--text-primary);
}

.contemplation {
    font-family: var(--font-mono);
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    line-height: 2.0;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    max-width: 38ch;
    margin: 0 auto;
}

.passage {
    font-family: var(--font-mono);
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    line-height: 2.0;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    max-width: 38ch;
    margin: 0 auto;
    text-align: left;
}

.metadata {
    font-family: var(--font-accent);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.couplet {
    font-family: var(--font-mono);
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    line-height: 2.0;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    margin-top: 2rem;
}

.closing-title {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin-top: 2rem;
    text-transform: lowercase;
}

/* Scroll hint */
.scroll-hint {
    width: 1px;
    height: 24px;
    background-color: var(--scroll-indicator);
    margin: 120px auto 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Pixel dividers */
.pixel-divider {
    width: 120px;
    height: 1px;
    margin: 0 auto;
}

.divider-rose {
    background-color: #E8C4C8;
    opacity: 0.6;
}

.divider-blue {
    background-color: #C4D4E8;
    opacity: 0.6;
}

.divider-lavender {
    background-color: #D4C4E8;
    opacity: 0.6;
}

.divider-sage {
    background-color: #C4DCC8;
    opacity: 0.6;
}

/* Nature marks - CSS-only geometric abstractions */

/* Moon - circle with 1px border */
.moon {
    width: 80px;
    height: 80px;
    border: 1px solid var(--accent-lavender);
    border-radius: 50%;
    opacity: 0.2;
    margin: 0 auto;
}

/* Bamboo - thin vertical line */
.bamboo {
    width: 1px;
    height: 160px;
    background-color: var(--accent-sage);
    opacity: 0.2;
    margin: 0 auto;
}

/* Mountain / bird in flight - two angled lines meeting at a point */
.mountain {
    width: 80px;
    height: 40px;
    position: relative;
    margin: 0 auto;
    opacity: 0.2;
}

.mountain::before,
.mountain::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 1px;
    background-color: var(--accent-rose);
    top: 50%;
}

.mountain::before {
    left: 0;
    transform-origin: right center;
    transform: rotate(-30deg);
}

.mountain::after {
    right: 0;
    transform-origin: left center;
    transform: rotate(30deg);
}

/* Enso - incomplete circle with 15-degree gap at 2 o'clock */
.enso {
    width: 80px;
    height: 80px;
    border: 1.5px solid var(--text-secondary);
    border-radius: 50%;
    opacity: 0.25;
    margin: 0 auto;
    position: relative;
    mask-image: conic-gradient(
        from 45deg,
        transparent 0deg,
        transparent 15deg,
        black 15deg,
        black 360deg
    );
    -webkit-mask-image: conic-gradient(
        from 45deg,
        transparent 0deg,
        transparent 15deg,
        black 15deg,
        black 360deg
    );
}

/* Nature watermarks - positioned in lower-right quadrant */
.nature-watermark {
    position: absolute;
    bottom: 15%;
    right: 15%;
    z-index: 1;
    pointer-events: none;
}

.nature-watermark.moon-mark {
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent-lavender);
    border-radius: 50%;
    opacity: 0;
}

.nature-watermark.moon-mark.visible {
    opacity: 0.15;
}

.nature-watermark.bamboo-mark {
    width: 1px;
    height: 80px;
    background-color: var(--accent-sage);
    opacity: 0;
}

.nature-watermark.bamboo-mark.visible {
    opacity: 0.15;
}

.nature-watermark.mountain-mark {
    width: 50px;
    height: 25px;
    position: absolute;
    opacity: 0;
}

.nature-watermark.mountain-mark.visible {
    opacity: 0.15;
}

.nature-watermark.mountain-mark::before,
.nature-watermark.mountain-mark::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 1px;
    background-color: var(--accent-rose);
    top: 50%;
}

.nature-watermark.mountain-mark::before {
    left: 0;
    transform-origin: right center;
    transform: rotate(-30deg);
}

.nature-watermark.mountain-mark::after {
    right: 0;
    transform-origin: left center;
    transform: rotate(30deg);
}

.nature-watermark.dewdrop {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    opacity: 0;
}

.nature-watermark.dewdrop.visible {
    opacity: 0.3;
}

/* Fade reveal animation system - pure opacity, no transforms */
.fade-reveal {
    opacity: 0;
    transition: opacity 1200ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.fade-reveal.visible {
    opacity: 1;
}

/* Elements with target opacities less than 1 */
.moon.fade-reveal.visible {
    opacity: 0.2;
}

.bamboo.fade-reveal.visible {
    opacity: 0.2;
}

.mountain.fade-reveal.visible {
    opacity: 0.2;
}

.enso.fade-reveal.visible {
    opacity: 0.25;
}

/* Stagger delay for elements within the same frame */
.fade-reveal[data-delay="400"] {
    transition-delay: 400ms;
}

/* 31 scattered dots - Heisei lasted 31 years */
.heisei-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.heisei-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 2000ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.heisei-dot.dot-visible {
    opacity: 0.12;
}

/* Responsive */
@media (max-width: 768px) {
    .frame-content {
        padding: 1.5rem;
    }

    .passage,
    .contemplation {
        max-width: 30ch;
    }

    .nature-watermark {
        bottom: 10%;
        right: 10%;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.2rem;
    }

    .passage,
    .contemplation,
    .couplet {
        font-size: 0.85rem;
    }

    .nature-watermark {
        bottom: 8%;
        right: 8%;
    }
}
