/* ============================================
   ronri.day - Watercolor Logic Journal
   ============================================ */

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

:root {
    --morning-blue: #B8D4E3;
    --ocean-teal: #5B8EA6;
    --sea-foam: #E8F0E8;
    --sand-warm: #F5ECD7;
    --botanical-green: #5A7B5A;
    --deep-current: #2A4A5A;
    --coral-soft: #D4907A;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.85;
    color: var(--deep-current);
    background-color: var(--sea-foam);
    overflow-x: hidden;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    line-height: 1.2;
}

code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 400;
}

/* ============================================
   MORNING PAGE - Hero Section
   ============================================ */
.morning-page {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    filter: blur(4px);
    opacity: 0.7;
    transition: filter 0.8s ease-out, opacity 0.8s ease-out;
}

.morning-page.focused {
    filter: blur(0);
    opacity: 1;
}

/* Watercolor washes */
.watercolor-wash {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.wash-1 {
    width: 140vw;
    height: 140vh;
    top: -30vh;
    left: -20vw;
    background: radial-gradient(ellipse at 40% 40%, #B8D4E3 0%, rgba(184, 212, 227, 0.6) 30%, rgba(232, 240, 232, 0.4) 60%, transparent 80%);
    filter: url(#watercolor-filter);
}

.wash-2 {
    width: 100vw;
    height: 100vh;
    top: -10vh;
    right: -20vw;
    background: radial-gradient(ellipse at 70% 30%, rgba(232, 240, 232, 0.8) 0%, rgba(184, 212, 227, 0.3) 40%, transparent 70%);
    filter: url(#watercolor-filter-2);
}

.wash-3 {
    width: 80vw;
    height: 80vh;
    bottom: -20vh;
    left: 10vw;
    background: radial-gradient(ellipse at 50% 70%, rgba(245, 236, 215, 0.5) 0%, rgba(184, 212, 227, 0.2) 50%, transparent 80%);
    filter: url(#watercolor-filter-3);
}

/* Morning content */
.morning-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 2rem;
}

.wordmark {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(42px, 7vw, 96px);
    font-weight: 700;
    color: var(--deep-current);
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 0.6s, transform 1s ease 0.6s;
}

.morning-page.focused .wordmark {
    opacity: 1;
    transform: translateY(0);
}

.subtitle {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(14px, 2vw, 20px);
    font-weight: 400;
    font-style: italic;
    color: var(--ocean-teal);
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 1.2s ease 1s;
}

.morning-page.focused .subtitle {
    opacity: 1;
}

.kanji {
    font-style: normal;
    font-size: 1.1em;
    letter-spacing: 0.15em;
}

/* Botanical branches */
.botanical-branch {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.botanical-right {
    right: 0;
    top: 0;
    width: 150px;
    height: 100%;
    opacity: 0.6;
}

.botanical-left {
    left: 0;
    top: 0;
    width: 120px;
    height: 100%;
    opacity: 0.5;
}

.botanical-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2.5s ease-out;
}

.morning-page.focused .botanical-path {
    stroke-dashoffset: 0;
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 1.5s ease 2s;
}

.morning-page.focused .scroll-hint {
    opacity: 0.6;
}

.scroll-hint-text {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: var(--ocean-teal);
    letter-spacing: 0.1em;
    text-transform: lowercase;
}

.scroll-hint-arrow {
    width: 1px;
    height: 24px;
    background: var(--ocean-teal);
    position: relative;
    animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-hint-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -3px;
    width: 7px;
    height: 7px;
    border-right: 1px solid var(--ocean-teal);
    border-bottom: 1px solid var(--ocean-teal);
    transform: rotate(45deg);
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(6px); }
}

/* ============================================
   TIMELINE SECTION
   ============================================ */
.timeline-section {
    position: relative;
    padding: 6rem 2rem 8rem;
    max-width: 1100px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Central timeline line */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 0;
    background: var(--ocean-teal);
    transform: translateX(-50%);
    transition: height 1.5s ease-out;
}

.timeline-line.extended {
    height: 100%;
}

/* --- Entry Base --- */
.entry {
    position: relative;
    width: 45%;
    margin-bottom: 5rem;
    filter: blur(4px);
    opacity: 0.7;
    transition: filter 0.6s ease, opacity 0.6s ease, transform 0.6s ease;
}

.entry.in-view {
    filter: blur(0);
    opacity: 1;
}

/* Entry positions */
.entry-left {
    margin-right: auto;
    margin-left: 0;
    transform: translateX(-20px);
}

.entry-right {
    margin-left: auto;
    margin-right: 0;
    text-align: right;
    transform: translateX(20px);
}

.entry-left.in-view {
    transform: translateX(0);
}

.entry-right.in-view {
    transform: translateX(0);
}

/* Entry connector line */
.entry-connector {
    position: absolute;
    top: 20px;
    height: 1px;
    background: var(--ocean-teal);
    opacity: 0.4;
}

.entry-left .entry-connector {
    right: -10%;
    width: 10%;
}

.entry-right .entry-connector {
    left: -10%;
    width: 10%;
}

/* Date markers */
.date-marker {
    position: absolute;
    top: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.entry-left .date-marker {
    right: -18%;
    flex-direction: row;
}

.entry-right .date-marker {
    left: -18%;
    flex-direction: row-reverse;
}

.date-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ocean-teal);
    border: 2px solid var(--sea-foam);
    box-shadow: 0 0 0 1px var(--ocean-teal);
    flex-shrink: 0;
}

.date-label {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: var(--ocean-teal);
    letter-spacing: 0.08em;
    white-space: nowrap;
}

/* Entry card */
.entry-card {
    position: relative;
    background: rgba(245, 236, 215, 0.6);
    padding: 2.5rem 2rem;
    border-radius: 2px;
    overflow: hidden;
}

.organic-blob {
    position: absolute;
    top: -10%;
    left: -5%;
    width: 110%;
    height: 120%;
    pointer-events: none;
    z-index: 0;
}

.entry-content {
    position: relative;
    z-index: 1;
}

.entry-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(24px, 3.5vw, 36px);
    font-weight: 700;
    color: var(--deep-current);
    margin-bottom: 0.35rem;
}

.entry-date {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(13px, 1.2vw, 15px);
    font-style: italic;
    color: var(--coral-soft);
    margin-bottom: 1.2rem;
}

.entry-body {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.85;
    color: var(--deep-current);
    margin-bottom: 1.5rem;
}

.entry-right .entry-body,
.entry-right .entry-title,
.entry-right .entry-date {
    text-align: right;
}

.logic-notation {
    padding: 0.75rem 1rem;
    background: rgba(232, 240, 232, 0.6);
    border-left: 2px solid var(--botanical-green);
    display: inline-block;
}

.entry-right .logic-notation {
    border-left: none;
    border-right: 2px solid var(--botanical-green);
    float: right;
}

.logic-notation code {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: var(--deep-current);
    letter-spacing: 0.05em;
}

/* Entry botanical decorations */
.entry-botanical {
    position: absolute;
    bottom: 0.5rem;
    width: 60px;
    height: 60px;
    opacity: 0.4;
    pointer-events: none;
}

.entry-left .entry-botanical {
    right: 0.5rem;
}

.entry-right .entry-botanical {
    left: 0.5rem;
}

/* ============================================
   ROOT SYSTEM SECTION
   ============================================ */
.root-system {
    position: relative;
    padding: 6rem 2rem 4rem;
    background: linear-gradient(180deg, var(--sea-foam) 0%, rgba(245, 236, 215, 0.4) 50%, var(--sea-foam) 100%);
    overflow: hidden;
    filter: blur(4px);
    opacity: 0.7;
    transition: filter 0.6s ease, opacity 0.6s ease;
}

.root-system.in-view {
    filter: blur(0);
    opacity: 1;
}

.root-system-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.root-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 700;
    color: var(--deep-current);
    margin-bottom: 0.5rem;
}

.root-subtitle {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: clamp(14px, 1.5vw, 18px);
    color: var(--ocean-teal);
    margin-bottom: 3rem;
}

.root-diagram {
    position: relative;
    width: 100%;
    padding: 2rem 0;
}

.root-tree {
    width: 100%;
    height: auto;
    max-height: 500px;
}

.root-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 3s ease-out;
}

.root-system.in-view .root-path {
    stroke-dashoffset: 0;
}

.root-label {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.root-label-center {
    text-anchor: middle;
}

/* ============================================
   EVENING PAGE - Footer
   ============================================ */
.evening-page {
    position: relative;
    padding: 8rem 2rem 6rem;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wash-evening-1 {
    width: 140vw;
    height: 140%;
    top: -20%;
    left: -20vw;
    background: radial-gradient(ellipse at 50% 60%, rgba(42, 74, 90, 0.15) 0%, rgba(91, 142, 166, 0.1) 30%, rgba(184, 212, 227, 0.05) 60%, transparent 80%);
    filter: url(#watercolor-filter);
}

.wash-evening-2 {
    width: 100vw;
    height: 100%;
    bottom: -10%;
    right: -10vw;
    background: radial-gradient(ellipse at 60% 80%, rgba(42, 74, 90, 0.12) 0%, rgba(90, 123, 90, 0.06) 40%, transparent 70%);
    filter: url(#watercolor-filter-2);
}

/* Timeline ending */
.timeline-end {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
}

.timeline-end-line {
    width: 1px;
    height: 80px;
    background: linear-gradient(to bottom, var(--ocean-teal), rgba(91, 142, 166, 0.2));
}

.timeline-end-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ocean-teal);
    margin-top: 4px;
}

/* Evening content */
.evening-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.evening-text {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: clamp(16px, 2vw, 22px);
    color: var(--deep-current);
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

.evening-kanji {
    font-size: clamp(20px, 3vw, 32px);
    color: var(--ocean-teal);
    letter-spacing: 0.3em;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.evening-domain {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: var(--coral-soft);
    letter-spacing: 0.15em;
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .timeline-section {
        padding: 4rem 1rem 6rem;
    }

    .entry {
        width: 80%;
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: left !important;
    }

    .entry-right .entry-body,
    .entry-right .entry-title,
    .entry-right .entry-date {
        text-align: left;
    }

    .entry-right .logic-notation {
        border-right: none;
        border-left: 2px solid var(--botanical-green);
        float: none;
    }

    .entry-connector {
        display: none;
    }

    .date-marker {
        position: relative;
        top: auto;
        right: auto !important;
        left: auto !important;
        flex-direction: row !important;
        margin-bottom: 0.75rem;
    }

    .timeline-line {
        left: 1rem;
    }

    .botanical-right {
        width: 80px;
        opacity: 0.3;
    }

    .botanical-left {
        width: 60px;
        opacity: 0.25;
    }

    .entry-botanical {
        display: none;
    }

    .root-tree {
        max-height: 300px;
    }

    .root-label {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .entry {
        width: 92%;
    }

    .entry-card {
        padding: 1.5rem 1.2rem;
    }

    .botanical-right,
    .botanical-left {
        display: none;
    }
}
