/* reiwa.boo v2 — Cyberpunk ghost shrine, magazine-spread, tech-mono */
:root {
    --ghost-green: #00FF88;
    --neon-violet: #7B2FFF;
    --cyber-teal: #00CCCC;
    --void-black: #0A0A14;
    --marble-white: #F0EDE8;
    --candle-amber: #D4A855;
    --night-gray: #3A3A4A;
    --text-base: #C8D0D8;
    --font-mono: 'Share Tech Mono', monospace;
    --font-sans: 'Noto Sans JP', sans-serif;
    --font-serif: 'Noto Serif JP', serif;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
    background: var(--void-black);
    color: var(--text-base);
    font-family: var(--font-sans);
    font-size: clamp(14px, 1.4vw, 16px);
    line-height: 1.8;
    overflow-x: hidden;
}

/* --- Spectral spotlight --- */
#spectral-spotlight {
    position: fixed;
    top: 0; left: 0;
    width: 360px; height: 360px;
    background: radial-gradient(circle, rgba(0,255,136,0.10) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%,-50%);
    transition: opacity 0.3s;
}

/* --- Spine (side nav) --- */
.spine {
    position: fixed;
    left: 0; top: 0;
    width: 56px; height: 100vh;
    background: rgba(10,10,20,0.92);
    border-right: 1px solid rgba(0,255,136,0.15);
    display: flex; flex-direction: column; align-items: center;
    padding: 24px 0;
    z-index: 1000;
    gap: 12px;
}
.spine-mark {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.2em;
    color: var(--ghost-green);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    opacity: 0.6;
}
.spine-index { list-style: none; display: flex; flex-direction: column; gap: 8px; flex: 1; justify-content: center; }
.spine-link {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    text-decoration: none; color: var(--night-gray);
    font-family: var(--font-mono); font-size: 8px;
    transition: color 0.3s;
}
.spine-link.is-active { color: var(--ghost-green); }
.spine-link:hover { color: var(--cyber-teal); }
.spine-num { font-size: 10px; }
.spine-label { writing-mode: vertical-rl; text-orientation: mixed; letter-spacing: 0.1em; }
.spine-foot {
    font-family: var(--font-serif);
    font-size: 9px;
    color: var(--candle-amber);
    opacity: 0.5;
    writing-mode: vertical-rl;
}

/* --- Candle field --- */
.candle-field { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.candle-glow {
    position: absolute;
    left: var(--cx); top: var(--cy);
    width: 80px; height: 80px;
    background: radial-gradient(circle, rgba(212,168,85,0.12) 0%, transparent 70%);
    border-radius: 50%;
    animation: candle-flicker 3s ease-in-out infinite;
    animation-delay: var(--cd, 0s);
    transform: translate(-50%,-50%);
}
@keyframes candle-flicker {
    0%, 100% { opacity: 0.6; transform: translate(-50%,-50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%,-50%) scale(1.2); }
}

/* --- Stage / main layout --- */
.stage { margin-left: 56px; }

/* --- Gate section (100vh) --- */
.gate {
    position: relative;
    min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center;
    overflow: hidden;
    padding: 60px 80px;
    background: var(--void-black);
}
.gate-overlay {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 80% 60% at 60% 40%, rgba(123,47,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.marble-panel {
    position: absolute;
    background: linear-gradient(135deg, rgba(240,237,232,0.06) 0%, rgba(240,237,232,0.02) 50%, rgba(123,47,255,0.04) 100%);
    border: 1px solid rgba(240,237,232,0.08);
    pointer-events: none;
}
.marble-a { width: 200px; height: 300px; right: 12%; top: 10%; transform: rotate(3deg); }
.marble-b { width: 140px; height: 200px; right: 5%; bottom: 15%; transform: rotate(-2deg); }
.marble-c { width: 100px; height: 160px; right: 22%; bottom: 20%; transform: rotate(5deg); }
.torii-stack {
    position: absolute; right: 18%; top: 0; bottom: 0;
    width: 80px; pointer-events: none; opacity: 0.15;
}
.torii-bar {
    position: absolute; left: 0; right: 0;
    background: var(--ghost-green);
}
.bar-cap { height: 6px; top: 60px; }
.bar-mid { height: 4px; top: 100px; }
.torii-pillar {
    position: absolute; width: 6px; top: 100px; bottom: 0;
    background: var(--ghost-green);
}
.pillar-l { left: 12px; }
.pillar-r { right: 12px; }
.torii-thread {
    position: absolute; left: 50%; top: 56px; width: 1px; height: 60px;
    background: var(--ghost-green); transform: translateX(-50%);
}
.gate-meta {
    display: flex; gap: 24px;
    font-family: var(--font-mono); font-size: 10px;
    color: var(--night-gray); letter-spacing: 0.15em;
    margin-bottom: 40px;
}
.gate-issue { color: var(--ghost-green); opacity: 0.7; }
.gate-headline { max-width: 600px; }
.gate-eyebrow {
    font-family: var(--font-serif); font-size: 14px;
    color: var(--candle-amber); margin-bottom: 16px; display: block;
    font-style: italic;
}
.wordmark {
    font-family: var(--font-mono);
    font-size: clamp(32px, 6vw, 80px);
    color: var(--ghost-green);
    text-shadow: 0 0 20px rgba(0,255,136,0.4), 0 0 60px rgba(0,255,136,0.15);
    letter-spacing: 0.04em;
    line-height: 1.1;
    margin-bottom: 24px;
}
.wordmark-caret { animation: caret-blink 0.8s step-end infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
.gate-tagline {
    font-size: clamp(13px, 1.5vw, 16px);
    color: var(--text-base);
    line-height: 1.7;
    max-width: 480px;
}
.gate-foot {
    display: flex; gap: 48px; flex-wrap: wrap;
    margin-top: 60px;
    font-family: var(--font-mono); font-size: 11px;
}
.gate-foot-block { display: flex; flex-direction: column; gap: 4px; }
.foot-label { color: var(--night-gray); letter-spacing: 0.15em; font-size: 9px; }
.foot-value { color: var(--cyber-teal); }
.foot-arrow { color: var(--ghost-green); animation: pulse-y 1.5s ease-in-out infinite; }
@keyframes pulse-y { 0%,100% { transform: translateY(0); opacity:1; } 50% { transform: translateY(4px); opacity:0.6; } }

/* --- Magazine spreads --- */
.spread {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 80vh;
    border-top: 1px solid rgba(0,255,136,0.08);
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.8s, transform 0.8s;
}
.spread.is-visible { opacity: 1; transform: none; }
.spread-flip { direction: rtl; }
.spread-flip > * { direction: ltr; }
.spread-text {
    padding: 80px 60px;
    display: flex; flex-direction: column; gap: 20px;
    justify-content: center;
    border-right: 1px solid rgba(0,255,136,0.06);
}
.spread-tag {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--ghost-green); letter-spacing: 0.2em;
}
.spread-title {
    font-family: var(--font-serif);
    font-size: clamp(24px, 3.5vw, 48px);
    color: var(--marble-white);
    line-height: 1.2;
}
.spread-lede {
    font-size: clamp(14px, 1.3vw, 16px);
    color: var(--text-base);
    font-style: italic;
}
.spread-body { font-size: clamp(13px, 1.2vw, 15px); color: var(--text-base); opacity: 0.85; }
.spread-quote {
    border-left: 3px solid var(--candle-amber);
    padding-left: 20px;
    font-family: var(--font-serif);
    font-size: 15px;
    color: var(--candle-amber);
    font-style: italic;
}
.quote-en { display: block; font-size: 11px; color: var(--night-gray); margin-top: 8px; font-style: normal; }
.spread-meta { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.meta-k { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.15em; color: var(--night-gray); margin-right: 12px; }
.meta-v { font-family: var(--font-mono); font-size: 9px; color: var(--cyber-teal); }
.spread-visual {
    position: relative;
    overflow: hidden;
    background: #0d0d1e;
}
.duotone-pane {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(123,47,255,0.20) 0%, rgba(0,204,204,0.12) 100%);
}
.duotone-grid {
    position: absolute; inset: 0;
    background-image:
        repeating-linear-gradient(rgba(0,255,136,0.05) 0px, transparent 1px, transparent 40px, rgba(0,255,136,0.05) 41px),
        repeating-linear-gradient(90deg, rgba(0,255,136,0.05) 0px, transparent 1px, transparent 40px, rgba(0,255,136,0.05) 41px);
}
.duotone-scan {
    position: absolute; inset: 0;
    background: repeating-linear-gradient(transparent 0px, transparent 2px, rgba(0,0,0,0.08) 3px);
    animation: scan-drift 8s linear infinite;
}
@keyframes scan-drift { from { background-position: 0 0; } to { background-position: 0 100px; } }
.visual-caption {
    position: absolute; bottom: 20px; left: 20px;
    font-family: var(--font-mono); font-size: 9px;
    color: var(--night-gray); letter-spacing: 0.1em;
}
.marble-strip {
    position: absolute; bottom: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--neon-violet), var(--cyber-teal), var(--ghost-green));
}

/* --- Elegy (quote panel) --- */
.elegy {
    text-align: center;
    padding: 80px 120px;
    background: linear-gradient(180deg, var(--void-black), rgba(123,47,255,0.06), var(--void-black));
    border-top: 1px solid rgba(0,255,136,0.06);
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.8s, transform 0.8s;
}
.elegy.is-visible { opacity: 1; transform: none; }
.elegy-tag {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--ghost-green); letter-spacing: 0.2em;
    display: block; margin-bottom: 32px;
}
.elegy-main {
    font-family: var(--font-serif);
    font-size: clamp(20px, 3vw, 40px);
    color: var(--marble-white);
    line-height: 1.5; font-style: italic; font-weight: 400;
    max-width: 800px; margin: 0 auto 24px;
}
.elegy-en {
    font-family: var(--font-mono); font-size: 12px;
    color: var(--night-gray); letter-spacing: 0.1em;
}
.elegy-hr {
    width: 120px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--ghost-green), transparent);
    margin: 32px auto; border: 0;
}
.elegy-sub {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--candle-amber); letter-spacing: 0.15em;
}

/* --- Yokai gallery --- */
.gallery {
    padding: 80px 80px;
    border-top: 1px solid rgba(0,255,136,0.06);
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.8s, transform 0.8s;
}
.gallery.is-visible { opacity: 1; transform: none; }
.gallery-tag {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--ghost-green); letter-spacing: 0.2em;
    display: block; margin-bottom: 12px;
}
.gallery-title {
    font-family: var(--font-serif);
    font-size: clamp(24px, 4vw, 52px);
    color: var(--marble-white);
    margin-bottom: 48px;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2px;
}
.yokai-card {
    position: relative;
    background: rgba(58,58,74,0.4);
    border: 1px solid rgba(0,255,136,0.08);
    overflow: hidden;
    padding: 40px 32px;
    transition: border-color 0.3s, background 0.3s;
    cursor: default;
}
.yokai-card:hover {
    border-color: rgba(0,255,136,0.3);
    background: rgba(123,47,255,0.08);
}
.yokai-glyph {
    font-size: 40px;
    display: block; margin-bottom: 16px;
    filter: drop-shadow(0 0 8px var(--ghost-green));
}
.yokai-name-jp {
    font-family: var(--font-serif); font-size: 20px;
    color: var(--ghost-green); display: block;
}
.yokai-name-en {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--night-gray); letter-spacing: 0.15em;
    display: block; margin-bottom: 12px;
}
.yokai-desc { font-size: 12px; color: var(--text-base); opacity: 0.7; line-height: 1.6; }

/* --- Protocol section --- */
.protocol {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    min-height: 80vh;
    border-top: 1px solid rgba(0,255,136,0.06);
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.8s, transform 0.8s;
}
.protocol.is-visible { opacity: 1; transform: none; }
.protocol-text {
    padding: 80px 60px;
    display: flex; flex-direction: column; gap: 20px; justify-content: center;
    border-right: 1px solid rgba(0,255,136,0.06);
}
.protocol-tag {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--ghost-green); letter-spacing: 0.2em;
}
.protocol-title {
    font-family: var(--font-serif);
    font-size: clamp(24px, 3.5vw, 48px);
    color: var(--marble-white); line-height: 1.2;
}
.protocol-body { font-size: clamp(13px, 1.2vw, 15px); color: var(--text-base); opacity: 0.85; }
.protocol-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.protocol-item {
    display: flex; align-items: flex-start; gap: 12px;
    font-family: var(--font-mono); font-size: 12px; color: var(--text-base);
}
.protocol-item::before {
    content: '▸'; color: var(--ghost-green); flex-shrink: 0;
}
.protocol-visual {
    position: relative; overflow: hidden; background: #0c0c1a;
    display: flex; align-items: center; justify-content: center;
}
.torii-vis {
    width: 160px; height: 260px;
    display: flex; flex-direction: column; align-items: center;
    opacity: 0.3;
}
.tv-bar {
    width: 100%; height: 8px;
    background: var(--ghost-green); border-radius: 2px;
}
.tv-bar2 { width: 80%; height: 6px; background: var(--ghost-green); border-radius: 2px; margin-top: 32px; }
.tv-pillars {
    display: flex; justify-content: space-between; width: 60%;
    flex: 1; margin-top: 0;
}
.tv-pillar { width: 8px; background: var(--ghost-green); border-radius: 2px; }

/* --- Colophon footer --- */
.colophon {
    padding: 80px 80px 40px;
    background: rgba(10,10,20,0.95);
    border-top: 1px solid rgba(0,255,136,0.12);
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.8s, transform 0.8s;
}
.colophon.is-visible { opacity: 1; transform: none; }
.colophon-tag {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--ghost-green); letter-spacing: 0.2em;
    display: block; margin-bottom: 48px;
}
.colophon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 48px; margin-bottom: 48px;
}
.colophon-h {
    font-family: var(--font-mono); font-size: 9px;
    letter-spacing: 0.2em; color: var(--ghost-green);
    display: block; margin-bottom: 12px;
}
.colophon-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.colophon-list li {
    font-family: var(--font-mono); font-size: 11px;
    color: var(--night-gray); transition: color 0.3s;
}
.colophon-list a { color: var(--cyber-teal); text-decoration: none; }
.colophon-list a:hover { color: var(--ghost-green); }
.colophon-body { font-size: 12px; color: var(--night-gray); line-height: 1.7; }
.colophon-foot {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 24px;
    border-top: 1px solid rgba(0,255,136,0.08);
    font-family: var(--font-mono); font-size: 10px;
    color: var(--night-gray); letter-spacing: 0.1em;
}
.colophon-foot-r { color: var(--cyber-teal); }
.colophon-marble {
    position: absolute; bottom: 0; left: 56px; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--neon-violet), var(--ghost-green), var(--cyber-teal));
}

/* --- Accent --- */
.accent-italic { font-style: italic; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .spine { display: none; }
    .stage { margin-left: 0; }
    .spread, .protocol { grid-template-columns: 1fr; }
    .gate { padding: 40px 32px; }
}
