/* ==========================================================================
   haru.club — watercolor / botanical
   Palette
   --sakura-mist:    #F4C6D0
   --morning-wisteria:#B8A9D4
   --new-leaf:       #A8D8B9
   --rice-paper:     #FBF7F0
   --evening-iris:   #4A3F6B
   --apricot-dawn:   #F5C896
   --spring-rain:    #89C4E1
   --sumi-gray:      #3D3B3C
   --vermillion:     #C0392B
   ========================================================================== */

:root {
    --sakura-mist:        #F4C6D0;
    --morning-wisteria:   #B8A9D4;
    --new-leaf:           #A8D8B9;
    --rice-paper:         #FBF7F0;
    --evening-iris:       #4A3F6B;
    --apricot-dawn:       #F5C896;
    --spring-rain:        #89C4E1;
    --sumi-gray:          #3D3B3C;
    --vermillion:         #C0392B;

    /* Shifting ambient colour driven by JS */
    --ambient: var(--rice-paper);
    --ambient-accent: var(--sakura-mist);
    --ambient-text: var(--evening-iris);

    --font-display: "Shippori Mincho", "Inter", serif;
    --font-body:    "Zen Maru Gothic", "Inter", system-ui, sans-serif;
    --font-script:  "Caveat", "Inter", cursive;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--ambient);
    color: var(--evening-iris);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.8;
    overflow-x: hidden;
    transition: background-color 1200ms ease, color 1200ms ease;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--spring-rain); text-decoration: none; }
a:hover { color: var(--morning-wisteria); }

/* svg defs holder */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ==========================================================================
   Paper grain & ambient overlays
   ========================================================================== */

.paper-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.55;
    background-image:
      radial-gradient(1px 1px at 20% 30%, rgba(61,59,60,0.05) 50%, transparent 51%),
      radial-gradient(1px 1px at 60% 80%, rgba(61,59,60,0.05) 50%, transparent 51%),
      radial-gradient(1px 1px at 80% 10%, rgba(61,59,60,0.04) 50%, transparent 51%),
      radial-gradient(1px 1px at 30% 60%, rgba(61,59,60,0.04) 50%, transparent 51%),
      radial-gradient(1px 1px at 90% 50%, rgba(61,59,60,0.05) 50%, transparent 51%),
      radial-gradient(1px 1px at 10% 90%, rgba(61,59,60,0.04) 50%, transparent 51%);
    background-size: 220px 220px, 280px 280px, 320px 320px, 200px 200px, 260px 260px, 240px 240px;
    mix-blend-mode: multiply;
}

.petal-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    overflow: hidden;
}

.petal-field svg {
    position: absolute;
    will-change: transform, opacity;
}

.ink-wash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
}

.ink-wash svg {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   Rail navigation (constellation dots, fixed left)
   ========================================================================== */

.rail-nav {
    position: fixed;
    left: clamp(14px, 2.4vw, 32px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px 10px;
    border-radius: 32px;
    background: rgba(251, 247, 240, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 10px 30px -20px rgba(74, 63, 107, 0.4);
}

.rail-dot {
    width: 14px;
    height: 14px;
    display: block;
    position: relative;
    border-radius: 50%;
    background: transparent;
    transition: transform 320ms ease;
}
.rail-dot span {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--morning-wisteria);
    opacity: 0.45;
    transition: background 320ms ease, opacity 320ms ease, transform 320ms ease;
}
.rail-dot:hover span { opacity: 1; transform: scale(1.5); background: var(--vermillion); }
.rail-dot.active span {
    background: var(--vermillion);
    opacity: 1;
    transform: scale(1.7);
    box-shadow: 0 0 0 4px rgba(192,57,43,0.12);
}
.rail-dot::after {
    content: attr(data-label);
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    font-family: var(--font-script);
    font-size: 14px;
    color: var(--evening-iris);
    opacity: 0;
    transition: opacity 240ms ease, transform 240ms ease;
    white-space: nowrap;
    pointer-events: none;
}
.rail-dot:hover::after, .rail-dot.active::after {
    opacity: 0.85;
    transform: translateY(-50%) translateX(0);
}

/* ==========================================================================
   Generic panel
   ========================================================================== */

.panel {
    position: relative;
    min-height: 100vh;
    padding: clamp(72px, 10vh, 140px) clamp(32px, 6vw, 120px);
    z-index: 2;
}

.panel__heading {
    max-width: 760px;
    margin: 0 0 clamp(40px, 6vh, 80px);
}

.panel__heading--left { text-align: left; }

.panel__chapter {
    display: inline-block;
    font-family: var(--font-script);
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    color: var(--vermillion);
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.panel__title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    letter-spacing: 0.04em;
    color: var(--evening-iris);
    margin: 0 0 12px;
}

.panel__caption {
    display: block;
    font-family: var(--font-script);
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    color: var(--sumi-gray);
    opacity: 0.8;
}

/* ==========================================================================
   Dividers
   ========================================================================== */

.divider {
    position: relative;
    height: 80px;
    z-index: 2;
    margin-top: -1px;
    margin-bottom: -1px;
    pointer-events: none;
}
.divider svg { width: 100%; height: 100%; }
.divider--alt { transform: scaleY(-1); }

/* ==========================================================================
   Panel 1 — The Awakening
   ========================================================================== */

.panel--awakening {
    background: linear-gradient(180deg, var(--rice-paper) 0%, #fef3ee 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.awakening__decor {
    position: absolute;
    opacity: 0.35;
    pointer-events: none;
}
.awakening__decor--branch-tl { top: 6vh; left: 4vw; }
.awakening__decor--branch-br { bottom: 8vh; right: 4vw; }

.awakening__brushstroke {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(1100px, 90vw);
    transform: translate(-50%, -42%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 800ms ease;
}
.awakening__brushstroke svg { width: 100%; height: auto; }
.awakening__brushstroke.is-active { opacity: 1; }

#brushPath {
    stroke-dasharray: 2200;
    stroke-dashoffset: 2200;
    transition: stroke-dashoffset 1200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.awakening__brushstroke.is-active #brushPath {
    stroke-dashoffset: 0;
}

.awakening__title {
    position: relative;
    z-index: 3;
    transform: translateY(-30px);
}

.brand {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    letter-spacing: 0.04em;
    color: var(--evening-iris);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 800ms ease 200ms, transform 800ms ease 200ms;
    line-height: 1.1;
}
.brand.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.brand__main {
    position: relative;
    display: inline-block;
    background: linear-gradient(120deg, var(--evening-iris) 0%, var(--evening-iris) 60%, var(--morning-wisteria) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand__sub {
    margin: 18px 0 0;
    font-family: var(--font-script);
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--sumi-gray);
    min-height: 1.6em;
}
.brand__sub .ch {
    display: inline-block;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 320ms ease, transform 320ms ease;
}
.brand__sub .ch.is-visible {
    opacity: 0.9;
    transform: translateY(0);
}

.awakening__petal-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 360px;
    height: 360px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
}
.orbit-petal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: 0 0;
    animation: orbit 18s linear infinite;
    animation-delay: calc(var(--orbit-i) * -3.6s);
    opacity: 0.6;
}

@keyframes orbit {
    from { transform: rotate(0deg) translate(170px) rotate(0deg); }
    to   { transform: rotate(360deg) translate(170px) rotate(-360deg); }
}

.scroll-indicator {
    position: absolute;
    bottom: 6vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--sumi-gray);
    opacity: 0.7;
}
.scroll-indicator__text {
    font-family: var(--font-script);
    font-size: 14px;
    letter-spacing: 0.05em;
}
.scroll-petal {
    animation: petal-fall 2.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    transform-origin: center;
}
@keyframes petal-fall {
    0%   { transform: translateY(-8px) rotate(-12deg); opacity: 0.4; }
    50%  { transform: translateY(6px)  rotate(8deg);   opacity: 0.9; }
    100% { transform: translateY(20px) rotate(-6deg);  opacity: 0; }
}

/* ==========================================================================
   Panel 2 — The Garden (masonry)
   ========================================================================== */

.panel--garden {
    background:
      radial-gradient(900px 600px at 20% 0%, rgba(244,198,208,0.35) 0%, transparent 70%),
      radial-gradient(800px 500px at 90% 100%, rgba(137,196,225,0.30) 0%, transparent 70%),
      linear-gradient(180deg, #fef3ee 0%, #f6f0ff 100%);
}

.garden__grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 28px;
    max-width: 1280px;
    margin: 0 auto;
}

.card {
    position: relative;
    padding: 32px 30px 36px;
    background: rgba(251, 247, 240, 0.78);
    border-radius: 18px;
    color: var(--sumi-gray);
    box-shadow:
      0 18px 40px -28px rgba(74, 63, 107, 0.35),
      0 4px 14px -8px rgba(74, 63, 107, 0.18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--depth);
    opacity: 0;
    transform: scale(0.85) translateY(14px);
    transition: opacity 500ms cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 320ms ease;
    border: 1px solid rgba(184, 169, 212, 0.25);
}

.card.is-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.card:hover {
    transform: translateY(-4px) scale(1);
    box-shadow:
      0 24px 50px -28px var(--hue, rgba(74,63,107,0.4)),
      0 6px 18px -8px rgba(74, 63, 107, 0.2);
}

.card--torn::before {
    content: "";
    position: absolute;
    top: -8px; left: -6px; right: -6px;
    height: 22px;
    background: var(--hue, var(--sakura-mist));
    opacity: 0.55;
    border-radius: 18px 18px 30% 30% / 18px 18px 60% 60%;
    filter: url(#watercolor-bleed);
    z-index: -1;
}
.card--torn::after {
    content: "";
    position: absolute;
    bottom: -10px; left: -4px; right: -4px;
    height: 18px;
    background: var(--hue, var(--sakura-mist));
    opacity: 0.32;
    border-radius: 30% 30% 18px 18px / 60% 60% 18px 18px;
    filter: url(#watercolor-bleed);
    z-index: -1;
}

.card h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.35rem;
    letter-spacing: 0.03em;
    margin: 0 0 14px;
    color: var(--evening-iris);
}
.card p {
    margin: 0 0 16px;
    font-size: 16px;
    line-height: 1.75;
}
.card__date {
    font-family: var(--font-script);
    font-size: 14px;
    color: var(--vermillion);
    opacity: 0.85;
}
.card__hanko {
    position: absolute;
    width: 44px; height: 44px;
    top: 18px; right: 18px;
    opacity: 0.7;
    transform: rotate(-8deg);
}

/* irregular masonry placement */
.card--a { grid-column: 1 / span 5; margin-top: 0; }
.card--b { grid-column: 6 / span 4; margin-top: 40px; }
.card--c { grid-column: 10 / span 3; margin-top: 12px; }
.card--d { grid-column: 1 / span 4; margin-top: -20px; }
.card--e { grid-column: 5 / span 5; margin-top: 12px; }
.card--f { grid-column: 10 / span 3; margin-top: -10px; }

.garden__specimen {
    position: absolute;
    width: 380px; height: 380px;
    bottom: -120px;
    left: -80px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

@media (max-width: 1024px) {
    .card--a { grid-column: 1 / span 7; }
    .card--b { grid-column: 8 / span 5; margin-top: 30px; }
    .card--c { grid-column: 1 / span 5; margin-top: 0; }
    .card--d { grid-column: 6 / span 7; margin-top: 0; }
    .card--e { grid-column: 1 / span 7; margin-top: 0; }
    .card--f { grid-column: 8 / span 5; margin-top: 0; }
}
@media (max-width: 720px) {
    .garden__grid { grid-template-columns: 1fr; gap: 20px; }
    .card { grid-column: 1 / -1 !important; margin-top: 0 !important; }
    .garden__specimen { width: 240px; height: 240px; bottom: -50px; left: -50px; opacity: 0.25; }
}

/* ==========================================================================
   Panel 3 — The Collection (asymmetric two-column)
   ========================================================================== */

.panel--collection {
    background:
      radial-gradient(1000px 600px at 80% 20%, rgba(184,169,212,0.30) 0%, transparent 70%),
      radial-gradient(700px 500px at 0% 80%, rgba(245,200,150,0.25) 0%, transparent 70%),
      linear-gradient(180deg, #f6f0ff 0%, #fff6e8 100%);
}

.collection__grid {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: clamp(24px, 4vw, 64px);
    max-width: 1280px;
    margin: 0 auto;
}
.collection__col { display: flex; flex-direction: column; gap: 28px; }
.collection__col--narrow { padding-top: 120px; }

.tile {
    position: relative;
    padding: 30px 32px 34px;
    border-radius: 16px;
    background: rgba(251, 247, 240, 0.85);
    border: 1px solid rgba(184, 169, 212, 0.18);
    box-shadow:
      0 18px 40px -30px var(--tone, rgba(74,63,107,0.4)),
      0 6px 16px -10px rgba(74, 63, 107, 0.18);
    transition: transform 360ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 320ms ease;
    opacity: 0;
    transform: scale(0.85) translateY(14px);
}
.tile.is-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.tile:hover {
    transform: translateY(-4px);
    box-shadow:
      0 28px 50px -28px var(--tone, rgba(74,63,107,0.5)),
      0 8px 20px -8px rgba(74, 63, 107, 0.2);
}

.tile::before {
    content: "";
    position: absolute;
    top: -4px; left: 18px;
    width: 60%;
    height: 6px;
    background: var(--tone, var(--sakura-mist));
    opacity: 0.6;
    border-radius: 6px;
    filter: url(#soft-bleed);
}

.tile__label {
    display: inline-block;
    font-family: var(--font-script);
    font-size: 15px;
    color: var(--vermillion);
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}
.tile h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.2rem, 1.7vw, 1.6rem);
    letter-spacing: 0.03em;
    margin: 0 0 12px;
    color: var(--evening-iris);
}
.tile p {
    margin: 0 0 16px;
    font-size: 16px;
    color: var(--sumi-gray);
}
.tile__meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-script);
    font-size: 14px;
    color: var(--sumi-gray);
    opacity: 0.8;
}
.tile__hanko { width: 28px; height: 28px; }

.tile--wide { padding: 36px 40px 40px; }

@media (max-width: 900px) {
    .collection__grid { grid-template-columns: 1fr; }
    .collection__col--narrow { padding-top: 0; }
}

/* ==========================================================================
   Panel 4 — The Clearing
   ========================================================================== */

.panel--clearing {
    background-color: var(--apricot-dawn);
    animation: clearing-breath 20s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 110vh;
    overflow: hidden;
}

@keyframes clearing-breath {
    0%, 100% { background-color: #FBE4C9; }
    33%      { background-color: #F4D5DC; }
    66%      { background-color: #DFD6EE; }
}

.clearing__inner {
    position: relative;
    max-width: 880px;
    padding: 0 24px;
}
.clearing__chapter { color: var(--vermillion); }
.clearing__text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    line-height: 1.6;
    letter-spacing: 0.03em;
    color: var(--evening-iris);
    margin: 28px 0 0;
}
.clearing__text .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 400ms ease-out, transform 400ms ease-out;
    margin-right: 0.18em;
}
.clearing__text .word.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.clearing__flower {
    position: absolute;
    width: 360px; height: 360px;
    right: -80px; bottom: -160px;
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

/* ==========================================================================
   Panel 5 — The Twilight
   ========================================================================== */

.panel--twilight {
    background: linear-gradient(180deg, #6F5E9A 0%, #4A3F6B 60%, #2D2548 100%);
    color: #E9E2F2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.twilight__inner {
    width: 100%;
    max-width: 880px;
    text-align: center;
    padding: 40px 24px;
}
.twilight__chapter { color: var(--apricot-dawn); }
.twilight__title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    color: #F8EDE0;
    letter-spacing: 0.05em;
    margin: 14px 0 56px;
}

.constellation {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 600 / 360;
    margin: 0 auto 60px;
}
.constellation__lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #E9E2F2;
}
.star__dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--apricot-dawn);
    box-shadow: 0 0 16px 4px rgba(245,200,150,0.35);
    transition: transform 320ms ease, box-shadow 320ms ease;
    animation: twinkle 3.6s ease-in-out infinite;
}
.star:nth-child(2) .star__dot { animation-delay: -0.6s; }
.star:nth-child(3) .star__dot { animation-delay: -1.2s; }
.star:nth-child(4) .star__dot { animation-delay: -1.8s; }
.star:nth-child(5) .star__dot { animation-delay: -2.4s; }
.star:nth-child(6) .star__dot { animation-delay: -3.0s; }

@keyframes twinkle {
    0%, 100% { transform: scale(1);   opacity: 0.85; }
    50%      { transform: scale(1.3); opacity: 1;    }
}

.star__name {
    font-family: var(--font-script);
    font-size: 16px;
    color: #E9E2F2;
    opacity: 0.9;
    letter-spacing: 0.04em;
}
.star:hover .star__dot {
    transform: scale(1.6);
    box-shadow: 0 0 24px 6px rgba(245,200,150,0.55);
}
.star:hover .star__name { color: var(--sakura-mist); }

.twilight__foot {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: rgba(233, 226, 242, 0.7);
}
.twilight__sig {
    font-family: var(--font-body);
    font-size: 14px;
    letter-spacing: 0.06em;
}
.twilight__sig--alt { font-family: var(--font-script); font-size: 16px; opacity: 0.75; }

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .brand, .brand__sub .ch, .card, .tile, .clearing__text .word {
        opacity: 1; transform: none;
    }
}
