/* conc.quest - Art-deco observatory aesthetic */

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

:root {
    --terracotta: #d4735e;
    --burnt-orange: #c47a2a;
    --obsidian: #1a1118;
    --gold: #e8b84d;
    --plum: #5a3d6b;
    --dark-wood: #2d1f1a;
    --parchment: #e8ddd0;
    --stone: #9a8e82;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--obsidian);
    color: var(--parchment);
    font-family: 'Cormorant Garamond', serif;
}

/* Film grain overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Progress bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 999;
    background: rgba(26, 17, 24, 0.5);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--burnt-orange), var(--gold));
    transition: width 0.3s ease;
}

/* Scroll container - horizontal */
.scroll-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 700vw;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Chambers */
.chamber {
    min-width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.chamber::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, var(--obsidian) 100%);
    pointer-events: none;
}

.chamber-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    z-index: 1;
    text-align: center;
    padding: 2rem;
}

/* Typography */
.title {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    color: var(--gold);
    text-transform: uppercase;
}

.subtitle {
    font-family: 'Inconsolata', monospace;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: var(--stone);
    text-transform: uppercase;
    animation: pulse-opacity 3s ease-in-out infinite;
}

.chamber-title {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    color: var(--gold);
    text-transform: uppercase;
}

.chamber-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    line-height: 1.8;
    color: var(--parchment);
    max-width: 500px;
    opacity: 0.85;
}

.chamber-text.monospace {
    font-family: 'Inconsolata', monospace;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: var(--gold);
    opacity: 0.7;
}

/* Central Glyph - Chamber 1 */
.central-glyph {
    position: relative;
    width: 250px;
    height: 250px;
}

.glyph-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--gold);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ring-1 {
    width: 250px;
    height: 250px;
    opacity: 0.4;
    animation: rotate-slow 30s linear infinite;
}

.ring-2 {
    width: 180px;
    height: 180px;
    border-color: var(--burnt-orange);
    opacity: 0.6;
    animation: rotate-slow 20s linear infinite reverse;
}

.ring-3 {
    width: 110px;
    height: 110px;
    opacity: 0.8;
    animation: rotate-slow 15s linear infinite;
}

.glyph-core {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--gold);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 30px var(--gold), 0 0 60px rgba(232, 184, 77, 0.3);
}

.glyph-rays {
    position: absolute;
    inset: 0;
    animation: rotate-slow 60s linear infinite;
}

.glyph-rays span {
    position: absolute;
    width: 1px;
    height: 125px;
    background: linear-gradient(to bottom, transparent, var(--gold), transparent);
    top: 50%;
    left: 50%;
    transform-origin: 0 0;
    opacity: 0.3;
}

.glyph-rays span:nth-child(1) { transform: rotate(0deg); }
.glyph-rays span:nth-child(2) { transform: rotate(45deg); }
.glyph-rays span:nth-child(3) { transform: rotate(90deg); }
.glyph-rays span:nth-child(4) { transform: rotate(135deg); }
.glyph-rays span:nth-child(5) { transform: rotate(180deg); }
.glyph-rays span:nth-child(6) { transform: rotate(225deg); }
.glyph-rays span:nth-child(7) { transform: rotate(270deg); }
.glyph-rays span:nth-child(8) { transform: rotate(315deg); }

/* Astrolabe - Chamber 2 */
.astrolabe {
    position: relative;
    width: 200px;
    height: 200px;
}

.astrolabe-outer {
    position: absolute;
    inset: 0;
    border: 2px solid var(--burnt-orange);
    border-radius: 50%;
    animation: rotate-slow 25s linear infinite;
}

.astrolabe-outer::before {
    content: '';
    position: absolute;
    inset: 15px;
    border: 1px solid var(--stone);
    border-radius: 50%;
}

.astrolabe-inner {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: rotate-slow 15s linear infinite reverse;
}

.astrolabe-cross {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 1px;
    background: var(--gold);
    transform: translate(-50%, -50%);
    opacity: 0.4;
}

.astrolabe-cross::after {
    content: '';
    position: absolute;
    width: 1px;
    height: 180px;
    background: var(--gold);
    top: -90px;
    left: 50%;
    opacity: 0.4;
}

/* Hex grid - Chamber 3 */
.hex-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 200px;
}

.hex {
    width: 50px;
    height: 57px;
    background: var(--plum);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    opacity: 0.6;
    transition: opacity 0.5s ease, background 0.5s ease;
}

.hex:hover {
    opacity: 1;
    background: var(--gold);
}

/* Triangle composition - Chamber 4 */
.triangle-composition {
    position: relative;
    width: 200px;
    height: 200px;
}

.tri {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
}

.tri-1 {
    border-bottom: 87px solid var(--terracotta);
    top: 20px;
    left: 50px;
    opacity: 0.7;
}

.tri-2 {
    border-bottom: 87px solid var(--burnt-orange);
    top: 60px;
    left: 30px;
    opacity: 0.5;
}

.tri-3 {
    border-bottom: 87px solid var(--gold);
    top: 60px;
    left: 70px;
    opacity: 0.4;
}

/* Cipher wheel - Chamber 5 */
.cipher-wheel {
    position: relative;
    width: 220px;
    height: 220px;
}

.cipher-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px dashed var(--gold);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.cipher-outer {
    width: 220px;
    height: 220px;
    animation: rotate-slow 20s linear infinite;
}

.cipher-middle {
    width: 160px;
    height: 160px;
    border-color: var(--burnt-orange);
    animation: rotate-slow 14s linear infinite reverse;
}

.cipher-inner {
    width: 100px;
    height: 100px;
    border-style: solid;
    animation: rotate-slow 10s linear infinite;
}

.cipher-symbols {
    position: absolute;
    inset: 0;
    animation: rotate-slow 30s linear infinite reverse;
}

.cipher-symbols span {
    position: absolute;
    font-size: 1.2rem;
    color: var(--gold);
    opacity: 0.6;
}

.cipher-symbols span:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.cipher-symbols span:nth-child(2) { top: 15%; right: 10%; }
.cipher-symbols span:nth-child(3) { top: 50%; right: 0; transform: translateY(-50%); }
.cipher-symbols span:nth-child(4) { bottom: 15%; right: 10%; }
.cipher-symbols span:nth-child(5) { bottom: 0; left: 50%; transform: translateX(-50%); }
.cipher-symbols span:nth-child(6) { bottom: 15%; left: 10%; }
.cipher-symbols span:nth-child(7) { top: 50%; left: 0; transform: translateY(-50%); }
.cipher-symbols span:nth-child(8) { top: 15%; left: 10%; }

/* Portal - Chamber 6 */
.portal {
    position: relative;
    width: 220px;
    height: 220px;
}

.portal-ring {
    position: absolute;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--gold);
}

.p-ring-1 {
    width: 220px;
    height: 220px;
    animation: portal-pulse 4s ease-in-out infinite;
}

.p-ring-2 {
    width: 160px;
    height: 160px;
    border-color: var(--burnt-orange);
    animation: portal-pulse 4s ease-in-out infinite 0.5s;
}

.p-ring-3 {
    width: 100px;
    height: 100px;
    border-color: var(--terracotta);
    animation: portal-pulse 4s ease-in-out infinite 1s;
}

.portal-center {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--gold), var(--plum), transparent);
    box-shadow: 0 0 40px var(--gold);
}

/* Core - Chamber 7 */
.core-glyph {
    position: relative;
    width: 150px;
    height: 150px;
}

.core-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid var(--gold);
    animation: core-expand 3s ease-in-out infinite;
}

.core-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--gold);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px var(--gold), 0 0 40px rgba(232, 184, 77, 0.4);
}

/* Chamber background variations */
#chamber-1 { background: radial-gradient(ellipse at center, var(--dark-wood) 0%, var(--obsidian) 70%); }
#chamber-2 { background: radial-gradient(ellipse at 30% 50%, rgba(90, 61, 107, 0.3) 0%, var(--obsidian) 70%); }
#chamber-3 { background: radial-gradient(ellipse at 70% 50%, rgba(45, 31, 26, 0.5) 0%, var(--obsidian) 70%); }
#chamber-4 { background: radial-gradient(ellipse at center, rgba(212, 115, 94, 0.1) 0%, var(--obsidian) 70%); }
#chamber-5 { background: radial-gradient(ellipse at 50% 30%, rgba(90, 61, 107, 0.2) 0%, var(--obsidian) 70%); }
#chamber-6 { background: radial-gradient(ellipse at center, rgba(232, 184, 77, 0.05) 0%, var(--obsidian) 70%); }
#chamber-7 { background: radial-gradient(ellipse at center, var(--obsidian) 0%, #000 70%); }

/* Animations */
@keyframes rotate-slow {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes pulse-opacity {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes portal-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

@keyframes core-expand {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.5); opacity: 0; }
}

/* Chamber entry animations */
.chamber .chamber-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.chamber.active .chamber-content {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile: vertical scroll */
@media (max-width: 768px) {
    html, body {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .scroll-container {
        flex-direction: column;
        width: 100vw;
        height: auto;
        transform: none !important;
        transition: none;
    }

    .chamber {
        min-width: 100vw;
        min-height: 100vh;
    }

    .progress-bar {
        display: none;
    }

    .chamber .chamber-content {
        opacity: 1;
        transform: none;
    }
}
