/* ============================================================
   haroo.day — wabi-sabi vertical narrative
   Palette: warm earth-tones, single cool celadon accent.
   ============================================================ */

:root {
    --rice-paper: #f5f0e8;
    --warm-mist: #ede5d8;
    --twilight-clay: #e8ddd0;
    --buncheong-gold: #d4a574;
    --repair-gold: #c9a84c;
    --iron-oxide: #8b5e3c;
    --celadon-mist: #a8b8a0;
    --ink-brown: #4a4540;
    --clay: #9a9080;
    --charcoal-earth: #3a3530;
    --moonlight-cream: #f5f0e8;

    --font-display: 'Cormorant Garamond', 'Lora', Georgia, serif;
    --font-body: 'Noto Serif JP', 'Lora', Georgia, serif;
    --font-cjk: 'Nanum Myeongjo', 'Noto Serif JP', serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'Menlo', monospace;

    --ease-zen: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

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

html, body {
    width: 100%;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--rice-paper);
    color: var(--ink-brown);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.1rem);
    line-height: 2.0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 1.4s var(--ease-zen), color 1.4s var(--ease-zen);
}

main {
    position: relative;
    z-index: 1;
}

/* ============================================================
   Time-of-day dot indicator
   ============================================================ */
.time-dots {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 50;
    mix-blend-mode: multiply;
}

.time-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0.35;
    transition: opacity 0.6s var(--ease-zen), transform 0.6s var(--ease-zen);
}

.time-dots .dot.active {
    opacity: 1;
    transform: scale(1.6);
}

.dot-dawn     { background: #d4a574; }
.dot-morning  { background: #c9a04c; }
.dot-noon     { background: #b8843c; }
.dot-afternoon{ background: #9a6b30; }
.dot-evening  { background: #6e4a28; }
.dot-night    { background: #3a3530; }

/* ============================================================
   Persistent grain overlay (ceramic surface)
   ============================================================ */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 40;
    opacity: 0;
    transition: opacity 1.6s var(--ease-zen);
    background-image:
        radial-gradient(circle at 13% 27%, rgba(74, 69, 64, 0.4) 0.5px, transparent 1px),
        radial-gradient(circle at 67% 41%, rgba(74, 69, 64, 0.35) 0.5px, transparent 1px),
        radial-gradient(circle at 81% 73%, rgba(74, 69, 64, 0.4) 0.5px, transparent 1px),
        radial-gradient(circle at 23% 84%, rgba(74, 69, 64, 0.35) 0.5px, transparent 1px),
        radial-gradient(circle at 49% 12%, rgba(74, 69, 64, 0.3) 0.5px, transparent 1px);
    background-size: 7px 7px, 11px 11px, 9px 9px, 13px 13px, 5px 5px;
    mix-blend-mode: multiply;
}

.grain-overlay.visible {
    opacity: 0.55;
}

/* ============================================================
   Sections — shared
   ============================================================ */
.section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: clamp(4rem, 10vh, 9rem) clamp(2rem, 6vw, 8rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 1.4s var(--ease-zen);
}

/* Kintsugi decorative gold lines */
.kintsugi {
    position: absolute;
    pointer-events: none;
    opacity: 0.4;
    fill: none;
    stroke: var(--repair-gold);
    stroke-width: 1.5;
    stroke-linecap: round;
}

.kintsugi-1 { top: 22%;  left: 0; width: 65%;  height: 4px; }
.kintsugi-2 { top: 0;   right: 8%; width: 4px; height: 70%; }
.kintsugi-3 { top: 12%;  left: 30%; width: 55%; height: 4px; }
.kintsugi-4 { top: 5%; left: 12%; width: 4px; height: 80%; }
.kintsugi-5 { top: 30%; left: 0; width: 70%; height: 4px; }
.kintsugi-6 { top: 18%; right: 0; width: 60%; height: 4px; }

/* SVG brush-stroke divider */
.brush-divider {
    width: clamp(220px, 32vw, 420px);
    height: 14px;
    fill: none;
    stroke: var(--iron-oxide);
    stroke-width: 6;
    stroke-linecap: round;
    opacity: 0.32;
    margin: clamp(3rem, 6vh, 5rem) 0;
    display: block;
}

.brush-1 { margin-left: 8%; }
.brush-2 { margin-left: 52%; }
.brush-3 { margin-left: 14%; }
.brush-4 { margin-left: 48%; }

/* Hangul watermark */
.hangul-watermark {
    position: absolute;
    font-family: var(--font-cjk);
    font-weight: 400;
    font-size: clamp(20rem, 40vw, 50rem);
    color: var(--ink-brown);
    opacity: 0.025;
    transform: rotate(-3deg);
    top: 8%;
    left: -6%;
    line-height: 0.9;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    z-index: 0;
}

.watermark-evening {
    top: auto;
    bottom: -8%;
    left: auto;
    right: -8%;
    transform: rotate(3deg);
    color: var(--ink-brown);
    opacity: 0.03;
}

/* Reveal animation base */
.reveal {
    opacity: 0;
    transform: translateY(0);
    transition: opacity 0.9s var(--ease-zen), transform 0.9s var(--ease-zen);
}

.reveal[data-side="left"]  { transform: translateX(-22px); }
.reveal[data-side="right"] { transform: translateX(22px); }

.reveal.in-view {
    opacity: 1;
    transform: translate(0, 0);
}

/* ============================================================
   SECTION 1 — DAWN
   ============================================================ */
.section-dawn {
    background-color: var(--rice-paper);
    justify-content: flex-end;
    padding-bottom: clamp(6rem, 18vh, 14rem);
    min-height: 100vh;
}

.dawn-content {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin-top: auto;
    padding-left: clamp(0rem, 4vw, 4rem);
}

.site-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(4rem, 10vw, 9rem);
    line-height: 1.05;
    letter-spacing: 0.04em;
    color: var(--ink-brown);
    text-transform: lowercase;
    display: inline-block;
    margin-bottom: clamp(2rem, 5vh, 4rem);
}

.site-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s var(--ease-zen), transform 0.5s var(--ease-zen);
}

.site-title .char.char-dot {
    color: var(--iron-oxide);
}

.site-title.lit .char {
    opacity: 1;
    transform: translateY(0);
}

.dawn-cjk {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
    opacity: 0;
    transition: opacity 0.6s var(--ease-zen) 0.1s;
}

.dawn-cjk.lit { opacity: 1; }

.cjk {
    font-family: var(--font-cjk);
    font-weight: 400;
    color: var(--ink-brown);
    font-size: 3rem;
    line-height: 1;
    letter-spacing: 0.05em;
}

.cjk-haru-jp {
    font-family: var(--font-body);
    color: var(--iron-oxide);
}

.horizon {
    display: block;
    width: 50%;
    height: 1.5px;
    margin-left: 30%;
    margin-top: 2rem;
}

.horizon path {
    fill: none;
    stroke: var(--iron-oxide);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 1.2s var(--ease-zen);
}

.horizon.drawn path {
    stroke-dashoffset: 0;
}

/* ============================================================
   SECTION 2-3 — MORNING
   ============================================================ */
.section-morning {
    background-color: var(--warm-mist);
    min-height: 200vh;
    justify-content: center;
    padding-top: clamp(8rem, 18vh, 14rem);
    padding-bottom: clamp(8rem, 18vh, 14rem);
}

.morning-blocks {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(3rem, 6vh, 6rem);
    z-index: 1;
}

.block {
    max-width: 40%;
}

.block-left   { align-self: flex-start; margin-left: 4%; }
.block-right  { align-self: flex-end;   margin-right: 8%; text-align: left; }
.block-left-2 { align-self: flex-start; margin-left: 12%; }

.block-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: 0.04em;
    color: var(--iron-oxide);
    margin-bottom: 1.2rem;
    text-transform: lowercase;
    line-height: 1.2;
}

.block-text {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--ink-brown);
    line-height: 2.0;
}

@media (max-width: 720px) {
    .block { max-width: 80%; }
    .block-left, .block-right, .block-left-2 {
        align-self: flex-start;
        margin-left: 4%;
        margin-right: 4%;
    }
}

/* ============================================================
   SECTION 4 — NOON
   ============================================================ */
.section-noon {
    background-color: var(--warm-mist);
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    position: relative;
}

.sun-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 0;
}

.implied-sun {
    width: clamp(200px, 40vw, 500px);
    height: clamp(200px, 40vw, 500px);
    border-radius: 50%;
    background: radial-gradient(circle at center,
        rgba(212, 165, 116, 0.55) 0%,
        rgba(212, 165, 116, 0.18) 35%,
        rgba(212, 165, 116, 0) 70%);
    animation: sun-breathe 8s var(--ease-zen) infinite;
}

@keyframes sun-breathe {
    0%, 100% { transform: scale(1.0); opacity: 1; }
    50%      { transform: scale(1.02); opacity: 0.92; }
}

.zen-fragments {
    position: relative;
    width: 100%;
    height: 70vh;
    max-width: 1200px;
    margin: 0 auto;
    z-index: 2;
}

.fragment {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 1.2rem;
    border-radius: 2px;
    transition: opacity 0.7s var(--ease-zen), transform 0.7s var(--ease-zen),
                box-shadow 0.5s var(--ease-zen);
    cursor: default;
}

.fragment.in-view {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.fragment:hover {
    box-shadow: 0 0 24px rgba(212, 165, 116, 0.3);
}

.frag-word {
    font-family: var(--font-cjk);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--ink-brown);
    letter-spacing: 0.06em;
}

.frag-meaning {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--clay);
    letter-spacing: 0.08em;
    text-transform: lowercase;
}

.seasonal-mark {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--iron-oxide);
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.5;
}

/* ============================================================
   SECTION 5-6 — AFTERNOON
   ============================================================ */
.section-afternoon {
    background-color: var(--twilight-clay);
    min-height: 200vh;
    justify-content: center;
    padding-top: clamp(8rem, 18vh, 14rem);
    padding-bottom: clamp(8rem, 18vh, 14rem);
}

.afternoon-rows {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(3rem, 6vh, 5rem);
    z-index: 1;
}

.row {
    display: grid;
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: start;
}

.row-narrow-wide { grid-template-columns: 1fr 2.5fr; }
.row-wide-narrow { grid-template-columns: 2.5fr 1fr; }

.col-narrow {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.4rem;
    border-left: 1px solid rgba(139, 94, 60, 0.3);
    padding-left: 1.4rem;
}

.col-narrow-right {
    border-left: none;
    border-right: 1px solid rgba(139, 94, 60, 0.3);
    padding-left: 0;
    padding-right: 1.4rem;
    text-align: right;
    align-items: flex-end;
}

.time-label, .date-label, .season-label {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.8rem;
    color: var(--clay);
    letter-spacing: 0.1em;
    text-transform: lowercase;
}

.time-label { color: var(--iron-oxide); font-size: 0.95rem; }

.col-wide p {
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 2.0;
    color: var(--ink-brown);
    max-width: 60ch;
}

@media (max-width: 720px) {
    .row-narrow-wide, .row-wide-narrow {
        grid-template-columns: 1fr;
    }
    .col-narrow, .col-narrow-right {
        text-align: left;
        align-items: flex-start;
        border-left: 1px solid rgba(139, 94, 60, 0.3);
        border-right: none;
        padding-left: 1.4rem;
        padding-right: 0;
    }
}

/* ============================================================
   SECTION 7 — EVENING
   ============================================================ */
.section-evening {
    background-color: var(--twilight-clay);
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.evening-content {
    position: relative;
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(2.5rem, 6vh, 5rem);
    z-index: 1;
}

.paper-photo {
    width: clamp(280px, 48vw, 540px);
    height: clamp(200px, 30vw, 340px);
    border-radius: 2px;
    background: linear-gradient(135deg,
        rgba(212, 165, 116, 0.18) 0%,
        rgba(201, 168, 76, 0.18) 50%,
        rgba(139, 94, 60, 0.20) 100%);
    filter: contrast(1.1) blur(0.5px);
    transition: filter 1.0s var(--ease-zen), background 1.0s var(--ease-zen);
    position: relative;
    overflow: hidden;
}

.paper-photo::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(74, 69, 64, 0.08), transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(168, 184, 160, 0.10), transparent 55%);
    mix-blend-mode: multiply;
}

.paper-photo::after {
    content: "";
    position: absolute;
    inset: -4px;
    border: 1px solid rgba(139, 94, 60, 0.18);
    border-radius: 2px;
    pointer-events: none;
}

.paper-photo:hover {
    filter: contrast(1.1) blur(0);
    background: linear-gradient(135deg,
        rgba(212, 165, 116, 0.25) 0%,
        rgba(201, 168, 76, 0.25) 50%,
        rgba(139, 94, 60, 0.28) 100%);
}

.evening-text {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.2rem, 2.2vw, 1.7rem);
    line-height: 1.7;
    color: var(--ink-brown);
    letter-spacing: 0.02em;
    max-width: 28ch;
}

/* ============================================================
   SECTION 8 — NIGHT
   ============================================================ */
.section-night {
    background-color: var(--charcoal-earth);
    color: var(--moonlight-cream);
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: clamp(4rem, 10vh, 9rem) clamp(2rem, 6vw, 8rem);
}

.section-night .kintsugi {
    opacity: 0.55;
}

.night-content {
    width: 100%;
    max-width: 1400px;
    margin-top: auto;
    margin-bottom: clamp(2rem, 6vh, 5rem);
    padding-right: clamp(0rem, 6vw, 6rem);
    text-align: right;
    align-self: flex-end;
}

.night-title {
    font-family: var(--font-cjk);
    font-weight: 400;
    margin-bottom: 2.5rem;
    line-height: 1;
}

.cjk-night {
    display: inline-block;
    font-size: clamp(4rem, 10vw, 9rem);
    color: var(--moonlight-cream);
    letter-spacing: 0.05em;
}

.cjk-night .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s var(--ease-zen), transform 0.5s var(--ease-zen);
}

.cjk-night.lit .char {
    opacity: 1;
    transform: translateY(0);
}

.horizon-night {
    margin-left: 0;
    margin-right: auto;
    width: 50%;
    margin-top: 1rem;
    margin-bottom: 2.5rem;
}

.horizon-night path {
    stroke: var(--repair-gold);
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    pathLength: 1;
    transition: stroke-dashoffset 1.2s var(--ease-zen);
}

.horizon-night.drawn path {
    stroke-dashoffset: 0;
}

.night-text {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    color: var(--clay);
    letter-spacing: 0.06em;
    opacity: 0;
    transition: opacity 1.0s var(--ease-zen) 0.4s;
}

.night-text.lit { opacity: 1; }

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
    }
    .reveal { opacity: 1 !important; transform: none !important; }
    .site-title .char,
    .cjk-night .char { opacity: 1 !important; transform: none !important; }
    .dawn-cjk, .night-text { opacity: 1 !important; }
    .horizon path { stroke-dashoffset: 0 !important; }
    .implied-sun { animation: none !important; }
}
