/* ================================================
   yongjoon.xyz - Goblincore Botanical Cabinet
   Aurora Gradient + Pastoral Romantic
   ================================================ */

/* CSS Custom Properties */
:root {
    --deep-forest: #1a2e1a;
    --moss-velvet: #2d5a3d;
    --twilight-violet: #4a2d6b;
    --aurora-green: #5ce0a0;
    --aurora-pink: #e85d9c;
    --parchment-mist: #f2ede3;
    --lantern-gold: #d4a843;

    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-accent: 'Space Grotesk', sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-forest);
    color: var(--parchment-mist);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* Noise Texture Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Vine Border */
#vine-border {
    position: fixed;
    top: 0;
    left: 0;
    width: 50px;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    opacity: 0.6;
}

#vine-path-left {
    stroke-dasharray: 4000;
    stroke-dashoffset: 4000;
    transition: stroke-dashoffset 0.1s linear;
}

.vine-leaf {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.3s ease;
}

.vine-leaf.visible {
    stroke-dashoffset: 0;
}

/* Navigation */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    transition: transform 0.4s ease, opacity 0.4s ease;
    background: linear-gradient(to bottom, rgba(26, 46, 26, 0.9), transparent);
}

#main-nav.nav-hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.03em;
    color: var(--lantern-gold);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--parchment-mist);
    text-decoration: none;
    position: relative;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--aurora-green);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease-out;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* Hero Section */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-aurora {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--aurora-green) 0%, var(--twilight-violet) 50%, var(--aurora-pink) 100%);
    opacity: 0.25;
    animation: auroraShift 12s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes auroraShift {
    0% {
        background: linear-gradient(135deg, var(--aurora-green) 0%, var(--twilight-violet) 50%, var(--aurora-pink) 100%);
        opacity: 0.25;
    }
    33% {
        background: linear-gradient(200deg, var(--aurora-pink) 0%, var(--aurora-green) 50%, var(--twilight-violet) 100%);
        opacity: 0.3;
    }
    66% {
        background: linear-gradient(80deg, var(--twilight-violet) 0%, var(--aurora-pink) 50%, var(--aurora-green) 100%);
        opacity: 0.2;
    }
    100% {
        background: linear-gradient(300deg, var(--aurora-green) 0%, var(--aurora-pink) 50%, var(--twilight-violet) 100%);
        opacity: 0.28;
    }
}

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

.hero-title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.03em;
    line-height: 1.4;
    color: var(--parchment-mist);
    min-height: 1.4em;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    animation: letterFadeIn 0.5s ease forwards;
}

@keyframes letterFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--lantern-gold);
    margin-top: 1.5rem;
    min-height: 1.75em;
    opacity: 0.9;
}

.hero-subtitle .cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--lantern-gold);
    margin-left: 2px;
    animation: cursorBlink 0.8s ease-in-out infinite;
    vertical-align: text-bottom;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.botanical-divider {
    width: clamp(200px, 50vw, 400px);
    margin: 2rem auto;
    opacity: 0.7;
    position: relative;
    z-index: 2;
}

/* Fish Ambient Animations */
.fish {
    position: absolute;
    opacity: 0.4;
    transition: opacity 0.3s ease, transform 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1;
    pointer-events: auto;
    cursor: default;
}

.fish:hover {
    opacity: 1;
}

.fish.darting {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.fish-hero-1 {
    width: 50px;
    top: 30%;
    left: -60px;
    animation: fishSwim1 28s linear infinite;
}

.fish-hero-2 {
    width: 40px;
    top: 55%;
    right: -50px;
    animation: fishSwim2 35s linear infinite;
    animation-direction: reverse;
}

.fish-hero-3 {
    width: 35px;
    top: 70%;
    left: -45px;
    animation: fishSwim3 22s linear infinite;
}

@keyframes fishSwim1 {
    0% { transform: translateX(-60px) rotate(0deg); }
    25% { transform: translateX(calc(25vw)) rotate(3deg); }
    50% { transform: translateX(calc(50vw)) rotate(-2deg); }
    75% { transform: translateX(calc(75vw)) rotate(3deg); }
    100% { transform: translateX(calc(100vw + 60px)) rotate(0deg); }
}

@keyframes fishSwim2 {
    0% { transform: translateX(60px) scaleX(-1) rotate(0deg); }
    25% { transform: translateX(calc(-25vw)) scaleX(-1) rotate(-3deg); }
    50% { transform: translateX(calc(-50vw)) scaleX(-1) rotate(2deg); }
    75% { transform: translateX(calc(-75vw)) scaleX(-1) rotate(-3deg); }
    100% { transform: translateX(calc(-100vw - 60px)) scaleX(-1) rotate(0deg); }
}

@keyframes fishSwim3 {
    0% { transform: translateX(-45px) rotate(0deg); }
    50% { transform: translateX(calc(50vw)) rotate(4deg); }
    100% { transform: translateX(calc(100vw + 45px)) rotate(0deg); }
}

.fish-card {
    width: 30px;
    bottom: 12px;
    right: 12px;
    opacity: 0.25;
    animation: fishCardDrift 15s ease-in-out infinite alternate;
}

@keyframes fishCardDrift {
    0% { transform: translateX(0) rotate(0deg); }
    50% { transform: translateX(-20px) rotate(-5deg); }
    100% { transform: translateX(10px) rotate(3deg); }
}

.fish-about-1 {
    width: 45px;
    top: 20%;
    right: 5%;
    animation: fishSwim1 32s linear infinite;
}

.fish-about-2 {
    width: 35px;
    bottom: 15%;
    left: 3%;
    animation: fishSwim3 26s linear infinite;
}

.fish-footer-1, .fish-footer-2, .fish-footer-3 {
    position: relative;
    display: inline-block;
    width: 35px;
    opacity: 0.4;
    animation: fishFooterSwim 20s linear infinite;
}

.fish-footer-2 { animation-delay: -7s; width: 28px; }
.fish-footer-3 { animation-delay: -14s; width: 32px; }

@keyframes fishFooterSwim {
    0% { transform: translateX(-20px) rotate(0deg); }
    50% { transform: translateX(20px) rotate(3deg); }
    100% { transform: translateX(-20px) rotate(0deg); }
}

/* Sections Common */
#collections, #writings, #about {
    position: relative;
    padding: clamp(2rem, 5vw, 6rem);
    padding-left: clamp(3rem, 6vw, 7rem);
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 3rem;
}

.section-label {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--aurora-green);
    display: block;
    margin-bottom: 0.5rem;
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.03em;
    line-height: 1.4;
    color: var(--parchment-mist);
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.card {
    position: relative;
    background: radial-gradient(circle at center, var(--parchment-mist), #e8e0d3);
    color: var(--deep-forest);
    border-radius: 12px;
    padding: 2rem;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    border: 1px solid rgba(45, 90, 61, 0.2);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(92, 224, 160, 0.15), 0 4px 12px rgba(232, 93, 156, 0.1);
}

.card-tall {
    grid-row: span 2;
}

.card-wide {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .card-wide {
        grid-column: span 1;
    }
}

.card-ornament {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.5;
}

.card-ornament-tl {
    top: 8px;
    left: 8px;
}

.card-ornament-br {
    bottom: 8px;
    right: 8px;
}

.card-tag {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--moss-velvet);
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 2px 8px;
    border: 1px solid var(--moss-velvet);
    border-radius: 3px;
}

.card-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: 0.03em;
    line-height: 1.4;
    color: var(--deep-forest);
    margin-bottom: 0.75rem;
}

.card-body {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.65;
    color: #3a3a2e;
    margin-bottom: 1rem;
}

.card-date {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--twilight-violet);
    opacity: 0.7;
}

/* Card appear animation */
.card {
    opacity: 0;
    transform: translateY(30px);
}

.card.card-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.card.card-visible:hover {
    transform: translateY(-4px);
}

/* Writings Section */
.writings-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.writing-entry {
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(212, 168, 67, 0.15);
    opacity: 0;
    transform: translateY(20px);
}

.writing-entry.entry-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.writing-date {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--aurora-green);
    display: block;
    margin-bottom: 0.5rem;
}

.writing-title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-style: italic;
    font-size: 1.6rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.writing-title a {
    color: var(--parchment-mist);
    text-decoration: none;
}

/* Wavy Link Underline Draw */
.wavy-link {
    position: relative;
    display: inline;
}

.wavy-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8'%3E%3Cpath d='M 0 4 Q 12 0 25 4 Q 38 8 50 4 Q 62 0 75 4 Q 88 8 100 4' fill='none' stroke='%235ce0a0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 40px 6px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease-out;
}

.wavy-link:hover::after {
    transform: scaleX(1);
}

.writing-excerpt {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(242, 237, 227, 0.7);
}

/* About Section */
.about-content {
    position: relative;
    max-width: 700px;
}

.about-body {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--parchment-mist);
    margin-bottom: 1.5rem;
}

.pull-quote {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--lantern-gold);
    border-left: 3px solid var(--aurora-green);
    padding-left: 1.5rem;
    margin: 2rem 0;
    opacity: 0.9;
}

/* Footer */
#footer {
    padding: 3rem clamp(2rem, 5vw, 6rem);
    text-align: center;
    position: relative;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-vine {
    width: clamp(200px, 40vw, 400px);
    margin: 0 auto 1.5rem;
    opacity: 0.5;
}

.footer-text {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 0.95rem;
    color: rgba(242, 237, 227, 0.5);
    letter-spacing: 0.03em;
}

.footer-fish-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

/* Card Overlay */
.card-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 46, 26, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.card-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.overlay-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--parchment-mist);
    font-size: 2rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    font-family: var(--font-heading);
}

.overlay-close:hover {
    color: var(--aurora-green);
}

.overlay-content {
    max-width: 700px;
    padding: 3rem;
    background: radial-gradient(circle at center, var(--parchment-mist), #e8e0d3);
    border-radius: 12px;
    color: var(--deep-forest);
    transform: scale(0.9);
    transition: transform 0.4s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.card-overlay.active .overlay-content {
    transform: scale(1);
}

.overlay-content .card-tag {
    margin-bottom: 1rem;
}

.overlay-content .card-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.overlay-content .card-body {
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 1.5rem;
}

.overlay-content .card-date {
    display: block;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    #vine-border {
        display: none;
    }

    #collections, #writings, #about {
        padding-left: clamp(1.5rem, 4vw, 3rem);
        padding-right: clamp(1.5rem, 4vw, 3rem);
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .card-tall {
        grid-row: span 1;
    }

    .nav-links {
        gap: 1rem;
    }

    .hero-title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
}

/* Hero dimming on scroll */
#hero.hero-scrolled .hero-aurora {
    opacity: 0.1;
    transition: opacity 0.8s ease;
}
