/* ronri.day — watercolor journal of logic
   palette (coastal blend):
     #2A4A5A  Deep Current   (primary text)
     #E8F0E8  Sea Foam       (secondary wash)
     #F5ECD7  Sand Warm      (card surfaces)
     #B8D4E3  Morning Blue   (primary wash)
     #D4907A  Coral Soft     (warm accent)
     #5A7B5A  Botanical Green
     #5B8EA6  Ocean Teal     (timeline, accent)
*/

:root {
    --c-deep:       #2A4A5A;
    --c-foam:       #E8F0E8;
    --c-sand:       #F5ECD7;
    --c-morning:    #B8D4E3;
    --c-coral:      #D4907A;
    --c-botanical:  #5A7B5A;
    --c-teal:       #5B8EA6;

    --font-head: "Playfair Display", Georgia, serif;
    --font-body: "Lora", Georgia, serif;
    --font-mono: "Fira Code", "SFMono-Regular", Menlo, monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--c-deep);
    background: var(--c-foam);
    line-height: 1.85;
    overflow-x: hidden;
}

/* SVG defs container — kept off-screen */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ============================================================
   Initial blur-focus on the whole page
   ============================================================ */
body {
    filter: blur(4px);
    opacity: 0.85;
    transition: filter 0.9s ease-out, opacity 0.9s ease-out;
}
body.focused {
    filter: blur(0);
    opacity: 1;
}

/* ============================================================
   Watercolor wash backgrounds
   Layered radial gradients to simulate bleed; turbulence filter
   adds an organic deformation.
   ============================================================ */
.wash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.wash-morning {
    background:
        radial-gradient(circle at 18% 22%, rgba(184, 212, 227, 0.95) 0%, rgba(184, 212, 227, 0) 55%),
        radial-gradient(circle at 82% 18%, rgba(232, 240, 232, 0.85) 0%, rgba(232, 240, 232, 0) 60%),
        radial-gradient(circle at 50% 78%, rgba(245, 236, 215, 0.55) 0%, rgba(245, 236, 215, 0) 65%),
        radial-gradient(circle at 30% 88%, rgba(91, 142, 166, 0.18) 0%, rgba(91, 142, 166, 0) 55%),
        linear-gradient(180deg, #ECF3F1 0%, #DCEAEC 60%, #E8F0E8 100%);
    filter: url(#watercolor-morning) blur(0.4px);
}

.wash-roots {
    background:
        radial-gradient(ellipse at 50% 10%, rgba(232, 240, 232, 0.95) 0%, rgba(232, 240, 232, 0) 60%),
        radial-gradient(ellipse at 12% 80%, rgba(184, 212, 227, 0.55) 0%, rgba(184, 212, 227, 0) 60%),
        radial-gradient(ellipse at 88% 80%, rgba(212, 144, 122, 0.16) 0%, rgba(212, 144, 122, 0) 55%),
        linear-gradient(180deg, #F0F4EE 0%, #E4ECE5 100%);
    filter: url(#watercolor-entry) blur(0.3px);
}

.wash-evening {
    background:
        radial-gradient(circle at 22% 30%, rgba(91, 142, 166, 0.55) 0%, rgba(91, 142, 166, 0) 55%),
        radial-gradient(circle at 78% 70%, rgba(42, 74, 90, 0.45) 0%, rgba(42, 74, 90, 0) 60%),
        radial-gradient(circle at 50% 100%, rgba(212, 144, 122, 0.18) 0%, rgba(212, 144, 122, 0) 55%),
        linear-gradient(180deg, #B8D4E3 0%, #5B8EA6 55%, #2A4A5A 100%);
    filter: url(#watercolor-evening) blur(0.5px);
}

/* Paper grain overlay */
.paper-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
    opacity: 0.6;
    mix-blend-mode: multiply;
    z-index: 1;
}

/* ============================================================
   Morning Page (100vh)
   ============================================================ */
.morning-page {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.morning-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1100px;
    padding: 6vh 6vw;
    text-align: center;
}

.wordmark-block {
    margin-top: 4vh;
    margin-bottom: 6vh;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}
.morning-page.focused .wordmark-block {
    opacity: 1;
    transform: translateY(0);
}

.kanji {
    font-family: var(--font-head);
    font-size: clamp(48px, 7vw, 96px);
    color: var(--c-teal);
    opacity: 0.55;
    letter-spacing: 0.04em;
    line-height: 1;
    margin-bottom: 0.4em;
    font-weight: 400;
    font-style: italic;
}

.wordmark {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--c-deep);
    font-size: clamp(40px, 6vw, 84px);
    letter-spacing: -0.01em;
    line-height: 1.05;
}

.wordmark .dot {
    color: var(--c-coral);
    margin: 0 0.04em;
}

.tagline {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 400;
    color: var(--c-deep);
    opacity: 0.75;
    font-size: clamp(15px, 1.4vw, 18px);
    margin-top: 1.2em;
    max-width: 38ch;
    margin-left: auto;
    margin-right: auto;
}

.meta-line {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--c-teal);
    margin-top: 2.2em;
    letter-spacing: 0.02em;
}

.meta-sep {
    margin: 0 0.6em;
    color: var(--c-coral);
    opacity: 0.7;
}

.timeline-anchor {
    position: absolute;
    left: 50%;
    top: 64%;
    transform: translateX(-50%);
    width: 1px;
    height: 24vh;
    pointer-events: none;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: var(--c-coral);
    box-shadow: 0 0 0 3px rgba(212, 144, 122, 0.18);
}

.start-dot {
    top: 0;
}

.timeline-line-morning {
    position: absolute;
    left: 50%;
    top: 12px;
    width: 1px;
    height: 0;
    background: var(--c-teal);
    transform: translateX(-50%);
    transition: height 1.5s ease 0.3s;
}
.morning-page.focused .timeline-line-morning {
    height: calc(100% - 12px);
}

/* Botanical decoration on the page edges */
.branch-decor {
    position: absolute;
    width: 220px;
    height: 720px;
    top: 0;
    pointer-events: none;
    overflow: visible;
}
.branch-decor-left {
    left: 0;
    transform: translateX(-12%);
}
.branch-decor-right {
    right: 0;
    transform: translateX(12%) scaleX(-1);
}

.branch-decor .vine-stem,
.branch-decor .vine-leaf {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 2s ease 0.4s;
}
.morning-page.focused .branch-decor .vine-stem,
.morning-page.focused .branch-decor .vine-leaf {
    stroke-dashoffset: 0;
}
.branch-decor .vine-bud {
    fill: var(--c-coral);
    fill-opacity: 0;
    transition: fill-opacity 0.8s ease 2s;
}
.morning-page.focused .branch-decor .vine-bud {
    fill-opacity: 0.85;
}

.scroll-hint {
    position: absolute;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--c-deep);
    opacity: 0;
    transition: opacity 1s ease 2.4s;
    letter-spacing: 0.05em;
}
.morning-page.focused .scroll-hint {
    opacity: 0.6;
}

.hint-arrow {
    display: inline-block;
    margin-left: 0.4em;
    animation: hintBob 2.6s ease-in-out infinite;
}

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

/* ============================================================
   Timeline section — daily entries
   ============================================================ */
.timeline-section {
    position: relative;
    width: 100%;
    padding: 12vh 0 14vh;
    background: linear-gradient(180deg, #E8F0E8 0%, #ECF3F1 50%, #E4ECE5 100%);
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: var(--c-teal);
    opacity: 0.7;
    transform: translateX(-50%);
}

.entry {
    position: relative;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto 14vh auto;
    padding: 0 6vw;
    filter: blur(4px);
    opacity: 0.7;
    transition: filter 0.6s ease, opacity 0.6s ease, transform 0.6s ease;
    transform: translateY(20px);
}

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

.entry-marker {
    position: absolute;
    left: 50%;
    top: 28px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--c-sand);
    border: 1.5px solid var(--c-teal);
    transform: translateX(-50%) scale(0.6);
    transition: transform 0.6s ease;
    z-index: 3;
}

.entry.in-view .entry-marker {
    transform: translateX(-50%) scale(1);
}

.entry-card {
    position: relative;
    width: 45%;
    padding: 36px 38px 40px;
    background: rgba(245, 236, 215, 0.78);
    border-radius: 6px;
    z-index: 2;
}

.entry-left .entry-card {
    margin-right: auto;
    text-align: left;
}

.entry-right .entry-card {
    margin-left: auto;
    text-align: right;
}

/* Organic blob behind each card */
.blob-bg {
    position: absolute;
    inset: -28px -34px -30px -34px;
    width: calc(100% + 68px);
    height: calc(100% + 58px);
    fill: var(--c-coral);
    fill-opacity: 0.12;
    z-index: -1;
    pointer-events: none;
}

.entry-date {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--c-teal);
    letter-spacing: 0.04em;
    text-transform: lowercase;
    margin-bottom: 0.9em;
}

.entry-title {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--c-deep);
    font-size: clamp(22px, 2.6vw, 34px);
    line-height: 1.22;
    margin-bottom: 0.7em;
    letter-spacing: -0.005em;
}

.entry-body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--c-deep);
    font-size: clamp(15px, 1.1vw, 17px);
    line-height: 1.85;
    margin-bottom: 1.3em;
}

.entry-body em {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--c-teal);
}

.entry-logic {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    border-left: 1px solid var(--c-coral);
    background: rgba(184, 212, 227, 0.16);
    margin-bottom: 1em;
}

.entry-right .entry-logic {
    border-left: none;
    border-right: 1px solid var(--c-coral);
    text-align: right;
}

.logic-line {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--c-deep);
    letter-spacing: 0.02em;
    line-height: 1.6;
}

.logic-line.therefore {
    color: var(--c-botanical);
    font-weight: 500;
    margin-top: 4px;
    border-top: 1px dashed rgba(90, 123, 90, 0.5);
    padding-top: 4px;
}

.logic-line.strike {
    color: var(--c-coral);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.entry-sprig {
    position: absolute;
    width: 120px;
    height: 80px;
    bottom: 18px;
    opacity: 0.85;
}

.entry-left .entry-sprig {
    right: 18px;
}

.entry-right .entry-sprig {
    left: 18px;
    transform: scaleX(-1);
}

.entry-sprig .sprig-path {
    stroke-dasharray: 320;
    stroke-dashoffset: 320;
    transition: stroke-dashoffset 1.6s ease 0.2s;
}

.entry-sprig circle {
    fill: var(--c-coral);
    fill-opacity: 0;
    transition: fill-opacity 0.6s ease 1.4s;
}

.entry.in-view .entry-sprig .sprig-path {
    stroke-dashoffset: 0;
}

.entry.in-view .entry-sprig circle {
    fill-opacity: 0.85;
}

/* ============================================================
   The Root System
   ============================================================ */
.roots-section {
    position: relative;
    width: 100%;
    padding: 14vh 0 16vh;
    overflow: hidden;
}

.roots-inner {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 6vw;
    text-align: center;
}

.roots-eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--c-teal);
    letter-spacing: 0.18em;
    text-transform: lowercase;
    margin-bottom: 1.2em;
}

.roots-title {
    font-family: var(--font-head);
    font-weight: 400;
    font-style: italic;
    color: var(--c-deep);
    font-size: clamp(26px, 3.4vw, 44px);
    line-height: 1.25;
    max-width: 22ch;
    margin: 0 auto 1.4em auto;
    letter-spacing: -0.005em;
}

.roots-body {
    font-family: var(--font-body);
    font-size: clamp(15px, 1.2vw, 17px);
    color: var(--c-deep);
    opacity: 0.86;
    max-width: 60ch;
    margin: 0 auto 6vh auto;
    line-height: 1.85;
}

.roots-body em {
    font-style: italic;
    color: var(--c-teal);
}

.root-diagram-wrap {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    aspect-ratio: 900 / 620;
}

.root-diagram {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.root-diagram .root-stroke {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2.4s ease;
}

.roots-section.in-view .root-diagram .root-stroke {
    stroke-dashoffset: 0;
}

.root-diagram .leaf {
    transform-origin: center;
    transform-box: fill-box;
    transform: scale(0);
    transition: transform 0.7s ease;
}

.roots-section.in-view .root-diagram .leaf {
    transform: scale(1);
}

.roots-section.in-view .root-diagram .leaf:nth-child(1) { transition-delay: 1.6s; }
.roots-section.in-view .root-diagram .leaf:nth-child(2) { transition-delay: 1.7s; }
.roots-section.in-view .root-diagram .leaf:nth-child(3) { transition-delay: 1.8s; }
.roots-section.in-view .root-diagram .leaf:nth-child(4) { transition-delay: 1.9s; }
.roots-section.in-view .root-diagram .leaf:nth-child(5) { transition-delay: 2.0s; }
.roots-section.in-view .root-diagram .leaf:nth-child(6) { transition-delay: 2.1s; }
.roots-section.in-view .root-diagram .leaf:nth-child(7) { transition-delay: 2.2s; }
.roots-section.in-view .root-diagram .leaf:nth-child(8) { transition-delay: 2.3s; }
.roots-section.in-view .root-diagram .leaf:nth-child(9) { transition-delay: 2.4s; }
.roots-section.in-view .root-diagram .leaf:nth-child(10) { transition-delay: 2.5s; }

.root-label-text,
.branch-label-text,
.leaf-label-text {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 1s ease 2.4s;
}

.roots-section.in-view .root-label-text,
.roots-section.in-view .branch-label-text,
.roots-section.in-view .leaf-label-text {
    opacity: 0.85;
}

.leaf-label-text {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 13px;
}

/* ============================================================
   Evening Page Footer
   ============================================================ */
.evening-page {
    position: relative;
    width: 100%;
    min-height: 60vh;
    overflow: hidden;
    color: var(--c-foam);
    padding: 12vh 0 8vh;
    text-align: center;
}

.evening-inner {
    position: relative;
    z-index: 2;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 6vw;
}

.evening-eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    color: rgba(232, 240, 232, 0.85);
    letter-spacing: 0.18em;
    text-transform: lowercase;
    margin-bottom: 1.2em;
}

.evening-text {
    font-family: var(--font-head);
    font-weight: 400;
    font-style: italic;
    color: rgba(232, 240, 232, 0.95);
    font-size: clamp(20px, 2.4vw, 30px);
    line-height: 1.35;
    margin-bottom: 6vh;
}

.evening-text em {
    font-style: italic;
    color: var(--c-coral);
}

.timeline-end {
    position: relative;
    width: 1px;
    height: 14vh;
    margin: 0 auto;
}

.timeline-line-evening {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(232, 240, 232, 0.55);
    transform: translateX(-50%);
}

.end-dot {
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--c-coral);
    transform: translateX(-50%);
    box-shadow: 0 0 0 4px rgba(212, 144, 122, 0.25);
}

.evening-meta {
    margin-top: 6vh;
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(232, 240, 232, 0.75);
    letter-spacing: 0.06em;
}

.evening-meta .meta-sep {
    color: rgba(212, 144, 122, 0.85);
    opacity: 1;
}

/* ============================================================
   Mobile / narrow widths
   ============================================================ */
@media (max-width: 760px) {
    .timeline-line {
        left: 22px;
        transform: none;
    }

    .entry {
        padding: 0 22px 0 50px;
    }

    .entry-card {
        width: 100%;
        text-align: left !important;
        margin: 0 !important;
        padding: 28px 24px 30px;
    }

    .entry-marker {
        left: 22px;
        transform: translateX(-50%) scale(0.6);
    }
    .entry.in-view .entry-marker {
        transform: translateX(-50%) scale(1);
    }

    .entry-right .entry-logic {
        border-right: none;
        border-left: 1px solid var(--c-coral);
        text-align: left;
    }

    .entry-right .entry-sprig {
        left: auto;
        right: 18px;
        transform: none;
    }

    .branch-decor {
        width: 110px;
        height: 460px;
        opacity: 0.55;
    }

    .branch-decor-left { transform: translateX(-30%); }
    .branch-decor-right { transform: translateX(30%) scaleX(-1); }

    .roots-title {
        font-size: clamp(22px, 6vw, 30px);
    }
}
