/* ===================================================
   sunhan.church — Art Deco Sacred-Futuristic Dark Mode
   Palette: #080910 / #0A0B14 / #12141F / #C9A84C / #E8D48B / #EDE8DC / #B8B4A8 / #8A8880 / #F0C040
   Fonts: Cinzel Decorative, Poiret One, Space Mono, Cinzel
   =================================================== */

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

html {
    scroll-snap-type: x mandatory;
    overflow-x: scroll;
    overflow-y: hidden;
    background: #080910;
    font-feature-settings: "kern" 1, "liga" 1;
}

body {
    background: #080910;
    color: #EDE8DC;
    height: 100vh;
    overflow: hidden;
}

/* --- Noise Overlay --- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 100;
    mix-blend-mode: overlay;
    opacity: 0.08;
}

.noise-overlay svg {
    width: 100%;
    height: 100%;
}

/* --- Progress Bar --- */
.progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: #C9A84C;
    z-index: 200;
    transition: width 0.1s linear;
}

/* --- Scroll Track --- */
.scroll-track {
    display: flex;
    width: 700vw;
    height: 100vh;
    flex-direction: row;
}

/* --- Panel Base --- */
.panel {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Panel Grid System (12 col, 24px gutters) --- */
.panel-grid {
    display: grid;
    grid-template-columns: 2fr repeat(8, 1fr) 2fr;
    gap: 24px;
    width: 100%;
    height: 100%;
    padding: 0 24px;
    align-items: center;
}

/* --- Panel Reveal Animation --- */
.panel-reveal {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 600ms ease, transform 600ms ease;
    transition-delay: 200ms;
}

.panel[data-active] .panel-reveal {
    opacity: 1;
    transform: translateY(0);
}

/* --- Double Rule --- */
.double-rule {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 20px 0;
}

.double-rule::before {
    content: '';
    display: block;
    height: 1px;
    background: #C9A84C;
    width: 100%;
}

.double-rule::after {
    content: '';
    display: block;
    height: 0.5px;
    background: #C9A84C;
    opacity: 0.6;
    width: 100%;
}

/* --- Typography --- */
.panel-number {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.3em;
    color: #C9A84C;
    text-transform: uppercase;
    display: block;
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}

.panel-heading {
    font-family: 'Cinzel Decorative', serif;
    font-size: 64px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #C9A84C;
    text-transform: uppercase;
    line-height: 1.1;
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
    margin-bottom: 8px;
}

.panel-subheading {
    font-family: 'Poiret One', sans-serif;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: #EDE8DC;
    margin-bottom: 16px;
}

.panel-body {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.85;
    color: #B8B4A8;
    margin-bottom: 16px;
    max-width: 480px;
}

.panel-caption {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: #8A8880;
    line-height: 1.8;
    text-transform: uppercase;
}

.panel-accent-line {
    width: 48px;
    height: 1px;
    background: #C9A84C;
    margin: 20px 0;
    opacity: 0.6;
}

/* --- Corner Marks --- */
.corner-mark {
    position: absolute;
    z-index: 10;
}

.corner-tl { top: 24px; left: 24px; }
.corner-tr { top: 24px; right: 24px; }
.corner-bl { bottom: 24px; left: 24px; }
.corner-br { bottom: 24px; right: 24px; }

/* ===================================================
   PANEL 1: Opening Transmission
   =================================================== */
.panel-opening {
    background: #080910;
}

.panel-content-centered {
    grid-column: 3 / 11;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    height: 100%;
}

.mandala-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mandala-svg {
    width: 420px;
    height: 420px;
}

.mandala-group {
    animation: spin 300s linear infinite;
    transform-origin: 240px 240px;
}

.mandala-group-reverse {
    animation: spin-reverse 240s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spin-reverse {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

.domain-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 42px;
    font-weight: 400;
    letter-spacing: 0.4em;
    color: #C9A84C;
    text-transform: lowercase;
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
    text-align: center;
    transition: color 400ms ease;
}

.domain-title:hover {
    color: #E8D48B;
}

.domain-dot {
    color: #EDE8DC;
    letter-spacing: 0;
}

.panel-label {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: 0.3em;
    color: #8A8880;
    text-transform: uppercase;
    text-align: center;
}

/* ===================================================
   PANEL 2: The Arch Panel
   =================================================== */
.panel-arch {
    background: #0A0B14;
}

.panel-text-column {
    grid-column: 3 / 7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 0;
}

.arch-visual-column {
    grid-column: 7 / 11;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.arch-svg {
    width: 100%;
    height: 85vh;
    max-height: 700px;
}

/* ===================================================
   PANEL 3: Signal Panel
   =================================================== */
.panel-signal {
    background: #080910;
}

.signal-ripple-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.signal-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.signal-text {
    grid-column: 3 / 7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 10;
}

/* ===================================================
   PANEL 4: Geometry Sanctuary
   =================================================== */
.panel-sanctuary {
    background: #12141F;
}

/* Diamond wallpaper background */
.panel-sanctuary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpolygon points='24,0 48,24 24,48 0,24' fill='none' stroke='%23C9A84C' stroke-width='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
    opacity: 0.06;
}

.sanctuary-window {
    grid-column: 3 / 11;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80vh;
}

.window-border-outer {
    border: 1px solid #C9A84C;
    padding: 4px;
    width: 100%;
    max-width: 760px;
    height: 100%;
    max-height: 580px;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background: rgba(10, 11, 20, 0.85);
}

.window-border-inner {
    border: 0.5px solid rgba(201, 168, 76, 0.4);
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpolygon points='24,0 48,24 24,48 0,24' fill='none' stroke='%23C9A84C' stroke-width='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 48px 48px;
    background-color: transparent;
}

.window-content {
    flex: 1;
    padding: 48px 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    background: rgba(18, 20, 31, 0.9);
}

.corner-fan {
    position: absolute;
}
.corner-fan-tl { top: 0; left: 0; }
.corner-fan-tr { top: 0; right: 0; }
.corner-fan-bl { bottom: 0; left: 0; }
.corner-fan-br { bottom: 0; right: 0; }

/* ===================================================
   PANEL 5: The Lineage Panel
   =================================================== */
.panel-lineage {
    background: #0A0B14;
}

.lineage-content {
    grid-column: 2 / 12;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 32px;
}

.timeline {
    width: 100%;
    padding: 24px 0;
}

.timeline-track {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-top: 32px;
}

.timeline-rule {
    position: absolute;
    top: 31px;
    left: 0;
    right: 0;
    height: 1px;
    background: #C9A84C;
    opacity: 0.5;
}

.timeline-event {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.event-chevron {
    background: #0A0B14;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.event-year {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: #C9A84C;
    text-transform: uppercase;
    white-space: nowrap;
}

.event-year-current {
    color: #F0C040;
    text-shadow: 0 0 10px rgba(240, 192, 64, 0.4);
}

.panel-accent-secondary {
    color: #E8D48B;
}

.event-label {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #8A8880;
    text-align: center;
    white-space: nowrap;
}

.timeline-event-current .event-label {
    color: #B8B4A8;
}

.lineage-text {
    max-width: 640px;
}

/* ===================================================
   PANEL 6: Noise Field
   =================================================== */
.panel-noise-field {
    background: #080910;
}

/* Heavy grain for noise panel (12% in JS) */
.noise-field-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.noise-content {
    grid-column: 3 / 11;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
    height: 100%;
}

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

.noise-number {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(80px, 14vw, 160px);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #C9A84C;
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
    animation: noise-pulse 4s ease-in-out infinite;
    line-height: 1;
}

@keyframes noise-pulse {
    0%, 100% { opacity: 1; }
    40% { opacity: 0.3; }
    60% { opacity: 0.7; }
    80% { opacity: 0.1; }
}

/* ===================================================
   PANEL 7: Closing Transmission
   =================================================== */
.panel-closing {
    background: #080910;
}

.mandala-svg-closing {
    opacity: 0.9;
}

.closing-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.closing-message {
    font-family: 'Poiret One', sans-serif;
    font-size: 32px;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: #EDE8DC;
}

/* ===================================================
   Scrollbar Styling
   =================================================== */
html::-webkit-scrollbar {
    height: 0;
    display: none;
}

html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* ===================================================
   Animated ripple circles (added by JS to signal panel)
   =================================================== */
.ripple-circle {
    fill: none;
    stroke: #C9A84C;
    stroke-width: 1;
}

/* ===================================================
   Panel-specific noise opacity overrides via JS class
   =================================================== */
.panel-heavy-grain .noise-overlay-local {
    opacity: 0.12;
}

.panel-light-grain .noise-overlay-local {
    opacity: 0.06;
}
