/* ============================================
   rironbusou.net — MCbling Ceremonial
   Magazine-Spread Layout / High-Contrast Palette
   ============================================ */

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

:root {
    --obsidian: #0c0a08;
    --charred-umber: #1e1a14;
    --candle-gold: #b8a07a;
    --champagne: #e8d5b0;
    --rose-chrome: #c4788a;
    --platinum: #d8d0c8;
    --molten-amber: #d4a84a;
    --void: #040302;
    --column-rule: #3a3028;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    background-color: var(--obsidian);
    color: var(--champagne);
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* === Candle Glow Ambient === */
#candle-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    background: radial-gradient(ellipse at var(--mouse-x) var(--mouse-y), rgba(184,160,122,0.04) 0%, transparent 50%);
}

@media (hover: none) {
    #candle-glow {
        background: radial-gradient(ellipse at 50% 50%, rgba(184,160,122,0.03) 0%, transparent 50%);
        animation: glowPulse 4s ease-in-out infinite alternate;
    }
}

@keyframes glowPulse {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* === Entry Overlay === */
#entry-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--obsidian);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease-out;
}

#entry-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

#entry-overlay.hidden {
    display: none;
}

.entry-rings {
    position: absolute;
    width: 400px;
    height: 400px;
}

.entry-rings .ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.entry-rings .ring.visible {
    opacity: 1;
}

.entry-rings .ring.expand {
    transform: scale(2.5);
    opacity: 0;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

.entry-typewriter {
    position: relative;
    z-index: 1;
    font-family: 'Victor Mono', monospace;
    font-style: italic;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--champagne);
    letter-spacing: 0.05em;
}

#entry-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--molten-amber);
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: cursorBlink 500ms step-end infinite;
}

#entry-cursor.hidden {
    display: none;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* === Spread Base === */
.spread {
    position: relative;
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    display: grid;
    grid-template-columns: [bleed-left] 0.5fr [verso-outer] 2fr [verso-inner] 2fr [gutter] 0.25fr [recto-inner] 2fr [recto-outer] 2fr [bleed-right] 0.5fr;
    grid-template-rows: 1fr;
    overflow: hidden;
    background-color: var(--obsidian);
}

@media (max-width: 768px) {
    .spread {
        grid-template-columns: 0.5fr 4fr 4fr 0.5fr;
    }
}

/* === Smoke Wisps === */
.smoke-wisp {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 300px;
    background: var(--candle-gold);
    opacity: 0.03;
    filter: blur(30px);
    border-radius: 50%;
    animation: smokeRise 12s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 1;
}

@keyframes smokeRise {
    0% { transform: translateX(-50%) translateY(0); }
    100% { transform: translateX(-50%) translateY(-20px); }
}

/* === Gutter === */
.gutter {
    grid-column: gutter;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.gutter-line {
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, var(--candle-gold) 30%, var(--candle-gold) 70%, transparent 100%);
    opacity: 0.3;
    animation: flicker 4s ease-in-out infinite;
}

@keyframes flicker {
    0% { opacity: 0.25; filter: brightness(0.95); }
    15% { opacity: 0.3; filter: brightness(1.05); }
    30% { opacity: 0.28; filter: brightness(0.98); }
    50% { opacity: 0.32; filter: brightness(1.02); }
    70% { opacity: 0.26; filter: brightness(0.96); }
    85% { opacity: 0.3; filter: brightness(1.04); }
    100% { opacity: 0.25; filter: brightness(0.95); }
}

.flicker {
    animation: flicker 4s ease-in-out infinite;
}

/* === Verso & Recto === */
.verso {
    grid-column: verso-outer / verso-inner;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 2rem;
    position: relative;
    z-index: 2;
}

.recto {
    grid-column: recto-inner / recto-outer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2rem;
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .verso {
        grid-column: 2 / 4;
        padding: 2rem 1rem;
    }
    .recto {
        grid-column: 2 / 4;
        padding: 2rem 1rem;
    }
    .gutter {
        display: none;
    }
    .spread {
        grid-template-rows: auto auto;
    }
}

/* === Folio Numbers === */
.folio {
    position: absolute;
    bottom: 2rem;
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--candle-gold);
    letter-spacing: 0.05em;
    font-variant: small-caps;
    z-index: 5;
    animation: flicker 5s ease-in-out infinite;
}

.folio-left {
    left: 3rem;
}

.folio-right {
    right: 3rem;
}

/* === Typography === */
.site-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--candle-gold);
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-align: center;
}

.title-subtitle {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--champagne);
    letter-spacing: 0.05em;
    text-align: center;
    margin-top: 1rem;
}

.section-heading {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--candle-gold);
    letter-spacing: 0.02em;
    margin-bottom: 2rem;
    line-height: 1.2;
}

.pull-quote {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--champagne);
    letter-spacing: -0.01em;
    line-height: 1.4;
    border-left: 3px solid var(--rose-chrome);
    padding-left: 1.5rem;
    margin: 2rem 0;
    position: relative;
}

.pull-quote::before {
    content: "\201C";
    position: absolute;
    top: -0.5em;
    left: -0.2em;
    font-size: 4em;
    color: var(--candle-gold);
    opacity: 0.15;
    font-style: normal;
}

/* === Typewriter Effect === */
.typewriter-target {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--molten-amber);
}

.typewriter-target.typed {
    border-right-color: transparent;
}

.typewriter-target.typing {
    animation: cursorBlink 500ms step-end infinite;
    animation-property: border-right-color;
}

/* === Fade Target === */
.fade-target {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.fade-target.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Editorial Columns === */
.editorial-columns {
    column-count: 2;
    column-gap: 2rem;
    column-rule: 1px solid var(--column-rule);
}

@media (max-width: 768px) {
    .editorial-columns {
        column-count: 1;
    }
}

.editorial-columns p {
    margin-bottom: 1rem;
    text-align: justify;
    hyphens: auto;
}

/* === Drop Cap === */
.initial-cap {
    float: left;
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 4.5em;
    line-height: 0.8;
    padding-right: 0.1em;
    margin-top: 0.05em;
    background: linear-gradient(135deg, #b8a07a 0%, #e8d5b0 30%, #d8d0c8 60%, #b8a07a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

/* === Diamond Facets === */
.diamond {
    display: inline-block;
    background: linear-gradient(135deg, #b8a07a 0%, #e8d5b0 30%, #d8d0c8 60%, #b8a07a 100%);
    transform: rotate(45deg);
}

.diamond-lg {
    width: 80px;
    height: 80px;
}

.diamond-md {
    width: 40px;
    height: 40px;
}

.diamond-sm {
    width: 24px;
    height: 24px;
}

.diamond-xs {
    width: 8px;
    height: 8px;
    vertical-align: middle;
    margin-right: 0.75rem;
}

.diamond-cluster {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    margin-top: 3rem;
}

/* === Geometric Lattice === */
.geometric-lattice {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.geometric-lattice svg {
    width: 100%;
    height: 100%;
}

/* === Concentric Rings === */
.concentric-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    z-index: 0;
    pointer-events: none;
}

.concentric-rings svg {
    width: 100%;
    height: 100%;
}

.title-rings circle {
    animation: flicker 5s ease-in-out infinite;
}

/* === Title Spread === */
.spread-title .verso {
    align-items: center;
    justify-content: center;
}

.spread-title .recto {
    position: relative;
}

/* === Geometric Compositions === */
.geometric-composition {
    width: 100%;
    max-width: 400px;
}

.geometric-composition svg {
    width: 100%;
    height: auto;
}

/* === Showcase Spread === */
.spread-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
}

.showcase-full {
    grid-column: bleed-left / bleed-right;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.showcase-geometry {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.showcase-geometry svg {
    width: 100%;
    height: 100%;
}

.showcase-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(5rem, 15vw, 12rem);
    color: var(--candle-gold);
    letter-spacing: 0.02em;
    z-index: 2;
    text-align: center;
    overflow: visible;
    white-space: nowrap;
}

.showcase-meta {
    font-family: 'Victor Mono', monospace;
    font-style: italic;
    font-size: clamp(0.75rem, 1.3vw, 0.9rem);
    color: var(--platinum);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    z-index: 2;
    margin-top: 1.5rem;
}

/* === Wax Drip Borders === */
.wax-drip {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 10px;
    z-index: 5;
}

.wax-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.2s ease-out;
}

.wax-path.drawn {
    stroke-dashoffset: 0;
}

/* === Index Spread === */
.spread-index .verso {
    justify-content: flex-start;
    padding-top: 15vh;
}

.spread-index .recto {
    justify-content: flex-start;
    padding-top: 15vh;
    align-items: flex-start;
}

.index-list {
    list-style: none;
    padding: 0;
}

.index-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(184, 160, 122, 0.1);
    position: relative;
    cursor: pointer;
}

.index-entry a {
    color: var(--champagne);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.index-entry a:hover {
    color: var(--rose-chrome);
}

.index-page {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--candle-gold);
    letter-spacing: 0.05em;
    font-variant: small-caps;
}

/* === MCbling Sparkle on Hover === */
.sparkle-target {
    position: relative;
    overflow: visible;
}

.sparkle-diamond {
    position: absolute;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #b8a07a 0%, #e8d5b0 30%, #d8d0c8 60%, #b8a07a 100%);
    transform: rotate(45deg);
    pointer-events: none;
    opacity: 0;
    z-index: 10;
}

.sparkle-diamond.burst {
    animation: sparkleBurst 600ms ease-out forwards;
}

@keyframes sparkleBurst {
    0% {
        opacity: 1;
        transform: rotate(45deg) translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: rotate(720deg) translate(var(--sx), var(--sy)) scale(0.3);
    }
}

/* === Colophon === */
.colophon {
    text-align: left;
}

.colophon-heading {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: var(--candle-gold);
    letter-spacing: 0.02em;
    margin-bottom: 2rem;
}

.colophon-text {
    margin-bottom: 0.75rem;
}

.mono-text {
    font-family: 'Victor Mono', monospace;
    font-style: italic;
    font-size: clamp(0.75rem, 1.3vw, 0.9rem);
    color: var(--platinum);
    letter-spacing: 0.02em;
}

.colophon-diamond-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 2rem 0;
}

.colophon-year {
    margin-top: 1rem;
    font-variant: small-caps;
    letter-spacing: 0.2em;
}

/* === Page Turn Transition === */
.spread {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* === Candle Glow behind content blocks === */
.spread-editorial .verso::before,
.spread-editorial .recto::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(ellipse at 50% 50%, rgba(184,160,122,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* === Responsive: Mobile single-page mode === */
@media (max-width: 768px) {
    .spread-showcase {
        display: flex;
    }

    .showcase-full {
        width: 100%;
    }

    .folio-left {
        left: 1.5rem;
    }

    .folio-right {
        right: 1.5rem;
    }

    .diamond-cluster {
        gap: 1rem;
    }

    .diamond-lg {
        width: 50px;
        height: 50px;
    }

    .diamond-md {
        width: 28px;
        height: 28px;
    }

    .concentric-rings {
        width: 300px;
        height: 300px;
    }

    .spread-editorial-alt .verso,
    .spread-editorial-alt .recto {
        grid-row: auto;
    }

    .entry-rings {
        width: 250px;
        height: 250px;
    }
}

/* === Selection color === */
::selection {
    background-color: var(--rose-chrome);
    color: var(--obsidian);
}

/* === Scrollbar (webkit) === */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--void);
}

::-webkit-scrollbar-thumb {
    background: var(--candle-gold);
    border-radius: 2px;
}

/* === Lattice node drift animation === */
@keyframes nodeDrift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(2px, -3px); }
    50% { transform: translate(-1px, 2px); }
    75% { transform: translate(3px, 1px); }
    100% { transform: translate(0, 0); }
}

.geometric-lattice circle {
    animation: nodeDrift 8s ease-in-out infinite;
}

.geometric-lattice circle:nth-child(2n) {
    animation-delay: -2s;
    animation-duration: 9s;
}

.geometric-lattice circle:nth-child(3n) {
    animation-delay: -4s;
    animation-duration: 7s;
}
