/* MasqproT.com — Surrealist Theatrical Masquerade
   Palette: #0B0C10 #1F1024 #C9A96E #E8E0D4 #A89F91 #9B1B30 #7FB069
   Fonts: Playfair Display, Libre Baskerville, Bebas Neue
*/

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

:root {
    --void: #0B0C10;
    --plum: #1F1024;
    --gold: #C9A96E;
    --bone: #E8E0D4;
    --linen: #A89F91;
    --carmine: #9B1B30;
    --absinthe: #7FB069;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Libre Baskerville', Georgia, serif;
    --font-accent: 'Bebas Neue', 'Helvetica Neue', sans-serif;
}

html, body {
    background: var(--void);
    color: var(--bone);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    position: relative;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(31, 16, 36, 0.6), transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(155, 27, 48, 0.08), transparent 60%),
        var(--void);
    background-attachment: fixed;
}

/* Subtle paper-grain noise overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(168, 159, 145, 0.012) 0px,
            rgba(168, 159, 145, 0.012) 1px,
            transparent 1px,
            transparent 3px
        );
    mix-blend-mode: overlay;
}

/* Page axis (undulating crack) */
.page-axis {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
}

/* ========== Vertical Timeline ========== */
.timeline-vertical {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 70px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.timeline-track {
    position: absolute;
    right: 36px;
    top: 12vh;
    bottom: 12vh;
    width: 1px;
    background: linear-gradient(to bottom,
        transparent,
        rgba(201, 169, 110, 0.25) 10%,
        rgba(201, 169, 110, 0.25) 90%,
        transparent);
}

.timeline-acts {
    list-style: none;
    position: absolute;
    right: 8px;
    top: 12vh;
    bottom: 12vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: auto;
}

.act-marker {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-family: var(--font-accent);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--linen);
    opacity: 0.45;
    cursor: pointer;
    transition: opacity 0.4s ease, color 0.4s ease, transform 0.4s ease;
    position: relative;
    height: 18px;
}

.act-marker .label {
    font-size: 10px;
    color: var(--linen);
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    white-space: nowrap;
}

.act-marker .numeral {
    color: var(--linen);
    width: 30px;
    text-align: right;
    font-size: 12px;
}

.act-marker::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 1px;
    background: var(--linen);
    opacity: 0.5;
}

.act-marker:hover {
    opacity: 1;
    color: var(--gold);
}

.act-marker:hover .label {
    opacity: 0.9;
    transform: translateX(0);
}

.act-marker.active {
    opacity: 1;
    color: var(--gold);
}

.act-marker.active .numeral {
    color: var(--gold);
    transform: scale(1.15);
}

.act-marker.active::after {
    background: var(--gold);
    width: 14px;
    opacity: 1;
}

/* ========== Ripple layer ========== */
#ripple-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.ripple {
    position: absolute;
    width: 0;
    height: 0;
    border: 1px solid var(--carmine);
    border-radius: 50%;
    opacity: 0.15;
    transform: translate(-50%, -50%);
    animation: rippleExpand 900ms cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
    pointer-events: none;
}

@keyframes rippleExpand {
    0%   { width: 0; height: 0; opacity: 0.35; }
    60%  { opacity: 0.18; }
    100% { width: 400px; height: 400px; opacity: 0; }
}

/* ========== Blackout flash ========== */
#blackout-flash {
    position: fixed;
    inset: 0;
    background: var(--void);
    z-index: 900;
    pointer-events: none;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 200ms ease;
}

#blackout-flash.active {
    opacity: 1;
}

#blackout-numeral {
    font-family: var(--font-accent);
    font-size: 60px;
    color: var(--carmine);
    letter-spacing: 0.15em;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 240ms ease, transform 240ms ease;
}

#blackout-flash.active #blackout-numeral {
    opacity: 1;
    transform: scale(1);
}

/* ========== Generic act sections ========== */
.act-section {
    position: relative;
    min-height: 100vh;
    padding: 120px 8% 120px 8%;
    overflow: hidden;
    z-index: 3;
}

.act-section.alt-bg {
    background: linear-gradient(180deg, var(--void) 0%, rgba(31, 16, 36, 0.55) 50%, var(--void) 100%);
}

/* Diagonal section cuts via clip-path */
.act-section.diag-down {
    clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    margin-top: -3%;
}

.act-section.diag-up {
    clip-path: polygon(0 0, 100% 4%, 100% 100%, 0 96%);
    margin-top: -3%;
}

/* Crack accents along diagonals (decorative pseudo) */
.act-section::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(168deg, transparent 47%, rgba(155, 27, 48, 0.08) 49.6%, transparent 50.5%),
        linear-gradient(168deg, transparent 49%, rgba(168, 159, 145, 0.08) 50%, transparent 51%);
}

.act-section.diag-up::before {
    background:
        linear-gradient(192deg, transparent 47%, rgba(155, 27, 48, 0.08) 49.6%, transparent 50.5%),
        linear-gradient(192deg, transparent 49%, rgba(168, 159, 145, 0.08) 50%, transparent 51%);
}

/* ========== Act meta header ========== */
.act-meta {
    position: absolute;
    top: 60px;
    left: 8%;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 4;
    font-family: var(--font-accent);
    letter-spacing: 0.22em;
    font-size: 12px;
    color: var(--linen);
}

.act-meta.right {
    left: auto;
    right: 8%;
    flex-direction: row-reverse;
}

.act-meta.center {
    left: 50%;
    transform: translateX(-50%);
}

.meta-line {
    width: 36px;
    height: 1px;
    background: var(--gold);
    opacity: 0.6;
}

.meta-act {
    color: var(--gold);
}

.meta-title {
    color: var(--linen);
}

/* ========== Opening (Act I) ========== */
.opening-scene {
    background: var(--void);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 0 8%;
}

.opening-stage {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mask-reveal {
    width: 240px;
    height: 180px;
    margin-bottom: 36px;
    opacity: 0;
    animation: maskFadeIn 800ms ease 800ms forwards;
}

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

.mask-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: drawMask 2500ms cubic-bezier(0.4, 0, 0.2, 1) 1000ms forwards;
}

@keyframes drawMask  { to { stroke-dashoffset: 0; } }
@keyframes maskFadeIn { to { opacity: 1; } }

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.5rem, 8vw, 8rem);
    letter-spacing: -0.03em;
    color: var(--gold);
    line-height: 1;
    min-height: 1.1em;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 320ms ease, transform 320ms ease;
}

.hero-title .letter.in {
    opacity: 1;
    transform: translateY(0);
}

.hero-line {
    width: 0;
    height: 1px;
    background: var(--gold);
    margin-top: 24px;
    opacity: 0.7;
    animation: lineExpand 1200ms cubic-bezier(0.4, 0, 0.2, 1) 4400ms forwards;
}

@keyframes lineExpand { to { width: 84vw; } }

.hero-sub {
    margin-top: 22px;
    font-family: var(--font-accent);
    letter-spacing: 0.32em;
    font-size: 13px;
    color: var(--linen);
    opacity: 0;
    animation: fadeIn 800ms ease 4800ms forwards;
}

.opening-stage .encoded-tag {
    margin-top: 14px;
    opacity: 0;
    animation: fadeIn 800ms ease 5200ms forwards;
}

.scroll-chevron {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fadeIn 600ms ease 5400ms forwards;
    cursor: pointer;
    z-index: 5;
}

.scroll-chevron svg {
    animation: chevBounce 2.4s ease-in-out 5400ms infinite;
}

.chev-label {
    font-family: var(--font-accent);
    font-size: 11px;
    letter-spacing: 0.32em;
    color: var(--bone);
    opacity: 0.7;
}

@keyframes chevBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(8px); }
}

@keyframes fadeIn { to { opacity: 1; } }

/* ========== Section titles ========== */
.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5.4vw, 4.6rem);
    letter-spacing: -0.025em;
    line-height: 1.04;
    color: var(--bone);
    margin-bottom: 28px;
}

.section-title.small {
    font-size: clamp(1.7rem, 3.6vw, 2.8rem);
}

.section-title.huge {
    font-size: clamp(2.4rem, 7vw, 7rem);
    line-height: 1.02;
}

.section-title em {
    color: var(--gold);
    font-style: italic;
}

.section-title .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.act-section.visible .section-title .word {
    opacity: 1;
    transform: translateY(0);
}

.act-section.visible .section-title .word:nth-child(1) { transition-delay: 80ms; }
.act-section.visible .section-title .word:nth-child(2) { transition-delay: 200ms; }
.act-section.visible .section-title .word:nth-child(3) { transition-delay: 320ms; }
.act-section.visible .section-title .word:nth-child(4) { transition-delay: 440ms; }

/* Body text inside acts */
.act-section p {
    font-size: 17px;
    line-height: 1.85;
    color: rgba(232, 224, 212, 0.82);
    margin-bottom: 18px;
    max-width: 56ch;
}

.act-section em {
    color: var(--gold);
    font-style: italic;
}

.caption {
    font-family: var(--font-accent);
    font-size: 12px;
    letter-spacing: 0.22em;
    color: var(--linen);
    opacity: 0.7;
    text-transform: uppercase;
}

.caption.center { text-align: center; }

/* ========== Split layouts ========== */
.split-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 80px;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    min-height: 60vh;
    padding-top: 60px;
}

.split-grid.right-dom {
    grid-template-columns: 0.9fr 1.1fr;
}

.split-cell {
    position: relative;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 800ms cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.act-section.visible .split-cell {
    opacity: 1;
    transform: translateY(0);
}

.act-section.visible .split-cell:nth-child(2) {
    transition-delay: 160ms;
}

.split-left .split-grid .text-cell { grid-column: 1; }
.split-left .split-grid .mask-cell, .split-left .split-grid .unmask-cell { grid-column: 2; }
.split-right .split-grid.right-dom .text-cell { grid-column: 2; text-align: left; }
.split-right .split-grid.right-dom .mask-cell { grid-column: 1; }
.split-right .split-grid.right-dom .dance-card { grid-column: 1; }

.mask-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    position: relative;
}

.mask-cell svg,
.unmask-cell svg {
    width: min(380px, 80%);
    height: auto;
    display: block;
}

/* ========== Path-draw SVG anim ========== */
.draw-svg .draw-path,
.act-section .draw-path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 2.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.act-section.visible .draw-path {
    stroke-dashoffset: 0;
}

/* Stagger draws in galleries */
.gallery-mask:nth-child(1) .draw-path { transition-delay: 60ms; }
.gallery-mask:nth-child(2) .draw-path { transition-delay: 180ms; }
.gallery-mask:nth-child(3) .draw-path { transition-delay: 300ms; }
.gallery-mask:nth-child(4) .draw-path { transition-delay: 420ms; }
.gallery-mask:nth-child(5) .draw-path { transition-delay: 540ms; }
.gallery-mask:nth-child(6) .draw-path { transition-delay: 660ms; }
.gallery-mask:nth-child(7) .draw-path { transition-delay: 780ms; }

/* Crack lines */
.crack-line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.4s ease 0.8s;
}

.act-section.visible .crack-line { stroke-dashoffset: 0; }

/* ========== Bento layouts ========== */
.bento {
    display: grid;
    gap: 18px;
    max-width: 1280px;
    margin: 60px auto 0;
    padding-top: 30px;
}

.bento-3 {
    grid-template-columns: 5fr 8fr 3fr;
    grid-template-rows: 220px 220px 160px;
    grid-template-areas:
        "c1 c2 c5"
        "c1 c3 c4"
        "c1 c3 c4";
}

.bento-3 .c1 { grid-area: c1; }
.bento-3 .c2 { grid-area: c2; }
.bento-3 .c3 { grid-area: c3; }
.bento-3 .c4 { grid-area: c4; }
.bento-3 .c5 { grid-area: c5; }

.bento-5 {
    grid-template-columns: 8fr 3fr 5fr;
    grid-template-rows: 220px 220px 200px;
    grid-template-areas:
        "c1 c2 c4"
        "c1 c3 c4"
        "c3 c3 c4";
}

.bento-5 .c1 { grid-area: c1; }
.bento-5 .c2 { grid-area: c2; }
.bento-5 .c3 { grid-area: c3; }
.bento-5 .c4 { grid-area: c4; }

.bento-9 {
    grid-template-columns: 5fr 3fr 5fr;
    grid-template-rows: 240px 220px;
    grid-template-areas:
        "c1 c1 c2"
        "c4 c3 c2";
}

.bento-9 .c1 { grid-area: c1; }
.bento-9 .c2 { grid-area: c2; }
.bento-9 .c3 { grid-area: c3; }
.bento-9 .c4 { grid-area: c4; }

.bento-cell {
    position: relative;
    border: 1px solid rgba(168, 159, 145, 0.12);
    background: linear-gradient(180deg, rgba(31, 16, 36, 0.45), rgba(11, 12, 16, 0.45));
    padding: 28px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(28px) scale(0.98);
    transition: opacity 700ms cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 400ms ease;
}

.act-section.visible .bento-cell {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.act-section.visible .bento-cell.c1 { transition-delay: 80ms; }
.act-section.visible .bento-cell.c2 { transition-delay: 200ms; }
.act-section.visible .bento-cell.c3 { transition-delay: 320ms; }
.act-section.visible .bento-cell.c4 { transition-delay: 440ms; }
.act-section.visible .bento-cell.c5 { transition-delay: 560ms; }

.bento-cell:hover {
    border-color: rgba(201, 169, 110, 0.35);
}

.bento-cell.text-cell { padding: 36px; }

.bento-cell.text-cell h2 { margin-bottom: 18px; }

.bento-cell.text-cell p {
    font-size: 15px;
    line-height: 1.7;
}

.bento-cell.mask-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(31, 16, 36, 0.7), rgba(11, 12, 16, 0.6));
}

.bento-cell.mask-cell svg {
    width: 80%;
    max-width: 220px;
    height: auto;
}

.bento-cell.quote-cell {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(31, 16, 36, 0.55);
}

.bento-cell.quote-cell blockquote {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 18px;
    line-height: 1.55;
    color: var(--bone);
    border-left: 2px solid var(--gold);
    padding-left: 16px;
}

.bento-cell.quote-cell.wide blockquote.big-quote {
    font-size: clamp(20px, 2.3vw, 30px);
    border-left: 3px solid var(--carmine);
}

.quote-attr {
    margin-top: 14px;
    font-family: var(--font-accent);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--linen);
    opacity: 0.7;
}

.bento-cell.arch-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}

.bento-cell.arch-cell svg {
    width: 80%;
    height: 80%;
}

.bento-cell.number-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(201, 169, 110, 0.06), rgba(155, 27, 48, 0.04));
}

.big-numeral {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(54px, 6vw, 96px);
    color: var(--gold);
    line-height: 1;
    letter-spacing: -0.04em;
}

.big-numeral.muted { color: var(--linen); opacity: 0.7; }

.cell-tag {
    font-family: var(--font-accent);
    font-size: 10px;
    letter-spacing: 0.28em;
    color: var(--linen);
    opacity: 0.6;
    text-transform: uppercase;
}

.cipher-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.cipher-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ========== Encoded text ========== */
.encoded-tag {
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--linen);
    opacity: 0.32;
    border-bottom: 1px dashed rgba(168, 159, 145, 0.2);
    padding: 1px 4px;
    cursor: pointer;
    transition: opacity 320ms ease, color 320ms ease, background 320ms ease;
    user-select: none;
}

.encoded-tag:hover {
    opacity: 1;
    color: var(--absinthe);
}

.encoded-tag.revealed {
    color: var(--gold);
    opacity: 1;
    background: rgba(201, 169, 110, 0.08);
}

.float-tr {
    position: absolute;
    top: 18px;
    right: 18px;
}

/* ========== Piranesi background ========== */
.piranesi {
    position: absolute;
    width: 60%;
    height: 80%;
    bottom: 0;
    left: 5%;
    pointer-events: none;
    opacity: 0.7;
    z-index: 1;
}

/* ========== Candle particles ========== */
.candle-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow:
        0 0 6px rgba(201, 169, 110, 0.6),
        0 0 14px rgba(201, 169, 110, 0.25);
    opacity: 0.4;
    animation: candleFlicker 4s ease-in-out infinite;
}

.particle.carmine {
    background: var(--carmine);
    box-shadow: 0 0 6px rgba(155, 27, 48, 0.5);
}

@keyframes candleFlicker {
    0%   { opacity: 0.3; transform: translateY(0) scale(1); }
    25%  { opacity: 0.85; transform: translateY(-4px) scale(1.1); }
    50%  { opacity: 0.45; transform: translateY(-2px) scale(0.95); }
    75%  { opacity: 1;    transform: translateY(-6px) scale(1.15); }
    100% { opacity: 0.3;  transform: translateY(0) scale(1); }
}

/* ========== Tilt-3D ========== */
.tilt {
    transform-style: preserve-3d;
    perspective: 800px;
    transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tilt svg {
    transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1),
                filter 360ms ease;
}

.tilt:hover svg {
    filter: drop-shadow(0 0 14px rgba(201, 169, 110, 0.25));
}

.tilt::after {
    content: '';
    position: absolute;
    inset: 10%;
    background: radial-gradient(ellipse at center, rgba(155, 27, 48, 0.12), transparent 70%);
    opacity: 0;
    transition: opacity 400ms ease;
    pointer-events: none;
    z-index: -1;
}

.tilt:hover::after { opacity: 1; }

.tilt:hover svg path { stroke: var(--gold) !important; }

/* ========== Parallax mask gallery (Act IV) ========== */
.gallery-section { padding-bottom: 80px; }

.gallery-intro {
    max-width: 1080px;
    margin: 60px auto 0;
    padding-top: 40px;
    text-align: center;
}

.parallax-gallery {
    position: relative;
    margin-top: 50px;
    height: 380px;
    overflow: hidden;
    width: 100%;
}

.parallax-track {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: max-content;
    display: flex;
    align-items: center;
    gap: 50px;
    padding: 0 8%;
    will-change: transform;
}

.gallery-mask {
    flex: 0 0 240px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(180deg, rgba(31, 16, 36, 0.4), rgba(11, 12, 16, 0.3));
    border: 1px solid rgba(168, 159, 145, 0.1);
    padding: 18px;
    position: relative;
    transition: border-color 400ms ease, transform 480ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gallery-mask svg {
    width: 80%;
    height: 70%;
}

.gallery-mask figcaption {
    font-family: var(--font-accent);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--linen);
    opacity: 0.7;
    text-align: center;
    text-transform: uppercase;
}

.gallery-mask:hover {
    border-color: rgba(201, 169, 110, 0.4);
}

/* ========== Dance card (Act VI) ========== */
.dance-card {
    background: linear-gradient(180deg, rgba(31, 16, 36, 0.7), rgba(11, 12, 16, 0.7));
    border: 1px solid rgba(201, 169, 110, 0.25);
    padding: 36px;
    position: relative;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(201, 169, 110, 0.15);
}

.dance-card::before {
    content: '';
    position: absolute;
    top: 12px; left: 12px; right: 12px; bottom: 12px;
    border: 1px dashed rgba(168, 159, 145, 0.15);
    pointer-events: none;
}

.card-title {
    font-family: var(--font-accent);
    font-size: 13px;
    letter-spacing: 0.32em;
    color: var(--gold);
    margin-bottom: 22px;
    text-align: center;
}

.dance-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dance-list li {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: baseline;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(168, 159, 145, 0.1);
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--bone);
    transition: color 300ms ease, transform 300ms ease;
}

.dance-list li:hover {
    color: var(--gold);
    transform: translateX(4px);
}

.d-num {
    font-family: var(--font-accent);
    color: var(--linen);
    font-size: 13px;
    letter-spacing: 0.18em;
}

.d-name { font-style: italic; }

.d-time {
    font-family: var(--font-accent);
    font-size: 12px;
    color: var(--linen);
    letter-spacing: 0.18em;
}

.card-stamp {
    display: block;
    margin-top: 24px;
    text-align: right;
    font-family: var(--font-accent);
    font-size: 11px;
    letter-spacing: 0.25em;
    color: var(--carmine);
    opacity: 0.85;
}

/* ========== Cipher stage (Act VII) ========== */
.centered-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.cipher-stage {
    max-width: 1080px;
    margin: 80px auto 0;
    padding-top: 60px;
}

.cipher-stage .section-title.huge {
    margin-bottom: 60px;
}

.cipher-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 640px;
    margin: 0 auto;
}

.cipher-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
    padding: 14px 20px;
    border: 1px solid rgba(168, 159, 145, 0.12);
    background: rgba(31, 16, 36, 0.35);
    transition: border-color 320ms ease, background 320ms ease;
}

.cipher-row:hover {
    border-color: rgba(127, 176, 105, 0.4);
    background: rgba(31, 16, 36, 0.6);
}

.cipher-coded {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--linen);
    text-align: right;
    letter-spacing: 0.04em;
}

.cipher-arrow {
    color: var(--gold);
    font-family: var(--font-accent);
    font-size: 18px;
}

.cipher-plain {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 18px;
    color: var(--bone);
    text-align: left;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 320ms ease, transform 320ms ease;
}

.cipher-row:hover .cipher-plain,
.cipher-row.locked .cipher-plain {
    opacity: 1;
    transform: translateX(0);
}

.cipher-row.locked {
    border-color: rgba(201, 169, 110, 0.45);
}

/* ========== Unmasking (Act VIII) ========== */
.unmask-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
}

.unmask-wrap {
    position: relative;
    width: min(440px, 90%);
    aspect-ratio: 1 / 1;
}

.unmask-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.unmask-label-l, .unmask-label-r {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-accent);
    font-size: 12px;
    letter-spacing: 0.32em;
    color: var(--linen);
    opacity: 0.7;
}

.unmask-label-l { left: -10%; color: var(--gold); }
.unmask-label-r { right: -10%; color: var(--carmine); }

/* ========== Echo (Act X) ========== */
.echo-stage {
    margin-top: 80px;
    padding-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.echo-line {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(28px, 5vw, 64px);
    color: var(--bone);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.echo-line.a { color: var(--bone); opacity: 0.95; }
.echo-line.b { color: var(--linen); opacity: 0.6; transform: translateX(20px); }
.echo-line.c { color: var(--linen); opacity: 0.3; transform: translateX(40px); }
.echo-line.d { margin-top: 24px; color: var(--gold); }

/* ========== Finale (Act XII) ========== */
.finale-section { padding-bottom: 160px; }

.finale-stage {
    max-width: 1080px;
    margin: 80px auto 0;
    text-align: center;
    padding-top: 60px;
}

.finale-text {
    margin: 0 auto 48px;
    max-width: 60ch;
    font-size: 18px;
    line-height: 1.85;
    color: rgba(232, 224, 212, 0.85);
}

.finale-mask-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    margin: 40px auto 50px;
    flex-wrap: wrap;
}

.finale-mask {
    width: 110px;
    height: 90px;
    cursor: pointer;
    transition: transform 380ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.finale-mask:hover {
    transform: scale(1.15) rotate(-2deg);
}

.finale-encoded {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
}

/* ========== Footer ========== */
#footer {
    text-align: center;
    padding: 80px 20px 60px;
    font-size: 14px;
    color: var(--linen);
    border-top: 1px solid rgba(201, 169, 110, 0.18);
    background: var(--void);
    position: relative;
    z-index: 4;
}

.footer-brand {
    font-family: var(--font-display);
    font-weight: 900;
    color: var(--gold);
    letter-spacing: -0.02em;
    font-size: 18px;
}

.footer-divider {
    margin: 0 14px;
    opacity: 0.4;
}

.footer-tagline {
    font-style: italic;
    color: var(--bone);
    opacity: 0.85;
}

.footer-meta {
    display: block;
    margin-top: 18px;
    font-family: var(--font-accent);
    letter-spacing: 0.28em;
    font-size: 11px;
    color: var(--linen);
    opacity: 0.6;
}

/* ========== Scrollbar (webkit) ========== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }

/* ========== Responsive ========== */
@media (max-width: 960px) {
    .timeline-vertical { width: 40px; }
    .act-marker .label { display: none; }
    .timeline-track { right: 18px; }
    .timeline-acts { right: 6px; }

    .split-grid,
    .split-grid.right-dom {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .split-right .split-grid.right-dom .text-cell,
    .split-right .split-grid.right-dom .mask-cell,
    .split-right .split-grid.right-dom .dance-card {
        grid-column: 1;
    }

    .bento-3, .bento-5, .bento-9 {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas: none;
    }
    .bento-cell.c1, .bento-cell.c2, .bento-cell.c3, .bento-cell.c4, .bento-cell.c5 {
        grid-area: auto;
        min-height: 200px;
    }

    .gallery-mask { flex: 0 0 200px; height: 280px; }
}

@media (max-width: 640px) {
    .act-section { padding: 100px 6% 100px 6%; }
    .act-meta { left: 6%; top: 32px; }
    .act-meta.right { right: 6%; }
    .finale-mask { width: 80px; height: 64px; }
    .echo-line.b { transform: translateX(10px); }
    .echo-line.c { transform: translateX(20px); }
}
