/* ============================================
   reiwa.boo — Cyberpunk Ghost Shrine
   ============================================ */

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

:root {
    --neon-violet: #8B5CF6;
    --cyber-blue: #3B82F6;
    --void-dark: #0A0A14;
    --marble-white: #E8E0F0;
    --candle-amber: #D4A040;
    --ghost-green: #4AE8C8;
    --surface-dark: #1A1A28;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void-dark);
    color: var(--marble-white);
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 17px);
    line-height: 1.7;
    overflow-x: hidden;
    cursor: none;
}

/* --- Custom Cursor --- */
@media (pointer: fine) {
    body {
        cursor: none;
    }
}

/* --- Spectral Spotlight (cursor follow) --- */
#spectral-spotlight {
    position: fixed;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 232, 200, 0.12) 0%, rgba(74, 232, 200, 0.04) 40%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
    mix-blend-mode: screen;
}

#spectral-spotlight.active {
    opacity: 1;
}

/* --- Candle Glow Points --- */
.candle-glow {
    position: fixed;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 160, 64, 0.10) 0%, rgba(212, 160, 64, 0.04) 50%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    animation: candlePulse 3s ease-in-out infinite;
}

.candle-glow-1 { top: 8%; left: 12%; animation-delay: 0s; }
.candle-glow-2 { top: 15%; right: 8%; animation-delay: 0.7s; }
.candle-glow-3 { top: 35%; left: 5%; animation-delay: 1.4s; }
.candle-glow-4 { top: 50%; right: 15%; animation-delay: 0.3s; }
.candle-glow-5 { top: 65%; left: 20%; animation-delay: 2.1s; }
.candle-glow-6 { top: 78%; right: 10%; animation-delay: 1.0s; }
.candle-glow-7 { top: 88%; left: 8%; animation-delay: 1.8s; }
.candle-glow-8 { top: 42%; left: 55%; animation-delay: 0.5s; }

@keyframes candlePulse {
    0%, 100% { opacity: 0.06; transform: scale(1); }
    50% { opacity: 0.12; transform: scale(1.1); }
}

/* --- Typography --- */
.accent-font {
    font-family: 'Noto Serif JP', serif;
    font-weight: 400;
    font-style: italic;
}

h1, h2, h3, .spread-label, .gallery-title {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ============================================
   SECTION: Shrine Gate (Hero)
   ============================================ */
#shrine-gate {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--void-dark);
    overflow: hidden;
}

.shrine-gate-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(139, 92, 246, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, rgba(139, 92, 246, 0.03) 0%, transparent 40%, rgba(59, 130, 246, 0.02) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Marble floating panels */
.marble-panel {
    position: absolute;
    background:
        radial-gradient(ellipse at 30% 30%, rgba(232, 224, 240, 0.06), transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(139, 92, 246, 0.04), transparent 50%),
        linear-gradient(135deg, rgba(232, 224, 240, 0.03), rgba(26, 26, 40, 0.8));
    border: 1px solid rgba(139, 92, 246, 0.1);
    z-index: 2;
    opacity: 0;
    animation: marbleFadeIn 1.5s ease-out forwards;
}

.marble-panel-1 {
    width: 180px;
    height: 260px;
    top: 10%;
    left: 8%;
    transform: rotate(-3deg);
    animation-delay: 0.2s;
}

.marble-panel-2 {
    width: 140px;
    height: 200px;
    top: 15%;
    right: 10%;
    transform: rotate(2deg);
    animation-delay: 0.5s;
}

.marble-panel-3 {
    width: 120px;
    height: 320px;
    bottom: 10%;
    right: 25%;
    transform: rotate(-1deg);
    animation-delay: 0.8s;
}

@keyframes marbleFadeIn {
    from { opacity: 0; transform: translateY(20px) rotate(var(--rot, 0deg)); }
    to { opacity: 1; }
}

/* Shrine Gate Content */
.shrine-gate-content {
    position: relative;
    z-index: 5;
    text-align: center;
}

.wordmark {
    font-size: clamp(32px, 5vw, 72px);
    letter-spacing: 0.15em;
    color: var(--marble-white);
    margin-bottom: 24px;
    text-shadow:
        0 0 40px rgba(139, 92, 246, 0.4),
        0 0 80px rgba(59, 130, 246, 0.2);
}

.wordmark-cursor {
    animation: cursorBlink 0.8s step-end infinite;
    color: var(--ghost-green);
}

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

.shrine-tagline {
    font-size: clamp(14px, 1.8vw, 20px);
    color: var(--candle-amber);
    margin-bottom: 12px;
    opacity: 0;
    animation: fadeInUp 1s ease-out 1.8s forwards;
}

.shrine-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(11px, 1.2vw, 14px);
    color: rgba(232, 224, 240, 0.5);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInUp 1s ease-out 2.2s forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Torii SVG */
.shrine-gate-torii {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(200px, 30vw, 400px);
    opacity: 0.15;
    z-index: 2;
}

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

/* ============================================
   SECTION: Feature Spreads
   ============================================ */
.feature-spread {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 80vh;
    position: relative;
}

.spread-panel {
    position: relative;
    overflow: hidden;
}

.spread-panel-text {
    display: flex;
    align-items: center;
    padding: clamp(40px, 5vw, 80px);
    background: var(--void-dark);
}

.spread-panel-visual {
    position: relative;
    background: var(--surface-dark);
}

.spread-content {
    max-width: 520px;
}

.spread-label {
    display: inline-block;
    font-size: clamp(10px, 1vw, 12px);
    letter-spacing: 0.3em;
    color: var(--ghost-green);
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(74, 232, 200, 0.3);
}

.spread-title {
    font-size: clamp(24px, 3.5vw, 44px);
    line-height: 1.2;
    color: var(--marble-white);
    margin-bottom: 28px;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
}

.spread-body {
    color: rgba(232, 224, 240, 0.8);
    margin-bottom: 20px;
}

.spread-quote {
    margin-top: 32px;
    padding-left: 20px;
    border-left: 2px solid var(--candle-amber);
    color: var(--candle-amber);
    font-size: clamp(14px, 1.4vw, 18px);
    line-height: 1.9;
}

.quote-translation {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-style: normal;
    font-size: 0.75em;
    color: rgba(232, 224, 240, 0.5);
    margin-top: 8px;
    letter-spacing: 0.05em;
}

/* Visual panels */
.spread-visual-inner {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.duotone-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    mix-blend-mode: luminosity;
    opacity: 0.5;
}

.duotone-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.6), rgba(59, 130, 246, 0.4));
    mix-blend-mode: overlay;
}

/* CSS-generated shrine imagery */
.duotone-shrine {
    background:
        radial-gradient(circle at 50% 30%, rgba(139, 92, 246, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 30% 70%, rgba(59, 130, 246, 0.2) 0%, transparent 35%),
        radial-gradient(circle at 70% 50%, rgba(232, 224, 240, 0.05) 0%, transparent 30%),
        linear-gradient(180deg, var(--surface-dark), rgba(10, 10, 20, 0.9));
}

.duotone-shrine::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(139, 92, 246, 0.05) 60px, rgba(139, 92, 246, 0.05) 61px),
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(59, 130, 246, 0.03) 40px, rgba(59, 130, 246, 0.03) 41px);
}

.duotone-yokai {
    background:
        radial-gradient(ellipse at 40% 40%, rgba(74, 232, 200, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 60% 60%, rgba(139, 92, 246, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(212, 160, 64, 0.1) 0%, transparent 30%),
        linear-gradient(200deg, var(--surface-dark), rgba(10, 10, 20, 0.95));
}

.duotone-yokai::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 50%, rgba(74, 232, 200, 0.08), transparent 60%),
        conic-gradient(from 45deg at 50% 50%, transparent 0deg, rgba(139, 92, 246, 0.06) 90deg, transparent 180deg, rgba(59, 130, 246, 0.04) 270deg, transparent 360deg);
}

.duotone-neon {
    background:
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.35) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.3) 0%, transparent 35%),
        radial-gradient(circle at 50% 50%, rgba(212, 160, 64, 0.08) 0%, transparent 50%),
        linear-gradient(160deg, var(--surface-dark), rgba(10, 10, 20, 0.9));
}

.duotone-neon::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(45deg, transparent, transparent 30px, rgba(139, 92, 246, 0.04) 30px, rgba(139, 92, 246, 0.04) 31px),
        repeating-linear-gradient(-45deg, transparent, transparent 50px, rgba(59, 130, 246, 0.03) 50px, rgba(59, 130, 246, 0.03) 51px);
}

/* Marble accent strips on visual panels */
.marble-accent-strip {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(180deg,
        rgba(232, 224, 240, 0.3),
        rgba(139, 92, 246, 0.2),
        rgba(232, 224, 240, 0.1),
        rgba(139, 92, 246, 0.3),
        rgba(232, 224, 240, 0.2));
}

.marble-accent-strip-right {
    left: auto;
    right: 0;
}

/* Alternate spread layout */
.spread-2 .spread-panel-visual {
    order: -1;
}

/* Spread reveal animation */
.spread-panel-text .spread-content {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.spread-panel-text.revealed .spread-content {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   SECTION: Spirit Gallery
   ============================================ */
#spirit-gallery {
    position: relative;
    padding: clamp(60px, 8vw, 120px) 0 clamp(40px, 5vw, 80px);
    background: var(--void-dark);
    overflow: hidden;
}

#spirit-gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-violet), var(--cyber-blue), var(--neon-violet), transparent);
}

.gallery-title {
    font-size: clamp(20px, 3vw, 36px);
    text-align: center;
    margin-bottom: 12px;
    color: var(--marble-white);
    padding: 0 clamp(20px, 3vw, 40px);
}

.gallery-title-jp {
    color: var(--neon-violet);
    font-family: 'Noto Serif JP', serif;
    font-style: italic;
    text-transform: none;
    letter-spacing: 0.2em;
}

.gallery-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 40px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-violet) var(--surface-dark);
}

.gallery-scroll-container::-webkit-scrollbar {
    height: 4px;
}

.gallery-scroll-container::-webkit-scrollbar-track {
    background: var(--surface-dark);
}

.gallery-scroll-container::-webkit-scrollbar-thumb {
    background: var(--neon-violet);
    border-radius: 2px;
}

.gallery-track {
    display: flex;
    gap: 28px;
    padding: 0 clamp(30px, 5vw, 80px);
    width: max-content;
}

/* Spirit Cards */
.spirit-card {
    position: relative;
    width: 300px;
    min-height: 380px;
    background: var(--surface-dark);
    border: 1px solid rgba(139, 92, 246, 0.15);
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.4s ease, transform 0.4s ease;
}

.spirit-card:hover {
    border-color: var(--ghost-green);
    transform: translateY(-4px);
}

.spirit-card-marble {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(232, 224, 240, 0.04), transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.03), transparent 40%);
    opacity: 0.6;
    pointer-events: none;
}

.spirit-card-content {
    position: relative;
    padding: 36px 28px;
    z-index: 2;
}

.spirit-kanji {
    display: block;
    font-family: 'Noto Serif JP', serif;
    font-size: 64px;
    color: rgba(139, 92, 246, 0.2);
    line-height: 1;
    margin-bottom: 16px;
    transition: color 0.4s ease;
}

.spirit-card:hover .spirit-kanji {
    color: rgba(74, 232, 200, 0.3);
}

.spirit-name {
    font-size: clamp(16px, 1.8vw, 20px);
    color: var(--marble-white);
    margin-bottom: 6px;
}

.spirit-type {
    font-size: 13px;
    color: var(--candle-amber);
    margin-bottom: 18px;
}

.spirit-desc {
    font-size: 14px;
    color: rgba(232, 224, 240, 0.65);
    line-height: 1.6;
}

.spirit-card-edge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-violet), var(--ghost-green), var(--cyber-blue));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.spirit-card:hover .spirit-card-edge {
    opacity: 1;
}

.gallery-scroll-indicator {
    text-align: center;
    margin-top: 16px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.15em;
    color: rgba(232, 224, 240, 0.3);
}

.scroll-arrow {
    display: inline-block;
    margin: 0 12px;
    color: var(--ghost-green);
    animation: scrollArrowPulse 2s ease-in-out infinite;
}

@keyframes scrollArrowPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* ============================================
   SECTION: Neon Shrine Footer
   ============================================ */
#neon-shrine-footer {
    position: relative;
    padding: clamp(60px, 8vw, 120px) clamp(20px, 5vw, 80px);
    background: var(--void-dark);
    text-align: center;
    overflow: hidden;
}

#neon-shrine-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--candle-amber), transparent);
}

.footer-marble-panel {
    position: absolute;
    top: 20%;
    left: -5%;
    width: 200px;
    height: 300px;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(232, 224, 240, 0.03), transparent 60%),
        linear-gradient(135deg, rgba(139, 92, 246, 0.02), rgba(26, 26, 40, 0.5));
    border: 1px solid rgba(232, 224, 240, 0.04);
    transform: rotate(-5deg);
    pointer-events: none;
}

.footer-content {
    position: relative;
    z-index: 2;
}

.footer-wordmark {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(28px, 4vw, 48px);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--marble-white);
    margin-bottom: 16px;
    text-shadow:
        0 0 40px rgba(139, 92, 246, 0.3),
        0 0 80px rgba(59, 130, 246, 0.15);
}

.footer-text {
    font-size: clamp(14px, 1.6vw, 18px);
    color: var(--candle-amber);
    margin-bottom: 8px;
}

.footer-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(10px, 1.1vw, 13px);
    color: rgba(232, 224, 240, 0.4);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 32px;
}

.footer-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, var(--neon-violet), var(--ghost-green));
    margin: 0 auto 32px;
}

.footer-note {
    font-size: 14px;
    color: rgba(232, 224, 240, 0.5);
    line-height: 1.8;
}

.footer-candle-row {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 48px;
}

.footer-candle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--candle-amber);
    box-shadow: 0 0 20px rgba(212, 160, 64, 0.4), 0 0 40px rgba(212, 160, 64, 0.2);
    animation: candlePulse 3s ease-in-out infinite;
}

.footer-candle:nth-child(2) { animation-delay: 0.6s; }
.footer-candle:nth-child(3) { animation-delay: 1.2s; }
.footer-candle:nth-child(4) { animation-delay: 0.3s; }
.footer-candle:nth-child(5) { animation-delay: 1.8s; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .feature-spread {
        grid-template-columns: 1fr;
    }

    .spread-panel-visual {
        min-height: 40vh;
    }

    .spread-2 .spread-panel-visual {
        order: 0;
    }

    .shrine-gate-torii {
        opacity: 0.08;
    }

    .marble-panel-1,
    .marble-panel-2,
    .marble-panel-3 {
        display: none;
    }

    .spirit-card {
        width: 260px;
        min-height: 340px;
    }

    .footer-marble-panel {
        display: none;
    }
}

/* ============================================
   Selection
   ============================================ */
::selection {
    background: rgba(139, 92, 246, 0.4);
    color: var(--marble-white);
}
