/* monopole.ai — Victorian Physics Cabinet */
:root {
    --obsidian: #0d0d0f;
    --cabinet: #151518;
    --aurora-cyan: #00e5ff;
    --mag-magenta: #ff00c8;
    --gold: #c9a84c;
    --paper: #d4cfc4;
    --faded-ink: #7a7468;
    --deep-violet: #2a0a3e;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--obsidian);
    color: var(--paper);
    font-family: 'Cutive Mono', monospace;
    font-size: 16px;
    line-height: 1.8;
    overflow-x: hidden;
}

.chamber {
    position: relative;
    width: 100%;
}

/* ==========================================
   CHAMBER 1: THE ANTECHAMBER
   ========================================== */

#antechamber {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ornate-frame {
    position: relative;
    width: 80vw;
    max-width: 800px;
    height: 60vh;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: border-breathe 6s ease-in-out infinite;
}

/* Victorian Filigree Corner System */
.corner {
    position: absolute;
    width: 40px;
    height: 40px;
}

.corner::before,
.corner::after {
    content: '';
    position: absolute;
    border: 1px solid var(--gold);
}

.corner::before {
    width: 20px;
    height: 20px;
    top: 0;
    left: 0;
}

.corner::after {
    width: 12px;
    height: 12px;
    top: 4px;
    left: 4px;
    transform: rotate(45deg);
}

.corner-tl { top: 0; left: 0; }
.corner-tr { top: 0; right: 0; transform: scaleX(-1); }
.corner-bl { bottom: 0; left: 0; transform: scaleY(-1); }
.corner-br { bottom: 0; right: 0; transform: scale(-1, -1); }

.corner-tl::before,
.corner-tl::after { animation: corner-shimmer 3s ease-in-out infinite; }
.corner-tr::before,
.corner-tr::after { animation: corner-shimmer 3s ease-in-out infinite 0.75s; }
.corner-bl::before,
.corner-bl::after { animation: corner-shimmer 3s ease-in-out infinite 1.5s; }
.corner-br::before,
.corner-br::after { animation: corner-shimmer 3s ease-in-out infinite 2.25s; }

/* Frame Lines */
.frame-line {
    position: absolute;
    background: var(--gold);
}

.frame-top {
    top: 19px;
    left: 40px;
    right: 40px;
    height: 1px;
}

.frame-bottom {
    bottom: 19px;
    left: 40px;
    right: 40px;
    height: 1px;
}

.frame-left {
    top: 40px;
    bottom: 40px;
    left: 19px;
    width: 1px;
}

.frame-right {
    top: 40px;
    bottom: 40px;
    right: 19px;
    width: 1px;
}

.antechamber-content {
    text-align: center;
    padding: 40px;
}

.domain-title {
    font-family: 'Major Mono Display', monospace;
    font-size: clamp(2rem, 8vw, 6rem);
    letter-spacing: 0.3em;
    color: var(--paper);
    margin: 20px 0;
    font-weight: 400;
}

.premise-text {
    font-family: 'Cutive Mono', monospace;
    font-style: italic;
    color: var(--faded-ink);
    font-size: 14px;
    line-height: 2.0;
    margin-top: 20px;
    letter-spacing: 0.05em;
}

/* Decorative Rules */
.decorative-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.rule-line {
    flex: 1;
    height: 1px;
    background: var(--gold);
    opacity: 0.6;
}

.rule-diamond {
    width: 8px;
    height: 8px;
    background: var(--gold);
    transform: rotate(45deg);
    opacity: 0.8;
    flex-shrink: 0;
}

/* ==========================================
   CHAMBER 2: THE VOID CHAMBER
   ========================================== */

#void-chamber {
    min-height: 250vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--obsidian);
    position: relative;
}

.void-space-upper {
    height: 75vh;
    width: 100%;
}

.monopole-orb {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.orb-inner {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--aurora-cyan), var(--mag-magenta) 40%, var(--deep-violet) 70%, transparent);
    box-shadow:
        0 0 20px var(--aurora-cyan),
        0 0 60px var(--mag-magenta),
        0 0 120px var(--deep-violet),
        0 0 200px rgba(0, 229, 255, 0.15);
    animation: orb-pulse 8s ease-in-out infinite;
}

.void-space-lower {
    height: 75vh;
    width: 100%;
}

/* ==========================================
   CHAMBER 3: THE OBSERVATION LOG
   ========================================== */

#observation-log {
    min-height: 150vh;
    padding: 20vh 0;
    display: flex;
    flex-direction: column;
    gap: 20vh;
    background: var(--obsidian);
}

.observation-entry {
    margin-left: 20%;
    margin-right: 10%;
    max-width: 600px;
}

.entry-date {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--faded-ink);
    display: block;
    margin-bottom: 8px;
}

.entry-observer {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--faded-ink);
    display: block;
    margin-bottom: 24px;
    opacity: 0.6;
}

.entry-text {
    font-family: 'Cutive Mono', monospace;
    font-size: 14px;
    line-height: 2.0;
    color: var(--gold);
}

/* ==========================================
   CHAMBER 4: THE APPARATUS
   ========================================== */

#apparatus {
    min-height: 150vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20vh 0;
    background: var(--obsidian);
}

.apparatus-frame {
    position: relative;
    width: 80vw;
    max-width: 700px;
    aspect-ratio: 1 / 1;
    max-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apparatus-diagram {
    width: 100%;
    padding: 60px;
    text-align: center;
}

.apparatus-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.field-line {
    fill: none;
    stroke: var(--aurora-cyan);
    stroke-width: 0.5;
    opacity: 0.6;
}

.field-line-1 { stroke-dasharray: 5 5; animation: stroke-flow 4s linear infinite; }
.field-line-2 { stroke-dasharray: 8 8; animation: stroke-flow 4s linear infinite 0.5s; }
.field-line-3 { stroke-dasharray: 12 12; animation: stroke-flow 4s linear infinite 1s; }
.field-line-4 { stroke-dasharray: 16 16; animation: stroke-flow 4s linear infinite 1.5s; }
.field-line-5 { stroke-dasharray: 20 20; animation: stroke-flow 4s linear infinite 2s; }

.flux-line {
    stroke: var(--aurora-cyan);
    stroke-width: 0.5;
    opacity: 0.4;
}

.measure-point {
    fill: var(--aurora-cyan);
    opacity: 0.8;
}

.core-point {
    fill: var(--aurora-cyan);
    opacity: 1;
}

.core-ring {
    fill: none;
    stroke: var(--aurora-cyan);
    stroke-width: 1;
    opacity: 0.8;
    animation: core-pulse 2s ease-in-out infinite;
}

.diagram-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    fill: var(--faded-ink);
    letter-spacing: 0.15em;
}

.figure-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--faded-ink);
    text-align: center;
    margin-top: 40px;
    line-height: 1.8;
}

/* ==========================================
   CHAMBER 5: THE CLOSING SEAL
   ========================================== */

#closing-seal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.seal-frame {
    position: relative;
    width: 60vw;
    max-width: 500px;
    height: 40vh;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: border-breathe 6s ease-in-out infinite;
}

.seal-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.seal-domain {
    font-family: 'Major Mono Display', monospace;
    font-size: clamp(1rem, 4vw, 2.5rem);
    letter-spacing: 0.3em;
    color: var(--paper);
}

.seal-rule {
    max-width: 200px;
}

.seal-phrase {
    font-family: 'Cutive Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--faded-ink);
    text-transform: lowercase;
}

.ambient-glow {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40vh;
    background: radial-gradient(ellipse at 50% 100%, rgba(0, 229, 255, 0.03) 0%, rgba(42, 10, 62, 0.02) 40%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* ==========================================
   BLUR-FOCUS TRANSITION SYSTEM
   ========================================== */

.blur-element {
    filter: blur(12px);
    opacity: 0.3;
    transition: filter 1.2s ease-out, opacity 1.2s ease-out;
}

.blur-element.in-view {
    filter: blur(0);
    opacity: 1;
}

/* ==========================================
   KEYFRAME ANIMATIONS
   ========================================== */

@keyframes border-breathe {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

@keyframes corner-shimmer {
    0% { opacity: 0.95; }
    50% { opacity: 1; }
    100% { opacity: 0.95; }
}

@keyframes orb-pulse {
    0% {
        background: radial-gradient(circle at 35% 35%, var(--aurora-cyan), var(--mag-magenta) 40%, var(--deep-violet) 70%, transparent);
        box-shadow:
            0 0 20px var(--aurora-cyan),
            0 0 60px var(--mag-magenta),
            0 0 120px var(--deep-violet),
            0 0 200px rgba(0, 229, 255, 0.15);
    }
    50% {
        background: radial-gradient(circle at 45% 45%, var(--aurora-cyan), var(--mag-magenta) 40%, var(--deep-violet) 70%, transparent);
        box-shadow:
            0 0 30px var(--aurora-cyan),
            0 0 80px var(--mag-magenta),
            0 0 150px var(--deep-violet),
            0 0 250px rgba(0, 229, 255, 0.2);
    }
    100% {
        background: radial-gradient(circle at 35% 35%, var(--aurora-cyan), var(--mag-magenta) 40%, var(--deep-violet) 70%, transparent);
        box-shadow:
            0 0 20px var(--aurora-cyan),
            0 0 60px var(--mag-magenta),
            0 0 120px var(--deep-violet),
            0 0 200px rgba(0, 229, 255, 0.15);
    }
}

@keyframes stroke-flow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -40; }
}

@keyframes core-pulse {
    0% { opacity: 0.6; r: 12; }
    50% { opacity: 1; r: 15; }
    100% { opacity: 0.6; r: 12; }
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .observation-entry {
        margin-left: 8%;
        margin-right: 8%;
    }

    .ornate-frame {
        width: 90vw;
        height: 70vh;
    }

    .apparatus-diagram {
        padding: 30px;
    }

    .seal-frame {
        width: 85vw;
    }

    .apparatus-frame {
        width: 90vw;
    }
}
