/* ============================================
   pencloser.com — Styles
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
}

body {
    background: #0a0e1a;
    color: #c8c0b4;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---- Sections (General) ---- */

.section {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    scroll-snap-align: start;
}

.section-content {
    text-align: center;
    width: 100%;
}

/* ---- Section Reveal Animation ---- */

.section .section-content,
.section .study-spread,
.section .paper-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.section.visible .section-content,
.section.visible .study-spread,
.section.visible .paper-content {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Section 1: The Seal (Hero)
   ============================================ */

.section-seal {
    background: #0a0e1a;
    flex-direction: column;
}

.hero-title {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(4rem, 10vw, 9rem);
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: #f4efe6;
    margin-bottom: 1.5rem;
}

.hero-tagline {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #c8c0b4;
    opacity: 0;
    animation: fadeInTagline 1s ease forwards;
    animation-delay: 1.5s;
}

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

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, rgba(184, 156, 100, 0.4), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* ============================================
   Section 2: The Study
   ============================================ */

.section-study {
    background: #111827;
}

.study-spread {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(4rem, 8vw, 10rem);
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.study-column {
    max-width: 38ch;
    flex: 0 1 38ch;
}

.study-text {
    text-indent: 1.5em;
    margin: 0;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-study.visible .study-text {
    opacity: 1;
    transform: translateY(0);
}

.section-study.visible .study-text:nth-child(1) { transition-delay: 0s; }
.section-study.visible .study-text:nth-child(2) { transition-delay: 0.15s; }
.section-study.visible .study-text:nth-child(3) { transition-delay: 0.3s; }

.section-study.visible .study-right .study-text:nth-child(1) { transition-delay: 0.45s; }
.section-study.visible .study-right .study-text:nth-child(2) { transition-delay: 0.6s; }
.section-study.visible .study-right .study-text:nth-child(3) { transition-delay: 0.75s; }

.study-spine {
    width: 1px;
    align-self: stretch;
    background: rgba(184, 156, 100, 0.15);
    flex-shrink: 0;
}

.study-botanical {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    opacity: 0.5;
}

.study-botanical-left {
    left: 0;
}

.study-botanical-right {
    right: 0;
}

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

/* ============================================
   Section 3: The Vault
   ============================================ */

.section-vault {
    background: #060a14;
}

.mandala {
    width: clamp(280px, 50vw, 500px);
    height: auto;
    margin-bottom: 3rem;
}

.mandala-ring {
    stroke-dasharray: 2200;
    stroke-dashoffset: 2200;
    transition: stroke-dashoffset 2s cubic-bezier(0.65, 0, 0.35, 1);
}

.ring-1 { transition-delay: 0s; stroke-dasharray: 2000; stroke-dashoffset: 2000; }
.ring-2 { transition-delay: 0.4s; stroke-dasharray: 1383; stroke-dashoffset: 1383; }
.ring-3 { transition-delay: 0.8s; stroke-dasharray: 1200; stroke-dashoffset: 1200; }
.ring-4 { transition-delay: 1.2s; stroke-dasharray: 817; stroke-dashoffset: 817; }
.ring-5 { transition-delay: 1.6s; stroke-dasharray: 800; stroke-dashoffset: 800; }

.section-vault.visible .mandala-ring {
    stroke-dashoffset: 0;
}

.vault-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b89c64;
    opacity: 0;
    transition: opacity 1s ease 2s;
}

.section-vault.visible .vault-text {
    opacity: 1;
}

/* ============================================
   Section 4: The Paper
   ============================================ */

.section-paper {
    background: #f4efe6;
    color: #0a0e1a;
    flex-direction: column;
    padding: 0;
}

.paper-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 24px;
    overflow: hidden;
}

.paper-border svg {
    width: 100%;
    height: 24px;
}

.paper-content {
    max-width: 52ch;
    margin: 0 auto;
    padding: 4rem 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.paper-text {
    text-indent: 1.5em;
    margin: 0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    color: #0a0e1a;
    line-height: 1.75;
}

/* ============================================
   Section 5: The Enclosure (Finale)
   ============================================ */

.section-enclosure {
    background: #0a0e1a;
    flex-direction: column;
}

.enclosure-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #f4efe6;
    margin-bottom: 3rem;
    letter-spacing: 0.02em;
}

.wax-seal {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #9a3040, #7a2030 60%, #5a1520);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.4), inset 0 -1px 3px rgba(255,255,255,0.1);
    clip-path: polygon(
        50% 0%, 62% 2%, 75% 5%, 85% 12%, 95% 22%,
        100% 35%, 98% 50%, 100% 65%, 95% 78%, 85% 88%,
        75% 95%, 62% 98%, 50% 100%, 38% 98%, 25% 95%,
        15% 88%, 5% 78%, 0% 65%, 2% 50%, 0% 35%,
        5% 22%, 15% 12%, 25% 5%, 38% 2%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transform: scale(0) rotate(-30deg);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.8s ease;
}

.section-enclosure.visible .wax-seal {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

.seal-letter {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 1.2rem;
    color: #f4efe6;
    letter-spacing: 0;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .study-spread {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .study-spine {
        width: 80%;
        height: 1px;
        align-self: center;
    }

    .study-botanical {
        display: none;
    }

    .section-study.visible .study-right .study-text:nth-child(1) { transition-delay: 0.45s; }
    .section-study.visible .study-right .study-text:nth-child(2) { transition-delay: 0.6s; }
    .section-study.visible .study-right .study-text:nth-child(3) { transition-delay: 0.75s; }
}
