/* ============================================================
   paraligm.com - Frutiger Herbarium
   Aesthetic: Frutiger Aero / Botanical / Scholarly-Intellectual
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --burnt-sienna: #C65D07;
    --dried-sage: #8B9A6B;
    --antique-cream: #FDF5E6;
    --deep-mahogany: #3B1F0E;
    --warm-ivory: #FAF3E0;
    --charred-umber: #2A1506;
    --amber-glow: #D4910A;
    --lichen-teal: #4A7C6F;
    --frosted-white: rgba(255, 248, 235, 0.65);
    --blue-amber-shadow: rgba(59, 31, 14, 0.15);
    --glass-gradient: linear-gradient(135deg, rgba(255, 248, 235, 0.7) 0%, rgba(255, 248, 235, 0.3) 100%);
    --dark-gradient: linear-gradient(180deg, #3B1F0E 0%, #2A1506 100%);
}

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

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

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    color: var(--charred-umber);
    background-color: var(--deep-mahogany);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Section Indicator --- */
.section-indicator {
    position: fixed;
    bottom: 30px;
    right: 30px;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 0.85rem;
    color: var(--warm-ivory);
    opacity: 0.35;
    z-index: 100;
    pointer-events: none;
    transition: opacity 0.6s ease;
    letter-spacing: 0.05em;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--deep-mahogany);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 70%, rgba(198, 93, 7, 0.25), transparent 60%),
        radial-gradient(ellipse at 70% 30%, rgba(74, 124, 111, 0.15), transparent 50%);
    z-index: 2;
    pointer-events: none;
}

.hero-glass-panel {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 60px 80px;
    background: var(--glass-gradient);
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(59, 31, 14, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    opacity: 0;
    animation: glassReveal 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

@keyframes glassReveal {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-title {
    font-family: 'Anybody', sans-serif;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 200;
    font-stretch: 110%;
    letter-spacing: 0.06em;
    color: var(--charred-umber);
    opacity: 0;
    animation: titleReveal 2s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards,
               titleBreathe 8s ease-in-out 2.6s infinite;
}

@keyframes titleReveal {
    from {
        opacity: 0;
        font-weight: 200;
    }
    to {
        opacity: 1;
        font-weight: 340;
    }
}

@keyframes titleBreathe {
    0%, 100% { font-weight: 300; }
    50% { font-weight: 350; }
}

.hero-subtitle {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    font-style: italic;
    color: var(--charred-umber);
    opacity: 0;
    margin-top: 16px;
    letter-spacing: 0.04em;
    animation: subtitleReveal 1.2s cubic-bezier(0.22, 1, 0.36, 1) 1.4s forwards;
}

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

/* --- Bokeh Elements --- */
.bokeh-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
}

/* Bokeh drift animations */
@keyframes bokehDrift1 {
    0% { transform: translate(0, 0); }
    25% { transform: translate(40px, -30px); }
    50% { transform: translate(80px, 10px); }
    75% { transform: translate(30px, 50px); }
    100% { transform: translate(0, 0); }
}

@keyframes bokehDrift2 {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-50px, 20px); }
    50% { transform: translate(-20px, -40px); }
    75% { transform: translate(30px, -10px); }
    100% { transform: translate(0, 0); }
}

@keyframes bokehDrift3 {
    0% { transform: translate(0, 0); }
    25% { transform: translate(20px, 40px); }
    50% { transform: translate(-30px, 60px); }
    75% { transform: translate(-50px, 20px); }
    100% { transform: translate(0, 0); }
}

@keyframes bokehDrift4 {
    0% { transform: translate(0, 0); }
    33% { transform: translate(-40px, -50px); }
    66% { transform: translate(50px, 30px); }
    100% { transform: translate(0, 0); }
}

@keyframes bokehOrbit {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -20px) rotate(90deg); }
    50% { transform: translate(0px, -40px) rotate(180deg); }
    75% { transform: translate(-30px, -20px) rotate(270deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

/* Ripple pulse for close section bokeh */
@keyframes bokehPulse {
    0%, 100% { transform: scale(1); opacity: var(--bokeh-base-opacity, 0.3); }
    50% { transform: scale(1.15); opacity: calc(var(--bokeh-base-opacity, 0.3) * 1.3); }
}

/* --- Section Transitions --- */
.section-transition {
    height: 20vh;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* --- Section I: The Thesis --- */
.section-thesis {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--antique-cream);
    padding: 80px 20px;
}

.thesis-content {
    max-width: 680px;
    width: 100%;
}

.thesis-content p {
    margin-bottom: 1.6em;
    color: var(--charred-umber);
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    line-height: 1.85;
}

.ripple-text {
    opacity: 0;
    transform: translateX(-3px);
    transition: opacity 0.8s ease, transform 0.4s ease;
}

.ripple-text.visible {
    opacity: 1;
    transform: translateX(0);
    animation: rippleSettle 0.4s ease forwards;
}

@keyframes rippleSettle {
    0% { transform: translateX(-3px); }
    25% { transform: translateX(3px); }
    50% { transform: translateX(-2px); }
    75% { transform: translateX(1px); }
    100% { transform: translateX(0); }
}

/* --- Section II: The Specimens --- */
.section-specimens {
    position: relative;
    background-color: var(--deep-mahogany);
    padding: 80px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 80px;
}

.specimen-panel {
    position: relative;
    width: 80vw;
    max-width: 1100px;
    min-height: 60vh;
    overflow: hidden;
    border-radius: 16px;
}

.specimen-bokeh {
    z-index: 0;
}

.specimen-glass {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 60px;
    background: var(--glass-gradient);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(59, 31, 14, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.specimen-glass.visible {
    opacity: 1;
    transform: translateY(0);
}

.specimen-illustration {
    flex: 0 0 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.botanical-svg {
    width: 180px;
    height: auto;
}

.fern-svg {
    width: 160px;
}

.chrysanthemum-svg {
    width: 170px;
}

/* SVG path drawing animation */
.draw-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2.5s ease;
}

.draw-active .draw-path {
    stroke-dashoffset: 0;
}

#fern-svg .draw-path {
    transition-duration: 4s;
}

#chrysanthemum-svg .draw-path {
    transition-duration: 3.5s;
}

/* Stagger individual paths within each SVG */
.draw-active .draw-path:nth-child(1) { transition-delay: 0s; }
.draw-active .draw-path:nth-child(2) { transition-delay: 0.08s; }
.draw-active .draw-path:nth-child(3) { transition-delay: 0.16s; }
.draw-active .draw-path:nth-child(4) { transition-delay: 0.24s; }
.draw-active .draw-path:nth-child(5) { transition-delay: 0.32s; }
.draw-active .draw-path:nth-child(6) { transition-delay: 0.4s; }
.draw-active .draw-path:nth-child(7) { transition-delay: 0.48s; }
.draw-active .draw-path:nth-child(8) { transition-delay: 0.56s; }
.draw-active .draw-path:nth-child(9) { transition-delay: 0.64s; }
.draw-active .draw-path:nth-child(10) { transition-delay: 0.72s; }
.draw-active .draw-path:nth-child(11) { transition-delay: 0.8s; }
.draw-active .draw-path:nth-child(12) { transition-delay: 0.88s; }
.draw-active .draw-path:nth-child(13) { transition-delay: 0.96s; }
.draw-active .draw-path:nth-child(14) { transition-delay: 1.04s; }
.draw-active .draw-path:nth-child(15) { transition-delay: 1.12s; }
.draw-active .draw-path:nth-child(16) { transition-delay: 1.2s; }
.draw-active .draw-path:nth-child(17) { transition-delay: 1.28s; }
.draw-active .draw-path:nth-child(18) { transition-delay: 1.36s; }
.draw-active .draw-path:nth-child(19) { transition-delay: 1.44s; }
.draw-active .draw-path:nth-child(20) { transition-delay: 1.52s; }
.draw-active .draw-path:nth-child(21) { transition-delay: 1.6s; }
.draw-active .draw-path:nth-child(22) { transition-delay: 1.68s; }
.draw-active .draw-path:nth-child(23) { transition-delay: 1.76s; }
.draw-active .draw-path:nth-child(24) { transition-delay: 1.84s; }
.draw-active .draw-path:nth-child(25) { transition-delay: 1.92s; }
.draw-active .draw-path:nth-child(26) { transition-delay: 2.0s; }
.draw-active .draw-path:nth-child(27) { transition-delay: 2.08s; }
.draw-active .draw-path:nth-child(28) { transition-delay: 2.16s; }
.draw-active .draw-path:nth-child(29) { transition-delay: 2.24s; }
.draw-active .draw-path:nth-child(30) { transition-delay: 2.32s; }
.draw-active .draw-path:nth-child(31) { transition-delay: 2.4s; }
.draw-active .draw-path:nth-child(32) { transition-delay: 2.48s; }
.draw-active .draw-path:nth-child(33) { transition-delay: 2.56s; }
.draw-active .draw-path:nth-child(34) { transition-delay: 2.64s; }
.draw-active .draw-path:nth-child(35) { transition-delay: 2.72s; }

.specimen-text {
    flex: 1;
    min-width: 0;
}

.specimen-label {
    display: block;
    font-family: 'Caveat', cursive;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--burnt-sienna);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.specimen-text p {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.85;
    color: var(--charred-umber);
}

/* --- Section III: The Theory --- */
.section-theory {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-gradient);
    padding: 80px 20px 80px 80px;
    overflow: hidden;
}

.vine-border {
    position: absolute;
    left: 40px;
    top: 0;
    bottom: 0;
    width: 30px;
    z-index: 1;
}

.vine-svg {
    width: 30px;
    height: 100%;
}

.vine-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 3s ease;
}

.vine-border.draw-active .vine-path,
.vine-border.draw-active .draw-path {
    stroke-dashoffset: 0;
}

.vine-border.draw-active .draw-path:nth-child(2) { transition-delay: 0.3s; }
.vine-border.draw-active .draw-path:nth-child(3) { transition-delay: 0.6s; }
.vine-border.draw-active .draw-path:nth-child(4) { transition-delay: 0.9s; }
.vine-border.draw-active .draw-path:nth-child(5) { transition-delay: 1.2s; }
.vine-border.draw-active .draw-path:nth-child(6) { transition-delay: 1.5s; }
.vine-border.draw-active .draw-path:nth-child(7) { transition-delay: 1.8s; }
.vine-border.draw-active .draw-path:nth-child(8) { transition-delay: 2.1s; }
.vine-border.draw-active .draw-path:nth-child(9) { transition-delay: 2.4s; }
.vine-border.draw-active .draw-path:nth-child(10) { transition-delay: 2.7s; }

.theory-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
    margin: 0 auto;
}

.theory-heading {
    font-family: 'Anybody', sans-serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    font-stretch: 100%;
    letter-spacing: 0.03em;
    color: var(--warm-ivory);
    margin-bottom: 40px;
    line-height: 1.3;
    transition: font-stretch 1.5s ease;
}

.theory-heading.condensed {
    font-stretch: 90%;
}

.theory-content p {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.85;
    color: var(--warm-ivory);
    margin-bottom: 1.6em;
    opacity: 0;
    transform: translateX(-3px);
    transition: opacity 0.8s ease, transform 0.4s ease;
}

.theory-content p.visible {
    opacity: 1;
    transform: translateX(0);
    animation: rippleSettle 0.4s ease forwards;
}

/* --- Section IV: The Close --- */
.section-close {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--deep-mahogany);
    overflow: hidden;
}

.close-domain {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Anybody', sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 320;
    font-stretch: 110%;
    letter-spacing: 0.06em;
    color: var(--warm-ivory);
    opacity: 0.6;
    z-index: 3;
}

.close-sentence {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 600px;
    padding: 0 20px;
}

.close-sentence p {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-style: italic;
    color: var(--warm-ivory);
    opacity: 0;
    line-height: 1.7;
    letter-spacing: 0.02em;
    transition: opacity 1.5s ease, transform 1.5s ease;
    transform: translateY(10px);
}

.close-sentence p.visible {
    opacity: 0.85;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-glass-panel {
        padding: 40px 30px;
        margin: 0 20px;
    }

    .specimen-panel {
        width: 92vw;
    }

    .specimen-glass {
        flex-direction: column;
        padding: 40px 24px;
        gap: 24px;
    }

    .specimen-illustration {
        flex: 0 0 auto;
    }

    .botanical-svg,
    .fern-svg,
    .chrysanthemum-svg {
        width: 120px;
    }

    .botanical-svg .draw-path,
    .fern-svg .draw-path,
    .chrysanthemum-svg .draw-path {
        stroke-width: 1;
    }

    .section-theory {
        padding: 80px 20px 80px 60px;
    }

    .vine-border {
        left: 15px;
    }

    .section-indicator {
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .hero-glass-panel {
        padding: 30px 20px;
    }

    .section-theory {
        padding: 60px 20px 60px 50px;
    }

    .vine-border {
        left: 10px;
    }
}
