/* ============================================
   MasqproT.com - Surreal Masquerade Design
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Palette */
    --midnight-velvet: #0D0B1A;
    --shadow-plum: #1E1433;
    --antique-ivory: #F5F0E8;
    --gilded-rose: #C9956B;
    --phantom-teal: #3B8C8C;
    --blush-veil: #D4A0A0;
    --candleflame-white: #FFF8E7;
    --deep-purple: #1A1228;

    /* Scroll-linked inversion properties */
    --bg-color: #0D0B1A;
    --text-color: #FFF8E7;
    --surface-color: #1E1433;
    --inversion-progress: 0;

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Cormorant Garamond', Garamond, serif;
    --font-accent: 'Josefin Sans', sans-serif;

    /* Spacing (8px grid, golden ratio) */
    --space-1: 8px;
    --space-2: 13px;
    --space-3: 21px;
    --space-4: 34px;
    --space-5: 55px;
    --space-6: 89px;

    /* Spring easing */
    --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-breath: cubic-bezier(0.4, 0.0, 0.2, 1.0);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--midnight-velvet);
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.72;
    color: var(--candleflame-white);
    background-color: var(--midnight-velvet);
    overflow-x: hidden;
}

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

.nav-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(201, 149, 107, 0.3) 20%,
        rgba(201, 149, 107, 0.3) 80%,
        transparent
    );
    transform: translateX(-50%);
}

.nav-node {
    position: relative;
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 1;
}

.node-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(201, 149, 107, 0.4);
    border: 1px solid rgba(201, 149, 107, 0.6);
    transition: all 0.4s var(--ease-breath);
}

.nav-node.active .node-dot {
    background: var(--gilded-rose);
    box-shadow: 0 0 12px rgba(201, 149, 107, 0.5);
    transform: scale(1.3);
}

.nav-node:hover .node-dot {
    background: var(--gilded-rose);
    transform: scale(1.4);
}

.node-label {
    position: absolute;
    left: 24px;
    white-space: nowrap;
    font-family: var(--font-accent);
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gilded-rose);
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.3s var(--ease-breath);
    pointer-events: none;
}

.nav-node:hover .node-label {
    opacity: 1;
    transform: translateX(0);
}

/* --- Sections (General) --- */
.section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 48px;
    letter-spacing: -0.02em;
    color: var(--candleflame-white);
    margin-bottom: var(--space-3);
}

.section-title-italic {
    font-style: italic;
}

.section-subtitle {
    font-family: var(--font-accent);
    font-weight: 300;
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gilded-rose);
    margin-bottom: var(--space-5);
}

/* --- Section 1: Arrival --- */
.section-arrival {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gradient-mesh-hero {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.mesh-layer {
    position: absolute;
    inset: 0;
}

.mesh-layer-1 {
    background:
        radial-gradient(ellipse 80% 60% at 30% 40%, #1A1228 0%, transparent 70%),
        radial-gradient(ellipse 70% 80% at 70% 60%, #1E1433 0%, transparent 70%),
        linear-gradient(135deg, #0D0B1A 0%, #1A1228 50%, #0D0B1A 100%);
}

.mesh-layer-2 {
    background: radial-gradient(circle at 50% 45%, rgba(201, 149, 107, 0.15) 0%, transparent 45%);
}

.mesh-layer-3 {
    background:
        radial-gradient(circle at 35% 55%, rgba(59, 140, 140, 0.06) 0%, transparent 30%),
        radial-gradient(circle at 65% 35%, rgba(212, 160, 160, 0.04) 0%, transparent 25%);
}

/* Mask Character */
.mask-character {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 360px;
    z-index: 1;
    animation: maskReveal 2.5s ease-out forwards;
    opacity: 0;
}

@keyframes maskReveal {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.mask-oval {
    position: absolute;
    inset: 0;
    border-radius: 50% 50% 45% 45%;
    background:
        radial-gradient(ellipse at 50% 40%, var(--gilded-rose) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, var(--shadow-plum) 20%, var(--midnight-velvet) 70%);
    opacity: 0.35;
}

.mask-eye {
    position: absolute;
    width: 50px;
    height: 24px;
    top: 38%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 50%, var(--phantom-teal) 0%, rgba(59, 140, 140, 0.3) 50%, transparent 80%);
    opacity: 0.6;
}

.mask-eye-left {
    left: 28%;
}

.mask-eye-right {
    right: 28%;
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 72px;
    letter-spacing: 0.08em;
    color: var(--candleflame-white);
    margin-bottom: var(--space-4);
    display: inline-block;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
    animation: letterReveal 0.6s var(--spring) forwards;
    animation-delay: calc(0.15s * var(--i) + 0.8s);
}

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

.hero-tagline {
    font-family: var(--font-accent);
    font-weight: 300;
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--blush-veil);
    opacity: 0;
    animation: taglineReveal 1s var(--ease-breath) forwards;
    animation-delay: 2.6s;
}

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

/* Veil Overlay */
.veil-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 60%,
        rgba(212, 160, 160, 0.03) 80%,
        rgba(255, 248, 231, 0.05) 100%
    );
    pointer-events: none;
}

/* --- Ornamental Brackets --- */
.ornament {
    position: absolute;
    width: 200px;
    height: 40px;
    z-index: 5;
}

.ornament-bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.ornament-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.5s var(--ease-breath);
}

.ornament-path.animate-in {
    stroke-dashoffset: 0;
}

/* --- Section 2: Grand Hall --- */
.section-grand-hall {
    min-height: 200vh;
    padding: var(--space-6) 0;
    position: relative;
}

.section-grand-hall .section-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.mesh-layer-bg-1 {
    background:
        linear-gradient(135deg, #0D0B1A 0%, #1E1433 50%, #0D0B1A 100%);
    opacity: 1;
}

.mesh-layer-bg-2 {
    background:
        radial-gradient(circle at 20% 30%, rgba(59, 140, 140, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(201, 149, 107, 0.06) 0%, transparent 35%);
}

.hall-header {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--space-6) var(--space-5);
}

/* Hall Rooms */
.hall-room {
    position: relative;
    z-index: 2;
    width: 70%;
    margin-bottom: var(--space-6);
    padding: var(--space-5);
    border-radius: 4px;
    background: rgba(30, 20, 51, 0.6);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.4s var(--ease-breath);
    overflow: hidden;
}

.hall-room:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(201, 149, 107, 0.1);
}

.hall-room-left {
    margin-left: 10%;
}

.hall-room-right {
    margin-left: 20%;
}

/* Room animate (initially hidden, animated on intersection) */
.room-animate {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s var(--ease-breath), transform 0.8s var(--spring);
}

.room-animate[data-direction="right"] {
    transform: translateX(60px);
}

.room-animate[data-direction="up"] {
    transform: translateY(40px);
}

.room-animate.visible {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

/* Room mesh backgrounds */
.room-mesh {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.archway-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 50% 20%, rgba(245, 240, 232, 0.05) 0%, transparent 60%),
        conic-gradient(from 180deg at 50% 0%, transparent 30%, rgba(201, 149, 107, 0.06) 50%, transparent 70%);
}

.archway-variant-2 {
    background:
        radial-gradient(ellipse 50% 70% at 50% 30%, rgba(59, 140, 140, 0.06) 0%, transparent 60%),
        conic-gradient(from 180deg at 50% 0%, transparent 25%, rgba(212, 160, 160, 0.05) 50%, transparent 75%);
}

.archway-variant-3 {
    background:
        radial-gradient(ellipse 70% 60% at 40% 50%, rgba(201, 149, 107, 0.05) 0%, transparent 55%),
        conic-gradient(from 200deg at 30% 10%, transparent 30%, rgba(59, 140, 140, 0.04) 50%, transparent 70%);
}

.archway-variant-4 {
    background:
        radial-gradient(ellipse 55% 75% at 60% 40%, rgba(212, 160, 160, 0.05) 0%, transparent 55%),
        conic-gradient(from 160deg at 70% 10%, transparent 25%, rgba(201, 149, 107, 0.05) 50%, transparent 75%);
}

.room-content {
    position: relative;
    z-index: 1;
}

.room-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 36px;
    letter-spacing: -0.02em;
    color: var(--candleflame-white);
    margin-bottom: var(--space-3);
}

.room-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.72;
    color: rgba(255, 248, 231, 0.85);
    margin-bottom: var(--space-3);
    max-width: 600px;
}

.room-text:last-child {
    margin-bottom: 0;
}

.room-foreground {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.corner-flourish {
    position: absolute;
    width: 60px;
    height: 60px;
}

.corner-flourish-tl { top: 8px; left: 8px; }
.corner-flourish-tr { top: 8px; right: 8px; }
.corner-flourish-bl { bottom: 8px; left: 8px; }
.corner-flourish-br { bottom: 8px; right: 8px; }

/* Floating Orbs */
.floating-orb {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 140, 140, 0.3) 0%, rgba(59, 140, 140, 0.05) 60%, transparent 100%);
    left: var(--x);
    top: var(--y);
    z-index: 3;
    pointer-events: none;
    animation: orbDrift var(--duration, 25s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes orbDrift {
    0% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(15px, -10px);
    }
    50% {
        transform: translate(-8px, -18px);
    }
    75% {
        transform: translate(-15px, 5px);
    }
    100% {
        transform: translate(0, 0);
    }
}

/* --- Section 3: Mirror Gallery --- */
.section-mirror-gallery {
    min-height: 100vh;
    padding: var(--space-6) 0;
    position: relative;
}

.section-mirror-gallery .section-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.mesh-layer-mirror-1 {
    background:
        linear-gradient(135deg, #1E1433 0%, #0D0B1A 40%, #1E1433 100%);
}

.mesh-layer-mirror-2 {
    background:
        radial-gradient(circle at 50% 50%, rgba(201, 149, 107, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 25% 40%, rgba(59, 140, 140, 0.04) 0%, transparent 35%),
        radial-gradient(circle at 75% 60%, rgba(59, 140, 140, 0.04) 0%, transparent 35%);
}

.mirror-header {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--space-6) var(--space-5);
}

.mirror-pairs {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.mirror-pair {
    display: flex;
    align-items: stretch;
    margin-bottom: var(--space-6);
    gap: 0;
}

.mirror-column {
    flex: 1;
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.mirror-column-left {
    align-items: flex-start;
}

.mirror-column-right {
    align-items: flex-end;
    text-align: right;
}

.mirror-divider {
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(201, 149, 107, 0.3) 20%,
        rgba(201, 149, 107, 0.5) 50%,
        rgba(201, 149, 107, 0.3) 80%,
        transparent
    );
    flex-shrink: 0;
}

.mirror-decorative {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.mirror-decorative-flipped {
    transform: scaleX(-1);
}

.mirror-mesh {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.mirror-mesh-1 {
    background:
        radial-gradient(circle at 40% 40%, var(--gilded-rose) 0%, transparent 50%),
        radial-gradient(circle at 60% 60%, var(--shadow-plum) 0%, var(--midnight-velvet) 70%);
    opacity: 0.5;
}

.mirror-mesh-2 {
    background:
        radial-gradient(circle at 50% 30%, var(--phantom-teal) 0%, transparent 50%),
        radial-gradient(circle at 50% 70%, var(--shadow-plum) 0%, var(--midnight-velvet) 70%);
    opacity: 0.5;
}

.mirror-mesh-3 {
    background:
        radial-gradient(circle at 30% 50%, var(--blush-veil) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, var(--shadow-plum) 0%, var(--midnight-velvet) 70%);
    opacity: 0.5;
}

.mirror-mesh-4 {
    background:
        radial-gradient(circle at 50% 50%, var(--gilded-rose) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, var(--phantom-teal) 20%, var(--midnight-velvet) 70%);
    opacity: 0.5;
}

.mirror-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 28px;
    font-style: italic;
    letter-spacing: -0.02em;
    color: var(--candleflame-white);
    margin-bottom: var(--space-2);
}

.mirror-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.72;
    color: rgba(255, 248, 231, 0.85);
    max-width: 400px;
}

/* Pull Quote */
.pull-quote {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--space-6) var(--space-5);
    max-width: 800px;
    margin: 0 auto;
}

.gradient-text-quote {
    font-family: var(--font-display);
    font-weight: 700;
    font-style: italic;
    font-size: 32px;
    letter-spacing: -0.01em;
    line-height: 1.4;
    background: linear-gradient(90deg, var(--gilded-rose), var(--blush-veil));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Section 4: Unmasking --- */
.section-unmasking {
    min-height: 100vh;
    padding: var(--space-6) 0;
    position: relative;
    transition: background-color 0.3s ease;
    background-color: var(--bg-color);
}

.section-unmasking .section-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    transition: opacity 0.3s ease;
}

.mesh-layer-unmasking-1 {
    background:
        linear-gradient(135deg, #0D0B1A 0%, #1E1433 50%, #0D0B1A 100%);
    transition: opacity 0.3s ease;
}

.mesh-layer-unmasking-2 {
    background:
        radial-gradient(circle at 50% 50%, rgba(201, 149, 107, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 30% 30%, rgba(59, 140, 140, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(212, 160, 160, 0.06) 0%, transparent 40%);
}

.unmasking-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-5);
    text-align: center;
}

.unmasking-intro {
    padding: var(--space-6) 0;
}

.unmasking-intro .section-title {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.unmasking-intro .section-subtitle {
    transition: color 0.3s ease;
}

.unmasking-body {
    padding: var(--space-5) 0;
}

.unmasking-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 19px;
    line-height: 1.72;
    color: var(--text-color);
    transition: color 0.3s ease;
    margin-bottom: var(--space-4);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.unmasking-closing {
    padding: var(--space-6) 0;
}

.closing-statement {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 96px;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.closing-statement em {
    font-style: italic;
    color: var(--gilded-rose);
}

.unmasking-coda {
    padding: var(--space-6) 0 var(--space-5);
}

.coda-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 28px;
    letter-spacing: 0.08em;
    color: var(--text-color);
    transition: color 0.3s ease;
    margin-bottom: var(--space-2);
}

.coda-sub {
    font-family: var(--font-accent);
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gilded-rose);
    opacity: 0.7;
}

/* Converging orbs - intensify at bottom */
.converging-orb {
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, rgba(59, 140, 140, 0.4) 0%, rgba(59, 140, 140, 0.08) 60%, transparent 100%);
    transition: transform 2s ease, opacity 2s ease;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar-nav {
        display: none;
    }

    .hero-title {
        font-size: 42px;
        letter-spacing: 0.05em;
    }

    .section-title {
        font-size: 36px;
    }

    .closing-statement {
        font-size: 52px;
    }

    .hall-room {
        width: 90%;
        margin-left: 5% !important;
    }

    .mirror-pair {
        flex-direction: column;
    }

    .mirror-column-right {
        text-align: left;
        align-items: flex-start;
    }

    .mirror-divider {
        width: 100%;
        height: 1px;
        margin: var(--space-3) 0;
    }

    .room-title {
        font-size: 28px;
    }

    .gradient-text-quote {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 32px;
    }

    .closing-statement {
        font-size: 38px;
    }

    .hall-room {
        padding: var(--space-4);
    }

    .section-title {
        font-size: 28px;
    }
}

/* --- Utility --- */
.section-bg {
    pointer-events: none;
}
