/* ============================================
   HHUDDL.com - Light Academia / Pastoral Romantic
   ============================================ */

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(232, 200, 122, 0.5);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 200, 122, 0.8);
}

/* --- Paper Grain Texture (SVG inline as background) --- */
/* Subtle noise texture at low opacity for parchment feel */

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(232, 200, 122, 0.5) transparent;
}

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    background-color: #F5F0E8;
    color: #3A2E25;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.85;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    position: relative;
}

/* Paper grain texture overlay */
body::before {
    content: '';
    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 xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='1' height='1' x='0' y='0' fill='%23000' opacity='0.4'/%3E%3Crect width='1' height='1' x='2' y='2' fill='%23000' opacity='0.3'/%3E%3Crect width='1' height='1' x='3' y='1' fill='%23000' opacity='0.2'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    color: #2B1810;
    letter-spacing: -0.02em;
}

/* --- Hero Alcove --- */
.hero-alcove {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 85% 15%, rgba(232,200,122,0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 10% 90%, rgba(26,18,11,0.06) 0%, transparent 50%),
        #F5F0E8;
}

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

.hero-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: #2B1810;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.15em;
}

.hero-dot-com {
    display: block;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    color: #8B7D6B;
    opacity: 0;
    animation: fadeInUp 1s ease-out 1s forwards;
}

.hero-tagline {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.2rem, 2vw, 1.75rem);
    color: #5C4A3A;
    letter-spacing: 0.01em;
    line-height: 1.5;
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeInUp 2s ease-out 1.5s forwards;
}

/* --- Fade Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Bubbles --- */
.bubbles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.bubbles-masonry {
    position: fixed;
    z-index: 1;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), rgba(168,212,230,0.15) 60%, rgba(168,212,230,0.05));
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.bubble::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.8), transparent);
}

@keyframes bubbleFloat1 {
    0% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(15px, -25vh) scale(1.02); }
    50% { transform: translate(-10px, -50vh) scale(0.98); }
    75% { transform: translate(20px, -75vh) scale(1.01); }
    100% { transform: translate(5px, -100vh) scale(1); }
}

@keyframes bubbleFloat2 {
    0% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-20px, -25vh) scale(0.98); }
    50% { transform: translate(15px, -50vh) scale(1.03); }
    75% { transform: translate(-5px, -75vh) scale(0.99); }
    100% { transform: translate(-15px, -100vh) scale(1); }
}

@keyframes bubbleFloat3 {
    0% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(10px, -30vh) scale(1.01); }
    50% { transform: translate(-15px, -55vh) scale(0.97); }
    75% { transform: translate(8px, -80vh) scale(1.02); }
    100% { transform: translate(-10px, -105vh) scale(1); }
}

@keyframes bubbleDrift {
    0% { transform: translate(0, 0); }
    33% { transform: translate(12px, -8px); }
    66% { transform: translate(-8px, -4px); }
    100% { transform: translate(0, 0); }
}

/* --- Dust Motes --- */
.dust-motes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.dust-mote {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #E8C87A;
    opacity: 0.4;
    pointer-events: none;
}

@keyframes dustFloat1 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    25% { transform: translate(40px, -30px) scale(1.2); opacity: 0.5; }
    50% { transform: translate(80px, 10px) scale(0.8); opacity: 0.35; }
    75% { transform: translate(30px, -20px) scale(1.1); opacity: 0.45; }
    100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
}

@keyframes dustFloat2 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.25; }
    25% { transform: translate(-30px, 20px) scale(0.9); opacity: 0.4; }
    50% { transform: translate(-60px, -15px) scale(1.3); opacity: 0.3; }
    75% { transform: translate(-20px, 25px) scale(0.85); opacity: 0.5; }
    100% { transform: translate(0, 0) scale(1); opacity: 0.25; }
}

@keyframes dustFloat3 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.35; }
    25% { transform: translate(20px, 40px) scale(1.15); opacity: 0.45; }
    50% { transform: translate(-25px, 20px) scale(0.9); opacity: 0.3; }
    75% { transform: translate(15px, -10px) scale(1.05); opacity: 0.5; }
    100% { transform: translate(0, 0) scale(1); opacity: 0.35; }
}

/* --- Masonry Section --- */
.masonry-section {
    position: relative;
    padding: 60px 40px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.masonry-grid {
    column-count: 3;
    column-gap: 24px;
}

/* --- Masonry Cards --- */
.masonry-card {
    position: relative;
    background: #FAF7F0;
    border: 1px solid #D4C5B0;
    border-radius: 3px;
    padding: 32px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(90,70,50,0.08);
    break-inside: avoid;
    transition: box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.masonry-card:hover {
    box-shadow: 0 4px 16px rgba(90,70,50,0.14);
    transform: translateY(-2px);
}

/* Fade reveal states */
.fade-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

.fade-reveal-slow {
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.fade-reveal-slow.is-visible {
    opacity: 1;
}

/* Card headings */
.card-heading {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    color: #2B1810;
    letter-spacing: -0.02em;
    margin-bottom: 0.75em;
    line-height: 1.3;
}

/* Card body text */
.card-body {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    color: #3A2E25;
    line-height: 1.85;
    letter-spacing: 0.005em;
    margin-bottom: 1em;
    max-width: 65ch;
}

.card-body:last-of-type {
    margin-bottom: 0.5em;
}

/* Card quotes */
.card-quote {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.2rem, 2vw, 1.75rem);
    color: #5C4A3A;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

.card-attribution {
    display: block;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 0.95rem;
    color: #8B7D6B;
    margin-top: 0.75em;
}

/* Card metadata */
.card-meta {
    display: block;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-variant: small-caps;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    color: #8B7D6B;
    margin-top: 1em;
    padding-top: 0.75em;
    border-top: 1px solid rgba(212,197,176,0.5);
}

/* Card variants */
.card-accent {
    padding: 40px;
    text-align: center;
    border-left: 3px solid #E8C87A;
}

.card-accent .card-quote::first-letter {
    color: #C4917A;
}

.card-torn {
    clip-path: polygon(
        0% 5px, 3% 2px, 6% 6px, 9% 1px, 12% 4px, 15% 7px, 18% 2px,
        21% 5px, 24% 0px, 27% 6px, 30% 3px, 33% 7px, 36% 1px, 39% 5px,
        42% 3px, 45% 8px, 48% 2px, 51% 6px, 54% 0px, 57% 4px, 60% 7px,
        63% 2px, 66% 5px, 69% 1px, 72% 6px, 75% 3px, 78% 7px, 81% 0px,
        84% 5px, 87% 2px, 90% 6px, 93% 1px, 96% 4px, 100% 3px,
        100% 100%, 0% 100%
    );
    padding-top: 40px;
}

.card-wide {
    column-span: all;
    padding: 40px;
}

/* Botanical silhouettes */
.card-botanical {
    position: relative;
}

.botanical-silhouette {
    position: absolute;
    top: 0;
    right: 0;
    width: 160px;
    height: auto;
    pointer-events: none;
    z-index: 0;
}

.card-botanical > *:not(.botanical-silhouette) {
    position: relative;
    z-index: 1;
}

/* --- Links within Cards --- */
.masonry-card a {
    color: #2B1810;
    text-decoration: none;
    border-bottom: 1px solid rgba(168,212,230,0.5);
    transition: border-bottom-color 0.3s ease, border-bottom-width 0.3s ease, color 0.3s ease;
}

.masonry-card a:hover {
    color: #5C4A3A;
    border-bottom: 2px solid #A8D4E6;
}

/* --- Interstitial Breaks --- */
.interstitial {
    padding: 120px 40px;
    text-align: center;
    position: relative;
}

.interstitial-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    color: #5C4A3A;
    letter-spacing: -0.01em;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Book Spines Divider */
.book-spines {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 3px;
    margin-bottom: 40px;
}

.spine {
    width: 8px;
    border-radius: 1px;
    opacity: 0.6;
}

/* --- Footer --- */
.site-footer {
    background: #1A120B;
    padding: 80px 40px;
    text-align: center;
    position: relative;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-brand {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: #FAF7F0;
    letter-spacing: -0.02em;
    display: block;
    margin-bottom: 0.5em;
}

.footer-tagline {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-style: italic;
    font-size: 1.1rem;
    color: #8B7D6B;
    margin-bottom: 2em;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2em;
    margin-bottom: 2em;
}

.footer-link {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-variant: small-caps;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: #8B7D6B;
    text-decoration: none;
    border-bottom: 1px solid rgba(168,212,230,0.3);
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
}

.footer-link:hover {
    color: #D4C5B0;
    border-bottom-color: #A8D4E6;
}

.footer-copy {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 0.8rem;
    color: #5C4A3A;
    letter-spacing: 0.05em;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 2;
    }

    .masonry-section {
        padding: 40px 24px 24px;
    }

    .card-wide {
        column-span: all;
    }
}

@media (max-width: 640px) {
    .masonry-grid {
        column-count: 1;
    }

    .masonry-section {
        padding: 30px 16px 16px;
    }

    .masonry-card {
        padding: 24px;
    }

    .card-wide {
        column-span: none;
    }

    .interstitial {
        padding: 80px 24px;
    }

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

    .footer-links {
        flex-direction: column;
        gap: 1em;
        align-items: center;
    }
}
