/* recycle.reviews - The Recycling Codex */
/* A scholarly treatise on the art of refuse classification */

:root {
    --bg-deep: #0b1120;
    --bg-mid: #121a2e;
    --bg-recessed: #162447;
    --accent-gold: #a2884e;
    --text-primary: #e8dcc8;
    --text-secondary: #c4bba8;
    --text-tertiary: #7a7060;
    --divider: #3d3520;
    --glow: rgba(162, 136, 78, 0.12);
    --unfilled: #2a2a3e;
}

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

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

body {
    background-color: var(--bg-deep);
    color: var(--text-secondary);
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.78;
    overflow-x: hidden;
}

/* Navigation Numerals */
#codex-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 100;
}

.nav-numeral {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: #5a5040;
    text-decoration: none;
    transition: color 0.4s ease, text-shadow 0.4s ease;
    display: block;
    text-align: center;
}

.nav-numeral.active {
    color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(162, 136, 78, 0.4);
}

.nav-numeral:hover {
    color: var(--accent-gold);
}

/* Folio Base Styles */
.folio {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    overflow: hidden;
}

.folio-i { z-index: 1; background-color: var(--bg-deep); }
.folio-ii { z-index: 2; background-color: var(--bg-mid); }
.folio-iii { z-index: 3; background-color: var(--bg-deep); }
.folio-iv { z-index: 4; background-color: var(--bg-mid); }
.folio-v { z-index: 5; background-color: var(--bg-deep); }

.folio-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.15s, transform 0.6s ease 0.15s;
}

.folio.is-visible .folio-content,
.folio.is-visible .folio-ii-layout,
.folio.is-visible .methodology-layout {
    opacity: 1;
    transform: translateY(0);
}

/* Folio Number */
.folio-number {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 0.8rem;
    font-variant: small-caps;
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
}

/* Ornamental Divider */
.ornamental-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
    height: 1px;
    background: var(--divider);
}

.ornamental-divider span {
    position: relative;
    top: -0.55em;
    padding: 0 1em;
    font-size: 0.6rem;
    color: var(--divider);
    line-height: 1;
}

.folio-i .ornamental-divider span,
.folio-iii .ornamental-divider span,
.folio-v .ornamental-divider span {
    background-color: var(--bg-deep);
}

.folio-ii .ornamental-divider span,
.folio-iv .ornamental-divider span {
    background-color: var(--bg-mid);
}

/* Section Heading */
.section-heading {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: 0.02em;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

/* ================================ */
/* FOLIO I - The Frontispiece       */
/* ================================ */
.folio-i {
    flex-direction: column;
    position: relative;
}

.folio-i-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.site-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    font-size: clamp(3rem, 7vw, 6.5rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.epigraph {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 40ch;
    margin: 0 auto;
}

/* Blob Styles */
.blob {
    position: absolute;
    border-radius: 40% 60% 55% 45% / 35% 65% 40% 60%;
    background: radial-gradient(ellipse at center, var(--bg-recessed), transparent 70%);
    pointer-events: none;
}

.blob-i {
    width: 60vw;
    height: 60vw;
    max-width: 700px;
    max-height: 700px;
    background: radial-gradient(ellipse at center, #1a2744, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.4);
    opacity: 0.6;
    animation: blobMorph1 25s ease-in-out infinite;
    z-index: 1;
}

.blob-ii {
    width: 100%;
    height: 100%;
    opacity: 0.8;
    animation: blobMorph2 30s ease-in-out infinite;
    background: radial-gradient(ellipse at center, var(--bg-recessed), transparent 65%);
}

.blob-v {
    width: 200px;
    height: 200px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.5;
    animation: blobMorph3 15s ease-in-out infinite;
    z-index: -1;
}

@keyframes blobMorph1 {
    0%   { border-radius: 40% 60% 55% 45% / 35% 65% 40% 60%; }
    25%  { border-radius: 55% 45% 40% 60% / 60% 40% 55% 45%; }
    50%  { border-radius: 45% 55% 60% 40% / 45% 55% 35% 65%; }
    75%  { border-radius: 60% 40% 45% 55% / 55% 45% 60% 40%; }
    100% { border-radius: 40% 60% 55% 45% / 35% 65% 40% 60%; }
}

@keyframes blobMorph2 {
    0%   { border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%; }
    33%  { border-radius: 35% 65% 55% 45% / 45% 55% 65% 35%; }
    66%  { border-radius: 60% 40% 50% 50% / 50% 50% 40% 60%; }
    100% { border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%; }
}

@keyframes blobMorph3 {
    0%   { border-radius: 45% 55% 50% 50% / 50% 50% 55% 45%; }
    50%  { border-radius: 55% 45% 45% 55% / 55% 45% 45% 55%; }
    100% { border-radius: 45% 55% 50% 50% / 50% 50% 55% 45%; }
}

/* ================================ */
/* FOLIO II - Index of Reviews      */
/* ================================ */
.folio-ii-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    align-items: center;
    padding: 80px 60px;
    gap: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.15s, transform 0.6s ease 0.15s;
}

.review-listings {
    width: 60%;
    padding-right: 40px;
}

.blob-plate {
    width: 40%;
    height: 60vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-entry {
    margin-bottom: 0.5rem;
}

.review-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.01em;
}

.review-meta {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
}

.review-rating {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1rem;
    letter-spacing: 0.15em;
    margin-bottom: 0.35rem;
    color: var(--accent-gold);
}

.review-excerpt {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 55ch;
}

/* ================================ */
/* FOLIO III - Featured Review      */
/* ================================ */
.folio-iii {
    position: relative;
}

.flourishes-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.flourish {
    position: absolute;
    width: 50%;
    opacity: 0.08;
}

.flourish-1 {
    top: 10%;
    left: 5%;
}

.flourish-2 {
    top: 50%;
    right: 0;
    left: auto;
}

.flourish-3 {
    bottom: 15%;
    left: 20%;
}

.flourish-4 {
    top: 30%;
    left: 10%;
}

.flourish-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawFlourish 8s ease-in-out forwards;
}

@keyframes drawFlourish {
    to { stroke-dashoffset: 0; }
}

.featured-review {
    max-width: 55ch;
    text-align: left;
    position: relative;
    z-index: 1;
    padding: 60px 20px;
}

.featured-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.featured-author {
    font-size: 0.88rem;
    color: var(--text-tertiary);
    margin-bottom: 2rem;
}

.featured-body p {
    margin-bottom: 1.5rem;
    text-align: justify;
    hyphens: auto;
}

.drop-cap {
    float: left;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    font-size: 4.5rem;
    line-height: 0.8;
    padding-right: 0.15em;
    padding-top: 0.05em;
    color: var(--accent-gold);
    border-bottom: 2px solid var(--divider);
}

.featured-rating {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    color: var(--accent-gold);
    text-align: center;
    margin-top: 2rem;
}

/* ================================ */
/* FOLIO IV - Methodology           */
/* ================================ */
.folio-iv {
    position: relative;
}

.methodology-layout {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    padding: 80px 40px;
    align-items: start;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.15s, transform 0.6s ease 0.15s;
}

.methodology-main {
    max-width: 50ch;
    justify-self: center;
}

.methodology-main p {
    margin-bottom: 1.25rem;
    text-align: justify;
    hyphens: auto;
}

.methodology-main sup {
    font-size: 0.7em;
    color: var(--accent-gold);
}

.methodology-main strong {
    color: var(--text-primary);
    font-weight: 700;
}

.margin-left,
.margin-right {
    padding-top: 80px;
}

.marginal-note {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--text-tertiary);
    margin-bottom: 2rem;
}

.footnotes {
    margin-top: 2rem;
}

.footnote {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-tertiary);
    margin-bottom: 0.8rem;
}

.footnote sup {
    font-size: 0.65em;
    color: var(--accent-gold);
    margin-right: 0.3em;
}

/* ================================ */
/* FOLIO V - The Colophon           */
/* ================================ */
.colophon-content {
    text-align: center;
    max-width: 500px;
}

.colophon-ornament {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    height: 140px;
}

.colophon-device {
    width: 120px;
    height: 120px;
    position: relative;
    z-index: 2;
}

.colophon-text {
    margin-top: 1rem;
}

.colophon-line {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 0.88rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.colophon-publisher {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--accent-gold);
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.colophon-details {
    margin: 1.5rem 0;
}

.colophon-details .colophon-line {
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
}

.colophon-motto {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.25rem;
}

.colophon-translation {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

/* ================================ */
/* Responsive                       */
/* ================================ */
@media (max-width: 768px) {
    #codex-nav {
        top: auto;
        bottom: 20px;
        right: 50%;
        transform: translateX(50%);
        flex-direction: row;
        gap: 20px;
        background: rgba(11, 17, 32, 0.85);
        padding: 10px 20px;
        border-radius: 30px;
        backdrop-filter: blur(8px);
    }

    .folio-ii-layout {
        flex-direction: column;
        padding: 60px 24px;
    }

    .review-listings {
        width: 100%;
        padding-right: 0;
    }

    .blob-plate {
        width: 100%;
        height: 30vh;
        position: relative;
    }

    .methodology-layout {
        grid-template-columns: 1fr;
        padding: 60px 24px;
    }

    .margin-left,
    .margin-right {
        padding-top: 0;
    }

    .marginal-note {
        padding-left: 1.5rem;
        border-left: 2px solid var(--divider);
        margin-bottom: 1.25rem;
    }

    .featured-review {
        padding: 40px 24px;
    }

    .site-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .folio-number {
        bottom: 60px;
    }
}

@media (max-width: 480px) {
    .review-excerpt {
        display: none;
    }

    .epigraph br {
        display: none;
    }
}
