/* ============================================================
   gamelicensor.com - Art-Deco Bureaucratic Opulence
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0D0B0E;
    --bg-secondary: #1A1520;
    --gold-primary: #D4AF37;
    --gold-secondary: #C9B06B;
    --gold-tertiary: #B8860B;
    --text-body: #D4CBB8;
    --text-muted: #8B7D5E;
    --accent-warm: #8B2500;
    --accent-cool: #2F4F4F;
    --highlight: #F5E6C8;
    --gold-gradient: linear-gradient(135deg, #B8860B 0%, #D4AF37 35%, #F5E6C8 50%, #D4AF37 65%, #B8860B 100%);
    --ease-ceremonial: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

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

body {
    background-color: var(--bg-primary);
    color: var(--text-body);
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: 1fr min(680px, 90vw) 1fr;
    min-height: 100vh;
}

body > * {
    grid-column: 1 / -1;
}

/* --- Noise Grain Overlay --- */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ============================================================
   GRAND VESTIBULE
   ============================================================ */
.vestibule {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--bg-primary);
}

.vestibule__sunburst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120vmin;
    height: 120vmin;
    opacity: 0;
    z-index: 1;
    transition: opacity 1.5s var(--ease-ceremonial);
}

.vestibule__sunburst.visible {
    opacity: 0.06;
}

.vestibule__sunburst svg {
    width: 100%;
    height: 100%;
}

.vestibule__content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vestibule__title {
    font-family: 'Poiret One', sans-serif;
    font-weight: 400;
    font-size: clamp(2.2rem, 6vw, 5rem);
    letter-spacing: 0.5em;
    text-transform: uppercase;
    line-height: 1.05;
    color: var(--gold-primary);
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.25);
    opacity: 0;
    transition: opacity 600ms var(--ease-ceremonial), letter-spacing 600ms var(--ease-ceremonial);
}

.vestibule__title.visible {
    opacity: 1;
    letter-spacing: 0.2em;
}

.vestibule__line {
    width: 0;
    height: 1px;
    background: var(--gold-gradient);
    margin: 1.5rem 0;
    transition: width 500ms var(--ease-ceremonial);
}

.vestibule__line.visible {
    width: min(400px, 60vw);
}

.vestibule__subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 3vw, 2rem);
    letter-spacing: 0.06em;
    line-height: 1.3;
    color: var(--gold-secondary);
    opacity: 0;
    transition: opacity 600ms var(--ease-ceremonial);
}

.vestibule__subtitle.visible {
    opacity: 1;
}

.vestibule__scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    opacity: 0;
    transition: opacity 800ms var(--ease-ceremonial);
}

.vestibule__scroll-hint.visible {
    opacity: 0.5;
}

.scroll-dot {
    animation: scrollBounce 2s var(--ease-ceremonial) infinite;
}

@keyframes scrollBounce {
    0%, 100% { cy: 12; }
    50% { cy: 28; }
}

/* ============================================================
   PROMENADE
   ============================================================ */
.promenade {
    position: relative;
    width: 100%;
    padding: 12rem 0;
}

/* --- Vertical Rail Borders --- */
.promenade__rail {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 40px;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 800ms var(--ease-ceremonial);
    float: left;
}

.promenade__rail.visible {
    opacity: 1;
}

.promenade__rail--left {
    float: left;
    margin-left: calc((100vw - min(680px, 90vw)) / 2 - 60px);
}

.promenade__rail--right {
    float: right;
    margin-right: calc((100vw - min(680px, 90vw)) / 2 - 60px);
}

.rail__line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--gold-tertiary) 10%,
        var(--gold-tertiary) 90%,
        transparent 100%
    );
}

.promenade__rail--left .rail__line::before,
.promenade__rail--right .rail__line::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--gold-tertiary) 10%,
        var(--gold-tertiary) 90%,
        transparent 100%
    );
    opacity: 0.4;
}

.promenade__rail--left .rail__line::before {
    left: -4px;
}

.promenade__rail--right .rail__line::before {
    right: -4px;
    left: auto;
}

.rail__diamond {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    border: 1px solid var(--gold-tertiary);
    background: var(--bg-primary);
}

/* --- Frieze Dividers --- */
.frieze {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 30px;
    opacity: 0.2;
    overflow: hidden;
    margin-top: 6rem;
    margin-bottom: 6rem;
}

.frieze__svg {
    width: 100%;
    height: 100%;
}

.frieze.shimmer .frieze__svg {
    animation: friezeShimmer 800ms var(--ease-ceremonial) forwards;
}

@keyframes friezeShimmer {
    0% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(2.5);
    }
    100% {
        filter: brightness(1);
    }
}

/* --- Alcove Panels --- */
.alcove {
    max-width: min(680px, 90vw);
    margin: 0 auto;
    position: relative;
    clear: both;
}

.alcove__inner {
    clip-path: polygon(0% 8%, 50% 0%, 100% 8%, 100% 100%, 0% 100%);
    border: 1px solid var(--gold-tertiary);
    background: var(--bg-secondary);
    box-shadow: inset 0 0 40px rgba(184, 134, 11, 0.08);
    padding: 4rem 3rem 3rem;
    position: relative;
}

.alcove__inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gold-gradient);
    opacity: 0.3;
}

.alcove__heading {
    font-family: 'Poiret One', sans-serif;
    font-weight: 400;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    line-height: 1.05;
    color: var(--gold-primary);
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.25);
    text-align: center;
    margin-bottom: 2rem;
}

.alcove__body p {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--text-body);
    margin-bottom: 1.5rem;
}

.alcove__body p:last-child {
    margin-bottom: 0;
}

/* --- Fade Reveal Animation --- */
.fade-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 500ms var(--ease-ceremonial), transform 500ms var(--ease-ceremonial);
}

.fade-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   SEAL CHAMBER
   ============================================================ */
.seal-chamber {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--bg-primary);
    padding: 4rem 0;
}

.seal-chamber__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.seal-chamber__seal {
    width: min(400px, 80vw);
    height: min(400px, 80vw);
    opacity: 0.5;
    transition: opacity 800ms var(--ease-ceremonial);
}

.seal-chamber__seal.active {
    opacity: 1;
}

.seal-chamber__seal svg {
    width: 100%;
    height: 100%;
}

/* Seal path draw animation */
.seal__outer-ring {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    transition: stroke-dashoffset 800ms var(--ease-ceremonial);
}

.seal__outer-ring.drawn {
    stroke-dashoffset: 0;
}

.seal__text {
    opacity: 0;
    transition: opacity 600ms var(--ease-ceremonial);
}

.seal__text.drawn {
    opacity: 1;
}

.seal__ticks line {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    transition: stroke-dashoffset 400ms var(--ease-ceremonial);
}

.seal__ticks.drawn line {
    stroke-dashoffset: 0;
}

.seal__inner-chain {
    opacity: 0;
    transition: opacity 500ms var(--ease-ceremonial);
}

.seal__inner-chain.drawn {
    opacity: 1;
}

.seal__starburst {
    opacity: 0;
    transition: opacity 400ms var(--ease-ceremonial);
}

.seal__starburst.drawn {
    opacity: 1;
}

/* Seal rotation */
.seal-chamber__seal.rotating svg {
    animation: sealRotate 90s linear infinite;
}

@keyframes sealRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Seal glow pulse */
.seal-chamber__seal.glow {
    filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.15));
    animation: sealGlow 1.2s var(--ease-ceremonial) forwards;
}

@keyframes sealGlow {
    0% { filter: drop-shadow(0 0 0px rgba(212, 175, 55, 0)); }
    50% { filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.2)); }
    100% { filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.05)); }
}

/* --- Seal Inscription --- */
.seal-chamber__inscription {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
    display: flex;
    align-items: center;
    gap: 1em;
    opacity: 0;
    transition: opacity 600ms var(--ease-ceremonial);
}

.seal-chamber__inscription.visible {
    opacity: 1;
}

.inscription__separator {
    color: var(--gold-tertiary);
    opacity: 0.5;
}

/* ============================================================
   SUNBURST RAY ANIMATIONS
   ============================================================ */
.sunburst-ray {
    opacity: 0;
    transition: opacity 300ms var(--ease-ceremonial);
}

.sunburst-ray.visible {
    opacity: 1;
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 768px) {
    .alcove__inner {
        padding: 3rem 1.5rem 2rem;
    }

    .promenade__rail {
        display: none;
    }

    .vestibule__title {
        letter-spacing: 0.3em;
    }

    .vestibule__title.visible {
        letter-spacing: 0.12em;
    }

    .seal-chamber__seal {
        width: min(300px, 85vw);
        height: min(300px, 85vw);
    }
}

@media (max-width: 480px) {
    .alcove__inner {
        clip-path: polygon(0% 5%, 50% 0%, 100% 5%, 100% 100%, 0% 100%);
        padding: 2.5rem 1.2rem 1.5rem;
    }

    .frieze {
        margin-top: 4rem;
        margin-bottom: 4rem;
    }
}

/* ============================================================
   WIDE SCREEN ADJUSTMENTS
   ============================================================ */
@media (min-width: 1200px) {
    body {
        grid-template-columns: 1fr min(960px, 90vw) 1fr;
    }

    .alcove {
        max-width: min(960px, 90vw);
    }
}
