/* ============================================
   monopole.bar - Styles
   Palette: Creamy Pastel / Retro Opulence
   Font: Commissioner (variable, 100-900)
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --aged-linen: #f5f0e6;
    --warm-ivory: #efe8d8;
    --espresso-noir: #2a2118;
    --tobacco-silk: #6b5d4f;
    --chandelier: #c4a265;
    --rosewood-blush: #d4a08a;
    --pale-champagne: #e8ddc8;
    --mahogany-shadow: #1a1410;

    --font-primary: 'Commissioner', sans-serif;

    --ease-grand: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-reveal: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
    font-family: var(--font-primary);
    background-color: var(--aged-linen);
    color: var(--espresso-noir);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Facet Background Pattern (SVG triangles at 3% opacity) --- */
.hero-facet-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 55%;
    height: 65%;
    opacity: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='32' height='28' viewBox='0 0 32 28' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 0 L32 28 L0 28Z' fill='%23c4a265' fill-opacity='0.03'/%3E%3C/svg%3E");
    background-size: 32px 28px;
    pointer-events: none;
    z-index: 0;
    transition: opacity 1200ms ease;
}

.hero-facet-bg.visible {
    opacity: 1;
}

/* --- Scroll Progress Line --- */
.scroll-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--chandelier);
    opacity: 0;
    z-index: 100;
    transition: opacity 300ms ease;
    pointer-events: none;
}

/* --- Navigation Toggle (Hamburger) --- */
.nav-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 200;
    background: none;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 0;
    transition: gap 400ms var(--ease-grand);
}

.nav-toggle:hover {
    gap: 8px;
}

.nav-toggle.active .nav-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.active .nav-line:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .nav-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.nav-line {
    display: block;
    width: 24px;
    height: 1px;
    background-color: var(--chandelier);
    transition: transform 400ms var(--ease-grand), opacity 300ms ease;
}

/* --- Navigation Overlay --- */
.nav-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--aged-linen);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(100%);
    transition: transform 600ms var(--ease-grand);
}

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

.nav-list {
    list-style: none;
    text-align: center;
}

.nav-list li {
    margin: 0;
}

.nav-link {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--mahogany-shadow);
    text-decoration: none;
    line-height: 4em;
    display: block;
    transition: color 400ms ease, letter-spacing 400ms var(--ease-grand);
}

.nav-link:hover {
    color: var(--chandelier);
    letter-spacing: 0.25em;
}

/* ============================================
   THE GRAND FOYER (Hero Section)
   ============================================ */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: var(--aged-linen);
}

.hero-content {
    position: relative;
    padding-left: 8vw;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(3.5rem, 7vw, 6.5rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--espresso-noir);
    opacity: 0;
    position: relative;
    display: inline-block;
    line-height: 1.1;
}

.hero-title.visible {
    animation: heroTitleReveal 900ms var(--ease-grand) forwards;
}

@keyframes heroTitleReveal {
    0% {
        opacity: 0;
        letter-spacing: 0.35em;
    }
    100% {
        opacity: 1;
        letter-spacing: 0.18em;
    }
}

/* Glitch pseudo-elements on hero title */
.hero-title::before,
.hero-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: inherit;
    font-weight: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    opacity: 0;
    pointer-events: none;
}

.hero-title::before {
    color: rgba(196, 162, 101, 0.4);
    animation: glitchGold 15s steps(1) infinite;
    animation-delay: 2.5s;
}

.hero-title::after {
    color: rgba(212, 160, 138, 0.3);
    animation: glitchRose 15s steps(1) infinite;
    animation-delay: 2.5s;
}

@keyframes glitchGold {
    0%, 98% { opacity: 0; transform: translateX(0); }
    98.5% { opacity: 1; transform: translateX(2px); clip-path: inset(10% 0 60% 0); }
    99% { opacity: 1; transform: translateX(-1px); clip-path: inset(40% 0 20% 0); }
    99.5%, 100% { opacity: 0; transform: translateX(0); }
}

@keyframes glitchRose {
    0%, 98% { opacity: 0; transform: translateX(0); }
    98.5% { opacity: 1; transform: translateX(-2px); clip-path: inset(50% 0 10% 0); }
    99% { opacity: 1; transform: translateX(1px); clip-path: inset(20% 0 50% 0); }
    99.5%, 100% { opacity: 0; transform: translateX(0); }
}

/* Hero decorative gold line */
.hero-line {
    width: 30vw;
    height: 1px;
    background-color: var(--chandelier);
    margin-top: 2rem;
    margin-left: 4vw;
    transform: scaleX(0);
    transform-origin: left;
}

.hero-line.visible {
    animation: lineDrawIn 1800ms var(--ease-grand) forwards;
}

/* Line stutter glitch */
.hero-line.visible {
    animation: lineDrawIn 1800ms var(--ease-grand) forwards, lineStutter 20s ease 3s infinite;
}

@keyframes lineDrawIn {
    0% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

@keyframes lineStutter {
    0%, 99% { transform: scaleX(1) translateY(0); opacity: 1; }
    99.25% { transform: scaleX(1) translateY(2px); opacity: 0.6; }
    99.5% { transform: scaleX(1) translateY(-1px); opacity: 0.8; }
    99.75%, 100% { transform: scaleX(1) translateY(0); opacity: 1; }
}

/* ============================================
   THE GRAND SILENCE (Empty Spacer)
   ============================================ */
.grand-silence {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: var(--aged-linen);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4rem;
}

.scroll-chevron {
    position: relative;
    width: 20px;
    height: 12px;
    animation: chevronPulse 3s ease-in-out infinite;
}

.chevron-line {
    position: absolute;
    width: 14px;
    height: 1px;
    background-color: var(--chandelier);
    bottom: 0;
}

.chevron-line.chevron-left {
    left: 0;
    transform: rotate(45deg);
    transform-origin: bottom left;
}

.chevron-line.chevron-right {
    right: 0;
    transform: rotate(-45deg);
    transform-origin: bottom right;
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.35; }
}

/* ============================================
   THE PROMENADE (Content Sections)
   ============================================ */
.promenade {
    position: relative;
    width: 100%;
    padding: clamp(6rem, 10vh, 12rem) 0;
    background-color: var(--aged-linen);
}

.promenade-block {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 2vw;
    padding: 0 4vw;
    margin-bottom: clamp(12rem, 20vh, 24rem);
}

.promenade-block:last-child {
    margin-bottom: 0;
}

/* Left-aligned content: columns 2-5 */
.promenade-block--left .content-group {
    grid-column: 2 / 6;
}

/* Right-aligned content: columns 7-11 */
.promenade-block--right .content-group {
    grid-column: 7 / 12;
}

/* Content animation state */
.content-group {
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 800ms var(--ease-reveal), transform 800ms var(--ease-reveal);
}

.content-group.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.content-group.animate-in .section-heading {
    transition-delay: 0ms;
}

.content-group.animate-in .prismatic-lines {
    transition-delay: 120ms;
}

.content-group.animate-in .body-text {
    transition-delay: 240ms;
}

.content-group.animate-in .caption-text {
    transition-delay: 360ms;
}

.content-group > * {
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity 600ms var(--ease-reveal), transform 600ms var(--ease-reveal);
}

.content-group.animate-in > * {
    opacity: 1;
    transform: translateY(0);
}

/* Section headings */
.section-heading {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--espresso-noir);
    margin-bottom: 2rem;
}

/* Body text */
.body-text {
    font-family: var(--font-primary);
    font-weight: 300;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    letter-spacing: 0.03em;
    line-height: 1.85;
    color: var(--espresso-noir);
    margin-bottom: 2rem;
    max-width: 42ch;
}

/* Caption text */
.caption-text {
    font-family: var(--font-primary);
    font-weight: 100;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    color: var(--tobacco-silk);
    text-transform: uppercase;
}

/* Prismatic Lines */
.prismatic-lines {
    position: relative;
    width: 100%;
    height: 40px;
    margin-bottom: 2rem;
    overflow: visible;
}

.prismatic-lines::before,
.prismatic-lines::after {
    content: '';
    position: absolute;
    height: 0.5px;
    background-color: var(--chandelier);
}

.prismatic-lines--1::before {
    width: 80px;
    top: 8px;
    left: 0;
    transform: rotate(25deg);
    opacity: 0.4;
}
.prismatic-lines--1::after {
    width: 120px;
    top: 18px;
    left: 10px;
    transform: rotate(20deg);
    opacity: 0.3;
}

.prismatic-lines--2::before {
    width: 100px;
    top: 5px;
    left: 0;
    transform: rotate(35deg);
    opacity: 0.35;
}
.prismatic-lines--2::after {
    width: 60px;
    top: 22px;
    left: 20px;
    transform: rotate(15deg);
    opacity: 0.5;
}

.prismatic-lines--3::before {
    width: 90px;
    top: 10px;
    left: 0;
    transform: rotate(30deg);
    opacity: 0.3;
}
.prismatic-lines--3::after {
    width: 110px;
    top: 20px;
    left: 5px;
    transform: rotate(42deg);
    opacity: 0.4;
}

/* ============================================
   THE CRYSTAL GALLERY (Feature Section)
   ============================================ */
.gallery {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: var(--aged-linen);
    padding: clamp(8rem, 14vh, 16rem) 0;
    overflow: hidden;
}

.gallery-field {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
}

/* Crystal base styles */
.crystal {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 400ms var(--ease-grand), filter 400ms ease;
    cursor: default;
}

.crystal-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.crystal-label {
    font-family: var(--font-primary);
    font-weight: 200;
    font-size: clamp(0.85rem, 1.2vw, 1.05rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--tobacco-silk);
    transition: font-weight 400ms ease, font-variation-settings 400ms ease;
    font-variation-settings: 'wght' 200;
}

.crystal:hover .crystal-label {
    font-variation-settings: 'wght' 400;
}

.crystal:hover {
    transform: scale(1.03);
}

/* Hexagonal crystal */
.crystal--hex {
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}

.crystal--hex .crystal-inner {
    background: linear-gradient(
        var(--crystal-angle, 160deg),
        var(--aged-linen) 0%,
        var(--pale-champagne) 50%,
        rgba(196, 162, 101, 0.15) 100%
    );
}

.crystal--hex::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    border: 1px solid var(--chandelier);
    opacity: var(--crystal-border-opacity, 0.3);
    transition: opacity 400ms ease;
    pointer-events: none;
}

/* Diamond crystal */
.crystal--diamond {
    clip-path: polygon(50% 0%, 85% 50%, 50% 100%, 15% 50%);
}

.crystal--diamond .crystal-inner {
    background: linear-gradient(
        var(--crystal-angle, 180deg),
        var(--pale-champagne) 0%,
        rgba(196, 162, 101, 0.2) 100%
    );
}

.crystal--diamond::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 85% 50%, 50% 100%, 15% 50%);
    border: 1px solid var(--chandelier);
    opacity: var(--crystal-border-opacity, 0.3);
    transition: opacity 400ms ease;
    pointer-events: none;
}

/* Crystal fracture glitch */
.crystal--1 {
    animation: crystalFracture1 28s ease 5s infinite;
}

@keyframes crystalFracture1 {
    0%, 99% {
        filter: none;
    }
    99.3% {
        filter: drop-shadow(1px 0 0 var(--aged-linen)) drop-shadow(-1px 0 0 var(--aged-linen));
        transform: scale(1);
    }
    99.6% {
        filter: drop-shadow(0 1px 0 var(--aged-linen));
        transform: scale(1.005);
    }
    100% {
        filter: none;
        transform: scale(1);
    }
}

/* Crystal positioning - golden ratio spiral distribution */
.crystal--1 {
    width: clamp(160px, 18vw, 220px);
    height: clamp(180px, 20vw, 250px);
    top: 8%;
    left: 15%;
}

.crystal--2 {
    width: clamp(120px, 14vw, 180px);
    height: clamp(160px, 18vw, 220px);
    top: 25%;
    right: 22%;
}

.crystal--3 {
    width: clamp(140px, 16vw, 200px);
    height: clamp(160px, 18vw, 230px);
    bottom: 15%;
    left: 38%;
}

.crystal--4 {
    width: clamp(100px, 12vw, 150px);
    height: clamp(140px, 16vw, 190px);
    bottom: 8%;
    right: 12%;
}

/* ============================================
   THE DEPARTING CORRIDOR (Footer)
   ============================================ */
.corridor {
    position: relative;
    width: 100%;
    padding-top: clamp(10rem, 16vh, 20rem);
    padding-bottom: clamp(4rem, 6vh, 8rem);
    background-color: var(--aged-linen);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Corridor lines drawing inward from edges */
.corridor-line {
    position: absolute;
    top: 50%;
    height: 1px;
    background-color: var(--chandelier);
    width: 30vw;
    transform: scaleX(0);
}

.corridor-line--left {
    left: 8vw;
    transform-origin: left;
}

.corridor-line--right {
    right: 8vw;
    transform-origin: right;
}

.corridor-line.visible {
    animation: corridorLineIn 1800ms var(--ease-grand) forwards;
}

@keyframes corridorLineIn {
    0% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

.corridor-text {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--espresso-noir);
    opacity: 0.4;
    position: relative;
    z-index: 1;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .promenade-block--left .content-group,
    .promenade-block--right .content-group {
        grid-column: 2 / 12;
    }

    .crystal--1 {
        top: 5%;
        left: 5%;
    }

    .crystal--2 {
        top: 28%;
        right: 5%;
    }

    .crystal--3 {
        bottom: 25%;
        left: 10%;
    }

    .crystal--4 {
        bottom: 5%;
        right: 5%;
    }

    .gallery-field {
        height: 90vh;
    }

    .hero-content {
        padding-left: 6vw;
    }

    .nav-toggle {
        top: 1.5rem;
        right: 1.5rem;
    }

    .body-text {
        max-width: 100%;
    }
}
