/* ============================================
   HHUDDL.com - Watercolor, Elegant Serif, Creamy Pastel
   ============================================ */

/* --- Color Palette ---
   Antique Cream:   #FDF6EC
   Blush Wash:      #F5E6DA
   Dusty Rose:      #C4908A
   Sage Mist:       #A8B5A0
   Charcoal Ink:    #3B3A36
   Faded Graphite:  #8A8478
   Warm Honey:      #E8C87A
   Pale Lilac:      #D8CCE0
*/

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

html {
    scroll-behavior: smooth;
    font-size: 18px;
    overflow-x: hidden;
}

body {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    color: #3B3A36;
    background-color: #FDF6EC;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- SVG Filters (hidden) --- */
#svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ============================================
   Opening Sequence
   ============================================ */
#opening-sequence {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FDF6EC;
    transition: opacity 1s ease-out;
}

#opening-sequence.fade-out {
    opacity: 0;
    pointer-events: none;
}

#opening-sequence.hidden {
    display: none;
}

#opening-wash {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, #D8CCE0 0%, rgba(216,204,224,0.4) 40%, rgba(253,246,236,0) 70%);
    transform: translate(-50%, -50%);
    filter: url(#watercolor-noise);
    transition: width 2s cubic-bezier(0.22, 1, 0.36, 1), height 2s cubic-bezier(0.22, 1, 0.36, 1);
}

#opening-wash.expanded {
    width: 200vmax;
    height: 200vmax;
}

#opening-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

#site-title {
    font-family: 'Special Elite', monospace;
    font-size: 96px;
    font-weight: 400;
    color: #3B3A36;
    letter-spacing: 0.08em;
    min-height: 1.2em;
    text-shadow: 0 0 0 transparent;
}

#site-title .char-pulse {
    display: inline-block;
    animation: charPulse 400ms ease-out forwards;
}

@keyframes charPulse {
    0% {
        text-shadow: 0 0 20px #C4908A;
    }
    100% {
        text-shadow: 0 0 0 transparent;
    }
}

#site-subtitle {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 1.2rem;
    color: #8A8478;
    margin-top: 1rem;
    min-height: 1.6em;
    letter-spacing: 0.02em;
}

.typewriter-cursor {
    display: inline-block;
    color: #3B3A36;
    animation: cursorBlink 530ms steps(1) infinite;
}

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

/* ============================================
   Particle Canvas
   ============================================ */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 5;
    pointer-events: none;
}

/* ============================================
   Sidebar
   ============================================ */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background: linear-gradient(180deg, #F5E6DA 0%, rgba(245,230,218,0.95) 50%, #F5E6DA 100%);
    z-index: 100;
    box-shadow: 4px 0 20px rgba(59,58,54,0.06);
    transform: translateX(-100%);
    transition: transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

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

#sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(200,144,138,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(168,181,160,0.08) 0%, transparent 60%);
    pointer-events: none;
}

#sidebar-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 3rem 1.5rem 2rem;
}

#sidebar-logo {
    font-family: 'Special Elite', monospace;
    font-size: 1.4rem;
    color: #3B3A36;
    letter-spacing: 0.06em;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(59,58,54,0.1);
}

#sidebar-nav {
    list-style: none;
    flex: 1;
}

#sidebar-nav li {
    margin-bottom: 1.2rem;
}

.nav-link {
    font-family: 'IM Fell English SC', serif;
    font-variant: small-caps;
    font-size: 14px;
    letter-spacing: 0.08em;
    color: #8A8478;
    text-decoration: none;
    position: relative;
    display: inline-block;
    padding: 0.3em 0.4em;
    transition: color 300ms ease;
    background-image: linear-gradient(#C4908A, #C4908A);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: background-size 300ms ease, color 300ms ease;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 160%;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200,144,138,0.2) 0%, transparent 70%);
    transition: transform 300ms ease;
    pointer-events: none;
}

.nav-link:hover {
    color: #C4908A;
    background-size: 100% 1px;
}

.nav-link:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

.nav-link.active {
    color: #C4908A;
}

.nav-link.active::before {
    transform: translate(-50%, -50%) scale(1);
}

#sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(59,58,54,0.1);
}

.sidebar-label {
    font-family: 'IM Fell English SC', serif;
    font-variant: small-caps;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: #8A8478;
    opacity: 0.7;
}

/* ============================================
   Main Content
   ============================================ */
#main-content {
    margin-left: 240px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms ease, transform 800ms ease;
}

#main-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.content-section {
    position: relative;
    padding: 6rem 0;
    min-height: 80vh;
    display: flex;
    overflow: hidden;
}

/* Watercolor wash backgrounds per section */
.content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    transition: filter 0.5s ease;
}

.content-section[data-wash="lilac"]::before {
    background:
        radial-gradient(ellipse at 80% 20%, rgba(216,204,224,0.3) 0%, transparent 55%),
        linear-gradient(180deg, #FDF6EC 0%, rgba(253,246,236,0.95) 100%);
}

.content-section[data-wash="sage"]::before {
    background:
        radial-gradient(ellipse at 30% 50%, rgba(168,181,160,0.25) 0%, transparent 55%),
        linear-gradient(180deg, rgba(245,230,218,0.3) 0%, #FDF6EC 50%, rgba(253,246,236,0.95) 100%);
}

.content-section[data-wash="honey"]::before {
    background:
        radial-gradient(ellipse at 50% 80%, rgba(232,200,122,0.2) 0%, transparent 55%),
        linear-gradient(180deg, #FDF6EC 0%, rgba(253,246,236,0.95) 100%);
}

.content-section[data-wash="rose"]::before {
    background:
        radial-gradient(ellipse at 60% 40%, rgba(196,144,138,0.2) 0%, transparent 55%),
        linear-gradient(180deg, rgba(253,246,236,0.95) 0%, #FDF6EC 100%);
}

.content-section[data-wash="lilac-sage"]::before {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(216,204,224,0.2) 0%, transparent 45%),
        radial-gradient(ellipse at 70% 70%, rgba(168,181,160,0.2) 0%, transparent 45%),
        linear-gradient(180deg, #FDF6EC 0%, rgba(253,246,236,0.95) 100%);
}

.section-body {
    position: relative;
    z-index: 1;
    max-width: 720px;
    padding: 0 3rem 0 4rem;
    flex: 1;
}

.section-body p {
    margin-bottom: 1.5rem;
    color: #3B3A36;
}

/* --- Dropcaps --- */
.dropcap-block {
    position: relative;
}

.dropcap {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-style: italic;
    font-size: 4.5rem;
    line-height: 0.8;
    float: left;
    color: #C4908A;
    margin-right: 0.15em;
    margin-top: 0.05em;
    transform: scale(0.8);
    transition: transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dropcap.animate-in {
    transform: scale(1);
}

/* --- Illustration Breaks --- */
.illustration-break {
    margin: 2.5rem 0;
    text-align: center;
}

.line-illustration {
    width: 100%;
    max-width: 400px;
    height: auto;
    opacity: 0.7;
}

.draw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s ease;
}

.draw-line.drawn {
    stroke-dashoffset: 0;
}

/* --- Right Margin Illustrations --- */
.margin-illustration {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    opacity: 0.6;
    z-index: 1;
}

.vignette-svg {
    width: 100%;
    height: auto;
}

/* --- Closing Section --- */
.closing-body {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.closing-text {
    font-family: 'Special Elite', monospace;
    font-size: 2rem;
    color: #3B3A36;
    letter-spacing: 0.04em;
    margin-bottom: 2rem;
}

.closing-circles {
    opacity: 0.5;
}

.closing-svg {
    width: 200px;
    height: 80px;
}

/* ============================================
   Typography - Headlines
   ============================================ */
h1, h2, h3 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-style: italic;
    letter-spacing: 0.02em;
}

h2 {
    font-size: 2.8rem;
    color: #3B3A36;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.8rem;
    color: #3B3A36;
    margin-bottom: 1rem;
}

/* ============================================
   Typewriter Effect Styling
   ============================================ */
.typewriter-target {
    min-height: 1em;
}

.typewriter-target .typed-char {
    opacity: 0;
    animation: fadeCharIn 50ms ease forwards;
}

@keyframes fadeCharIn {
    to { opacity: 1; }
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #FDF6EC;
}

::-webkit-scrollbar-thumb {
    background: rgba(168,181,160,0.4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(168,181,160,0.6);
}

/* ============================================
   Selection
   ============================================ */
::selection {
    background: rgba(216,204,224,0.4);
    color: #3B3A36;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .margin-illustration {
        display: none;
    }

    .section-body {
        max-width: 100%;
        padding: 0 2rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    #sidebar {
        width: 200px;
    }

    #main-content {
        margin-left: 200px;
    }

    #site-title {
        font-size: 56px;
    }

    .dropcap {
        font-size: 3.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .section-body {
        padding: 0 1.5rem;
    }

    .content-section {
        padding: 4rem 0;
    }
}

@media (max-width: 540px) {
    #sidebar {
        width: 60px;
        padding: 0;
    }

    #sidebar.visible {
        width: 60px;
    }

    #sidebar-inner {
        padding: 1.5rem 0.5rem;
        align-items: center;
    }

    #sidebar-logo {
        font-size: 0.8rem;
        letter-spacing: 0;
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .nav-link {
        font-size: 10px;
        letter-spacing: 0.02em;
    }

    #sidebar-footer {
        display: none;
    }

    #main-content {
        margin-left: 60px;
    }

    #site-title {
        font-size: 40px;
    }

    .dropcap {
        font-size: 2.5rem;
    }

    .content-section {
        padding: 3rem 0;
        min-height: auto;
    }
}
