/* ==========================================================================
   xanadu.quest — Art Deco Ornate Luxury
   Palette: Onyx #0a0a0a · Gold #d4a843 · Bright Gold #f0d060
            Ivory #f5f0e0 · Ruby #8b1a3a · Dome Blue #1a3a5a
   Fonts:   Playfair Display (display) · Raleway (body) · Cormorant Garamond (verse)
   ========================================================================== */

:root {
    --onyx: #0a0a0a;
    --onyx-deep: #050505;
    --gold: #d4a843;
    --gold-bright: #f0d060;
    --gold-dim: #8b6a23;
    --ivory: #f5f0e0;
    --ivory-soft: #e9e2cf;
    --ruby: #8b1a3a;
    --ruby-bright: #b22a4a;
    --dome-blue: #1a3a5a;
    --max-content: 900px;
    --side-gutter: clamp(1.25rem, 4vw, 3rem);
    --gold-rgba: 212, 168, 67;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--onyx);
    color: var(--ivory);
    font-family: 'Raleway', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Global subtle chevron texture wash */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        repeating-linear-gradient(135deg,
            transparent, transparent 14px,
            rgba(var(--gold-rgba), 0.025) 14px,
            rgba(var(--gold-rgba), 0.025) 28px);
    mix-blend-mode: screen;
}

main, header, section, footer {
    position: relative;
    z-index: 1;
}

/* ---------------- Hero / Palace Gates ---------------- */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem var(--side-gutter);
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 60%, rgba(var(--gold-rgba), 0.10) 0%, rgba(var(--gold-rgba), 0) 60%),
        var(--onyx);
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 90px;
    pointer-events: none;
    background:
        repeating-linear-gradient(135deg,
            transparent 0,
            transparent 10px,
            rgba(var(--gold-rgba), 0.18) 10px,
            rgba(var(--gold-rgba), 0.18) 12px,
            transparent 12px,
            transparent 22px);
    mask-image: linear-gradient(to bottom, var(--onyx), transparent);
    -webkit-mask-image: linear-gradient(to bottom, var(--onyx), transparent);
}

.hero::before {
    top: 0;
}

.hero::after {
    bottom: 0;
    transform: scaleY(-1);
}

.hero-gate {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.85;
}

.gate-svg {
    width: min(85vw, 740px);
    height: auto;
    max-height: 110vh;
    filter: drop-shadow(0 0 28px rgba(var(--gold-rgba), 0.18));
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 800px;
    padding: 2rem 1rem;
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin: 0 0 2rem;
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-style: italic;
    font-weight: 400;
    color: var(--gold);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.eyebrow-text {
    white-space: nowrap;
}

.ornament-line {
    flex: 1 1 auto;
    max-width: 90px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero-title {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-weight: 900;
    font-size: clamp(3rem, 11vw, 7rem);
    letter-spacing: 0.18em;
    margin: 0;
    color: var(--gold-bright);
    line-height: 1;
    text-shadow:
        0 0 30px rgba(var(--gold-rgba), 0.45),
        0 0 60px rgba(var(--gold-rgba), 0.25),
        0 2px 0 rgba(0, 0, 0, 0.6);
}

.title-letter {
    display: inline-block;
    transform: translateY(0);
    transition: transform 700ms cubic-bezier(0.2, 0.8, 0.3, 1),
                color 700ms ease,
                text-shadow 700ms ease;
}

.title-letter.is-revealed {
    /* hook for entrance animations */
}

.hero-domain {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    color: var(--ivory-soft);
    letter-spacing: 0.4em;
    text-transform: lowercase;
    margin-top: 1rem;
    font-size: clamp(0.9rem, 2vw, 1.15rem);
}

.hero-subtitle {
    margin: 1.6rem auto 0;
    max-width: 560px;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: var(--ivory);
    line-height: 1.7;
}

.hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2.5rem auto 0;
    width: min(360px, 70%);
}

.hero-divider .div-line {
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero-divider .div-diamond {
    width: 10px;
    height: 10px;
    background: var(--gold);
    transform: rotate(45deg);
    box-shadow: 0 0 12px rgba(var(--gold-rgba), 0.8);
}

.hero-scroll {
    margin-top: 3rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--gold);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-size: 0.72rem;
    opacity: 0.75;
    animation: scrollPulse 3s ease-in-out infinite;
}

.scroll-arrow {
    font-size: 1.4rem;
    line-height: 1;
}

@keyframes scrollPulse {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50%      { transform: translateY(8px); opacity: 1; }
}

/* ---------------- Verse Sections ---------------- */

.verse-section {
    padding: 5rem var(--side-gutter);
    display: flex;
    justify-content: center;
}

.verse-block {
    position: relative;
    max-width: 560px;
    width: 100%;
    padding: 3rem 2rem 2.5rem;
    margin: 0 auto;
    text-align: center;
    border-top: 1px solid var(--gold);
    border-bottom: 1px solid var(--gold);
    color: var(--ruby);
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 1.25rem;
    line-height: 2.0;
    background:
        linear-gradient(180deg,
            rgba(var(--gold-rgba), 0.04),
            rgba(var(--gold-rgba), 0.02) 50%,
            rgba(var(--gold-rgba), 0.04));
}

.verse-block::before,
.verse-block::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 50px;
    height: 1px;
    background: var(--gold);
    transform: translateX(-50%);
}

.verse-block::before {
    top: -1px;
    box-shadow:
        -34px 6px 0 -0.5px var(--gold),
        34px 6px 0 -0.5px var(--gold);
}

.verse-block::after {
    bottom: -1px;
    box-shadow:
        -34px -6px 0 -0.5px var(--gold),
        34px -6px 0 -0.5px var(--gold);
}

.verse-line {
    margin: 0 0 0.4rem;
}

.verse-line:first-of-type {
    color: var(--ruby-bright);
}

.verse-attribution {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--gold);
    letter-spacing: 0.1em;
}

/* Fan ornament (conic gradient sunburst) */
.fan-ornament {
    width: 64px;
    height: 32px;
    margin: 0 auto 1.5rem;
    border-bottom: 1px solid var(--gold);
    background:
        conic-gradient(from 270deg at 50% 100%,
            transparent 0deg,
            rgba(var(--gold-rgba), 0.05) 5deg,
            rgba(var(--gold-rgba), 0.5) 30deg,
            rgba(var(--gold-rgba), 0.05) 60deg,
            rgba(var(--gold-rgba), 0.5) 90deg,
            rgba(var(--gold-rgba), 0.05) 120deg,
            rgba(var(--gold-rgba), 0.5) 150deg,
            rgba(var(--gold-rgba), 0.05) 180deg,
            transparent 180deg);
    -webkit-mask-image: radial-gradient(ellipse 50% 100% at 50% 100%, #000 60%, transparent 100%);
    mask-image: radial-gradient(ellipse 50% 100% at 50% 100%, #000 60%, transparent 100%);
}

/* Larger version for section headers */
.section-header .fan-ornament {
    width: 96px;
    height: 48px;
    margin-bottom: 1.5rem;
}

/* ---------------- Section Header / Frame ---------------- */

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--gold-bright);
    font-size: clamp(2rem, 4.5vw, 3rem);
    letter-spacing: 0.06em;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 0 18px rgba(var(--gold-rgba), 0.25);
}

.section-lede {
    margin: 1rem auto 0;
    max-width: 540px;
    color: var(--ivory-soft);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.7;
}

.gold-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1rem auto 0;
    width: min(280px, 60%);
}

.gold-divider span {
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.gold-divider .diamond {
    width: 8px;
    height: 8px;
    background: var(--gold);
    transform: rotate(45deg);
    box-shadow: 0 0 8px rgba(var(--gold-rgba), 0.6);
}

.section-frame {
    max-width: var(--max-content);
    margin: 0 auto;
    padding: 4rem 2.25rem;
    border: 1px solid rgba(var(--gold-rgba), 0.35);
    position: relative;
    background:
        repeating-linear-gradient(135deg,
            transparent, transparent 10px,
            rgba(var(--gold-rgba), 0.05) 10px,
            rgba(var(--gold-rgba), 0.05) 20px);
}

.section-frame::before,
.section-frame::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.section-frame::before { top: 6px; }
.section-frame::after  { bottom: 6px; }

/* Corner ornaments via background */
.section-frame > .section-corner-tl,
.section-frame > .section-corner-tr,
.section-frame > .section-corner-bl,
.section-frame > .section-corner-br {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 1px solid var(--gold);
}

/* ---------------- Manifesto ---------------- */

.manifesto {
    padding: 5rem var(--side-gutter);
}

.manifesto-body {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.manifesto-body .lead {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    color: var(--ivory);
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

.manifesto-body p {
    margin: 0 0 1.4rem;
    color: var(--ivory-soft);
    font-size: 1.02rem;
}

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

/* ---------------- Chambers ---------------- */

.chambers {
    padding: 6rem var(--side-gutter);
    max-width: var(--max-content);
    margin: 0 auto;
}

.chamber-list {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    margin-top: 2rem;
}

.chamber {
    position: relative;
    text-align: center;
    padding: 2.5rem 1.5rem;
    transition: transform 600ms ease, opacity 600ms ease;
    opacity: 0;
    transform: translateY(24px);
}

.chamber.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.chamber-numeral {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--gold);
    font-size: 2rem;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.chamber-numeral::before,
.chamber-numeral::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold) 40%, var(--gold) 60%, transparent);
}

.chamber-numeral::before { right: calc(100% + 14px); }
.chamber-numeral::after  { left:  calc(100% + 14px); }

.chamber-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--gold-bright);
    font-size: clamp(1.4rem, 2.6vw, 1.8rem);
    letter-spacing: 0.05em;
    margin: 0 0 1rem;
}

.chamber-text {
    max-width: 540px;
    margin: 0 auto;
    color: var(--ivory-soft);
    font-size: 1.02rem;
    line-height: 1.75;
}

.chamber-rule {
    width: 80px;
    height: 1px;
    background: var(--gold);
    margin: 1.6rem auto 0;
    position: relative;
}

.chamber-rule::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    background: var(--gold);
    transform: translate(-50%, -50%) rotate(45deg);
}

/* ---------------- Decree ---------------- */

.decree {
    padding: 6rem var(--side-gutter);
    max-width: var(--max-content);
    margin: 0 auto;
}

.decree-list {
    list-style: none;
    margin: 2.5rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.decree-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.4rem 1.6rem;
    border-top: 1px solid rgba(var(--gold-rgba), 0.25);
    border-bottom: 1px solid rgba(var(--gold-rgba), 0.25);
    background:
        linear-gradient(90deg,
            rgba(var(--gold-rgba), 0.02),
            rgba(var(--gold-rgba), 0.06) 50%,
            rgba(var(--gold-rgba), 0.02));
    transition: background 500ms ease, transform 500ms ease;
}

.decree-item:hover {
    background:
        linear-gradient(90deg,
            rgba(var(--gold-rgba), 0.05),
            rgba(var(--gold-rgba), 0.14) 50%,
            rgba(var(--gold-rgba), 0.05));
    transform: translateX(4px);
}

.decree-mark {
    flex: 0 0 auto;
    color: var(--ruby);
    font-size: 1.1rem;
    line-height: 1.6;
    transform: translateY(2px);
}

.decree-item:hover .decree-mark {
    color: var(--gold-bright);
    transition: color 400ms ease;
}

.decree-text {
    color: var(--ivory);
    font-size: 1.02rem;
    line-height: 1.75;
}

.decree-text strong {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 0.04em;
    margin-right: 0.25rem;
}

/* ---------------- Dome Close ---------------- */

.dome-close {
    padding: 7rem var(--side-gutter) 6rem;
    text-align: center;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(var(--gold-rgba), 0.08) 0%, transparent 65%),
        var(--onyx);
}

.dome-frame {
    max-width: 720px;
    margin: 0 auto;
}

.dome-svg-wrap {
    margin: 0 auto 2rem;
    max-width: 520px;
}

.dome-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 16px rgba(var(--gold-rgba), 0.25));
}

.dome-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--gold-bright);
    font-size: clamp(2rem, 4vw, 2.8rem);
    letter-spacing: 0.08em;
    margin: 0;
}

.dome-text {
    margin: 1.5rem auto 0;
    max-width: 580px;
    color: var(--ivory-soft);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.85;
}

.dome-signature {
    margin-top: 2rem;
    color: var(--gold);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    letter-spacing: 0.3em;
    text-transform: lowercase;
    font-size: 0.95rem;
}

/* ---------------- Footer ---------------- */

.palace-footer {
    padding: 3rem var(--side-gutter) 4rem;
    text-align: center;
    background: var(--onyx-deep);
    border-top: 1px solid rgba(var(--gold-rgba), 0.3);
    position: relative;
}

.palace-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    pointer-events: none;
    background:
        repeating-linear-gradient(135deg,
            transparent 0,
            transparent 10px,
            rgba(var(--gold-rgba), 0.18) 10px,
            rgba(var(--gold-rgba), 0.18) 12px,
            transparent 12px,
            transparent 22px);
    mask-image: linear-gradient(to bottom, var(--onyx-deep), transparent);
    -webkit-mask-image: linear-gradient(to bottom, var(--onyx-deep), transparent);
}

.footer-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0 auto 1.5rem;
    width: min(360px, 70%);
}

.footer-divider .div-line {
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.footer-divider .div-diamond {
    width: 8px;
    height: 8px;
    background: var(--gold);
    transform: rotate(45deg);
}

.footer-line {
    color: var(--ivory-soft);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.78rem;
    margin: 0;
}

.footer-poem {
    margin-top: 1rem;
    color: var(--ruby);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.7;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------------- Reveal animations ---------------- */

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 900ms ease, transform 900ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 720px) {
    .hero {
        padding: 3rem 1rem;
        min-height: 100svh;
    }

    .hero-title {
        letter-spacing: 0.12em;
    }

    .hero-eyebrow {
        gap: 0.5rem;
        font-size: 0.7rem;
    }

    .ornament-line {
        max-width: 50px;
    }

    .verse-section {
        padding: 4rem 1rem;
    }

    .verse-block {
        padding: 2.5rem 1.25rem 2rem;
        font-size: 1.1rem;
        line-height: 1.85;
    }

    .section-frame {
        padding: 3rem 1.25rem;
    }

    .chamber {
        padding: 1.5rem 0.5rem;
    }

    .chamber-numeral::before,
    .chamber-numeral::after {
        width: 28px;
    }

    .decree-item {
        padding: 1.1rem 1rem;
        gap: 0.8rem;
    }

    .dome-close {
        padding: 5rem 1rem 4rem;
    }
}

@media (max-width: 420px) {
    .hero-title {
        letter-spacing: 0.08em;
    }

    .hero-domain {
        letter-spacing: 0.25em;
    }

    .hero-eyebrow {
        flex-direction: column;
        gap: 0.6rem;
    }

    .ornament-line {
        width: 80px;
        max-width: 80px;
    }
}

/* Respect reduced motion (palace remains still) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    html { scroll-behavior: auto; }

    .reveal { opacity: 1; transform: none; }
    .chamber { opacity: 1; transform: none; }
    .hero-scroll { animation: none; opacity: 0.7; }
}
