:root {
    --bg-parchment: #F5EDE0;
    --bg-mahogany: #2B1810;
    --text-sepia: #3D2B1F;
    --gold: #C5963A;
    --copper: #8B6E4E;
    --verdigris: #5B7C6B;
    --champagne: #E8D5B5;
    --umber: #4A3728;

    --font-display: 'Poiret One', sans-serif;
    --font-body: 'Cormorant Garamond', serif;
    --font-accent: 'Libre Baskerville', serif;
}

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

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

body {
    font-family: var(--font-body);
    background: var(--bg-parchment);
    color: var(--text-sepia);
    line-height: 1.9;
    overflow-x: hidden;
}

/* ========================
   BORDER ORNAMENTS (Margin Columns)
   ======================== */
.border-ornament {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 10;
    pointer-events: none;
}

.border-ornament--left {
    left: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 8px,
        rgba(197, 150, 58, 0.08) 8px,
        rgba(197, 150, 58, 0.08) 9px
    );
}

.border-ornament--right {
    right: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(197, 150, 58, 0.08) 8px,
        rgba(197, 150, 58, 0.08) 9px
    );
}

/* ========================
   PLATES (Folio Pages)
   ======================== */
.plate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 6rem;
}

.plate__content {
    max-width: 1400px;
    width: 100%;
    position: relative;
}

.plate__grid {
    max-width: 1400px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2.4rem;
    padding: 0 6rem;
    position: relative;
}

/* ========================
   PLATE I: THE FRONTISPIECE
   ======================== */
.plate-i {
    background: var(--bg-parchment);
    text-align: center;
    flex-direction: column;
}

.plate-i__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(3.5rem, 12vw, 9rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-sepia);
    margin-bottom: 2rem;
    line-height: 1;
    position: relative;
    z-index: 2;
}

.hero-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px);
}

.hero-char.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-char--dot {
    color: var(--gold);
}

/* Icosahedron (3D CSS Polyhedron) */
.icosahedron {
    width: 280px;
    height: 280px;
    position: relative;
    margin: 0 auto 3rem;
    transform-style: preserve-3d;
    z-index: 1;
}

.ico-face {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 104px solid rgba(197, 150, 58, 0.15);
    left: 50%;
    top: 50%;
    transform-origin: center center;
    filter: drop-shadow(0 0 1px #4A3728);
}

.ico-face--1  { transform: translate(-50%, -50%) rotateX(0deg) rotateY(0deg) translateZ(80px); }
.ico-face--2  { transform: translate(-50%, -50%) rotateX(0deg) rotateY(30deg) translateZ(80px); }
.ico-face--3  { transform: translate(-50%, -50%) rotateX(0deg) rotateY(60deg) translateZ(80px); }
.ico-face--4  { transform: translate(-50%, -50%) rotateX(0deg) rotateY(90deg) translateZ(80px); }
.ico-face--5  { transform: translate(-50%, -50%) rotateX(0deg) rotateY(120deg) translateZ(80px); }
.ico-face--6  { transform: translate(-50%, -50%) rotateX(0deg) rotateY(150deg) translateZ(80px); }
.ico-face--7  { transform: translate(-50%, -50%) rotateX(60deg) rotateY(0deg) translateZ(80px); }
.ico-face--8  { transform: translate(-50%, -50%) rotateX(60deg) rotateY(60deg) translateZ(80px); }
.ico-face--9  { transform: translate(-50%, -50%) rotateX(60deg) rotateY(120deg) translateZ(80px); }
.ico-face--10 { transform: translate(-50%, -50%) rotateX(-60deg) rotateY(30deg) translateZ(80px); }
.ico-face--11 { transform: translate(-50%, -50%) rotateX(-60deg) rotateY(90deg) translateZ(80px); }
.ico-face--12 { transform: translate(-50%, -50%) rotateX(-60deg) rotateY(150deg) translateZ(80px); }

.ico-face:nth-child(odd) {
    border-bottom-color: rgba(197, 150, 58, 0.2);
}

.ico-face:nth-child(even) {
    border-bottom-color: rgba(232, 213, 181, 0.15);
}

/* Chevron Hint */
.chevron-hint {
    margin-top: 3rem;
    opacity: 0;
    animation: chevronPulse 2.5s ease-in-out infinite;
    animation-delay: 1.5s;
}

.chevron-svg {
    width: 40px;
    height: 20px;
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0; transform: translateY(0); }
    50% { opacity: 0.7; transform: translateY(6px); }
}

/* ========================
   CHEVRON DIVIDERS
   ======================== */
.chevron-divider {
    width: 100%;
    line-height: 0;
    position: relative;
    z-index: 5;
    margin: -1px 0;
}

.chevron-divider__svg {
    width: 100%;
    height: 40px;
    display: block;
}

/* ========================
   Z-PATTERN LAYOUT
   ======================== */
.z-visual--top-right {
    grid-column: 7 / 11;
    grid-row: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
}

.z-text--bottom-left {
    grid-column: 3 / 7;
    grid-row: 1;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    position: relative;
    align-self: end;
}

.z-visual--top-left {
    grid-column: 3 / 7;
    grid-row: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
}

.z-text--bottom-right {
    grid-column: 7 / 11;
    grid-row: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    align-self: end;
}

/* Z-Lines (Diagonal Gold Connectors) */
.z-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.z-line__stroke {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.z-line__stroke.is-drawn {
    stroke-dashoffset: 0;
}

/* ========================
   SKELETON LOADING
   ======================== */
.skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--champagne);
    border-radius: 4px;
    overflow: hidden;
    z-index: 3;
    clip-path: polygon(0 0, calc(100% - 2rem) 0, 100% 2rem, 100% 100%, 0 100%);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.skeleton--text {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.skeleton--card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.skeleton__line {
    background: rgba(197, 150, 58, 0.15);
    border-radius: 3px;
    height: 14px;
}

.skeleton__line--title {
    width: 60%;
    height: 20px;
}

.skeleton__line--body {
    width: 100%;
}

.skeleton__line--short {
    width: 75%;
}

.skeleton__shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(197, 150, 58, 0.25), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skeleton.is-revealed {
    opacity: 0;
    filter: blur(8px);
    pointer-events: none;
}

/* ========================
   CONTENT REVEAL
   ======================== */
.plate__text-content,
.triptych-card__content {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(12px);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.plate__text-content.is-revealed,
.triptych-card__content.is-revealed {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Pyramid, keyword-frames, crystal hidden until reveal */
.pyramid,
.keyword-frames,
.crystal {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(12px);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pyramid.is-revealed,
.keyword-frames.is-revealed,
.crystal.is-revealed {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* ========================
   TYPOGRAPHY
   ======================== */
.section-numeral {
    display: block;
    font-family: var(--font-accent);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--gold);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.section-numeral--center {
    text-align: center;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-sepia);
    margin-bottom: 1.5rem;
}

.section-title--center {
    text-align: center;
}

.section-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    line-height: 1.9;
    letter-spacing: 0.02em;
    color: var(--text-sepia);
    max-width: 520px;
}

.drop-cap {
    font-family: var(--font-accent);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2rem, 5vw, 4rem);
    float: left;
    line-height: 0.8;
    margin-right: 0.15em;
    margin-top: 0.05em;
    color: var(--gold);
    transform: scale(0);
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.drop-cap.is-visible {
    transform: scale(1);
}

/* ========================
   PLATE II: STEPPED PYRAMID
   ======================== */
.plate-ii {
    background: var(--bg-parchment);
}

.plate-ii__visual {
    min-height: 300px;
    position: relative;
}

.plate-ii__text {
    position: relative;
    min-height: 300px;
    padding: 2rem 0;
}

.pyramid {
    width: 220px;
    height: 260px;
    position: relative;
    margin: 0 auto;
    perspective: 600px;
}

.pyramid-layer {
    position: absolute;
    left: 50%;
    background: linear-gradient(135deg, #C5963A 0%, #8B6E4E 50%, #2B1810 100%);
    border: 1px solid rgba(74, 55, 40, 0.3);
}

.pyramid-layer--1 {
    width: 200px;
    height: 40px;
    bottom: 0;
    transform: translateX(-50%);
}

.pyramid-layer--2 {
    width: 160px;
    height: 40px;
    bottom: 44px;
    transform: translateX(-50%);
}

.pyramid-layer--3 {
    width: 120px;
    height: 40px;
    bottom: 88px;
    transform: translateX(-50%);
}

.pyramid-layer--4 {
    width: 80px;
    height: 40px;
    bottom: 132px;
    transform: translateX(-50%);
}

.pyramid-layer--5 {
    width: 40px;
    height: 40px;
    bottom: 176px;
    transform: translateX(-50%);
}

/* ========================
   PLATE III: KEYWORD FRAMES + CRYSTAL
   ======================== */
.plate-iii {
    background: var(--bg-mahogany);
}

.plate-iii .section-numeral,
.plate-iii .section-title,
.plate-iii .section-body {
    color: var(--champagne);
}

.plate-iii__visual {
    min-height: 300px;
    position: relative;
}

.plate-iii__text {
    min-height: 300px;
    position: relative;
}

.keyword-frames {
    position: relative;
    width: 280px;
    height: 260px;
    margin: 0 auto;
}

.keyword-frame {
    position: absolute;
    border: 2px solid var(--gold);
    clip-path: polygon(0 0, calc(100% - 1.5rem) 0, 100% 1.5rem, 100% 100%, 0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 2rem;
    background: rgba(197, 150, 58, 0.08);
}

.keyword-frame--1 {
    top: 0;
    left: 0;
    width: 200px;
    height: 80px;
    z-index: 3;
}

.keyword-frame--2 {
    top: 60px;
    left: 40px;
    width: 200px;
    height: 80px;
    z-index: 2;
}

.keyword-frame--3 {
    top: 120px;
    left: 80px;
    width: 200px;
    height: 80px;
    z-index: 1;
}

.keyword-frame__text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--champagne);
}

/* Angular Crystal */
.crystal {
    width: 120px;
    height: 240px;
    position: relative;
    margin: 0 auto;
}

.crystal-face {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.crystal-face--top {
    top: 0;
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 80px solid rgba(197, 150, 58, 0.25);
}

.crystal-face--left {
    top: 80px;
    left: 0;
    width: 60px;
    height: 80px;
    background: linear-gradient(180deg, rgba(197, 150, 58, 0.25), rgba(43, 24, 16, 0.4));
    transform: skewY(0deg);
}

.crystal-face--right {
    top: 80px;
    right: 0;
    left: auto;
    width: 60px;
    height: 80px;
    background: linear-gradient(180deg, rgba(232, 213, 181, 0.2), rgba(43, 24, 16, 0.3));
    transform: skewY(0deg);
}

.crystal-face--bottom {
    bottom: 0;
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-top: 80px solid rgba(139, 110, 78, 0.25);
}

.crystal-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 30%, rgba(232, 213, 181, 0.3) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: crystalShimmer 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes crystalShimmer {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

/* ========================
   PLATE IV: THE ARCHIVE (Triptych)
   ======================== */
.plate-iv {
    background: var(--bg-parchment);
}

.triptych {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.4rem;
    margin-top: 3rem;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.triptych-card {
    position: relative;
    background: var(--champagne);
    clip-path: polygon(0 0, calc(100% - 2rem) 0, 100% 2rem, 100% 100%, 0 100%);
    padding: 2.5rem 2rem;
    min-height: 280px;
}

.triptych-card--1 {
    transform: translateY(0);
}

.triptych-card--2 {
    transform: translateY(2rem);
}

.triptych-card--3 {
    transform: translateY(4rem);
}

.triptych-card__numeral {
    display: block;
    font-family: var(--font-accent);
    font-weight: 700;
    font-style: italic;
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.triptych-card__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-sepia);
    margin-bottom: 1rem;
}

.triptych-card__text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    line-height: 1.8;
    letter-spacing: 0.02em;
    color: var(--umber);
}

/* ========================
   PLATE V: THE COLOPHON
   ======================== */
.plate-v {
    background: var(--bg-mahogany);
    text-align: center;
}

.plate-v__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4rem;
}

.colophon-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(3rem, 10vw, 8rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--champagne);
    margin-bottom: 2rem;
    line-height: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.colophon-title.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Gold Rule with Diamonds */
.gold-rule {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.gold-rule__line {
    width: 120px;
    height: 1px;
    background: var(--gold);
}

.gold-rule__diamond {
    width: 8px;
    height: 8px;
    background: var(--gold);
    transform: rotate(45deg);
    flex-shrink: 0;
}

.colophon-coda {
    font-family: var(--font-body);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.8;
    color: var(--champagne);
    max-width: 500px;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease 0.3s, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s;
}

.colophon-coda.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.colophon-year {
    font-family: var(--font-accent);
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.35em;
    color: rgba(232, 213, 181, 0.3);
}

/* Corner Ornaments */
.corner-ornament {
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: var(--gold);
    border-style: solid;
    opacity: 0.3;
}

.corner-ornament--tl {
    top: 0;
    left: 0;
    border-width: 2px 0 0 2px;
}

.corner-ornament--tr {
    top: 0;
    right: 0;
    border-width: 2px 2px 0 0;
}

.corner-ornament--bl {
    bottom: 0;
    left: 0;
    border-width: 0 0 2px 2px;
}

.corner-ornament--br {
    bottom: 0;
    right: 0;
    border-width: 0 2px 2px 0;
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 1024px) {
    .plate {
        padding: 4rem 2rem;
    }

    .plate__grid {
        padding: 0 2rem;
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }

    .z-visual--top-right,
    .z-visual--top-left,
    .z-text--bottom-left,
    .z-text--bottom-right {
        grid-column: auto;
    }

    .z-line {
        display: none;
    }

    .triptych {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .triptych-card--1,
    .triptych-card--2,
    .triptych-card--3 {
        transform: translateY(0);
    }

    .border-ornament {
        width: 30px;
    }
}

@media (max-width: 768px) {
    .plate {
        padding: 3rem 1.5rem;
    }

    .plate__grid {
        padding: 0;
    }

    .hero-title {
        font-size: clamp(2.5rem, 10vw, 5rem);
        letter-spacing: 0.1em;
    }

    .icosahedron {
        width: 180px;
        height: 180px;
        margin-bottom: 2rem;
    }

    .border-ornament {
        display: none;
    }

    .keyword-frames {
        width: 220px;
        height: 220px;
    }

    .keyword-frame {
        width: 160px;
        height: 65px;
    }

    .keyword-frame--2 {
        left: 30px;
        top: 50px;
    }

    .keyword-frame--3 {
        left: 60px;
        top: 100px;
    }

    .colophon-title {
        font-size: clamp(2rem, 8vw, 4rem);
        -webkit-text-stroke: 1px var(--champagne);
    }

    .pyramid {
        width: 160px;
        height: 200px;
    }

    .pyramid-layer--1 { width: 150px; }
    .pyramid-layer--2 { width: 120px; }
    .pyramid-layer--3 { width: 90px; }
    .pyramid-layer--4 { width: 60px; }
    .pyramid-layer--5 { width: 30px; }
}

@media (max-width: 480px) {
    .plate {
        min-height: auto;
        padding: 2.5rem 1rem;
    }

    .plate-i,
    .plate-v {
        min-height: 100vh;
    }

    .section-title {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }

    .triptych-card {
        padding: 1.5rem;
        min-height: 200px;
    }

    .crystal {
        width: 80px;
        height: 160px;
    }

    .crystal-face--top {
        border-left-width: 40px;
        border-right-width: 40px;
        border-bottom-width: 53px;
    }

    .crystal-face--left {
        width: 40px;
        height: 54px;
        top: 53px;
    }

    .crystal-face--right {
        width: 40px;
        height: 54px;
        top: 53px;
    }

    .crystal-face--bottom {
        border-left-width: 40px;
        border-right-width: 40px;
        border-top-width: 53px;
    }
}
