/* ============================================
   hwaglyul.com - Sepia Pop-Art Botanical Garden
   ============================================ */

:root {
    --bg-primary: #F5ECD7;
    --bg-alt: #EDE0C8;
    --surface: #D4C4A0;
    --text-primary: #3D2B1F;
    --text-secondary: #6B5744;
    --pop-terracotta: #C4573A;
    --pop-ochre: #D4943A;
    --pop-indigo: #4A5568;
    --marble-vein: #B8907A;
    --cream-light: #FAF6ED;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'EB Garamond', Georgia, serif;
    --font-label: 'Cormorant SC', Georgia, serif;
    --scroll-offset: 0px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ==== MARBLE TEXTURE (foundation) ==== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 30%, var(--surface) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, var(--surface) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, var(--marble-vein) 0%, transparent 45%),
        linear-gradient(18deg, transparent 40%, rgba(184, 144, 122, 0.08) 41%, transparent 42%),
        linear-gradient(162deg, transparent 55%, rgba(184, 144, 122, 0.06) 56%, transparent 57%),
        linear-gradient(25deg, transparent 30%, rgba(212, 196, 160, 0.06) 31%, transparent 32%);
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
    transform: translateY(calc(var(--scroll-offset) * -1));
    will-change: transform;
}

/* Noise grain overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

/* ==== SCROLL STEM (left edge progress) ==== */
.scroll-stem {
    position: fixed;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 12px;
    z-index: 100;
    pointer-events: none;
}

.stem-svg {
    width: 12px;
    height: 100%;
}

.stem-line {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 0.1s linear;
}

.stem-bud {
    transition: opacity 0.4s ease;
}

/* ==== SEED NAVIGATION ==== */
.seed-nav {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--pop-terracotta);
    background: var(--cream-light);
    cursor: pointer;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    box-shadow: 0 2px 12px rgba(61, 43, 31, 0.15);
}

.seed-nav:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(61, 43, 31, 0.25);
}

.seed-nav.active {
    transform: scale(1.1) rotate(45deg);
}

.seed-icon {
    pointer-events: none;
}

.seed-menu {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    z-index: 190;
    pointer-events: none;
}

.seed-link {
    position: absolute;
    left: 50%;
    top: 50%;
    width: auto;
    white-space: nowrap;
    font-family: var(--font-label);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--cream-light);
    border: 1px solid var(--surface);
    border-radius: 20px;
    padding: 6px 14px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
    transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(61, 43, 31, 0.12);
}

.seed-link:hover {
    color: var(--pop-terracotta);
    border-color: var(--pop-terracotta);
}

.seed-menu.open .seed-link {
    opacity: 1;
    pointer-events: auto;
    transform: translate(
        calc(-50% + cos(var(--angle)) * 80px),
        calc(-50% + sin(var(--angle)) * 80px)
    ) scale(1);
}

/* ==== HERO PETAL ==== */
.hero-petal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--bg-alt);
    clip-path: ellipse(85% 100% at 50% 0%);
    overflow: hidden;
    z-index: 1;
}

.hero-halftone {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--pop-ochre) 1.5px, transparent 1.5px);
    background-size: 14px 14px;
    opacity: 0.08;
}

.hero-marble {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 35% 45%, rgba(184, 144, 122, 0.15) 0%, transparent 55%),
        radial-gradient(ellipse at 65% 30%, rgba(212, 196, 160, 0.12) 0%, transparent 50%),
        linear-gradient(22deg, transparent 45%, rgba(184, 144, 122, 0.08) 46%, transparent 47%);
    opacity: 0.6;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.8rem, 8vw + 0.5rem, 7rem);
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.hero-line {
    display: block;
}

.hero-line--italic {
    font-weight: 300;
    font-style: italic;
    color: var(--pop-terracotta);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.hero-hangul {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--pop-ochre);
    margin-top: 1rem;
    opacity: 0.7;
    letter-spacing: 0.15em;
}

.hero-petal-clip {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 80px;
}

/* ==== CONTENT RIVER ==== */
.content-river {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==== PETAL SECTIONS ==== */
.petal-section {
    padding: 96px 0;
    max-width: 65%;
    position: relative;
}

.petal-left {
    margin-right: auto;
    margin-left: 0;
}

.petal-right {
    margin-left: auto;
    margin-right: 0;
}

.petal-inner {
    position: relative;
    padding: 2.5rem;
    background-color: var(--bg-alt);
    border-radius: 60% 40% 55% 45% / 50% 55% 45% 50%;
    background-image:
        radial-gradient(ellipse at 30% 40%, rgba(184, 144, 122, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(212, 196, 160, 0.15) 0%, transparent 50%);
    overflow: hidden;
}

.petal-right .petal-inner {
    border-radius: 45% 55% 40% 60% / 55% 45% 50% 50%;
}

/* Halftone dot hover on sections */
.petal-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: radial-gradient(circle, var(--pop-ochre) 1px, transparent 1px);
    background-size: 14px 14px;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
    pointer-events: none;
    z-index: 0;
}

.petal-inner:hover::before {
    opacity: 0.06;
    transform: scale(1.05);
}

/* Crystalline overlay variant */
.crystalline-overlay {
    clip-path: polygon(10% 0%, 90% 2%, 98% 15%, 95% 50%, 100% 80%, 88% 98%, 12% 100%, 2% 85%, 0% 50%, 5% 18%);
    border-radius: 0;
}

.crystalline-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(250, 246, 237, 0.08) 0%, transparent 40%, rgba(212, 196, 160, 0.06) 60%, transparent 100%);
    pointer-events: none;
    transition: background 0.5s ease;
}

.crystalline-overlay:hover::after {
    background: linear-gradient(135deg, rgba(250, 246, 237, 0.15) 0%, transparent 40%, rgba(196, 87, 58, 0.04) 60%, transparent 100%);
}

/* ==== TYPOGRAPHY ==== */
.section-label {
    font-family: var(--font-label);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pop-terracotta);
    display: block;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.8rem, 4vw + 0.5rem, 3.5rem);
    color: var(--text-primary);
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw + 0.4rem, 1.25rem);
    line-height: 1.75;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: 0.01em;
    position: relative;
    z-index: 1;
}

.pull-quote {
    margin: 2rem 0;
    padding-left: 1.5rem;
    border-left: 2px solid var(--pop-terracotta);
    position: relative;
    z-index: 1;
}

.pull-quote p {
    font-family: var(--font-display);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    line-height: 1.5;
    color: var(--text-primary);
}

.pull-quote cite {
    display: block;
    font-family: var(--font-label);
    font-size: 0.8rem;
    font-style: normal;
    text-align: right;
    margin-top: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

/* ==== FISH STREAM ==== */
.fish-stream {
    height: 80px;
    position: relative;
    overflow: hidden;
    margin: 1rem 0;
    background-image:
        linear-gradient(18deg, transparent 48%, rgba(184, 144, 122, 0.06) 49%, transparent 50%);
}

.fish {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

/* Forward-swimming fish */
.fish-a1 {
    animation: swimRight 12s linear infinite, bobVertical 3s ease-in-out infinite;
}

.fish-a2 {
    animation: swimRight 10s linear infinite, bobVertical 2.5s ease-in-out infinite;
    animation-delay: -4s, -1s;
    top: 30%;
}

.fish-a3 {
    animation: swimRight 14s linear infinite, bobVertical 3.5s ease-in-out infinite;
    animation-delay: -7s, -2s;
    top: 68%;
}

.fish-a4 {
    animation: swimRight 16s linear infinite, bobVertical 2.8s ease-in-out infinite;
    animation-delay: -11s, -0.5s;
    top: 48%;
}

/* Reverse-swimming fish */
.fish-stream--reverse .fish-b1 {
    animation: swimLeft 11s linear infinite, bobVertical 3.2s ease-in-out infinite;
    animation-delay: -2s, 0s;
}

.fish-stream--reverse .fish-b2 {
    animation: swimLeft 13s linear infinite, bobVertical 2.7s ease-in-out infinite;
    animation-delay: -6s, -1.5s;
    top: 62%;
}

.fish-stream--reverse .fish-b3 {
    animation: swimLeft 9s linear infinite, bobVertical 3s ease-in-out infinite;
    animation-delay: -3s, -0.8s;
    top: 35%;
}

@keyframes swimRight {
    0% { left: -80px; }
    100% { left: calc(100% + 80px); }
}

@keyframes swimLeft {
    0% { left: calc(100% + 80px); }
    100% { left: -80px; }
}

@keyframes bobVertical {
    0%, 100% { margin-top: 0; }
    50% { margin-top: -6px; }
}

/* ==== PRESSED FLOWER DIVIDER ==== */
.pressed-flower-divider {
    text-align: center;
    padding: 2rem 0;
    opacity: 0.6;
}

.pressed-flower-divider svg {
    max-width: 100%;
}

/* ==== ACCORDION BLOOM ==== */
.accordion-bloom {
    padding: 60px 0;
    position: relative;
}

.bloom-path {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    position: relative;
}

/* SVG meandering connector via pseudo */
.bloom-path::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: linear-gradient(to bottom,
        transparent,
        var(--surface) 10%,
        var(--surface) 90%,
        transparent
    );
    transform: translateX(-50%);
    opacity: 0.5;
}

.bloom-bud {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    cursor: pointer;
}

.bud-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-alt);
    border: 2px solid var(--pop-terracotta);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.bud-circle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-image: radial-gradient(circle, var(--pop-ochre) 0.8px, transparent 0.8px);
    background-size: 6px 6px;
    opacity: 0.15;
}

.bud-label {
    font-family: var(--font-label);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pop-terracotta);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    position: absolute;
}

.bloom-bud:hover .bud-circle,
.bloom-bud.open .bud-circle {
    width: 100%;
    max-width: 520px;
    height: auto;
    min-height: 48px;
    border-radius: 60% 40% 55% 45% / 50% 55% 45% 50%;
    padding: 1rem 1.5rem;
    border-color: var(--pop-ochre);
}

.bloom-bud:hover .bud-label,
.bloom-bud.open .bud-label {
    opacity: 1;
    position: relative;
}

.bloom-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease, padding 0.4s ease;
    opacity: 0;
    padding: 0 1.5rem;
}

.bloom-bud.open .bloom-content {
    max-height: 400px;
    opacity: 1;
    padding: 1rem 1.5rem 0.5rem;
}

/* ==== GALLERY POND ==== */
.gallery-pond {
    position: relative;
    height: 320px;
    margin: 3rem 0;
}

.pond-circle {
    position: absolute;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 40% 35%, rgba(250, 246, 237, 0.6) 0%, transparent 70%),
        radial-gradient(ellipse at 60% 65%, rgba(184, 144, 122, 0.1) 0%, transparent 60%),
        var(--bg-alt);
    border: 1px solid var(--surface);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.pond-circle:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 24px rgba(184, 144, 122, 0.2);
}

.pond-circle--lg {
    width: 120px;
    height: 120px;
}

.pond-circle--md {
    width: 80px;
    height: 80px;
}

.pond-circle--sm {
    width: 56px;
    height: 56px;
}

.pond-circle--xs {
    width: 36px;
    height: 36px;
}

.pond-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.pond-fish {
    position: absolute;
    pointer-events: none;
}

/* ==== FOOTER MEADOW ==== */
.footer-meadow {
    position: relative;
    padding: 6rem 2rem 4rem;
    text-align: center;
    background-color: var(--bg-alt);
    margin-top: 4rem;
    overflow: hidden;
    z-index: 1;
}

.meadow-grass {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-alt));
}

.footer-halftone {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--pop-ochre) 1px, transparent 1px);
    background-size: 14px 14px;
    opacity: 0.03;
}

.footer-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
}

.footer-domain {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--pop-terracotta);
    margin-bottom: 0.5rem;
    letter-spacing: 0.04em;
}

.footer-hangul {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 1.1rem;
    color: var(--pop-ochre);
    margin-bottom: 1.5rem;
    letter-spacing: 0.2em;
    opacity: 0.7;
}

.footer-colophon {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-style: italic;
}

/* ==== FADE REVEAL ==== */
.fade-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fade-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
    .petal-section {
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    .petal-inner {
        border-radius: 24px;
        padding: 2rem 1.5rem;
    }

    .petal-right .petal-inner {
        border-radius: 24px;
    }

    .crystalline-overlay {
        clip-path: none;
        border-radius: 24px;
    }

    .hero-petal {
        clip-path: none;
    }

    .gallery-pond {
        height: 220px;
    }

    .pond-circle--lg { width: 80px; height: 80px; }
    .pond-circle--md { width: 60px; height: 60px; }
    .pond-circle--sm { width: 40px; height: 40px; }
    .pond-circle--xs { width: 28px; height: 28px; }

    .scroll-stem {
        left: 8px;
    }

    .seed-menu.open .seed-link {
        transform: translate(
            calc(-50% + cos(var(--angle)) * 64px),
            calc(-50% + sin(var(--angle)) * 64px)
        ) scale(1);
    }

    .bloom-bud:hover .bud-circle,
    .bloom-bud.open .bud-circle {
        border-radius: 24px;
    }
}

@media (max-width: 480px) {
    .content-river {
        padding: 0 1rem;
    }

    .petal-section {
        max-width: 100%;
        padding: 48px 0;
    }

    .petal-inner {
        padding: 1.5rem 1rem;
    }

    .body-text {
        font-size: 1rem;
    }

    .fish-stream {
        height: 60px;
    }

    .gallery-pond {
        height: 180px;
    }

    .scroll-stem {
        display: none;
    }

    .seed-nav {
        width: 40px;
        height: 40px;
        bottom: 16px;
        right: 16px;
    }

    .seed-menu.open .seed-link {
        transform: translate(
            calc(-50% + cos(var(--angle)) * 56px),
            calc(-50% + sin(var(--angle)) * 56px)
        ) scale(0.9);
    }

    .bloom-bud:hover .bud-circle,
    .bloom-bud.open .bud-circle {
        border-radius: 20px;
    }

    .accordion-bloom {
        padding: 40px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fish {
        animation: none !important;
    }

    .fade-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .stem-line {
        transition: none;
    }

    .bud-circle {
        transition: none;
    }

    .bloom-content {
        transition: none;
    }
}
