/* ============================================
   PPEBBL.com — Styles
   Minimalist editorial design system
   ============================================ */

/* --- Custom Properties --- */
:root {
    --bg-primary: #f4f1ec;
    --bg-alternate: #eae5dc;
    --text-primary: #3d3a36;
    --text-secondary: #5a554d;
    --text-tertiary: #8a8279;
    --accent-sage: #6b8f71;
    --accent-terracotta: #c4705a;
    --rule-color: #c8c0b4;
    --particle-moss: #b5c7a9;
    --hover-blush: #e8d5c4;

    --font-family: 'Commissioner', sans-serif;
    --bg-scroll: var(--bg-primary);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-weight: 350;
    font-size: 1.0625rem;
    line-height: 1.85;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
    background-color: var(--bg-scroll);
    overflow-x: hidden;
    transition: background-color 0.8s ease;
}

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

/* --- Navigation Toggle --- */
#nav-toggle {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 100;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    padding: 0;
}

#nav-toggle:hover {
    opacity: 1;
}

#nav-toggle svg {
    display: block;
}

/* --- Navigation Overlay --- */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 200;
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-close {
    position: absolute;
    top: 24px;
    right: 32px;
    background: none;
    border: none;
    font-family: var(--font-family);
    font-size: 2rem;
    font-weight: 200;
    color: var(--text-primary);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    line-height: 1;
    padding: 0;
}

.nav-close:hover {
    opacity: 1;
}

.nav-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-family: var(--font-family);
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.04em;
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-sage);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-sage);
    transition: width 0.4s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* --- Spreads (Sections) --- */
.spread {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 96px 48px;
}

/* --- Pause Zones --- */
.pause-zone {
    position: relative;
    z-index: 1;
    height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pause-rule {
    width: 1px;
    height: 60%;
    background-color: var(--rule-color);
    opacity: 0.4;
}

/* ============================================
   SPREAD 1: HERO
   ============================================ */
.spread-hero {
    min-height: 100vh;
    padding-bottom: 0;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.hero-title {
    font-family: var(--font-family);
    font-weight: 200;
    font-size: clamp(3rem, 12vw, 10rem);
    letter-spacing: 0.06em;
    color: var(--text-primary);
    text-transform: uppercase;
    text-align: center;
    line-height: 1;
    margin-bottom: 48px;
}

.hero-botanical {
    width: 120px;
    height: 300px;
    position: relative;
}

.botanical-sedge {
    width: 100%;
    height: 100%;
}

/* ============================================
   SPREAD 2: PHILOSOPHY
   ============================================ */
.spread-philosophy {
    padding: 128px 48px;
}

.philosophy-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 64px;
    max-width: 1100px;
    width: 100%;
    align-items: start;
}

.philosophy-illustration {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.botanical-watermint {
    width: 100%;
    max-width: 320px;
    height: auto;
}

.philosophy-text {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.section-heading {
    font-family: var(--font-family);
    font-weight: 200;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.04em;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 16px;
}

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

.body-text {
    font-family: var(--font-family);
    font-weight: 350;
    font-size: 1.0625rem;
    line-height: 1.85;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
    max-width: 38em;
}

.centered-text {
    text-align: center;
}

/* Pull Quote */
.pull-quote {
    position: relative;
    padding-left: 32px;
    margin: 16px 0;
}

.pull-quote-rule {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 0;
    background-color: var(--rule-color);
    transition: height 0.6s ease;
}

.pull-quote.animated .pull-quote-rule {
    height: 100%;
}

.pull-quote p {
    font-family: var(--font-family);
    font-weight: 100;
    font-style: italic;
    font-size: clamp(1.25rem, 3vw, 2rem);
    line-height: 1.6;
    letter-spacing: 0.01em;
    color: var(--accent-sage);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease 0.6s, transform 0.5s ease 0.6s;
}

.pull-quote.animated p {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   SPREAD 3: COLLECTION
   ============================================ */
.spread-collection {
    padding: 128px 48px;
}

.collection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-width: 700px;
    width: 100%;
    margin-top: 64px;
}

.specimen-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px 32px;
    border: 1px solid var(--rule-color);
    margin: -0.5px;
}

.specimen-illustration {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.specimen-illustration svg {
    width: 100%;
    height: 100%;
}

.specimen-label {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 0.75rem;
    font-variant: small-caps;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    margin-top: 24px;
    text-align: center;
}

/* ============================================
   SPREAD 4: DETAIL
   ============================================ */
.spread-detail {
    padding: 128px 48px;
}

.detail-diagram {
    max-width: 800px;
    width: 100%;
    margin-top: 48px;
}

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

.annotation-label {
    opacity: 0;
    transition: opacity 0.8s ease 1.5s;
}

.detail-diagram.animated .annotation-label {
    opacity: 1;
}

/* ============================================
   SPREAD 5: CLOSE
   ============================================ */
.spread-close {
    min-height: 100vh;
}

.close-content {
    text-align: center;
}

.close-text {
    font-family: var(--font-family);
    font-weight: 200;
    font-size: clamp(1.5rem, 5vw, 4rem);
    letter-spacing: 0.04em;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    position: relative;
    z-index: 1;
    padding: 64px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.footer-rule {
    width: 60px;
    height: 1px;
    background-color: var(--rule-color);
}

.footer-text {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 0.75rem;
    font-variant: small-caps;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
}

/* ============================================
   SVG DRAW ANIMATIONS
   ============================================ */
.draw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2.5s ease;
}

.animated .draw-line,
.draw-line.animated {
    stroke-dashoffset: 0;
}

.annotation-line {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.5s ease;
}

.animated .annotation-line {
    stroke-dashoffset: 0;
}

/* ============================================
   FADE-IN ANIMATION
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Staggered delays for siblings */
.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }
.fade-in:nth-child(4) { transition-delay: 0.3s; }
.fade-in:nth-child(5) { transition-delay: 0.4s; }
.fade-in:nth-child(6) { transition-delay: 0.5s; }
.fade-in:nth-child(7) { transition-delay: 0.6s; }

/* ============================================
   WATERMARK BACKGROUNDS
   ============================================ */
.spread-philosophy::before {
    content: '';
    position: absolute;
    top: 10%;
    right: -5%;
    width: 40%;
    height: 60%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 500' fill='none'%3E%3Cpath d='M150 480 C150 380 145 300 150 220 C155 140 148 80 150 20' stroke='%235a554d' stroke-width='1'/%3E%3Cpath d='M150 350 C110 310 70 290 30 280' stroke='%235a554d' stroke-width='1'/%3E%3Cpath d='M150 350 C190 310 230 290 270 280' stroke='%235a554d' stroke-width='1'/%3E%3Cpath d='M150 250 C120 220 85 200 50 195' stroke='%235a554d' stroke-width='1'/%3E%3Cpath d='M150 250 C180 220 215 200 250 195' stroke='%235a554d' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.03;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 0;
}

.spread-close::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 140' fill='none'%3E%3Cellipse cx='100' cy='70' rx='90' ry='60' stroke='%235a554d' stroke-width='1'/%3E%3Cellipse cx='100' cy='70' rx='60' ry='40' stroke='%235a554d' stroke-width='0.5' stroke-dasharray='4 4'/%3E%3Cellipse cx='100' cy='70' rx='30' ry='20' stroke='%235a554d' stroke-width='0.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    opacity: 0.03;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   PEBBLE CONTAINER SHAPES
   ============================================ */
.pebble-shape {
    border-radius: 47% 53% 42% 58% / 55% 45% 48% 52%;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .spread {
        padding: 64px 24px;
    }

    .philosophy-layout {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .philosophy-illustration {
        order: -1;
    }

    .botanical-watermint {
        max-width: 200px;
    }

    .collection-grid {
        grid-template-columns: 1fr;
        max-width: 350px;
    }

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

    .pause-zone {
        height: 30vh;
    }

    .spread-philosophy,
    .spread-collection,
    .spread-detail {
        padding: 80px 24px;
    }

    .detail-diagram {
        max-width: 100%;
    }

    #nav-toggle {
        top: 16px;
        left: 16px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2rem, 16vw, 4rem);
    }

    .section-heading {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .close-text {
        font-size: clamp(1.2rem, 5vw, 2.5rem);
    }

    .specimen-card {
        padding: 32px 24px 24px;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .draw-line,
    .annotation-line {
        stroke-dasharray: none;
        stroke-dashoffset: 0;
        transition: none;
    }

    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .pull-quote-rule {
        height: 100% !important;
        transition: none;
    }

    .pull-quote p {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .annotation-label {
        opacity: 1;
        transition: none;
    }
}
