/* ============================================
   GGIGGL.com - Watercolor + Neon Magazine
   Color Palette:
     #0A0A0F - Wet Ink (Background Dark)
     #1C1C24 - Graphite Wash (Background Mid)
     #2A2A35 - Charcoal Paper (Surface)
     #6B6B78 - Pencil Gray (Muted Text)
     #B8B8C4 - Silver Mist (Body Text)
     #E8E8ED - Wet Paper (Light Surface)
     #C8A0FF - Violet Tube (Neon Primary)
     #FF6B9D - Rose Tube (Neon Secondary)
   ============================================ */

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #C8A0FF #0A0A0F;
}

html::-webkit-scrollbar {
    width: 4px;
}

html::-webkit-scrollbar-track {
    background: #0A0A0F;
}

html::-webkit-scrollbar-thumb {
    background: #C8A0FF;
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(200, 160, 255, 0.8),
                0 0 20px rgba(200, 160, 255, 0.4),
                0 0 60px rgba(200, 160, 255, 0.15);
}

body {
    background-color: #0A0A0F;
    color: #B8B8C4;
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-size: 18px;
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* Paper grain overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.3;
}

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

/* --- Typography --- */
.playfair-italic {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-style: italic;
}

.cormorant-accent {
    font-family: 'Cormorant Garamond', 'Garamond', serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #6B6B78;
}

.source-serif {
    font-family: 'Source Serif 4', 'Georgia', serif;
}

.neon-heading {
    font-family: 'Playfair Display', 'Georgia', serif;
    color: #E8E8ED;
    text-shadow:
        0 0 7px rgba(200, 160, 255, 0.8),
        0 0 20px rgba(200, 160, 255, 0.5),
        0 0 42px rgba(200, 160, 255, 0.3),
        0 0 82px rgba(200, 160, 255, 0.15),
        0 0 120px rgba(200, 160, 255, 0.08);
    transition: text-shadow 300ms ease;
}

.neon-heading:hover {
    text-shadow:
        0 0 7px rgba(200, 160, 255, 1),
        0 0 20px rgba(200, 160, 255, 0.65),
        0 0 42px rgba(200, 160, 255, 0.4),
        0 0 82px rgba(200, 160, 255, 0.2),
        0 0 120px rgba(200, 160, 255, 0.12);
}

/* --- Folio Navigation --- */
.folio-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 1000;
}

.folio-number {
    font-family: 'Cormorant Garamond', 'Garamond', serif;
    font-size: 13px;
    letter-spacing: 0.1em;
    color: #6B6B78;
    cursor: pointer;
    transition: color 300ms ease, text-shadow 300ms ease;
    text-align: center;
}

.folio-number:hover {
    color: #C8A0FF;
}

.folio-number.active {
    color: #C8A0FF;
    text-shadow:
        0 0 5px rgba(200, 160, 255, 0.8),
        0 0 20px rgba(200, 160, 255, 0.5),
        0 0 60px rgba(200, 160, 255, 0.15);
    animation: folioPulse 2s ease-in-out infinite;
}

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

/* --- Gutter Bleed Line --- */
.gutter-bleed {
    position: fixed;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100vh;
    background: linear-gradient(180deg,
        rgba(200, 160, 255, 0.3) 0%,
        rgba(255, 107, 157, 0.3) 50%,
        rgba(200, 160, 255, 0.3) 100%
    );
    box-shadow:
        0 0 5px rgba(200, 160, 255, 0.5),
        0 0 20px rgba(200, 160, 255, 0.2),
        0 0 60px rgba(200, 160, 255, 0.08);
    z-index: 100;
    transform: translateX(-50%);
    animation: gutterShift 12s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gutterShift {
    0%, 100% {
        background: linear-gradient(180deg,
            rgba(200, 160, 255, 0.3) 0%,
            rgba(255, 107, 157, 0.3) 50%,
            rgba(200, 160, 255, 0.3) 100%
        );
        box-shadow:
            0 0 5px rgba(200, 160, 255, 0.5),
            0 0 20px rgba(200, 160, 255, 0.2),
            0 0 60px rgba(200, 160, 255, 0.08);
    }
    50% {
        background: linear-gradient(180deg,
            rgba(255, 107, 157, 0.3) 0%,
            rgba(200, 160, 255, 0.3) 50%,
            rgba(255, 107, 157, 0.3) 100%
        );
        box-shadow:
            0 0 5px rgba(255, 107, 157, 0.5),
            0 0 20px rgba(255, 107, 157, 0.2),
            0 0 60px rgba(255, 107, 157, 0.08);
    }
}

/* --- Neon Rule --- */
.neon-rule-horizontal {
    width: 80px;
    height: 1px;
    background: #C8A0FF;
    margin: 30px auto;
    box-shadow:
        0 0 5px rgba(200, 160, 255, 1),
        0 0 20px rgba(200, 160, 255, 0.5),
        0 0 60px rgba(200, 160, 255, 0.15),
        0 0 120px rgba(200, 160, 255, 0.05);
    opacity: 0;
    transition: opacity 200ms ease;
}

.neon-rule-horizontal.neon-struck {
    animation: neonStrike 200ms ease forwards;
}

@keyframes neonStrike {
    0% { opacity: 1; }
    30% { opacity: 0.7; }
    60% { opacity: 1; }
    100% { opacity: 1; }
}

/* --- Spreads (Sections) --- */
.spread {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    transition: opacity 400ms ease, filter 400ms ease;
}

.spread-watercolor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(200, 160, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(255, 107, 157, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, #0A0A0F 0%, #1C1C24 100%);
    z-index: 0;
}

.spread-watercolor-alt {
    background:
        radial-gradient(ellipse at 60% 30%, rgba(200, 160, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 70%, rgba(255, 107, 157, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #1C1C24 0%, #0A0A0F 100%);
}

.spread-watercolor-light {
    background:
        radial-gradient(ellipse at 40% 50%, rgba(200, 160, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(255, 107, 157, 0.03) 0%, transparent 50%),
        linear-gradient(180deg, #E8E8ED 0%, #d8d8e0 100%);
}

.spread-watercolor-closing {
    background:
        radial-gradient(ellipse at 50% 40%, rgba(200, 160, 255, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 70%, rgba(255, 107, 157, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(200, 160, 255, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #0A0A0F 0%, #1C1C24 50%, #0A0A0F 100%);
}

.spread-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 60px 80px;
}

/* --- Full-bleed Spread (Template B) --- */
.spread-fullbleed .spread-content-centered {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.display-title {
    font-size: 96px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 20px;
}

.display-title-closing {
    font-size: 80px;
}

.tagline {
    margin-bottom: 10px;
    color: #6B6B78;
}

.body-intro {
    max-width: 540px;
    text-align: center;
    color: #B8B8C4;
    font-size: 17px;
    line-height: 1.75;
}

.body-text-overlay {
    max-width: 600px;
    text-align: center;
    margin: 0 auto;
    font-size: 17px;
    line-height: 1.85;
    color: #B8B8C4;
}

.closing-text {
    max-width: 620px;
    margin: 0 auto;
}

.closing-signature {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.closing-signature .cormorant-accent {
    color: #C8A0FF;
    font-size: 16px;
    letter-spacing: 0.25em;
    text-shadow:
        0 0 5px rgba(200, 160, 255, 0.6),
        0 0 20px rgba(200, 160, 255, 0.3);
}

.closing-year {
    color: #6B6B78 !important;
    font-size: 12px !important;
    text-shadow: none !important;
}

/* --- Ginkgo Motif on Spread 1 --- */
.motif-ginkgo {
    position: absolute;
    bottom: 40px;
    right: 10%;
    width: 200px;
    opacity: 0.5;
    z-index: 1;
}

/* --- Spread Grid (Template A & C) --- */
.spread-grid {
    display: grid;
    grid-template-columns: 6fr 120px 6fr;
    gap: 0;
    align-items: start;
    padding-top: 80px;
    padding-bottom: 80px;
}

.page-left {
    grid-column: 1;
    padding-right: 40px;
}

.page-right {
    grid-column: 3;
    padding-left: 40px;
}

/* --- Caption Labels --- */
.caption-label {
    display: block;
    margin-bottom: 20px;
    color: #6B6B78;
}

.caption-dark {
    color: #6B6B78;
}

/* --- Spread Headlines --- */
.spread-headline {
    font-size: 64px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 30px;
}

.spread-headline-large {
    font-size: 80px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 20px;
}

.spread-headline-dark {
    font-family: 'Playfair Display', 'Georgia', serif;
    color: #1A1A1A;
    text-shadow: none;
    font-size: 64px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 30px;
}

/* --- Pull Quotes --- */
.pull-quote {
    border-left: 2px solid #C8A0FF;
    padding-left: 20px;
    margin: 30px 0 30px -20px;
    box-shadow: -2px 0 5px rgba(200, 160, 255, 0.5),
                -2px 0 20px rgba(200, 160, 255, 0.2);
}

.pull-quote .playfair-italic {
    font-size: 28px;
    line-height: 1.4;
    color: #E8E8ED;
    text-shadow:
        0 0 20px rgba(200, 160, 255, 0.2);
}

.pull-quote-dark {
    border-left-color: #FF6B9D;
    box-shadow: -2px 0 5px rgba(255, 107, 157, 0.5),
                -2px 0 20px rgba(255, 107, 157, 0.2);
}

.pull-quote-dark .playfair-italic {
    color: #1A1A1A;
    text-shadow: none;
    font-size: 26px;
}

/* Pull quote border animation */
.pull-quote {
    position: relative;
}

.pull-quote::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    width: 2px;
    height: 0;
    background: #C8A0FF;
    box-shadow:
        0 0 5px rgba(200, 160, 255, 0.8),
        0 0 20px rgba(200, 160, 255, 0.4);
    transition: height 500ms ease-out;
}

.pull-quote-dark::before {
    background: #FF6B9D;
    box-shadow:
        0 0 5px rgba(255, 107, 157, 0.8),
        0 0 20px rgba(255, 107, 157, 0.4);
}

.pull-quote.pull-quote-visible::before {
    height: 100%;
}

.pull-quote.pull-quote-visible {
    border-left-color: transparent;
}

/* --- Body Text --- */
.body-text {
    color: #D8D8D8;
    font-size: 17px;
    line-height: 1.75;
}

.body-text p {
    margin-bottom: 18px;
}

.body-text-dark {
    color: #1A1A1A;
}

.body-text-dark p {
    margin-bottom: 18px;
}

/* --- Light Page Styles --- */
.page-left-light .caption-label {
    color: #6B6B78;
}

/* --- Image Frames --- */
.image-frame {
    position: relative;
    width: 100%;
    padding: 20px;
    background: #1C1C24;
    border: 1px solid transparent;
    transition: border-color 800ms ease-out, box-shadow 800ms ease-out;
}

.image-frame.border-visible {
    border-color: #C8A0FF;
    box-shadow:
        0 0 5px rgba(200, 160, 255, 1),
        0 0 20px rgba(200, 160, 255, 0.5),
        0 0 60px rgba(200, 160, 255, 0.15),
        0 0 120px rgba(200, 160, 255, 0.05);
}

.image-caption {
    display: block;
    margin-top: 12px;
    color: #6B6B78;
}

/* --- Border Animate Frame (clockwise drawing effect) --- */
.border-animate-frame {
    position: relative;
    background: #1C1C24;
    border: none;
}

.border-animate-frame::before,
.border-animate-frame::after {
    content: '';
    position: absolute;
    background: #C8A0FF;
    box-shadow:
        0 0 5px rgba(200, 160, 255, 0.8),
        0 0 20px rgba(200, 160, 255, 0.4);
}

/* Top & bottom edges */
.border-animate-frame::before {
    top: 0;
    left: 0;
    height: 1px;
    width: 0;
    transition: width 300ms ease-out;
}

.border-animate-frame::after {
    bottom: 0;
    right: 0;
    height: 1px;
    width: 0;
    transition: width 300ms ease-out 400ms;
}

.border-animate-frame .border-edge-right,
.border-animate-frame .border-edge-left {
    position: absolute;
    background: #C8A0FF;
    box-shadow:
        0 0 5px rgba(200, 160, 255, 0.8),
        0 0 20px rgba(200, 160, 255, 0.4);
}

/* When visible */
.border-animate-frame.border-drawing::before {
    width: 100%;
}

.border-animate-frame.border-drawing::after {
    width: 100%;
}

/* --- Mosaic Cards (Template C) --- */
.spread-mosaic .spread-grid {
    align-items: start;
}

.mosaic-card {
    background: #2A2A35;
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid transparent;
    transition: border-color 800ms ease-out, box-shadow 800ms ease-out;
    position: relative;
}

.mosaic-card.card-visible {
    border-color: #C8A0FF;
    box-shadow:
        0 0 5px rgba(200, 160, 255, 1),
        0 0 20px rgba(200, 160, 255, 0.5),
        0 0 60px rgba(200, 160, 255, 0.15),
        0 0 120px rgba(200, 160, 255, 0.05);
}

.card-1 {
    transform: rotate(-1deg);
}

.card-2 {
    transform: rotate(0.5deg);
    margin-left: 20px;
}

.card-3 {
    transform: rotate(0.8deg);
}

.card-4 {
    transform: rotate(-0.5deg);
    margin-left: 15px;
    background: #1C1C24;
}

.card-5 {
    transform: rotate(0.3deg);
    margin-left: -10px;
}

.card-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: -0.02em;
}

.card-body {
    font-size: 16px;
    line-height: 1.7;
    color: #B8B8C4;
}

.card-meta {
    display: block;
    margin-bottom: 12px;
}

.card-quote {
    font-size: 22px;
    line-height: 1.5;
    color: #E8E8ED;
    text-shadow: 0 0 20px rgba(200, 160, 255, 0.15);
}

/* --- Interstitials --- */
.interstitial {
    height: 40vh;
    background: #0A0A0F;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.interstitial-motif {
    width: 120px;
    opacity: 0.6;
    transition: opacity 600ms ease;
}

.interstitial:hover .interstitial-motif {
    opacity: 0.8;
}

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

/* --- Motifs --- */
.motif {
    pointer-events: none;
}

.motif-bottom {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.motif-grasses.motif-bottom {
    width: 80%;
    max-width: 600px;
    bottom: 0;
}

.motif-mushrooms.motif-bottom {
    width: 300px;
    bottom: 40px;
}

.motif-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --- SVG Neon Outline Animations --- */
.motif-neon-outline {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s ease-out;
}

.motif-neon-outline.neon-drawn {
    stroke-dashoffset: 0;
}

.motif-neon-vein {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 2s ease-out 0.5s;
}

.motif-neon-vein.neon-drawn {
    stroke-dashoffset: 0;
}

/* Leaf vein pulse animation */
.motif-neon-vein.neon-drawn {
    animation: veinPulse 2s ease-in-out infinite 3s;
}

@keyframes veinPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.9; }
}

/* --- Firefly Animation --- */
.firefly {
    animation: fireflyFlicker 3s ease-in-out infinite;
}

.firefly:nth-child(odd) {
    animation-delay: 0.5s;
    animation-duration: 2.5s;
}

.firefly:nth-child(3n) {
    animation-delay: 1s;
    animation-duration: 3.5s;
}

@keyframes fireflyFlicker {
    0%, 100% { opacity: 0.3; }
    30% { opacity: 0.9; }
    50% { opacity: 0.5; }
    70% { opacity: 1; }
}

/* --- Mushroom Glow Animation --- */
.mushroom-glow {
    animation: mushroomBio 4s ease-in-out infinite;
}

.mushroom-glow:nth-child(odd) {
    animation-delay: 0.7s;
}

.mushroom-glow:nth-child(3n) {
    animation-delay: 1.5s;
    animation-duration: 3s;
}

@keyframes mushroomBio {
    0%, 100% { opacity: 0.4; r: attr(r); }
    50% { opacity: 0.9; }
}

/* --- Lotus Pistil Animation --- */
.lotus-pistil {
    animation: pistilGlow 3s ease-in-out infinite;
}

.lotus-pistil:nth-child(even) {
    animation-delay: 0.5s;
}

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

/* --- Watercolor Splatters --- */
.watercolor-splatter {
    position: absolute;
    width: 80px;
    height: 80px;
    pointer-events: none;
}

.splatter-1 {
    bottom: 40px;
    left: 10px;
    transform: rotate(-12deg);
}

/* --- Spread Transition Effects (scroll-driven opacity/blur) --- */
.spread.spread-fading {
    opacity: 0.6;
    filter: blur(2px);
}

.spread.spread-entering {
    opacity: 0.4;
    filter: blur(3px);
}

/* --- Full-bleed Overlay Content --- */
.spread-content-overlay {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.spread-content-overlay .caption-label {
    margin-bottom: 20px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .spread-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .page-left {
        grid-column: 1;
        padding-right: 0;
    }

    .page-right {
        grid-column: 1;
        padding-left: 0;
    }

    .gutter-bleed {
        display: none;
    }

    .display-title {
        font-size: 64px;
    }

    .spread-headline {
        font-size: 48px;
    }

    .spread-headline-large {
        font-size: 56px;
    }

    .spread-headline-dark {
        font-size: 48px;
    }

    .spread-content {
        padding: 40px 30px;
    }

    .folio-nav {
        right: 10px;
    }

    .motif-ginkgo {
        width: 140px;
        right: 5%;
    }

    .motif-grasses.motif-bottom {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .display-title {
        font-size: 48px;
    }

    .display-title-closing {
        font-size: 42px;
    }

    .spread-headline {
        font-size: 36px;
    }

    .spread-headline-large {
        font-size: 42px;
    }

    .spread-headline-dark {
        font-size: 36px;
    }

    .spread-content {
        padding: 30px 20px;
    }

    .pull-quote .playfair-italic {
        font-size: 22px;
    }

    .pull-quote-dark .playfair-italic {
        font-size: 20px;
    }

    .card-title {
        font-size: 22px;
    }

    .card-quote {
        font-size: 18px;
    }

    .mosaic-card {
        padding: 20px;
        transform: none !important;
        margin-left: 0 !important;
    }

    .folio-nav {
        right: 6px;
        gap: 14px;
    }

    .folio-number {
        font-size: 11px;
    }

    .motif-ginkgo {
        width: 100px;
        bottom: 20px;
    }
}
