/* ==========================================
   monopole.cloud — Art Deco Cloud Chamber
   ========================================== */

:root {
    --obsidian-bronze: #1a1410;
    --burnished-copper: #2d2118;
    --amber-dusk: #c99563;
    --monopole-coral: #e8614d;
    --ionosphere-teal: #3d9b8f;
    --solar-flare: #f2c94c;
    --parchment-cream: #f0e6d3;
    --deco-blush: #e8d5c0;
    --deep-copper: #3a2a1e;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--obsidian-bronze);
    color: var(--parchment-cream);
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* ==========================================
   FLOATING PARTICLES
   ========================================== */

#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    bottom: -20px;
    width: 4px;
    height: 4px;
    background: var(--solar-flare);
    border-radius: 50%;
    opacity: 0.6;
    animation: float-up linear infinite;
}

.particle:nth-child(odd) {
    width: 3px;
    height: 3px;
    opacity: 0.4;
}

.particle:nth-child(3n) {
    width: 2px;
    height: 2px;
    opacity: 0.7;
}

@keyframes float-up {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    5% {
        opacity: 0.6;
    }
    50% {
        transform: translateY(-50vh) translateX(15px);
    }
    95% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-110vh) translateX(-10px);
        opacity: 0;
    }
}

/* ==========================================
   SCROLL COMPASS
   ========================================== */

#compass {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#compass:hover {
    opacity: 1;
}

#compass-needle {
    transform-origin: 24px 24px;
    transition: transform 0.3s ease;
}

/* ==========================================
   MAIN GRID
   ========================================== */

#deco-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(4px, 0.5vw, 8px);
    max-width: 100vw;
    position: relative;
    z-index: 2;
}

/* ==========================================
   BLOCK TYPES
   ========================================== */

.block {
    position: relative;
    overflow: hidden;
}

/* Monument Block — 12 columns, tall */
.monument-block {
    grid-column: 1 / -1;
    min-height: 80vh;
    background: linear-gradient(135deg, var(--obsidian-bronze) 0%, var(--burnished-copper) 60%, var(--deep-copper) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Plinth Block — 4 columns, medium */
.plinth-block {
    min-height: 35vh;
    background: var(--burnished-copper);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 3vw, 3rem);
}

/* Frieze Block — full width, thin decorative band */
.frieze-block {
    grid-column: 1 / -1;
    height: clamp(40px, 8vh, 70px);
    background: var(--burnished-copper);
}

/* Tablet Block — 5-6 columns, content */
.tablet-block {
    min-height: 45vh;
    padding: clamp(2rem, 4vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Keystone Block — 2-3 columns, square-ish */
.keystone-block {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ==========================================
   1. OPENING PANEL
   ========================================== */

.opening-panel {
    min-height: 100vh;
    background: var(--obsidian-bronze);
}

.opening-content {
    text-align: center;
    z-index: 3;
}

.site-title {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--amber-dusk);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.subtitle {
    font-family: 'Special Elite', monospace;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    letter-spacing: 0.05em;
    color: var(--parchment-cream);
    display: inline;
    min-height: 1.5em;
}

.cursor {
    font-family: 'Special Elite', monospace;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    color: var(--amber-dusk);
    animation: blink-cursor 530ms steps(1) infinite;
    display: inline;
}

@keyframes blink-cursor {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ==========================================
   SUNBURST CORNERS
   ========================================== */

.sunburst-corner {
    position: absolute;
    width: 120px;
    height: 120px;
    pointer-events: none;
}

.sunburst-tl { top: 20px; left: 20px; }
.sunburst-tr { top: 20px; right: 20px; }
.sunburst-bl { bottom: 20px; left: 20px; }
.sunburst-br { bottom: 20px; right: 20px; }

.sunburst-corner::before,
.sunburst-corner::after {
    content: '';
    position: absolute;
    background: var(--amber-dusk);
}

.sunburst-tl::before {
    top: 0; left: 0;
    width: 80px; height: 1px;
}
.sunburst-tl::after {
    top: 0; left: 0;
    width: 1px; height: 80px;
}

.sunburst-tr::before {
    top: 0; right: 0;
    width: 80px; height: 1px;
}
.sunburst-tr::after {
    top: 0; right: 0;
    width: 1px; height: 80px;
}

.sunburst-bl::before {
    bottom: 0; left: 0;
    width: 80px; height: 1px;
}
.sunburst-bl::after {
    bottom: 0; left: 0;
    width: 1px; height: 80px;
}

.sunburst-br::before {
    bottom: 0; right: 0;
    width: 80px; height: 1px;
}
.sunburst-br::after {
    bottom: 0; right: 0;
    width: 1px; height: 80px;
}

/* Diagonal lines for sunburst effect */
.sunburst-tl {
    background:
        linear-gradient(45deg, transparent 49%, var(--amber-dusk) 49%, var(--amber-dusk) 50%, transparent 50%),
        linear-gradient(30deg, transparent 49%, rgba(201,149,99,0.3) 49%, rgba(201,149,99,0.3) 50%, transparent 50%),
        linear-gradient(60deg, transparent 49%, rgba(201,149,99,0.3) 49%, rgba(201,149,99,0.3) 50%, transparent 50%);
}

.sunburst-br {
    background:
        linear-gradient(225deg, transparent 49%, var(--amber-dusk) 49%, var(--amber-dusk) 50%, transparent 50%),
        linear-gradient(210deg, transparent 49%, rgba(201,149,99,0.3) 49%, rgba(201,149,99,0.3) 50%, transparent 50%),
        linear-gradient(240deg, transparent 49%, rgba(201,149,99,0.3) 49%, rgba(201,149,99,0.3) 50%, transparent 50%);
}

.sunburst-tr {
    background:
        linear-gradient(315deg, transparent 49%, var(--amber-dusk) 49%, var(--amber-dusk) 50%, transparent 50%),
        linear-gradient(300deg, transparent 49%, rgba(201,149,99,0.3) 49%, rgba(201,149,99,0.3) 50%, transparent 50%),
        linear-gradient(330deg, transparent 49%, rgba(201,149,99,0.3) 49%, rgba(201,149,99,0.3) 50%, transparent 50%);
}

.sunburst-bl {
    background:
        linear-gradient(135deg, transparent 49%, var(--amber-dusk) 49%, var(--amber-dusk) 50%, transparent 50%),
        linear-gradient(120deg, transparent 49%, rgba(201,149,99,0.3) 49%, rgba(201,149,99,0.3) 50%, transparent 50%),
        linear-gradient(150deg, transparent 49%, rgba(201,149,99,0.3) 49%, rgba(201,149,99,0.3) 50%, transparent 50%);
}

/* ==========================================
   2. FRIEZE BLOCKS
   ========================================== */

.frieze-chevron {
    background:
        repeating-linear-gradient(
            60deg,
            transparent 0,
            transparent 10px,
            var(--amber-dusk) 10px,
            var(--amber-dusk) 11px
        ),
        repeating-linear-gradient(
            -60deg,
            transparent 0,
            transparent 10px,
            var(--amber-dusk) 10px,
            var(--amber-dusk) 11px
        );
    background-color: var(--burnished-copper);
}

.frieze-zigzag {
    background-color: var(--burnished-copper);
    position: relative;
}

.frieze-zigzag::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        var(--amber-dusk) 0,
        var(--amber-dusk) 15px,
        transparent 15px,
        transparent 20px
    );
    transform: translateY(-50%);
}

.frieze-zigzag::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(135deg, transparent 33.33%, var(--amber-dusk) 33.33%, var(--amber-dusk) 33.5%, transparent 33.5%),
        linear-gradient(225deg, transparent 33.33%, var(--amber-dusk) 33.33%, var(--amber-dusk) 33.5%, transparent 33.5%);
    background-size: 30px 100%;
    opacity: 0.4;
}

/* ==========================================
   3. CONCEPT TRIPTYCH
   ========================================== */

.triptych-left {
    grid-column: 1 / 5;
    background: linear-gradient(135deg, var(--burnished-copper) 0%, var(--deep-copper) 100%);
}

.triptych-center {
    grid-column: 5 / 9;
    background: linear-gradient(135deg, var(--obsidian-bronze) 0%, var(--burnished-copper) 100%);
}

.triptych-right {
    grid-column: 9 / -1;
    background: linear-gradient(135deg, var(--burnished-copper) 0%, var(--obsidian-bronze) 100%);
}

.triptych-svg {
    max-width: 100%;
    height: auto;
}

.plinth-label {
    font-family: 'Special Elite', monospace;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    letter-spacing: 0.05em;
    color: var(--amber-dusk);
    margin-top: 1rem;
    text-align: center;
}

/* Triptych fade-in */
.triptych-left,
.triptych-center,
.triptych-right {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.triptych-left.visible {
    opacity: 1;
    transform: translateY(0);
}

.triptych-center.visible {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 200ms;
}

.triptych-right.visible {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 400ms;
}

/* Radiate animation for triptych right */
.radiate-circle {
    animation: radiate-pulse 4s ease-in-out infinite;
}

.radiate-circle:nth-child(2) { animation-delay: 0s; }
.radiate-circle:nth-child(3) { animation-delay: 0.5s; }
.radiate-circle:nth-child(4) { animation-delay: 1s; }
.radiate-circle:nth-child(5) { animation-delay: 1.5s; }
.radiate-circle:nth-child(6) { animation-delay: 2s; }

@keyframes radiate-pulse {
    0%, 100% { opacity: inherit; transform: scale(1); }
    50% { opacity: 0.15; transform: scale(1.05); }
}

/* ==========================================
   4. NARRATIVE TABLET
   ========================================== */

.narrative-tablet {
    grid-column: 2 / 12;
    background: linear-gradient(135deg, var(--burnished-copper) 0%, var(--deep-copper) 100%);
    min-height: 60vh;
}

.tablet-text {
    column-count: 2;
    column-gap: 2rem;
    column-rule: 1px solid rgba(201, 149, 99, 0.25);
    max-width: 900px;
}

.tablet-text p {
    margin-bottom: 1.2em;
    text-indent: 1.5em;
    color: var(--parchment-cream);
}

.tablet-text p:first-child {
    text-indent: 0;
}

.margin-note {
    position: absolute;
    font-family: 'Special Elite', monospace;
    font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    color: var(--amber-dusk);
    opacity: 0.6;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.margin-note-left {
    left: clamp(0.5rem, 1vw, 1rem);
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left center;
    white-space: nowrap;
}

.margin-note-right {
    right: clamp(0.5rem, 1vw, 1rem);
    top: 40%;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: right center;
    white-space: nowrap;
}

.margin-note-bottom {
    bottom: clamp(0.5rem, 1vw, 1rem);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* ==========================================
   5. MONOPOLE CLOUD VISUALIZATION
   ========================================== */

.cloud-visualization {
    min-height: 100vh;
    background: var(--obsidian-bronze);
}

.bubble-cluster {
    position: relative;
    z-index: 3;
}

.bubble-svg {
    max-width: 90vw;
    height: auto;
}

/* Bubble drift animations */
.bubble { animation: bubble-drift-1 15s ease-in-out infinite; }
.b1 { animation: bubble-drift-1 18s ease-in-out infinite; }
.b2 { animation: bubble-drift-2 15s ease-in-out infinite; }
.b3 { animation: bubble-drift-3 20s ease-in-out infinite; }
.b4 { animation: bubble-drift-4 16s ease-in-out infinite; }
.b5 { animation: bubble-drift-5 19s ease-in-out infinite; }
.b6 { animation: bubble-drift-6 14s ease-in-out infinite; }
.b7 { animation: bubble-drift-7 17s ease-in-out infinite; }
.b8 { animation: bubble-drift-8 21s ease-in-out infinite; }
.b9 { animation: bubble-drift-1 13s ease-in-out infinite reverse; }
.b10 { animation: bubble-drift-2 16s ease-in-out infinite reverse; }
.b11 { animation: bubble-drift-3 18s ease-in-out infinite reverse; }
.b12 { animation: bubble-drift-4 15s ease-in-out infinite reverse; }
.b13 { animation: bubble-drift-5 12s ease-in-out infinite; }
.b14 { animation: bubble-drift-6 20s ease-in-out infinite reverse; }
.b15 { animation: bubble-drift-7 14s ease-in-out infinite; }
.b16 { animation: bubble-drift-8 16s ease-in-out infinite reverse; }

@keyframes bubble-drift-1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(8px, -12px); }
    50% { transform: translate(-5px, 6px); }
    75% { transform: translate(10px, 8px); }
}

@keyframes bubble-drift-2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-10px, 8px); }
    50% { transform: translate(6px, -10px); }
    75% { transform: translate(-8px, -5px); }
}

@keyframes bubble-drift-3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(12px, 5px); }
    50% { transform: translate(-8px, -12px); }
    75% { transform: translate(4px, 10px); }
}

@keyframes bubble-drift-4 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-6px, -10px); }
    50% { transform: translate(10px, 4px); }
    75% { transform: translate(-12px, 8px); }
}

@keyframes bubble-drift-5 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(5px, 12px); }
    50% { transform: translate(-10px, -6px); }
    75% { transform: translate(8px, -8px); }
}

@keyframes bubble-drift-6 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-8px, 6px); }
    50% { transform: translate(12px, -8px); }
    75% { transform: translate(-5px, 10px); }
}

@keyframes bubble-drift-7 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(10px, -5px); }
    50% { transform: translate(-6px, 12px); }
    75% { transform: translate(8px, -10px); }
}

@keyframes bubble-drift-8 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-12px, -8px); }
    50% { transform: translate(5px, 10px); }
    75% { transform: translate(-10px, -4px); }
}

/* Monopole Core Pulse */
.monopole-core {
    animation: core-pulse 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px #e8614d) drop-shadow(0 0 40px rgba(232,97,77,0.5)) drop-shadow(0 0 80px rgba(232,97,77,0.25));
}

@keyframes core-pulse {
    0%, 100% { r: 8; filter: drop-shadow(0 0 20px #e8614d) drop-shadow(0 0 40px rgba(232,97,77,0.5)); }
    50% { r: 10; filter: drop-shadow(0 0 30px #e8614d) drop-shadow(0 0 60px rgba(232,97,77,0.6)); }
}

.cloud-title {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(1.8rem, 3vw, 3rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--amber-dusk);
    font-weight: 400;
    margin-top: 3rem;
    z-index: 3;
}

/* ==========================================
   6. DESCRIPTIVE PANELS
   ========================================== */

/* Keystone blocks */
.keystone-n {
    grid-column: 1 / 3;
    background: var(--solar-flare);
    aspect-ratio: 1;
}

.tablet-search {
    grid-column: 3 / 9;
    background: linear-gradient(135deg, var(--burnished-copper) 0%, var(--obsidian-bronze) 100%);
}

.keystone-s {
    grid-column: 9 / 11;
    background: linear-gradient(135deg, var(--deep-copper) 0%, var(--burnished-copper) 100%);
    aspect-ratio: 1;
}

.keystone-q {
    grid-column: 11 / -1;
    background: var(--monopole-coral);
    aspect-ratio: 1;
}

.tablet-cosmic {
    grid-column: 3 / 10;
    background: linear-gradient(135deg, var(--deep-copper) 0%, var(--burnished-copper) 60%, var(--obsidian-bronze) 100%);
}

.keystone-one {
    grid-column: 10 / -1;
    background: linear-gradient(135deg, var(--obsidian-bronze) 0%, var(--burnished-copper) 100%);
    aspect-ratio: 1;
}

.keystone-char {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(2rem, 4vw, 4rem);
    letter-spacing: 0.1em;
    color: var(--obsidian-bronze);
    z-index: 2;
}

.keystone-s .keystone-char,
.keystone-one .keystone-char {
    color: var(--amber-dusk);
}

.keystone-q .keystone-char {
    color: var(--obsidian-bronze);
}

/* Fan motif */
.fan-motif {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.fan-arc {
    position: absolute;
    bottom: 0;
    left: 0;
    border-radius: 0 100% 0 0;
    border-right: 1px solid var(--amber-dusk);
    border-top: 1px solid var(--amber-dusk);
}

.fan-arc-1 {
    width: 50%;
    height: 50%;
    opacity: 0.6;
}

.fan-arc-2 {
    width: 70%;
    height: 70%;
    opacity: 0.4;
}

.fan-arc-3 {
    width: 90%;
    height: 90%;
    opacity: 0.2;
}

/* ==========================================
   FIELD LINE DIAGRAM
   ========================================== */

.field-diagram {
    min-height: 50vh;
    background: var(--obsidian-bronze);
    display: flex;
    align-items: center;
    justify-content: center;
}

.field-svg {
    width: 80%;
    max-width: 800px;
    height: auto;
}

.field-line {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.5s ease;
}

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

/* ==========================================
   7. CLOSING PANEL
   ========================================== */

.closing-panel {
    min-height: 80vh;
    background: linear-gradient(180deg, var(--burnished-copper) 0%, var(--obsidian-bronze) 100%);
}

.closing-title {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(2rem, 4vw, 4rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--amber-dusk);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 3;
}

.closing-letter {
    display: inline-block;
}

.closing-dot {
    color: var(--monopole-coral);
}

.inline-bubble {
    display: inline-block;
    vertical-align: middle;
    margin: 0 2px;
}

.closing-subtitle {
    font-family: 'Special Elite', monospace;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    letter-spacing: 0.05em;
    color: var(--parchment-cream);
    display: inline;
    margin-top: 2rem;
    z-index: 3;
}

.closing-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(to bottom, transparent, var(--obsidian-bronze));
    pointer-events: none;
}

/* ==========================================
   STEP PATTERN BORDERS
   ========================================== */

.tablet-search::before,
.tablet-cosmic::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        var(--amber-dusk) 0,
        var(--amber-dusk) 20px,
        transparent 20px,
        transparent 24px
    );
    opacity: 0.4;
}

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

@media (max-width: 768px) {
    .triptych-left,
    .triptych-center,
    .triptych-right {
        grid-column: 1 / -1;
        min-height: 30vh;
    }

    .narrative-tablet {
        grid-column: 1 / -1;
    }

    .tablet-text {
        column-count: 1;
    }

    .keystone-n {
        grid-column: 1 / 4;
    }

    .tablet-search {
        grid-column: 4 / -1;
    }

    .keystone-s {
        grid-column: 1 / 4;
    }

    .keystone-q {
        grid-column: 4 / 7;
    }

    .tablet-cosmic {
        grid-column: 1 / 10;
    }

    .keystone-one {
        grid-column: 10 / -1;
    }

    .margin-note-left,
    .margin-note-right {
        display: none;
    }

    .closing-title {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .keystone-n,
    .keystone-s,
    .keystone-q,
    .keystone-one {
        grid-column: span 6;
        aspect-ratio: auto;
        min-height: 120px;
    }

    .tablet-search,
    .tablet-cosmic {
        grid-column: 1 / -1;
    }

    .sunburst-corner {
        width: 60px;
        height: 60px;
    }

    .sunburst-tl::before,
    .sunburst-tr::before,
    .sunburst-bl::before,
    .sunburst-br::before {
        width: 40px;
    }

    .sunburst-tl::after,
    .sunburst-tr::after,
    .sunburst-bl::after,
    .sunburst-br::after {
        height: 40px;
    }
}

/* ==========================================
   REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .particle,
    .bubble,
    .monopole-core,
    .radiate-circle {
        animation: none !important;
    }

    .cursor {
        animation: blink-cursor 530ms steps(1) infinite;
    }
}
