/* MasqueradeProtocol.com - Venetian Cryptographic Soiree */

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

:root {
    --void: #0B0B0F;
    --smoke: #2A2A35;
    --gilded: #C9A84C;
    --bronze: #8B6914;
    --parchment: #F5ECD7;
    --burgundy: #4A0E2C;
    --cipher: #39FF85;
    --gold-glow: 0 0 4px rgba(201, 168, 76, 0.4);
    --tilt-x: 0deg;
    --tilt-y: 0deg;
}

html, body {
    background: var(--void);
    color: var(--parchment);
    font-family: 'Cormorant Garamond', serif;
    overflow-x: hidden;
}

body {
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

/* Cipher rain background */
.cipher-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 28px,
            rgba(57, 255, 133, 0.012) 28px,
            rgba(57, 255, 133, 0.012) 29px
        ),
        radial-gradient(ellipse at top, rgba(74, 14, 44, 0.18), transparent 60%),
        radial-gradient(ellipse at bottom, rgba(74, 14, 44, 0.12), transparent 70%);
}

.cipher-bg::before {
    content: "01001100 10110010 11001100 0xA17F 0x4A0E2C 11010101 00101010 0xC9A84C 11110001 PROTOCOL MASK_v3 IDENTITY CONCEALED 0x8B6914 01101100 KEY EXCHANGE 0xF5EC 11001010 01010101 0xCAFE 0xBABE PROTOCOL 11000111 0xDEAD 0xBEEF 10101010 MASQUERADE 01111000 0x0B0B0F 11110000 PROTOCOL_v3.7 IDENTITY 01001100 10110010 11001100 0xA17F 0x4A0E2C 11010101 00101010 0xC9A84C 11110001 0x8B6914 01101100 0xF5EC 11001010 01010101 0xCAFE 0xBABE 11000111 0xDEAD 0xBEEF 10101010 01111000 0x0B0B0F 11110000";
    position: absolute;
    inset: 0;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: var(--cipher);
    opacity: 0.045;
    word-spacing: 14px;
    letter-spacing: 0.2em;
    line-height: 1.9;
    padding: 30px 18px;
    overflow: hidden;
    animation: cipherDrift 90s linear infinite;
}

@keyframes cipherDrift {
    from { transform: translateY(0); }
    to { transform: translateY(-50%); }
}

/* Chambers */
.chamber {
    min-height: 100vh;
    position: relative;
    padding: 120px clamp(24px, 8vw, 120px) 100px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dark-chamber {
    background:
        linear-gradient(180deg, rgba(42, 42, 53, 0.96) 0%, rgba(11, 11, 15, 0.98) 100%);
}

/* Diagonal section seams */
.chamber + .chamber::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 80px;
    background: inherit;
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 100%);
    z-index: 0;
    opacity: 0.6;
    pointer-events: none;
}

/* Chamber heads */
.chamber-head {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
}

.chamber-head.centered { text-align: center; }

.chamber-numeral {
    display: inline-block;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5em;
    color: var(--gilded);
    padding: 4px 18px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 1px;
    margin-bottom: 18px;
}

.chamber-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--parchment);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 14px;
}

.chamber-sub {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(15px, 1.4vw, 18px);
    color: rgba(245, 236, 215, 0.55);
    max-width: 500px;
    margin: 0 auto;
}

/* ───────────── Hero / Foyer ───────────── */
.chamber-foyer {
    justify-content: center;
    text-align: center;
    background:
        radial-gradient(ellipse at center, rgba(74, 14, 44, 0.22), transparent 65%),
        var(--void);
}

.metadata-line {
    position: absolute;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: rgba(201, 168, 76, 0.55);
    z-index: 3;
}

.metadata-line.top-left { top: 30px; left: 36px; }
.metadata-line.top-right { top: 30px; right: 70px; }

.meta-key { color: var(--gilded); }
.meta-sep { color: rgba(245, 236, 215, 0.4); margin: 0 6px; }
.meta-val { color: var(--cipher); }

/* Hero mask */
.mask-hero {
    width: clamp(280px, 36vw, 460px);
    aspect-ratio: 11 / 9;
    margin: 30px auto 50px;
    perspective: 1000px;
}

.mask-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    transform-style: preserve-3d;
    transform: perspective(800px) rotateY(var(--tilt-x)) rotateX(var(--tilt-y));
    transition: transform 0.18s ease-out;
    will-change: transform;
}

.mask-left, .mask-right {
    width: 50%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.mask-left {
    background: linear-gradient(135deg, var(--gilded) 0%, var(--bronze) 70%, #5a440b 100%);
    clip-path: polygon(0% 18%, 30% 4%, 50% 0%, 50% 100%, 38% 96%, 12% 92%, 0% 76%);
    box-shadow: inset -2px 0 0 rgba(11, 11, 15, 0.5);
    animation: maskLeftIn 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

.mask-right {
    background: var(--void);
    border: 1.5px solid var(--gilded);
    border-left: none;
    clip-path: polygon(50% 0%, 70% 4%, 100% 18%, 100% 76%, 88% 92%, 62% 96%, 50% 100%);
    filter: drop-shadow(var(--gold-glow));
    animation: maskRightIn 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

@keyframes maskLeftIn {
    from { transform: translateX(-30%) rotateY(-40deg); opacity: 0; }
    to { transform: translateX(0) rotateY(0); opacity: 1; }
}

@keyframes maskRightIn {
    from { transform: translateX(30%) rotateY(40deg); opacity: 0; }
    to { transform: translateX(0) rotateY(0); opacity: 1; }
}

.mask-eye {
    position: absolute;
    top: 38%;
    width: 26%;
    height: 18%;
    border-radius: 50%;
    background: var(--void);
    box-shadow: inset 0 0 0 2px var(--bronze);
}

.mask-left .mask-eye { right: 14%; }
.mask-right .mask-eye {
    left: 14%;
    background: var(--void);
    box-shadow: inset 0 0 0 1.5px var(--gilded);
}

.mask-filigree {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.mask-filigree svg {
    width: 100%;
    height: 100%;
}

.mask-seam {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(201, 168, 76, 0.6), transparent);
    transform: translateX(-50%);
    pointer-events: none;
}

.mask-particles {
    position: absolute;
    inset: -10%;
    pointer-events: none;
}

.gold-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gilded);
    filter: drop-shadow(0 0 4px rgba(201, 168, 76, 0.8));
    animation: particleDisperse 1.4s ease-out forwards;
    pointer-events: none;
}

@keyframes particleDisperse {
    from { opacity: 1; transform: translate(0, 0) scale(1); }
    to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); }
}

.hero-eyebrow {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.5em;
    color: var(--gilded);
    text-transform: uppercase;
    margin-bottom: 14px;
    opacity: 0;
    animation: fadeUp 1s ease 1.6s forwards;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-style: italic;
    font-size: clamp(2.4rem, 6vw, 5.5rem);
    color: var(--parchment);
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 22px;
    text-shadow: 0 0 30px rgba(201, 168, 76, 0.2);
    opacity: 0;
    animation: fadeUp 1s ease 1.8s forwards;
}

.hero-cipher {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(16px, 1.5vw, 19px);
    color: rgba(245, 236, 215, 0.7);
    max-width: 540px;
    margin: 0 auto 50px;
    opacity: 0;
    animation: fadeUp 1s ease 2.1s forwards;
}

.cipher-quote {
    border-left: 1px solid var(--gilded);
    border-right: 1px solid var(--gilded);
    padding: 0 22px;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.scroll-cue {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.3em;
    color: rgba(201, 168, 76, 0.55);
    text-align: center;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 1s ease 2.6s forwards;
}

.cue-arrow {
    display: block;
    margin-top: 8px;
    color: var(--gilded);
    animation: cueBounce 2s ease-in-out infinite;
}

@keyframes cueBounce {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(6px); opacity: 1; }
}

/* Filigree dividers */
.filigree-divider {
    width: min(600px, 88%);
    margin: 30px auto;
    opacity: 0.85;
}

.filigree-divider.hero-divider {
    margin-top: 10px;
}

.filigree-svg {
    width: 100%;
    height: 36px;
    overflow: visible;
}

.draw-path {
    filter: drop-shadow(var(--gold-glow));
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
}

.in-view .draw-path {
    animation: drawFiligree 2.4s ease forwards;
}

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

/* ───────────── Gallery / Timeline ───────────── */
.chamber-gallery {
    background:
        linear-gradient(180deg, var(--void) 0%, rgba(42, 42, 53, 0.4) 50%, var(--void) 100%);
}

.timeline {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 60px auto 40px;
    padding: 40px 0;
}

.timeline-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: linear-gradient(180deg,
        transparent 0%,
        var(--gilded) 8%,
        var(--bronze) 50%,
        var(--gilded) 92%,
        transparent 100%);
    transform: translateX(-50%);
    box-shadow: var(--gold-glow);
}

.timeline-card {
    position: relative;
    width: 46%;
    margin-bottom: 60px;
    opacity: 0;
    transform: scale(0.6) rotate(45deg);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
}

.timeline-card.card-left {
    margin-right: auto;
    padding-right: 50px;
    text-align: right;
}

.timeline-card.card-right {
    margin-left: auto;
    padding-left: 50px;
}

.timeline-card.in-view {
    opacity: 1;
    transform: scale(1) rotate(0);
}

.card-shape {
    position: relative;
    background: linear-gradient(135deg, rgba(42, 42, 53, 0.85), rgba(11, 11, 15, 0.95));
    border: 1px solid rgba(201, 168, 76, 0.35);
    padding: 28px 32px;
    transition: border-color 0.4s, transform 0.4s, box-shadow 0.4s;
    will-change: transform;
}

.timeline-card.card-left .card-shape {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 8% 100%, 0 80%);
}

.timeline-card.card-right .card-shape {
    clip-path: polygon(0 0, 100% 0, 100% 80%, 92% 100%, 0 100%);
}

.card-shape:hover {
    border-color: var(--gilded);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(201, 168, 76, 0.2);
}

.card-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--gilded);
    opacity: 0.8;
}
.card-corner.tl { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.card-corner.tr { top: 6px; right: 6px; border-left: none; border-bottom: none; }
.card-corner.bl { bottom: 6px; left: 6px; border-right: none; border-top: none; }
.card-corner.br { bottom: 6px; right: 6px; border-left: none; border-top: none; }

.card-step {
    display: block;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.3em;
    color: var(--gilded);
    margin-bottom: 8px;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(20px, 2.4vw, 28px);
    color: var(--parchment);
    margin-bottom: 12px;
}

.card-body {
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px;
    line-height: 1.65;
    color: rgba(245, 236, 215, 0.78);
    margin-bottom: 14px;
}

.card-meta {
    display: inline-block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--cipher);
    padding: 4px 10px;
    border: 1px solid rgba(57, 255, 133, 0.3);
}

.timeline-node {
    position: absolute;
    top: 32px;
    width: 16px;
    height: 16px;
    background: var(--void);
    border: 2px solid var(--gilded);
    transform: rotate(45deg);
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.6);
}

.card-left .timeline-node {
    right: -8px;
}

.card-right .timeline-node {
    left: -8px;
}

.mask-ornament {
    position: absolute;
    bottom: 30px;
    right: 4%;
    width: 130px;
    height: 100px;
    opacity: 0.35;
    pointer-events: none;
}

.orn-svg { width: 100%; height: 100%; }

.orn-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2.5s ease;
}

.in-view .orn-path { stroke-dashoffset: 0; }

/* ───────────── Inner Sanctum / Bento ───────────── */
.chamber-sanctum {
    background:
        linear-gradient(180deg, var(--smoke) 0%, var(--void) 100%);
}

.bento-grid {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 280px;
    gap: 22px;
    margin: 0 auto 60px;
    perspective: 1400px;
}

.bento-cell {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.bento-cell:nth-child(1) { grid-column: span 1; grid-row: span 2; }
.bento-cell:nth-child(2) { grid-column: span 2; }
.bento-cell:nth-child(3) { grid-column: span 1; }
.bento-cell:nth-child(4) { grid-column: span 1; grid-row: span 2; }
.bento-cell:nth-child(5) { grid-column: span 1; }
.bento-cell:nth-child(6) { grid-column: span 1; }

.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-cell:hover .flip-inner,
.bento-cell.flipped .flip-inner {
    transform: rotateY(180deg);
}

.bento-cell:not(:hover):not(.flipped) {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.flip-front, .flip-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.flip-front {
    background:
        linear-gradient(135deg, rgba(11, 11, 15, 0.92), rgba(42, 42, 53, 0.85)),
        radial-gradient(circle at 30% 30%, rgba(201, 168, 76, 0.06), transparent 60%);
    border: 1px solid rgba(201, 168, 76, 0.35);
}

.flip-back {
    background:
        linear-gradient(180deg, var(--parchment) 0%, #ebe0c4 100%);
    border: 1px solid var(--bronze);
    transform: rotateY(180deg);
    color: var(--void);
}

.cell-corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 1.5px solid var(--gilded);
    opacity: 0.9;
}
.cell-corner.tl { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.cell-corner.tr { top: 8px; right: 8px; border-left: none; border-bottom: none; }
.cell-corner.bl { bottom: 8px; left: 8px; border-right: none; border-top: none; }
.cell-corner.br { bottom: 8px; right: 8px; border-left: none; border-top: none; }

.cell-mask-emblem {
    width: 64px;
    height: 54px;
    margin-bottom: 20px;
    filter: drop-shadow(var(--gold-glow));
}

.cell-mask-emblem svg { width: 100%; height: 100%; }

.cell-title {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(20px, 2.4vw, 30px);
    color: var(--gilded);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.cell-tag {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.25em;
    color: rgba(245, 236, 215, 0.55);
    text-transform: uppercase;
}

.back-label {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.5em;
    color: var(--burgundy);
}

.back-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(18px, 2.2vw, 24px);
    color: var(--burgundy);
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.back-body {
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--void);
    margin-bottom: 14px;
    max-width: 90%;
}

.back-code {
    display: inline-block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: var(--burgundy);
    background: rgba(74, 14, 44, 0.08);
    border: 1px dashed rgba(74, 14, 44, 0.4);
    padding: 6px 12px;
    letter-spacing: 0.1em;
}

/* ───────────── Cipher Wall ───────────── */
.chamber-cipher {
    background:
        linear-gradient(180deg, var(--void) 0%, #050507 100%);
}

.cipher-wall {
    width: 100%;
    max-width: 900px;
    margin: 30px auto 50px;
    padding: 50px clamp(20px, 4vw, 60px);
    border: 1px solid rgba(201, 168, 76, 0.25);
    background: rgba(11, 11, 15, 0.7);
    position: relative;
}

.cipher-wall::before, .cipher-wall::after {
    content: '⚜';
    position: absolute;
    color: var(--gilded);
    font-size: 18px;
    background: var(--void);
    padding: 0 12px;
}

.cipher-wall::before { top: -12px; left: 30px; }
.cipher-wall::after { bottom: -12px; right: 30px; }

.cipher-line {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(15px, 1.6vw, 19px);
    line-height: 2.1;
    letter-spacing: 0.04em;
    color: var(--cipher);
    margin-bottom: 18px;
    text-shadow: 0 0 8px rgba(57, 255, 133, 0.3);
}

.cipher-line.decoded {
    color: var(--parchment);
    text-shadow: 0 0 6px rgba(201, 168, 76, 0.25);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(17px, 1.8vw, 21px);
    letter-spacing: 0.02em;
    transition: color 0.6s ease;
}

.protocol-block {
    width: 100%;
    max-width: 700px;
    margin: 30px auto 0;
    background: rgba(11, 11, 15, 0.85);
    border: 1px solid rgba(201, 168, 76, 0.4);
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(201, 168, 76, 0.05);
}

.protocol-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    padding: 12px 18px;
    background: linear-gradient(90deg, rgba(201, 168, 76, 0.12), rgba(201, 168, 76, 0.04));
    border-bottom: 1px solid rgba(201, 168, 76, 0.25);
    color: var(--gilded);
}

.proto-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cipher);
    box-shadow: 0 0 8px var(--cipher);
    animation: pulseDot 1.6s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.proto-name { flex: 1; }
.proto-status { color: rgba(245, 236, 215, 0.4); }

.protocol-body { padding: 20px 24px; }

.protocol-line {
    display: flex;
    gap: 14px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(201, 168, 76, 0.1);
}
.protocol-line:last-child { border-bottom: none; }

.pkey { color: var(--gilded); min-width: 130px; letter-spacing: 0.05em; }
.psep { color: rgba(245, 236, 215, 0.3); }
.pval { color: var(--cipher); letter-spacing: 0.05em; }

/* ───────────── Revelation ───────────── */
.chamber-revelation {
    background:
        radial-gradient(ellipse at center, rgba(74, 14, 44, 0.4) 0%, var(--void) 70%);
    text-align: center;
}

.revelation-mask {
    position: relative;
    width: clamp(220px, 28vw, 320px);
    aspect-ratio: 4 / 3;
    margin: 30px auto 50px;
}

.rev-mask-shape {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.3));
}

.rev-mask-shape svg { width: 100%; height: 100%; }

.rev-outline {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    transition: stroke-dashoffset 3s ease;
}

.in-view .rev-outline { stroke-dashoffset: 0; }

.mask-fragments {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.frag {
    position: absolute;
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--gilded);
    opacity: 0.7;
    box-shadow: var(--gold-glow);
}

.frag-1 { top: 10%; left: 5%; clip-path: polygon(0 0, 100% 0, 50% 100%); animation: fragDrift 8s ease-in-out infinite 0s; }
.frag-2 { top: 20%; right: 5%; clip-path: polygon(50% 0, 100% 100%, 0 100%); animation: fragDrift 9s ease-in-out infinite 0.5s; }
.frag-3 { bottom: 20%; left: 10%; clip-path: polygon(0 0, 100% 50%, 0 100%); animation: fragDrift 7s ease-in-out infinite 1s; }
.frag-4 { bottom: 10%; right: 10%; clip-path: polygon(100% 0, 100% 100%, 0 50%); animation: fragDrift 10s ease-in-out infinite 1.5s; }
.frag-5 { top: 50%; left: -5%; clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%); animation: fragDrift 8.5s ease-in-out infinite 2s; }
.frag-6 { top: 45%; right: -5%; clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%); animation: fragDrift 9.5s ease-in-out infinite 2.5s; }

@keyframes fragDrift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(8px, -10px) rotate(15deg); }
}

.rev-prose {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(17px, 1.8vw, 22px);
    line-height: 1.7;
    color: rgba(245, 236, 215, 0.85);
    max-width: 640px;
    margin: 0 auto 18px;
}

.rev-prose em {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--gilded);
}

.rev-italic {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(20px, 2.4vw, 30px);
    color: var(--gilded);
    margin-bottom: 50px;
    text-shadow: 0 0 16px rgba(201, 168, 76, 0.3);
}

/* ───────────── Navigation ───────────── */
.nav-toggle {
    position: fixed;
    top: 22px;
    right: 22px;
    width: 46px;
    height: 46px;
    background: rgba(11, 11, 15, 0.7);
    border: 1px solid rgba(201, 168, 76, 0.4);
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 6px;
    transition: transform 0.4s, border-color 0.3s, background 0.3s;
}

.nav-toggle:hover {
    border-color: var(--gilded);
    transform: rotate(20deg) scale(1.08);
    background: rgba(74, 14, 44, 0.6);
}

.nav-toggle.active {
    transform: rotate(180deg);
    background: var(--burgundy);
}

.nav-mask-icon { width: 100%; height: 100%; }

.nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(380px, 92vw);
    height: 100vh;
    background:
        linear-gradient(135deg, var(--burgundy) 0%, #350720 100%);
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
    border-left: 2px solid var(--gilded);
    overflow: hidden;
}

.nav-panel.open { transform: translateX(0); }

.nav-panel::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    bottom: 30px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    pointer-events: none;
}

.nav-panel-inner {
    padding: 90px 50px 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.nav-stamp {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(201, 168, 76, 0.3);
}

.stamp-line {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.5em;
    color: var(--gilded);
}

.stamp-seal {
    display: block;
    font-size: 32px;
    color: var(--gilded);
    margin: 12px 0;
    text-shadow: 0 0 12px rgba(201, 168, 76, 0.5);
}

.nav-panel nav {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nav-link {
    display: flex;
    align-items: baseline;
    gap: 18px;
    padding: 12px 0;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: 22px;
    color: var(--gilded);
    text-decoration: none;
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
    position: relative;
    transition: color 0.3s, padding-left 0.3s;
}

.nav-link::before {
    content: attr(data-num);
    font-family: 'Share Tech Mono', monospace;
    font-style: normal;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: rgba(245, 236, 215, 0.4);
    min-width: 24px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gilded);
    transition: width 0.4s ease;
}

.nav-link:hover {
    color: var(--parchment);
    padding-left: 8px;
}

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

.nav-foot {
    margin-top: auto;
    text-align: center;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 13px;
    color: rgba(245, 236, 215, 0.5);
    padding-top: 30px;
}

/* ───────────── Footer ───────────── */
#footer {
    text-align: center;
    padding: 50px 20px 40px;
    background: var(--void);
    border-top: 1px solid rgba(201, 168, 76, 0.15);
    position: relative;
    z-index: 1;
}

.footer-mark {
    width: 80px;
    height: 40px;
    margin: 0 auto 20px;
    opacity: 0.6;
    filter: drop-shadow(var(--gold-glow));
}

.footer-mark svg { width: 100%; height: 100%; }

.footer-text {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 15px;
    color: rgba(245, 236, 215, 0.55);
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.footer-meta {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.3em;
    color: rgba(201, 168, 76, 0.5);
}

.gold { color: var(--gilded); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gilded), var(--bronze));
    border-radius: 1px;
}

/* ───────────── Responsive ───────────── */
@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 240px;
    }
    .bento-cell:nth-child(n) {
        grid-column: span 1;
        grid-row: span 1;
    }
}

@media (max-width: 700px) {
    .chamber {
        padding: 90px 22px 70px;
    }
    .metadata-line.top-left { left: 16px; top: 18px; font-size: 10px; }
    .metadata-line.top-right { right: 70px; top: 18px; font-size: 10px; }
    .timeline-line { left: 18px; }
    .timeline-card,
    .timeline-card.card-left,
    .timeline-card.card-right {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding-left: 44px;
        padding-right: 0;
        text-align: left;
    }
    .timeline-card.card-left .card-shape,
    .timeline-card.card-right .card-shape {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 6% 100%, 0 88%);
    }
    .timeline-card .timeline-node {
        left: 10px;
        right: auto;
    }
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 220px;
    }
    .mask-ornament { display: none; }
    .nav-panel-inner { padding: 80px 30px 30px; }
    .mask-hero {
        animation: heroIdle 8s ease-in-out infinite;
    }
}

@keyframes heroIdle {
    0%, 100% { transform: rotate(-1deg); }
    50% { transform: rotate(1.5deg); }
}
