/* ===========================================
   PPEBBL.com - Styles
   A Victorian naturalist's specimen cabinet
   =========================================== */

/* CSS Custom Properties */
:root {
    --color-bg: #F5EDE0;
    --color-card: #FFF8EE;
    --color-text-primary: #3B2F2F;
    --color-text-secondary: #4A3F35;
    --color-text-tertiary: #9E8E7E;
    --color-accent-warm: #C4918A;
    --color-accent-cool: #A8B5A0;
    --color-nav: #8B6F4E;
    --color-shadow: #D4C5A9;
    --color-spot: #7B8DA6;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-label: 'Abril Fatface', Georgia, serif;
    --font-body: 'Lora', Georgia, serif;
    --font-accent: 'IM Fell English', Georgia, serif;

    --ease-lift: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-settle: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-scroll: cubic-bezier(0.45, 0, 0.55, 1);
}

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

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

body {
    background-color: var(--color-bg);
    color: var(--color-text-secondary);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* ===========================================
   Paper Texture & Vignette Overlays
   =========================================== */

#svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

#paper-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.04;
    filter: url(#paper-texture);
    background: var(--color-bg);
}

#vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(74, 63, 53, 0.08) 100%);
}

/* ===========================================
   Scenes (Full-viewport sections)
   =========================================== */

.scene {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8vw;
    z-index: 3;
}

.scene--interlude {
    min-height: 70vh;
}

/* ===========================================
   Opening Void
   =========================================== */

.scene--opening {
    flex-direction: column;
}

.opening-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
}

.site-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(48px, 8vw, 72px);
    color: var(--color-text-primary);
    letter-spacing: 0.03em;
    transition: opacity 2s var(--ease-settle);
    text-align: center;
}

.site-title.faded {
    opacity: 0.6;
}

.opening-pebble {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pebble-shadow--upward {
    width: 60px;
    height: 12px;
    background: radial-gradient(ellipse, rgba(59, 47, 47, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    margin-top: -18px;
    transform: scaleY(-1);
    filter: blur(2px);
}

.scroll-chevron {
    opacity: 0;
    transition: opacity 0.8s var(--ease-settle);
    animation: chevron-bob 3s var(--ease-settle) infinite;
}

.scroll-chevron.visible {
    opacity: 1;
}

@keyframes chevron-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ===========================================
   Pebble Stones (CSS-drawn)
   =========================================== */

.pebble-stone {
    border-radius: 48% 52% 45% 55% / 52% 48% 55% 45%;
    position: relative;
}

.pebble-stone--hero {
    width: 64px;
    height: 52px;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(196, 145, 138, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(168, 181, 160, 0.5) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 60%, rgba(139, 111, 78, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 50%, var(--color-shadow) 0%, #b8a890 100%);
    box-shadow: 0 2px 8px rgba(59, 47, 47, 0.08);
    transition: transform 300ms var(--ease-lift), box-shadow 300ms var(--ease-lift);
}

.pebble-stone--hero:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(59, 47, 47, 0.12);
}

/* Floating pebbles in interlude */
.pebble-stone--float {
    position: absolute;
    left: var(--float-x);
    top: var(--float-y);
    transform: rotate(var(--pebble-rotate, 0deg));
    transition: transform 300ms var(--ease-lift), box-shadow 300ms var(--ease-lift);
    box-shadow: 0 2px 8px rgba(59, 47, 47, 0.08);
    cursor: default;
}

.pebble-stone--float:hover {
    transform: rotate(var(--pebble-rotate, 0deg)) translateY(-6px);
    box-shadow: 0 12px 32px rgba(59, 47, 47, 0.12);
}

.pebble-stone--a {
    width: 56px;
    height: 44px;
    background:
        radial-gradient(ellipse at 35% 45%, rgba(196, 145, 138, 0.7) 0%, transparent 50%),
        radial-gradient(ellipse at 65% 25%, rgba(212, 197, 169, 0.6) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, #c4b8a8 0%, #a89880 100%);
}

.pebble-stone--b {
    width: 42px;
    height: 36px;
    background:
        radial-gradient(ellipse at 40% 30%, rgba(168, 181, 160, 0.7) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 60%, rgba(139, 111, 78, 0.5) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, #b5c0ad 0%, #98a890 100%);
    border-radius: 52% 48% 50% 50% / 48% 52% 50% 50%;
}

.pebble-stone--c {
    width: 70px;
    height: 54px;
    background:
        radial-gradient(ellipse at 25% 35%, rgba(212, 197, 169, 0.6) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 50%, rgba(196, 145, 138, 0.4) 0%, transparent 40%),
        radial-gradient(ellipse at 45% 55%, rgba(139, 111, 78, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, #c2b5a0 0%, #a89680 100%);
    border-radius: 45% 55% 48% 52% / 55% 45% 52% 48%;
}

.pebble-stone--d {
    width: 38px;
    height: 32px;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(123, 141, 166, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 60%, rgba(212, 197, 169, 0.6) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, #b0a898 0%, #988878 100%);
    border-radius: 50% 50% 46% 54% / 54% 46% 50% 50%;
}

.pebble-stone--e {
    width: 48px;
    height: 40px;
    background:
        radial-gradient(ellipse at 40% 35%, rgba(196, 145, 138, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 55%, rgba(168, 181, 160, 0.6) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, #c0b8a5 0%, #a8a088 100%);
    border-radius: 46% 54% 52% 48% / 50% 50% 48% 52%;
}

.pebble-stone--f {
    width: 52px;
    height: 38px;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(139, 111, 78, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 65% 40%, rgba(212, 197, 169, 0.5) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, #bab0a0 0%, #9e9080 100%);
    border-radius: 55% 45% 48% 52% / 48% 52% 55% 45%;
}

.pebble-stone--g {
    width: 34px;
    height: 30px;
    background:
        radial-gradient(ellipse at 45% 40%, rgba(168, 181, 160, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 55% 60%, rgba(196, 145, 138, 0.4) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, #a8b8a0 0%, #90a088 100%);
    border-radius: 50% 50% 45% 55% / 55% 45% 50% 50%;
}

/* Inline decorative pebbles in specimen cards */
.pebble-stone--inline {
    width: 40px;
    height: 32px;
    margin: 24px auto 0;
}

.pebble-stone--sage {
    background:
        radial-gradient(ellipse at 35% 40%, rgba(168, 181, 160, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse at 65% 55%, rgba(212, 197, 169, 0.5) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, var(--color-accent-cool) 0%, #90a088 100%);
}

.pebble-stone--rose {
    background:
        radial-gradient(ellipse at 40% 35%, rgba(196, 145, 138, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 60%, rgba(212, 197, 169, 0.5) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, var(--color-accent-warm) 0%, #b08878 100%);
}

/* Closing pebbles */
.pebble-stone--closing {
    display: inline-block;
}

.pebble-stone--c1 {
    width: 28px;
    height: 22px;
    background:
        radial-gradient(ellipse at 40% 40%, rgba(196, 145, 138, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, var(--color-shadow) 0%, #b8a890 100%);
    margin-right: 16px;
}

.pebble-stone--c2 {
    width: 22px;
    height: 18px;
    background:
        radial-gradient(ellipse at 40% 40%, rgba(168, 181, 160, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, #b0b8a0 0%, #98a888 100%);
    border-radius: 52% 48% 46% 54% / 48% 52% 54% 46%;
    margin-right: 12px;
}

.pebble-stone--c3 {
    width: 18px;
    height: 16px;
    background:
        radial-gradient(ellipse at 45% 45%, rgba(139, 111, 78, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, #c0b0a0 0%, #a89888 100%);
    border-radius: 46% 54% 50% 50% / 54% 46% 50% 50%;
}

/* ===========================================
   Specimen Cards
   =========================================== */

.specimen-card {
    background-color: var(--color-card);
    padding: 48px 56px;
    position: relative;
    transform: rotate(var(--card-rotate, 0deg));
    box-shadow: 0 2px 8px rgba(59, 47, 47, 0.08);
    transition: transform 300ms var(--ease-lift), box-shadow 300ms var(--ease-lift);
    opacity: 0;
    translate: 0 20px;

    /* Specimen border: double-line frame */
    border: 1px solid var(--color-shadow);
    outline: 1px solid rgba(212, 197, 169, 0.5);
    outline-offset: 4px;

    /* Slight irregular edges */
    clip-path: polygon(
        0.3% 0.5%,
        99.5% 0.2%,
        99.8% 99.6%,
        0.5% 99.8%
    );
}

.specimen-card.in-view {
    opacity: 1;
    translate: 0 0;
    transition: opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                translate 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.specimen-card:hover {
    transform: rotate(var(--card-rotate, 0deg)) translateY(-8px);
    box-shadow: 0 12px 32px rgba(59, 47, 47, 0.12);
}

.specimen-card--wide {
    width: min(60vw, 720px);
    max-width: 90vw;
}

.specimen-card--narrow {
    width: min(45vw, 540px);
    max-width: 90vw;
}

/* Corner Ornaments */
.corner-ornament {
    position: absolute;
    z-index: 1;
}

.corner-ornament--tl {
    top: 8px;
    left: 8px;
}

.corner-ornament--tr {
    top: 8px;
    right: 8px;
}

.corner-ornament--bl {
    bottom: 8px;
    left: 8px;
}

.corner-ornament--br {
    bottom: 8px;
    right: 8px;
}

/* Specimen Typography */
.specimen-label {
    display: block;
    font-family: var(--font-label);
    font-size: 22px;
    color: var(--color-nav);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.specimen-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(32px, 4vw, 52px);
    color: var(--color-text-primary);
    letter-spacing: 0.03em;
    margin-bottom: 20px;
    line-height: 1.2;
    transition: transform 300ms var(--ease-lift);
}

.specimen-heading:hover {
    transform: translateY(-3px);
}

.specimen-body {
    font-family: var(--font-body);
    font-size: clamp(16px, 1.8vw, 19px);
    color: var(--color-text-secondary);
    line-height: 1.75;
    max-width: 52ch;
}

.specimen-decoration {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

/* Peeled Corner Effect */
.peeled-corner {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(225deg, var(--color-spot) 50%, transparent 50%);
    clip-path: polygon(100% 0%, 100% 100%, 0% 100%);
    opacity: 0.7;
}

/* ===========================================
   Marginal Notes
   =========================================== */

.marginal-note {
    position: absolute;
    transform: rotate(var(--note-rotate, 0deg));
}

.marginal-note--right {
    right: 4vw;
    top: 50%;
}

.marginal-note--left {
    left: 4vw;
    top: 55%;
}

.note-text {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 13px;
    color: var(--color-text-tertiary);
    opacity: 0.7;
    white-space: nowrap;
}

/* ===========================================
   Pressed Flower Silhouettes
   =========================================== */

.pressed-flowers {
    position: relative;
    z-index: 3;
    height: 20vh;
    pointer-events: none;
}

.pressed-flower {
    position: absolute;
    background-color: var(--color-accent-cool);
    opacity: 0.18;
}

.pressed-flower--circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    left: 30%;
    top: 30%;
}

.pressed-flower--oval-1 {
    width: 18px;
    height: 48px;
    border-radius: 50%;
    left: 33%;
    top: 20%;
    transform: rotate(-30deg);
}

.pressed-flower--oval-2 {
    width: 14px;
    height: 42px;
    border-radius: 50%;
    left: 28%;
    top: 25%;
    transform: rotate(40deg);
}

.pressed-flower--oval-3 {
    width: 16px;
    height: 50px;
    border-radius: 50%;
    right: 25%;
    top: 35%;
    transform: rotate(-15deg);
}

.pressed-flower--circle-2 {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    right: 22%;
    top: 50%;
}

/* ===========================================
   Pebble Navigation
   =========================================== */

#pebble-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.nav-pebble {
    width: 20px;
    height: 16px;
    border-radius: 48% 52% 45% 55% / 52% 48% 55% 45%;
    background:
        radial-gradient(ellipse at 40% 40%, rgba(196, 145, 138, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, var(--color-shadow) 0%, #c0b0a0 100%);
    opacity: 0.4;
    cursor: pointer;
    transition: opacity 300ms var(--ease-lift),
                transform 300ms var(--ease-lift),
                box-shadow 300ms var(--ease-lift);
    position: relative;
    box-shadow: 0 1px 4px rgba(59, 47, 47, 0.06);
}

.nav-pebble:hover {
    opacity: 1;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(59, 47, 47, 0.1);
}

.nav-pebble:hover .pebble-label {
    opacity: 1;
    transform: translateY(0);
}

.nav-pebble.active {
    opacity: 0.8;
}

.nav-pebble--rotating {
    animation: slow-rotate 60s linear infinite;
}

@keyframes slow-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.nav-pebble--rotating:hover {
    animation-play-state: paused;
    transform: translateY(-4px);
}

.pebble-label {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(4px);
    font-family: var(--font-accent);
    font-size: 13px;
    color: var(--color-text-tertiary);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 300ms var(--ease-settle), transform 300ms var(--ease-settle);
    pointer-events: none;
}

/* Nav pebble pulse animation for closing */
@keyframes pebble-pulse {
    0% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
    100% { opacity: 0.4; transform: scale(1); }
}

.nav-pebble.pulsing {
    animation: pebble-pulse 600ms var(--ease-settle) forwards;
}

/* ===========================================
   Floating Pebbles (Interlude)
   =========================================== */

.floating-pebbles {
    position: relative;
    width: 100%;
    height: 60vh;
}

/* ===========================================
   Closing Section
   =========================================== */

.scene--closing {
    flex-direction: column;
}

.scene--closing #vignette-overlay {
    background: radial-gradient(ellipse at center, transparent 40%, rgba(74, 63, 53, 0.15) 100%);
}

.closing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    text-align: center;
}

.closing-text {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: clamp(16px, 2.2vw, 22px);
    color: var(--color-text-tertiary);
    max-width: 48ch;
    line-height: 1.8;
    opacity: 0;
    transition: opacity 1200ms var(--ease-settle);
}

.closing-text.in-view {
    opacity: 1;
}

.closing-pebbles {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

/* ===========================================
   Responsive Adjustments
   =========================================== */

@media (max-width: 768px) {
    .scene {
        padding: 6vw;
    }

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

    .specimen-card--wide,
    .specimen-card--narrow {
        width: 88vw;
        max-width: 88vw;
    }

    #pebble-nav {
        right: 12px;
        gap: 14px;
    }

    .nav-pebble {
        width: 14px;
        height: 12px;
    }

    .pebble-label {
        display: none;
    }

    .marginal-note {
        display: none;
    }

    .specimen-label {
        font-size: 18px;
    }

    .pressed-flowers {
        height: 12vh;
    }
}

@media (max-width: 480px) {
    .specimen-card {
        padding: 24px 20px;
    }

    .opening-content {
        gap: 32px;
    }

    #pebble-nav {
        right: 8px;
        gap: 10px;
    }

    .nav-pebble {
        width: 12px;
        height: 10px;
    }
}
