/* ============================================
   yongjoon.xyz - Sepia Vaporwave Elegy
   ============================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #F5E6D0;
    color: #2C1810;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Sidebar --- */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: #3D2E1F;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 30px;
    overflow: hidden;
}

#sidebar-wave-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
    pointer-events: none;
}

#sidebar-wave-bg svg {
    width: 100%;
    height: 100%;
}

.sidebar-wave-path {
    animation: sidebarWaveOscillate 8s ease-in-out infinite;
}

.sidebar-wave-path.delay1 { animation-delay: -1.6s; }
.sidebar-wave-path.delay2 { animation-delay: -3.2s; }
.sidebar-wave-path.delay3 { animation-delay: -4.8s; }
.sidebar-wave-path.delay4 { animation-delay: -6.4s; }

@keyframes sidebarWaveOscillate {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

#sidebar-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: 1.1rem;
    color: #E8DCC8;
    letter-spacing: 0.15em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

#sidebar-separator {
    width: 80%;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

#sidebar-separator svg {
    width: 100%;
    height: 20px;
}

#sidebar-nav {
    list-style: none;
    width: 100%;
    position: relative;
    z-index: 1;
}

#sidebar-nav li {
    text-align: center;
}

.nav-rule {
    height: 1px;
    background-color: #B8956A;
    opacity: 0.4;
    margin: 8px 10px;
}

.nav-link {
    font-family: 'Lora', Georgia, serif;
    font-weight: 500;
    font-variant: small-caps;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: #E8DCC8;
    text-decoration: none;
    display: block;
    padding: 10px 0;
    position: relative;
    transition: color 0.4s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    background-image: linear-gradient(#D4A04A, #D4A04A);
    background-size: 0% 1px;
    background-repeat: no-repeat;
    background-position: center bottom 6px;
    transition: background-size 0.4s cubic-bezier(0.25, 0.1, 0.25, 1.0), color 0.4s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.nav-link:hover,
.nav-link.active {
    color: #D4A04A;
    background-size: 60% 1px;
}

/* --- Mobile Menu Toggle --- */
#menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 200;
    background: #3D2E1F;
    border: 1px solid #B8956A;
    border-radius: 4px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
}

#menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #E8DCC8;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

#menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

#menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Main Content --- */
#content {
    margin-left: 280px;
    min-height: 100vh;
}

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

#hero-waves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#hero-waves svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#wave-layer-1 {
    animation: waveFloat1 12s ease-in-out infinite;
}

#wave-layer-2 {
    animation: waveFloat2 15s ease-in-out infinite;
}

#wave-layer-3 {
    animation: waveFloat3 18s ease-in-out infinite;
}

@keyframes waveFloat1 {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-15px) translateX(10px); }
    50% { transform: translateY(10px) translateX(-5px); }
    75% { transform: translateY(-5px) translateX(15px); }
}

@keyframes waveFloat2 {
    0%, 100% { transform: translateY(0) translateX(0); }
    33% { transform: translateY(20px) translateX(-15px); }
    66% { transform: translateY(-10px) translateX(10px); }
}

@keyframes waveFloat3 {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-20px) translateX(-20px); }
}

#hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 40px;
}

#hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    letter-spacing: 0.02em;
    color: #2C1810;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeIn 1.2s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0.3s forwards;
}

#hero-tagline {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    color: #6B4E37;
    letter-spacing: 0.03em;
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeIn 1.2s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0.8s forwards;
}

@keyframes heroFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Wave Dividers --- */
.wave-divider {
    padding: 20px 60px;
    overflow: hidden;
    /* Sepia Ink (#8B6914) used for wave strokes */
    --wave-stroke: #8B6914;
}

.wave-divider svg {
    width: 100%;
    height: 40px;
}

.divider-wave {
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.divider-wave.drawn {
    stroke-dashoffset: 0;
}

/* --- Plates (General) --- */
.plate {
    min-height: 80vh;
    position: relative;
}

.plate-inner {
    padding: 80px 60px 80px 120px;
    max-width: 1100px;
}

.section-header {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    letter-spacing: 0.02em;
    color: #2C1810;
    margin-bottom: 40px;
    position: relative;
}

.section-header::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background-color: #C4743A;
    margin-top: 12px;
}

/* --- First Plate: Text --- */
.text-plate {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.text-block {
    max-width: 60ch;
}

.text-block p {
    margin-bottom: 1.5em;
    color: #2C1810;
}

.reveal-line {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1.0), transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    position: relative;
    background-image: linear-gradient(#C4743A, #C4743A);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
}

.reveal-line.visible {
    opacity: 1;
    transform: translateY(0);
    background-size: 100% 2px;
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1.0), transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1.0), background-size 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0.4s;
}

/* --- Second Plate: Illustration --- */
.illustration-plate {
    min-height: 120vh;
    display: flex;
    align-items: center;
}

.illustration-layout {
    display: flex;
    align-items: center;
    gap: 40px;
    padding-right: 0;
}

.illustration-caption {
    flex: 0 0 30%;
}

.caption-text {
    font-family: 'EB Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 0.95rem;
    color: #6B4E37;
    line-height: 1.8;
}

.illustration-frame {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.illustration-radio {
    width: 100%;
    max-width: 600px;
    height: auto;
}

.radio-wave {
    animation: radioWavePulse 3s ease-in-out infinite;
}

.radio-wave.rw1 { animation-delay: 0s; }
.radio-wave.rw2 { animation-delay: 0.5s; }
.radio-wave.rw3 { animation-delay: 1s; }

@keyframes radioWavePulse {
    0%, 100% { opacity: 0; transform: translateX(0); }
    30% { opacity: 0.7; }
    50% { opacity: 0.5; transform: translateX(10px); }
    100% { opacity: 0; transform: translateX(20px); }
}

.corner-ornament {
    position: absolute;
    width: 60px;
    height: 60px;
    pointer-events: none;
}

.corner-ornament.top-right {
    top: -10px;
    right: -10px;
}

.corner-ornament.bottom-left {
    bottom: -10px;
    left: -10px;
    transform: rotate(180deg);
}

/* --- Third Plate: Manifesto --- */
.manifesto-plate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F0DCC0;
    transition: background-color 0.8s ease;
}

.manifesto-inner {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 40px;
}

#manifesto-quote {
    position: relative;
    border: none;
    margin: 0;
    padding: 0;
}

.quote-mark {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 4rem;
    color: #B8956A;
    opacity: 0.3;
    line-height: 1;
    display: block;
}

.quote-mark.close {
    text-align: right;
}

#manifesto-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #2C1810;
    padding: 20px 0;
}

.word {
    display: inline-block;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0), transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    margin-right: 0.25em;
}

.word.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Wave borders on quote */
#manifesto-quote::before,
#manifesto-quote::after {
    content: '';
    display: block;
    width: 200px;
    height: 2px;
    margin: 0 auto;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 4px,
        #B8956A 4px,
        #B8956A 8px
    );
    opacity: 0.5;
}

#manifesto-quote::before {
    margin-bottom: 10px;
}

#manifesto-quote::after {
    margin-top: 10px;
}

/* --- Fourth Plate: Signal --- */
.signal-plate {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.signal-inner {
    padding: 80px 60px 40px 120px;
    max-width: 1100px;
}

.signal-content {
    max-width: 60ch;
    margin-bottom: 60px;
}

.signal-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: #6B4E37;
    margin-bottom: 30px;
    line-height: 1.8;
}

.signal-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.signal-link {
    font-family: 'Lora', Georgia, serif;
    font-weight: 500;
    font-size: 1rem;
    color: #C4743A;
    text-decoration: none;
    display: inline-block;
    position: relative;
    background-image: linear-gradient(#C4743A, #C4743A);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.4s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    padding-bottom: 2px;
}

.signal-link:hover {
    background-size: 100% 2px;
    color: #D4A04A;
}

#closing-wave {
    padding: 40px 0;
}

#closing-wave svg {
    width: 100%;
    height: 60px;
}

/* --- Footer --- */
#footer {
    padding: 20px 60px 40px 120px;
}

#footer-rule {
    border: none;
    height: 1px;
    background-color: #B8956A;
    opacity: 0.4;
    margin-bottom: 20px;
}

#footer-text {
    font-family: 'EB Garamond', Georgia, serif;
    font-style: italic;
    font-size: 0.85rem;
    color: #6B4E37;
    opacity: 0.7;
}

/* --- Interactive Underline Draw (all interactive text) --- */
a:not(.nav-link):not(.signal-link) {
    color: #C4743A;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.4s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

a:not(.nav-link):not(.signal-link):hover {
    background-size: 100% 2px;
}

/* --- Scroll Reveal Utility --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1.0), transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

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

/* --- Responsive (below 768px) --- */
@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #menu-toggle {
        display: flex;
    }

    #content {
        margin-left: 0;
    }

    .plate-inner,
    .signal-inner,
    #footer {
        padding-left: 30px;
        padding-right: 30px;
    }

    .illustration-layout {
        flex-direction: column;
    }

    .illustration-caption {
        flex: none;
        width: 100%;
    }

    #hero-content {
        padding: 0 20px;
    }

    .wave-divider {
        padding: 15px 30px;
    }

    .manifesto-inner {
        padding: 60px 20px;
    }

    #manifesto-text {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }
}

/* --- Selection Color --- */
::selection {
    background-color: #C4743A;
    color: #F5E6D0;
}

::-moz-selection {
    background-color: #C4743A;
    color: #F5E6D0;
}
