/* ====================================
   ppss.ee — Watercolor on Concrete
   Brutalist Editorial Design
   ==================================== */

:root {
    --concrete: #E8E4DF;
    --ink: #1C1917;
    --bubblegum: #F72585;
    --lemon: #FFD166;
    --mint: #06D6A0;
    --blueberry: #4361EE;
    --tangerine: #FF6B35;
    --structural: #A8A29E;
    --deep: #292524;
    --accent: var(--bubblegum);
    --accent-desat: #F7258580;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    background-color: var(--concrete);
    color: var(--ink);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    line-height: 1.72;
    overflow-x: hidden;
    position: relative;
}

/* Concrete noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ---- Noise SVG (hidden) ---- */
.noise-svg {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ---- Fixed Site Title ---- */
.site-title {
    position: fixed;
    top: 24px;
    left: 24px;
    font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--ink);
    z-index: 100;
    opacity: 0.7;
}

/* ---- Folio Navigation ---- */
.folio-nav {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.folio-numeral {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--ink);
    letter-spacing: -0.02em;
    transition: color 0.6s ease;
}

.progress-track {
    width: 2px;
    height: 80px;
    background: rgba(168, 162, 158, 0.3);
    position: relative;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--accent);
    transition: background-color 0.6s ease;
}

/* ---- Folio Overlay ---- */
.folio-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(41, 37, 36, 0.92);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.folio-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.folio-overlay-inner {
    position: relative;
    text-align: center;
}

.folio-overlay-close {
    position: absolute;
    top: -60px;
    right: 0;
    background: none;
    border: none;
    color: var(--concrete);
    font-size: 2rem;
    cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
}

.folio-list {
    list-style: none;
}

.folio-list li {
    margin: 16px 0;
}

.folio-list a {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--concrete);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
    display: inline-block;
}

.folio-list a:hover {
    color: var(--bubblegum);
}

/* ---- Grid Overlay ---- */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    opacity: 0.08;
    background-image: repeating-linear-gradient(
        to right,
        transparent,
        transparent calc((100% - 48px - 160px) / 6 + 32px - 1px),
        var(--structural) calc((100% - 48px - 160px) / 6 + 32px - 1px),
        var(--structural) calc((100% - 48px - 160px) / 6 + 32px)
    );
    background-position: 80px 0;
    background-size: calc((100% - 48px - 160px) / 6 + 32px) 100%;
    transition: opacity 0.5s ease;
}

/* ---- Folios ---- */
.folio {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.folio-border {
    position: absolute;
    top: 24px;
    right: 24px;
    bottom: 24px;
    left: 24px;
    border: 4px solid var(--accent);
    pointer-events: none;
    z-index: 10;
    transition: border-color 0.6s ease;
}

[data-accent="bubblegum"] .folio-border { border-color: var(--bubblegum); }
[data-accent="lemon"] .folio-border { border-color: var(--lemon); }
[data-accent="mint"] .folio-border { border-color: var(--mint); }
[data-accent="blueberry"] .folio-border { border-color: var(--blueberry); }
[data-accent="tangerine"] .folio-border { border-color: var(--tangerine); }

/* ---- Background Numerals ---- */
.folio-bg-numeral {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: 20vw;
    color: var(--structural);
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
    line-height: 1;
    user-select: none;
}

/* ---- Folio Grid ---- */
.folio-grid {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 32px;
    min-height: 100vh;
    padding: 80px 80px 80px 80px;
    align-items: center;
}

/* ---- Folio Titles ---- */
.folio-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1.05;
    margin-bottom: 1.5rem;
}

.title-hero {
    font-size: clamp(4rem, 10vw, 8rem);
    letter-spacing: 0.3em;
    text-align: center;
}

/* ---- Body Text ---- */
.body-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    line-height: 1.72;
    color: var(--ink);
    max-width: 42ch;
    margin-bottom: 1.5em;
}

/* ---- Drop Caps ---- */
.drop-cap::first-letter {
    float: left;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: 4.5em;
    line-height: 0.8;
    margin-right: 0.08em;
    margin-top: 0.05em;
    padding: 4px 8px;
    border: 1px solid currentColor;
    border-color: inherit;
}

[data-accent="bubblegum"] .drop-cap::first-letter {
    color: var(--bubblegum);
    border-color: rgba(247, 37, 133, 0.2);
}
[data-accent="lemon"] .drop-cap::first-letter {
    color: var(--lemon);
    border-color: rgba(255, 209, 102, 0.2);
}
[data-accent="mint"] .drop-cap::first-letter {
    color: var(--mint);
    border-color: rgba(6, 214, 160, 0.2);
}
[data-accent="blueberry"] .drop-cap::first-letter {
    color: var(--blueberry);
    border-color: rgba(67, 97, 238, 0.2);
}
[data-accent="tangerine"] .drop-cap::first-letter {
    color: var(--tangerine);
    border-color: rgba(255, 107, 53, 0.2);
}

/* ---- Epigraph ---- */
.epigraph {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 1.3vw, 1.4rem);
    color: var(--ink);
    opacity: 0.7;
    text-align: center;
    max-width: 50ch;
    margin: 0 auto;
}

/* ---- Pull Quote ---- */
.pull-quote {
    text-align: center;
    max-width: 80%;
    margin: 0 auto;
}

.pull-quote p {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    line-height: 1.3;
    color: var(--mint);
    letter-spacing: -0.01em;
}

/* ---- Marginal Notes ---- */
.marginal-note {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--ink);
    opacity: 0.65;
    transform: rotate(-2deg);
    padding-left: 16px;
    position: relative;
}

.marginal-note::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
}

[data-accent="lemon"] .marginal-note::before { background: var(--lemon); }
[data-accent="blueberry"] .marginal-note::before { background: var(--blueberry); }

/* ---- Ornamental Rules ---- */
.ornamental-rule {
    text-align: center;
    margin: 2em 0;
    user-select: none;
}

.ornamental-rule span {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: 6px;
    letter-spacing: 12px;
    color: var(--structural);
    display: inline-block;
}

/* ---- Concrete Joints ---- */
.concrete-joint {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    z-index: 20;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='6'%3E%3Cfilter id='j'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='6' filter='url(%23j)' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
}

[data-accent="bubblegum"] + .folio .concrete-joint,
[data-accent="bubblegum"] .concrete-joint {
    background-color: rgba(247, 37, 133, 0.15);
}
[data-accent="lemon"] .concrete-joint {
    background-color: rgba(255, 209, 102, 0.2);
}
[data-accent="mint"] .concrete-joint {
    background-color: rgba(6, 214, 160, 0.15);
}
[data-accent="blueberry"] .concrete-joint {
    background-color: rgba(67, 97, 238, 0.15);
}
[data-accent="tangerine"] .concrete-joint {
    background-color: rgba(255, 107, 53, 0.15);
}

/* ---- Watercolor Washes ---- */
.watercolor-wash {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: multiply;
    will-change: transform;
}

/* Folio I: Bubblegum wash, top-right */
.wash-1 {
    top: -15%;
    right: -20%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(ellipse at 40% 40%,
        rgba(247, 37, 133, 0.25) 0%,
        rgba(247, 37, 133, 0.12) 40%,
        rgba(247, 37, 133, 0.04) 70%,
        transparent 100%
    );
    filter: blur(80px);
    clip-path: polygon(15% 0%, 100% 0%, 100% 85%, 60% 100%, 30% 80%, 0% 50%, 5% 20%);
}

/* Folio II: Lemon wash, left */
.wash-2 {
    top: 10%;
    left: -25%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(ellipse at 60% 50%,
        rgba(255, 209, 102, 0.28) 0%,
        rgba(255, 209, 102, 0.14) 45%,
        rgba(255, 209, 102, 0.05) 70%,
        transparent 100%
    );
    filter: blur(90px);
    clip-path: polygon(0% 10%, 40% 0%, 80% 15%, 100% 50%, 85% 90%, 40% 100%, 0% 75%);
}

/* Folio III: Mint wash, bottom */
.wash-3 {
    bottom: -20%;
    left: 10%;
    width: 75vw;
    height: 50vw;
    background: radial-gradient(ellipse at 50% 70%,
        rgba(6, 214, 160, 0.25) 0%,
        rgba(6, 214, 160, 0.12) 40%,
        rgba(6, 214, 160, 0.04) 70%,
        transparent 100%
    );
    filter: blur(100px);
    clip-path: polygon(10% 20%, 50% 0%, 90% 15%, 100% 60%, 80% 100%, 20% 100%, 0% 65%);
}

/* Folio IV: Blueberry wash, center */
.wash-4 {
    top: 20%;
    left: 30%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(ellipse at 50% 50%,
        rgba(67, 97, 238, 0.22) 0%,
        rgba(67, 97, 238, 0.1) 45%,
        rgba(67, 97, 238, 0.03) 75%,
        transparent 100%
    );
    filter: blur(100px);
    clip-path: polygon(20% 5%, 70% 0%, 100% 30%, 90% 75%, 50% 100%, 10% 80%, 0% 40%);
}

/* Folio V: Converging washes */
.wash-5a {
    top: 15%;
    left: 5%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle,
        rgba(247, 37, 133, 0.18) 0%,
        rgba(247, 37, 133, 0.06) 60%,
        transparent 100%
    );
    filter: blur(70px);
}

.wash-5b {
    top: 25%;
    right: 10%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle,
        rgba(255, 209, 102, 0.2) 0%,
        rgba(255, 209, 102, 0.07) 60%,
        transparent 100%
    );
    filter: blur(70px);
}

.wash-5c {
    bottom: 20%;
    left: 20%;
    width: 38vw;
    height: 38vw;
    background: radial-gradient(circle,
        rgba(6, 214, 160, 0.18) 0%,
        rgba(6, 214, 160, 0.06) 60%,
        transparent 100%
    );
    filter: blur(70px);
}

.wash-5d {
    bottom: 15%;
    right: 15%;
    width: 32vw;
    height: 32vw;
    background: radial-gradient(circle,
        rgba(67, 97, 238, 0.18) 0%,
        rgba(67, 97, 238, 0.06) 60%,
        transparent 100%
    );
    filter: blur(70px);
}

.wash-5e {
    top: 40%;
    left: 35%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle,
        rgba(255, 107, 53, 0.2) 0%,
        rgba(255, 107, 53, 0.07) 60%,
        transparent 100%
    );
    filter: blur(70px);
}

/* ---- Folio Content Positioning ---- */

/* Folio I: centered */
.folio-1-content {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Folio II: starts at column 2, 3-col span */
.folio-2-content {
    grid-column: 2 / 5;
    align-self: center;
}

.folio-2-margin {
    grid-column: 5 / 7;
    align-self: start;
    margin-top: 180px;
}

/* Folio III: centered full-width */
.folio-3-content {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Folio IV: starts at column 1, 3-col span */
.folio-4-content {
    grid-column: 1 / 4;
    align-self: center;
}

.folio-4-margin {
    grid-column: 5 / 7;
    align-self: start;
    margin-top: 200px;
}

/* Folio V: centered, narrower */
.folio-5-content {
    grid-column: 2 / 6;
    text-align: center;
    align-self: center;
}

/* ---- Coda Domain Letters ---- */
.coda-domain {
    margin-top: 3rem;
    font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: lowercase;
}

.coda-letter {
    display: inline-block;
    transition: color 0.3s ease;
    animation: codaCycle 8s ease-in-out infinite;
}

.coda-letter[data-color="bubblegum"] { color: var(--bubblegum); animation-delay: 0s; }
.coda-letter[data-color="lemon"] { color: var(--lemon); animation-delay: 1.6s; }
.coda-letter[data-color="mint"] { color: var(--mint); animation-delay: 3.2s; }
.coda-letter[data-color="blueberry"] { color: var(--blueberry); animation-delay: 4.8s; }
.coda-letter[data-color="tangerine"] { color: var(--tangerine); animation-delay: 6.4s; }

@keyframes codaCycle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.coda-text {
    font-size: clamp(0.9rem, 1vw, 1.05rem);
    max-width: 50ch;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Scroll Reveal Animation ---- */
.reveal-block {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-block.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Responsive: Tablet ---- */
@media (max-width: 768px) {
    .folio-border {
        top: 12px;
        right: 12px;
        bottom: 12px;
        left: 12px;
        border-width: 2px;
    }

    .folio-grid {
        grid-template-columns: 1fr;
        padding: 60px 32px;
        gap: 24px;
    }

    .folio-1-content,
    .folio-2-content,
    .folio-3-content,
    .folio-4-content,
    .folio-5-content {
        grid-column: 1 / -1;
    }

    .folio-2-margin,
    .folio-4-margin {
        grid-column: 1 / -1;
        margin-top: 24px;
        transform: rotate(0deg);
        text-align: right;
    }

    .site-title {
        top: 14px;
        left: 14px;
    }

    .folio-nav {
        left: 14px;
    }

    .grid-overlay {
        display: none;
    }

    .body-text {
        max-width: 100%;
    }

    .pull-quote {
        max-width: 100%;
    }

    .pull-quote p {
        font-size: clamp(1.4rem, 5vw, 2.2rem);
    }

    .folio-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }

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

/* ---- Responsive: Mobile ---- */
@media (max-width: 480px) {
    .folio-border {
        display: none;
    }

    .folio-grid {
        padding: 48px 20px;
    }

    .site-title {
        font-size: 9px;
    }

    .folio-nav {
        left: 10px;
    }

    .folio-numeral {
        font-size: 1.2rem;
    }

    .progress-track {
        height: 50px;
    }

    .folio-bg-numeral {
        font-size: 30vw;
    }
}
