/* ========================================
   paragram.dev — Cathedral Streetwear
   Palette: Deep Burgundy
   Fonts: Cormorant Garamond, Source Serif 4, Bebas Neue
   ======================================== */

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

:root {
    --crypt-black: #1a0a0f;
    --nave-stone: #2d1f24;
    --deep-burgundy: #6b1d3a;
    --altar-gold: #c9a84c;
    --rose-dust: #a8707a;
    --vellum-white: #f0e6e0;
    --stone-gray: #8a7a72;
    --claret-glow: #8b2252;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--crypt-black);
    color: var(--vellum-white);
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* --- Grain Patina Overlay --- */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    filter: url(#grain-filter);
    background: var(--rose-dust);
    opacity: 0.04;
}

/* --- Processional Navigation --- */
#processional-nav {
    position: fixed;
    top: 0;
    left: 1.5rem;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-line {
    position: absolute;
    top: 10%;
    left: 2px;
    width: 1px;
    height: 80%;
    background-color: var(--altar-gold);
}

.nav-markers {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

.nav-marker {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    position: relative;
}

.marker-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--crypt-black);
    border: 1px solid var(--altar-gold);
    transition: background-color 300ms ease, transform 400ms ease;
    flex-shrink: 0;
}

.nav-marker.active .marker-dot {
    background-color: var(--altar-gold);
}

.marker-label {
    font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--vellum-white);
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 250ms ease-out, transform 250ms ease-out;
    white-space: nowrap;
}

.nav-marker:hover .marker-label {
    opacity: 1;
    transform: translateX(0);
}

/* --- Clerestory Panels --- */
.clerestory-panel {
    position: relative;
    min-height: 70vh;
    width: 100vw;
    overflow: hidden;
}

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

.gen-art-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4;
}

.content-scrim {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(180deg,
        rgba(26, 10, 15, 0.7) 0%,
        rgba(26, 10, 15, 0.3) 50%,
        rgba(26, 10, 15, 0.8) 100%
    );
    opacity: 0;
    transition: opacity 600ms ease;
}

.clerestory-panel.in-view .content-scrim {
    opacity: 1;
}

.panel-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

/* --- Panel Grid (8-col) --- */
.panel-grid {
    display: grid;
    grid-template-columns:
        [gutter-start] minmax(2rem, 1fr)
        [content-start] repeat(8, minmax(0, 8rem))
        [content-end] minmax(2rem, 1fr)
        [gutter-end];
    width: 100%;
    padding: clamp(3rem, 6vh, 5rem) 0;
}

.panel-heading {
    grid-column: content-start / content-end;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: -0.01em;
    line-height: 1.25;
    text-align: center;
    color: var(--vellum-white);
    text-shadow: 0 0 40px rgba(107, 29, 58, 0.4);
    margin-bottom: clamp(2rem, 4vh, 3rem);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

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

.panel-body {
    grid-column: 3 / 9;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 400ms ease-out 150ms, transform 400ms ease-out 150ms;
}

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

.panel-body p {
    margin-bottom: 1.5em;
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-weight: 400;
    color: var(--vellum-white);
}

.panel-body p:last-child {
    margin-bottom: 0;
}

/* Drop Cap */
.drop-cap::first-letter {
    float: left;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: 3.5em;
    line-height: 0.8;
    margin-right: 0.08em;
    color: var(--altar-gold);
}

/* --- Hero Content --- */
.hero-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
}

.hero-text-group {
    text-align: center;
    opacity: 0;
    transform: translateY(12px);
}

.hero-text-group.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.hero-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.02em;
    line-height: 1.1;
    color: var(--vellum-white);
    text-shadow: 0 0 60px rgba(107, 29, 58, 0.5);
    margin-bottom: 1.5rem;
}

.hero-rule {
    width: 0;
    height: 1px;
    background-color: var(--altar-gold);
    margin: 0 auto 1.5rem;
    transform-origin: center;
    transition: width 600ms ease-out;
    max-width: min(60vw, 500px);
}

.hero-rule.expanded {
    width: min(60vw, 500px);
}

.hero-tagline {
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--rose-dust);
    opacity: 0;
    transition: opacity 500ms ease-out;
}

.hero-tagline.visible {
    opacity: 1;
}

.hero-text-group.dissolve {
    opacity: 0;
    transform: translateY(-30px);
    transition: opacity 400ms ease-in, transform 400ms ease-in;
}

/* --- Transept Breaks --- */
.transept-break {
    width: 100vw;
    height: 30vh;
    background: linear-gradient(170deg, var(--crypt-black) 0%, var(--nave-stone) 40%, var(--deep-burgundy) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.transept-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rose-window-container canvas {
    width: min(60vw, 400px);
    height: min(60vw, 400px);
    max-width: 400px;
    max-height: 400px;
}

.flourish-container canvas {
    width: min(80vw, 600px);
    height: 120px;
}

.tag-container canvas {
    width: min(50vw, 300px);
    height: 150px;
}

.final-inscription {
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--stone-gray);
    margin-top: 1.5rem;
    letter-spacing: 0.1em;
}

.transept-final {
    min-height: 30vh;
    padding-bottom: 4rem;
}

/* --- Circuit Rose SVGs --- */
.circuit-rose {
    position: fixed;
    width: 120px;
    height: 120px;
    z-index: 5;
    opacity: 0.15;
    pointer-events: none;
}

.circuit-rose-1 {
    bottom: 3rem;
    right: 2rem;
}

.circuit-rose-2 {
    top: 3rem;
    right: 2rem;
}

.circuit-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 2s ease;
}

.circuit-rose.drawn .circuit-path {
    stroke-dashoffset: 0;
}

.circuit-node {
    opacity: 0;
    transition: opacity 0.5s ease 1.8s;
}

.circuit-rose.drawn .circuit-node {
    opacity: 1;
}

/* --- Vellum Scrim (top candlelight) --- */
.clerestory-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
        rgba(240, 230, 224, 0.08) 0%,
        rgba(240, 230, 224, 0) 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* --- Scroll Reveal --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #processional-nav {
        left: 0.75rem;
    }

    .nav-markers {
        gap: 1.8rem;
    }

    .panel-body {
        grid-column: 2 / 10;
    }

    .circuit-rose {
        display: none;
    }

    .hero-title {
        font-size: clamp(2.2rem, 10vw, 4rem);
    }
}

@media (max-width: 480px) {
    .panel-grid {
        grid-template-columns:
            [gutter-start] 1rem
            [content-start] repeat(8, 1fr)
            [content-end] 1rem
            [gutter-end];
    }

    .panel-body {
        grid-column: 2 / 10;
    }
}
