/* namu.day — japanese-minimal sumi-e meditation */

:root {
    --rice-paper: #f8f5f0;
    --sumi-ink: #1a1a1a;
    --diluted-ink: #5c5c5c;
    --bark-wash: #8b7355;
    --stone-gray: #e8e2d8;
    --aged-paper: #d4c4a0;
    --deep-ink: #2d2d2d;

    --font-display: "Noto Serif JP", "Source Serif 4", serif;
    --font-body: "Source Serif 4", "Noto Serif JP", serif;
    --font-label: "Zen Kaku Gothic New", system-ui, sans-serif;

    --col-max: 480px;
    --section-gap: 30vh;
}

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

html {
    scroll-behavior: smooth;
    background: var(--rice-paper);
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 2.0;
    color: var(--sumi-ink);
    background: var(--rice-paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ---------- Layout ---------- */
.scroll {
    width: 100%;
    max-width: var(--col-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 6rem 0 4rem;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.hero-label {
    font-family: var(--font-label);
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: var(--diluted-ink);
    text-transform: lowercase;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeInSoft 2.4s ease forwards 0.2s;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2.4rem, 8vw, 4.2rem);
    line-height: 1.2;
    color: var(--deep-ink);
    letter-spacing: -0.01em;
    opacity: 0;
    transform: translateY(12px);
    animation: fadeInSoft 2.6s ease forwards 0.6s;
}

.hero-title .dot {
    color: var(--bark-wash);
    font-weight: 400;
}

.hero-sub {
    font-family: var(--font-display);
    font-weight: 300;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--diluted-ink);
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeInSoft 2.8s ease forwards 1.0s;
}

.trunk-line {
    width: 1px;
    height: 40vh;
    margin: 3rem auto 0;
    background: linear-gradient(to bottom, var(--sumi-ink), transparent);
    transform-origin: top center;
    transform: scaleY(0);
    animation: drawTrunk 2.8s cubic-bezier(0.4, 0, 0.2, 1) forwards 1.2s;
}

.hero-date {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-label);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    color: var(--diluted-ink);
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInSoft 2s ease forwards 2.4s;
}

/* ---------- Ink blot section markers ---------- */
.ink-blot {
    width: 6px;
    height: 6px;
    margin: var(--section-gap) auto;
    background: var(--sumi-ink);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 1.6s ease, transform 1.6s ease;
}

.ink-blot.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* ---------- Tree sections ---------- */
.tree-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    padding: 0 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.8s ease, transform 1.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.tree-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.species-meta {
    font-family: var(--font-label);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--diluted-ink);
    text-transform: lowercase;
}

.species-name {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    line-height: 1.4;
    color: var(--deep-ink);
    letter-spacing: 0.01em;
    margin-top: 0.25rem;
}

.contemplation {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 2.0;
    color: var(--sumi-ink);
    max-width: 36ch;
    margin: 0.5rem auto 1rem;
    font-style: italic;
}

/* ---------- Tree shapes ---------- */
.tree-shape {
    position: relative;
    width: 140px;
    height: 200px;
    margin: 1.5rem auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.tree-shape .canopy {
    background: var(--bark-wash);
    opacity: 0.3;
    transition: opacity 1.6s ease, transform 1.6s ease;
    transform: scale(0.92);
    transform-origin: bottom center;
}

.tree-section.is-visible .tree-shape .canopy {
    opacity: 0.32;
    transform: scale(1);
}

.tree-shape .trunk {
    width: 2px;
    height: 60px;
    background: var(--bark-wash);
    opacity: 0.55;
    margin-top: -2px;
}

/* round canopy (oak-like) */
.tree-round .canopy {
    width: 110px;
    height: 110px;
    border-radius: 50%;
}

.tree-round-small .canopy {
    width: 90px;
    height: 90px;
    border-radius: 50%;
}

/* umbrella (zelkova) */
.tree-umbrella .canopy {
    width: 130px;
    height: 70px;
    border-radius: 50% 50% 0 0;
}

/* conifer (pine) */
.tree-conifer .canopy {
    width: 110px;
    height: 130px;
    background: var(--bark-wash);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    border-radius: 0;
}

/* fan (ginkgo) — inverted umbrella */
.tree-fan .canopy {
    width: 120px;
    height: 90px;
    border-radius: 0 0 50% 50%;
}

/* weeping (willow) — tall ellipse with drips */
.tree-weeping {
    height: 220px;
}

.tree-weeping .canopy {
    width: 100px;
    height: 130px;
    border-radius: 50% 50% 60% 60% / 40% 40% 100% 100%;
}

.tree-weeping .trunk {
    height: 50px;
}

/* tall (bamboo) */
.tree-tall {
    height: 230px;
}

.tree-tall .canopy {
    width: 24px;
    height: 170px;
    border-radius: 12px 12px 4px 4px;
    background: var(--bark-wash);
}

.tree-tall .trunk {
    height: 40px;
    width: 2px;
}

/* ---------- Archive ---------- */
.archive {
    margin-top: var(--section-gap);
    padding: 2rem 0 3rem;
    text-align: center;
    border-top: 1px solid var(--stone-gray);
}

.archive-label {
    font-family: var(--font-label);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--diluted-ink);
    text-transform: lowercase;
    margin-bottom: 2rem;
    padding-top: 2rem;
}

.archive-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
}

.archive-list li {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 0.95rem;
    color: var(--diluted-ink);
    letter-spacing: 0.02em;
    transition: color 0.6s ease, letter-spacing 0.6s ease;
    cursor: default;
}

.archive-list li:hover {
    color: var(--sumi-ink);
    letter-spacing: 0.05em;
}

.archive-list li .day-num {
    font-family: var(--font-label);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--bark-wash);
    margin-right: 0.8rem;
}

/* ---------- Footer ---------- */
.site-foot {
    margin-top: var(--section-gap);
    padding: 4rem 0 6rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.foot-line {
    font-family: var(--font-display);
    color: var(--diluted-ink);
    font-size: 1.2rem;
    line-height: 1;
}

.foot-text {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 2.0;
    color: var(--diluted-ink);
}

.foot-mark {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 1.6rem;
    color: var(--bark-wash);
    background: var(--aged-paper);
    width: 56px;
    height: 56px;
    line-height: 56px;
    border-radius: 4px;
    opacity: 0.85;
    letter-spacing: 0;
    user-select: none;
    transition: transform 1.2s ease, opacity 1.2s ease;
}

.foot-mark:hover {
    transform: rotate(-4deg);
    opacity: 1;
}

/* ---------- Animations ---------- */
@keyframes fadeInSoft {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes drawTrunk {
    from {
        transform: scaleY(0);
    }
    to {
        transform: scaleY(1);
    }
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.32;
    }
    50% {
        transform: scale(1.015);
        opacity: 0.36;
    }
}

.tree-section.is-visible .tree-shape .canopy {
    animation: breathe 8s ease-in-out infinite;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .trunk-line { transform: scaleY(1); }
    .hero-label, .hero-title, .hero-sub, .hero-date { opacity: 1; transform: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 540px) {
    :root {
        --section-gap: 22vh;
    }
    .scroll {
        padding: 0 1.25rem;
    }
    .hero {
        padding-top: 4rem;
    }
    .trunk-line {
        height: 30vh;
    }
    .contemplation {
        max-width: 32ch;
    }
}

@media (min-width: 900px) {
    .hero-title {
        font-size: clamp(3rem, 6vw, 5rem);
    }
}
