/* ============================================
   PPEBBL.com - Frutiger Aero x Classical Marble
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --marble-white: #F2EFEA;
    --veined-gray: #C4BEB4;
    --obsidian: #1A1A1E;
    --aero-sky: #3CA5D9;
    --aero-leaf: #6BBF59;
    --golden-hour: #D4A843;
    --deep-plinth: #2A2830;
    --frost-glass: rgba(242, 239, 234, 0.72);
    --overlay-opacity: 0.1;
    --scroll-progress: 0;

    --font-headline: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    --font-accent: 'Space Grotesk', sans-serif;
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1vw + 0.75rem, 1.25rem);
    line-height: 1.8;
    color: var(--obsidian);
    background-color: var(--marble-white);
    overflow-x: hidden;
}

/* --- Frosted Glass Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--frost-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(196, 190, 180, 0.4);
    transition: background 0.4s ease;
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-wordmark {
    font-family: var(--font-headline);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--obsidian);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: font-weight 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    font-family: var(--font-accent);
    font-size: clamp(0.625rem, 0.5vw + 0.5rem, 0.875rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--obsidian);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--golden-hour);
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.nav-link:hover {
    color: var(--deep-plinth);
}

/* --- Hero / Parallax Marble Atrium --- */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    perspective: 1000px;
}

.hero-parallax-container {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.hero-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Layer 0 - Nature photography */
.hero-layer--nature {
    z-index: 1;
}

.nature-window {
    position: absolute;
    border-radius: 2px;
}

.nature-window--sky {
    top: 10%;
    left: 15%;
    width: 30%;
    height: 35%;
    background: linear-gradient(180deg, #87CEEB 0%, #3CA5D9 40%, #B0D4E8 100%);
    filter: blur(2px);
    opacity: 0.8;
    clip-path: polygon(10% 0%, 90% 0%, 95% 100%, 5% 100%);
}

.nature-window--foliage {
    top: 20%;
    right: 10%;
    width: 25%;
    height: 40%;
    background: linear-gradient(160deg, #8BC34A 0%, #6BBF59 30%, #4A8C3F 70%, #2E5927 100%);
    filter: blur(2px);
    opacity: 0.7;
    clip-path: polygon(5% 0%, 100% 5%, 95% 95%, 0% 100%);
}

.nature-window--water {
    bottom: 15%;
    left: 35%;
    width: 35%;
    height: 25%;
    background: linear-gradient(180deg, #3CA5D9 0%, #2A8AB8 50%, #1A6A94 100%);
    filter: blur(3px);
    opacity: 0.6;
    clip-path: polygon(0% 10%, 100% 0%, 95% 100%, 5% 90%);
}

/* Layer 1 - Marble texture */
.hero-layer--marble {
    z-index: 2;
}

.marble-surface {
    position: absolute;
    inset: 0;
    background: var(--marble-white);
    opacity: 0.85;
}

.marble-surface::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(196, 190, 180, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(196, 190, 180, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(196, 190, 180, 0.12) 0%, transparent 45%);
}

.marble-veining {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Layer 2 - Frosted glass */
.hero-layer--frost {
    z-index: 3;
}

.frost-panel {
    position: absolute;
    background: var(--frost-glass);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.frost-panel--left {
    top: 25%;
    left: 0;
    width: 18%;
    height: 50%;
    clip-path: polygon(0% 0%, 100% 5%, 95% 100%, 0% 95%);
}

.frost-panel--right {
    top: 15%;
    right: 0;
    width: 15%;
    height: 60%;
    clip-path: polygon(5% 0%, 100% 0%, 100% 100%, 10% 95%);
}

/* Layer 3 - Content */
.hero-layer--content {
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.hero-headline {
    font-family: var(--font-headline);
    font-size: clamp(3.5rem, 8vw + 1rem, 10rem);
    font-weight: 400;
    color: var(--obsidian);
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 1.5rem;
    transition: text-shadow 0.3s ease;
    text-shadow: 0 2px 40px rgba(242, 239, 234, 0.5);
}

.hero-subtitle {
    font-family: var(--font-accent);
    font-size: clamp(0.75rem, 0.8vw + 0.5rem, 1.1rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--deep-plinth);
    opacity: 0.8;
    margin-bottom: 2rem;
}

.hero-ornament {
    margin-top: 1rem;
    opacity: 0.7;
}

.acanthus-leaf {
    display: block;
}

/* Scroll-linked darkening overlay */
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(42, 40, 48, var(--overlay-opacity));
    pointer-events: none;
    transition: background 0.1s linear;
}

/* Glossy highlight on hero marble */
.hero-layer--marble::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    pointer-events: none;
}

/* --- Section Headers --- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 4rem 2rem 3rem;
}

.section-title {
    font-family: var(--font-headline);
    font-size: clamp(2rem, 3vw + 0.5rem, 4rem);
    font-weight: 700;
    color: var(--obsidian);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.gold-rule {
    flex: 1;
    max-width: 200px;
    height: 1px;
    background: var(--golden-hour);
    opacity: 0.6;
}

/* --- Masonry Grid --- */
.masonry-section {
    position: relative;
    padding: 0 2rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.masonry-section--deeper {
    background: linear-gradient(180deg, var(--marble-white) 0%, rgba(196, 190, 180, 0.3) 100%);
}

.masonry-grid {
    position: relative;
    column-count: 3;
    column-gap: 1.5rem;
}

/* Colonnade lines */
.colonnade-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--veined-gray);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.colonnade-line--left {
    left: -1rem;
}

.colonnade-line--right {
    right: -1rem;
}

/* --- Masonry Cells --- */
.cell {
    position: relative;
    break-inside: avoid;
    margin-bottom: 1.5rem;
    border-radius: 2px;
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(26, 26, 30, 0.12),
        0 2px 8px rgba(26, 26, 30, 0.08);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.cell:hover {
    transform: scale(1.02);
    box-shadow:
        0 12px 48px rgba(26, 26, 30, 0.18),
        0 4px 16px rgba(26, 26, 30, 0.12);
}

.cell--tall {
    min-height: 400px;
}

.cell--short {
    min-height: 180px;
}

/* Marble cell */
.cell--marble {
    background: var(--marble-white);
    background-image:
        radial-gradient(ellipse at 30% 40%, rgba(196, 190, 180, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(196, 190, 180, 0.1) 0%, transparent 40%);
}

.cell--marble::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(196, 190, 180, 0.08) 100%);
    pointer-events: none;
}

/* Glass cell */
.cell--glass {
    background: var(--frost-glass);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(196, 190, 180, 0.3);
}

/* Shadow well cell */
.cell--shadow {
    background: var(--deep-plinth);
    color: var(--marble-white);
}

.cell--shadow .cell-title {
    color: var(--marble-white);
}

.cell--shadow .cell-text {
    color: rgba(242, 239, 234, 0.8);
}

.cell--shadow .cell-number {
    color: var(--golden-hour);
}

/* Window cell (nature reveal) */
.cell--window {
    background: var(--marble-white);
}

.nature-reveal {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.nature-image {
    position: absolute;
    inset: 0;
    filter: blur(2px) saturate(0.8);
    opacity: 0.85;
}

.nature-image--canopy {
    background: linear-gradient(160deg, #2E7D32 0%, #6BBF59 30%, #8BC34A 60%, #A5D6A7 100%);
}

.nature-image--stones {
    background: linear-gradient(180deg, #78909C 0%, #B0BEC5 30%, #90A4AE 60%, #607D8B 100%);
}

.nature-image--droplets {
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 30%, #03A9F4 60%, #0288D1 100%);
}

.window-marble-frame {
    position: absolute;
    inset: 0;
    border: 20px solid var(--marble-white);
    border-radius: 2px;
    box-shadow: inset 0 0 60px rgba(242, 239, 234, 0.6);
    pointer-events: none;
}

.cell-content--overlay {
    position: relative;
    z-index: 2;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.cell-content--overlay .cell-title {
    color: #fff;
}

.cell-content--overlay .cell-caption {
    color: rgba(255, 255, 255, 0.85);
}

/* Collision cell */
.cell--collision {
    background: linear-gradient(135deg, var(--deep-plinth) 0%, var(--deep-plinth) 50%, var(--frost-glass) 50%, rgba(242, 239, 234, 0.9) 100%);
    border: 1px solid rgba(196, 190, 180, 0.2);
}

/* Veining overlay on glass cells */
.veining-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Cell content */
.cell-content {
    position: relative;
    z-index: 1;
    padding: 2rem;
}

.cell-title {
    font-family: var(--font-headline);
    font-size: clamp(1.4rem, 1.5vw + 0.5rem, 2rem);
    font-weight: 700;
    color: var(--obsidian);
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.cell-text {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 0.8vw + 0.5rem, 1.1rem);
    line-height: 1.7;
    color: rgba(26, 26, 30, 0.75);
}

.cell-caption {
    display: block;
    font-family: var(--font-accent);
    font-size: clamp(0.625rem, 0.5vw + 0.4rem, 0.75rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--aero-sky);
    margin-bottom: 0.75rem;
}

.cell-number {
    display: block;
    font-family: var(--font-headline);
    font-size: 3rem;
    font-weight: 900;
    color: var(--veined-gray);
    opacity: 0.4;
    line-height: 1;
    margin-bottom: 1rem;
}

/* Glossy highlight on cells */
.cell-gloss {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    z-index: 3;
}

.cell:hover .cell-gloss {
    transform: translateX(0);
}

/* --- Full-bleed Parallax Interludes --- */
.interlude {
    position: relative;
    height: 80vh;
    min-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.interlude-bg {
    position: absolute;
    inset: -20%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.interlude-bg--sky {
    background: linear-gradient(180deg,
        #B3E5FC 0%,
        #81D4FA 15%,
        #4FC3F7 30%,
        #3CA5D9 50%,
        #0288D1 75%,
        #01579B 100%);
}

.interlude-bg--foliage {
    background: linear-gradient(160deg,
        #1B5E20 0%,
        #2E7D32 20%,
        #43A047 40%,
        #6BBF59 55%,
        #8BC34A 70%,
        #AED581 85%,
        #C5E1A5 100%);
}

.interlude-frost {
    position: relative;
    z-index: 2;
    background: var(--frost-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 4rem 3rem;
    max-width: 800px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(196, 190, 180, 0.3);
    border-radius: 2px;
    box-shadow: 0 16px 64px rgba(26, 26, 30, 0.15);
}

.interlude-frost--dark {
    background: rgba(42, 40, 48, 0.75);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(212, 168, 67, 0.2);
}

.interlude-statement {
    font-family: var(--font-headline);
    font-size: clamp(1.5rem, 2.5vw + 0.5rem, 3rem);
    font-weight: 700;
    color: var(--obsidian);
    letter-spacing: -0.02em;
    line-height: 1.4;
    margin-top: 1.5rem;
}

.interlude-frost--dark .interlude-statement {
    color: var(--marble-white);
}

.interlude--dark .acanthus-leaf--large path {
    stroke: var(--golden-hour);
}

.acanthus-leaf--large {
    display: block;
    margin: 0 auto;
}

/* --- Footer / Sunken Plinth --- */
.footer {
    background: var(--deep-plinth);
    position: relative;
    padding: 6rem 2rem;
    box-shadow: inset 0 8px 32px rgba(0, 0, 0, 0.3);
}

.footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(196, 190, 180, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 40%, rgba(196, 190, 180, 0.03) 0%, transparent 40%);
    pointer-events: none;
}

.footer-inner {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.footer-ornament {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.footer-ornament--bottom {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    margin-bottom: 0;
}

.footer-title {
    font-family: var(--font-headline);
    font-size: clamp(2.5rem, 4vw + 1rem, 5rem);
    font-weight: 900;
    color: var(--marble-white);
    letter-spacing: -0.02em;
    text-shadow:
        0 1px 0 rgba(196, 190, 180, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.5),
        inset 0 -1px 0 rgba(212, 168, 67, 0.2);
    margin-bottom: 1rem;
}

.footer-text {
    font-family: var(--font-accent);
    font-size: clamp(0.7rem, 0.6vw + 0.5rem, 0.9rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--veined-gray);
    margin-bottom: 2rem;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.footer-link {
    font-family: var(--font-accent);
    font-size: clamp(0.625rem, 0.5vw + 0.4rem, 0.8rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--veined-gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--golden-hour);
}

.footer-divider {
    color: rgba(196, 190, 180, 0.3);
    font-size: 0.5rem;
}

/* --- Responsive --- */

/* Tablet: 2-column stagger */
@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 2;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .hero-headline {
        font-size: clamp(3rem, 6vw + 1rem, 7rem);
    }

    .frost-panel--left,
    .frost-panel--right {
        display: none;
    }
}

/* Mobile: single column */
@media (max-width: 640px) {
    .masonry-grid {
        column-count: 1;
    }

    .nav-inner {
        padding: 0.75rem 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.625rem;
    }

    .section-header {
        padding: 3rem 1rem 2rem;
        gap: 1rem;
    }

    .gold-rule {
        max-width: 60px;
    }

    .masonry-section {
        padding: 0 1rem 3rem;
    }

    .cell-content {
        padding: 1.5rem;
    }

    .interlude {
        height: 60vh;
        min-height: 400px;
    }

    .interlude-frost {
        padding: 2.5rem 1.5rem;
    }

    .footer {
        padding: 4rem 1.5rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-divider {
        display: none;
    }

    .hero-headline {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }
}

/* --- Aero Glow Gradient (hover accents) --- */
.cell--glass:hover {
    border-color: rgba(60, 165, 217, 0.3);
}

.cell--shadow:hover {
    box-shadow:
        0 12px 48px rgba(26, 26, 30, 0.25),
        0 0 0 1px rgba(212, 168, 67, 0.15);
}

/* Progress indicator gradient (Aero Glow) on nav scroll */
.nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: calc(var(--scroll-progress, 0) * 100%);
    height: 2px;
    background: linear-gradient(135deg, #3CA5D9 0%, #6BBF59 50%, #D4A843 100%);
    transition: width 0.1s linear;
}

/* Marble depth gradient for deeper sections */
.masonry-section--deeper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(196, 190, 180, 0.1) 50%, rgba(42, 40, 48, 0.05) 100%);
    pointer-events: none;
}

/* Cell z-depth variations */
.cell:nth-child(odd) {
    transform: scale(1.0);
}

.cell:nth-child(3n+1) {
    transform: scale(1.01);
}

.cell:nth-child(3n+2) {
    transform: scale(1.015);
}

.cell:nth-child(3n) {
    transform: scale(1.0);
}

.cell:hover {
    transform: scale(1.03);
}
