/* xity.dev - Luxury Corporate x Glitch Corruption */

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

:root {
    --obsidian: #0A0A0A;
    --onyx: #1A1A1F;
    --gold: #C9A84C;
    --gold-light: #E8D48B;
    --warm-amber: #8B7032;
    --stone: #9A9590;
    --parchment: #F0EDE6;
    --cyan-accent: #2BD4D9;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--obsidian);
    color: var(--parchment);
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.1vw, 1.125rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ===== OPENING SEQUENCE ===== */
.scene-opening {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--obsidian);
    overflow: hidden;
}

#goldParticles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.opening-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    animation: fadeInUp 1.2s ease 0.5s forwards;
}

.logo-reveal {
    font-family: 'Rokkitt', serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.04em;
    color: var(--parchment);
    text-transform: uppercase;
}

.logo-dot {
    color: var(--gold);
}

.tagline-rule {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 24px auto;
    animation: ruleExpand 1.5s ease 1.2s forwards;
}

.tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--stone);
    opacity: 0;
    animation: fadeIn 0.8s ease 1.8s forwards;
}

.glitch-strip {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    top: 50%;
    background: var(--cyan-accent);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
}

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

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

@keyframes ruleExpand {
    from { width: 0; }
    to { width: 200px; }
}

/* ===== SECTION LABEL ===== */
.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--stone);
    padding: 0 48px;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.section-label.revealed {
    opacity: 1;
    transform: translateY(0);
}

.section-label-light {
    color: var(--gold-light);
}

/* ===== GILT FRAME GRID ===== */
.scene-grid {
    padding: 120px 0;
    background: var(--obsidian);
}

.gilt-grid {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 2px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 48px;
}

.gilt-panel {
    position: relative;
    background: var(--onyx);
    border: 1px solid rgba(201, 168, 76, 0.15);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.gilt-panel.revealed {
    opacity: 1;
    transform: translateY(0);
}

.panel-large {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}

.panel-small {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

.panel-medium {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

.panel-inner {
    padding: 48px;
}

.panel-number {
    font-family: 'Rokkitt', serif;
    font-weight: 700;
    font-size: 2.4rem;
    color: rgba(201, 168, 76, 0.2);
    display: block;
    margin-bottom: 16px;
}

.gilt-panel h2 {
    font-family: 'Rokkitt', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: 0.04em;
    color: var(--parchment);
    margin-bottom: 16px;
}

.gilt-panel p {
    color: var(--stone);
    max-width: 560px;
}

.panel-gold-edge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--warm-amber), var(--gold));
    opacity: 0;
    transition: opacity 0.6s ease;
}

.gilt-panel:hover .panel-gold-edge {
    opacity: 1;
}

/* ===== RGB CHANNEL SPLIT ===== */
.scene-rgb {
    padding: 160px 0;
    background: var(--obsidian);
    text-align: center;
    overflow: hidden;
}

.rgb-display {
    position: relative;
    height: 200px;
    margin: 0 auto 64px;
    max-width: 800px;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.rgb-display.revealed {
    opacity: 1;
    transform: scale(1);
}

.rgb-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Rokkitt', serif;
    font-weight: 700;
    font-size: clamp(5rem, 12vw, 10rem);
    letter-spacing: 0.08em;
    mix-blend-mode: screen;
    transition: transform 0.6s ease;
}

.rgb-r {
    color: #ff0000;
    transform: translateX(-4px);
}

.rgb-g {
    color: #00ff00;
    transform: translateX(0);
}

.rgb-b {
    color: #0000ff;
    transform: translateX(4px);
}

.rgb-display:hover .rgb-r { transform: translateX(-12px); }
.rgb-display:hover .rgb-b { transform: translateX(12px); }

.rgb-caption {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 48px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.rgb-caption.revealed {
    opacity: 1;
    transform: translateY(0);
}

.rgb-caption p {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    color: var(--stone);
    font-style: italic;
}

/* ===== EROSION CORRIDOR ===== */
.scene-corridor {
    position: relative;
    padding: 120px 0;
    background: linear-gradient(180deg, var(--obsidian) 0%, var(--onyx) 100%);
}

.corridor-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 48px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
}

.corridor-block {
    position: relative;
    padding-left: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.corridor-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.corridor-gold-inlay {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--gold), transparent);
}

.corridor-block h2 {
    font-family: 'Rokkitt', serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    letter-spacing: 0.04em;
    color: var(--parchment);
    margin-bottom: 16px;
}

.corridor-block p {
    color: var(--stone);
}

.scanline-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(10, 10, 10, 0.03) 2px,
        rgba(10, 10, 10, 0.03) 4px
    );
}

/* ===== GOLD VEIN ===== */
.scene-vein {
    padding: 160px 0;
    background: var(--onyx);
}

.vein-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 48px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.vein-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

.gold-vein-svg {
    width: 100%;
    height: auto;
    margin-bottom: 48px;
}

.vein-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 3s ease;
}

.vein-content.revealed .vein-path {
    stroke-dashoffset: 0;
}

.vein-text h2 {
    font-family: 'Rokkitt', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: 0.04em;
    color: var(--gold);
    margin-bottom: 16px;
}

.vein-text p {
    color: var(--stone);
    max-width: 600px;
}

/* ===== FOUNDATION ===== */
.scene-foundation {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 0;
    background: var(--obsidian);
}

.foundation-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 48px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.foundation-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

.foundation-statement {
    font-family: 'Rokkitt', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: 0.04em;
    color: var(--parchment);
    line-height: 1.6;
}

.foundation-rule {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 32px auto;
    transition: width 1.5s ease;
}

.foundation-content.revealed .foundation-rule {
    width: 160px;
}

.foundation-meta {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.meta-item {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--stone);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .gilt-grid {
        grid-template-columns: 1fr;
        padding: 0 24px;
    }

    .panel-large {
        grid-column: 1;
        grid-row: auto;
    }

    .panel-small,
    .panel-medium {
        grid-column: 1;
        grid-row: auto;
    }

    .corridor-content {
        grid-template-columns: 1fr;
        padding: 0 24px;
        gap: 48px;
    }

    .section-label {
        padding: 0 24px;
    }

    .vein-content,
    .foundation-content {
        padding: 0 24px;
    }

    .rgb-caption {
        padding: 0 24px;
    }

    .foundation-meta {
        gap: 24px;
    }
}
