/* heisei.boo v2 — navy-metallic fairycore midnight room */

:root {
    --field-base: #0A1428;
    --field-shadow: #060E1C;
    --grid-line: #1F2D48;
    --grid-line-strong: #2C3D5E;
    --metallic-silver: #B8C2D0;
    --metallic-accent: #4A6FA5;
    --oxidized-chrome: #6E7E94;
    --marble-veil: #E6E2D8;
    --moonlight-cream: #D4D8E0;
    --phosphor: #7FA8D8;

    --district-tint: #4A6FA5;

    --serif-jp: "Noto Serif JP", serif;
    --sans-jp: "Noto Sans JP", sans-serif;
    --display: "Commissioner", "Inter", system-ui, sans-serif;
    --hand: "Caveat", cursive;

    --tile-radius: 4px;
    --max-frame: 1180px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background: var(--field-base);
    color: var(--moonlight-cream);
    font-family: var(--display);
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100%;
}

body {
    background:
        radial-gradient(ellipse at 50% 20%, #0E1A33 0%, var(--field-base) 60%, var(--field-shadow) 100%);
    position: relative;
}

/* Background grid lines layer — full document height */
.grid-lines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    /* line color animates from #06081A (near-invisible) toward var(--grid-line) on arrival */
    background-color: #06081A;
    background-image:
        repeating-linear-gradient(
            to right,
            transparent 0,
            transparent 79px,
            var(--grid-line) 79px,
            var(--grid-line) 80px
        );
    opacity: 0;
    transition: opacity 1200ms ease-out;
}

.grid-lines.is-on {
    opacity: 0.55;
}

/* Section base */
section {
    position: relative;
    z-index: 1;
    padding: 120px 32px;
}

.section-frame {
    max-width: var(--max-frame);
    margin: 0 auto;
}

.section-eyebrow {
    font-family: var(--display);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--oxidized-chrome);
    margin-bottom: 18px;
}

.section-lede {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(15px, 1.4vw, 18px);
    color: var(--metallic-silver);
    margin-bottom: 56px;
    max-width: 560px;
}

/* ---------- HERO ---------- */
.hero-section {
    min-height: 100vh;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-inner {
    position: relative;
    width: 100%;
    max-width: var(--max-frame);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.wordmark {
    position: absolute;
    bottom: 12px;
    left: 0;
    font-family: var(--hand);
    font-weight: 400;
    font-size: 22px;
    color: var(--oxidized-chrome);
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1400ms ease, transform 1400ms ease;
}

.wordmark.is-on {
    opacity: 1;
    transform: translateY(0);
}

.heisei-title {
    font-family: var(--serif-jp);
    font-weight: 700;
    font-size: clamp(64px, 11vw, 160px);
    line-height: 1;
    color: var(--metallic-silver);
    letter-spacing: 0.04em;
    user-select: none;
}

.char {
    display: inline-block;
    transition: text-shadow 600ms ease, color 600ms ease;
    text-shadow: 0 0 0 rgba(74, 111, 165, 0);
    opacity: 0;
    transform: translateY(16px);
}

.char.is-on {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1400ms ease, transform 1400ms ease, text-shadow 1800ms ease, color 1800ms ease;
}

.char.is-pulse {
    animation: charPulse 3600ms ease-in-out infinite;
}

@keyframes charPulse {
    0%, 100% {
        text-shadow: 0 0 0 rgba(74, 111, 165, 0);
        color: var(--metallic-silver);
    }
    50% {
        text-shadow: 0 0 60px rgba(74, 111, 165, 0.55), 0 0 120px rgba(127, 168, 216, 0.18);
        color: #C8D2DE;
    }
}

.era-span {
    margin-top: 36px;
    font-family: var(--display);
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.5em;
    color: var(--oxidized-chrome);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1400ms ease 600ms, transform 1400ms ease 600ms;
}

.era-span.is-on {
    opacity: 1;
    transform: translateY(0);
}

.scroll-cue {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-family: var(--display);
    font-size: 10px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--oxidized-chrome);
    opacity: 0;
    transition: opacity 1200ms ease 1400ms;
}

.scroll-cue.is-on {
    opacity: 0.9;
}

.scroll-line {
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, var(--oxidized-chrome), transparent);
    animation: scrollLine 2400ms ease-in-out infinite;
}

@keyframes scrollLine {
    0% { transform: scaleY(0.2); transform-origin: top; opacity: 0.2; }
    50% { transform: scaleY(1); opacity: 1; }
    100% { transform: scaleY(0.2); transform-origin: bottom; opacity: 0.2; }
}

/* ---------- SPECIMEN WALL ---------- */
.specimen-section {
    padding-top: 140px;
    padding-bottom: 140px;
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.tile {
    position: relative;
    aspect-ratio: 11 / 8;
    background: rgba(20, 30, 55, 0.7);
    border: 1px solid var(--grid-line);
    border-radius: var(--tile-radius);
    overflow: hidden;
    cursor: default;
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 800ms ease,
        transform 800ms ease,
        border-color 320ms ease,
        background 320ms ease;
}

.tile.is-in {
    opacity: 1;
    transform: translateY(0);
}

.tile:hover {
    border-color: var(--metallic-accent);
    background: rgba(28, 40, 70, 0.78);
}

.tile-marble {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.08;
}

.marble-svg {
    width: 100%;
    height: 100%;
    stroke: var(--marble-veil);
    fill: none;
    stroke-width: 1;
}

.tile-art {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 64px;
    height: 64px;
    opacity: 0.85;
    transition: transform 600ms ease, opacity 320ms ease;
}

.art-svg {
    width: 100%;
    height: 100%;
    fill: var(--metallic-silver);
    stroke: var(--metallic-silver);
}

.tile:hover .tile-art {
    transform: translateY(-2px) rotate(-2deg);
    opacity: 1;
}

.tile-text {
    position: absolute;
    left: 24px;
    bottom: 22px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tile-year {
    font-family: var(--display);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.4em;
    color: var(--metallic-accent);
}

.tile-label {
    font-family: var(--serif-jp);
    font-weight: 500;
    font-size: clamp(20px, 1.9vw, 26px);
    color: var(--metallic-silver);
    line-height: 1.2;
}

.tile-en {
    font-family: var(--display);
    font-weight: 300;
    font-size: 12px;
    color: var(--oxidized-chrome);
    letter-spacing: 0.04em;
}

.shimmer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        110deg,
        transparent 0%,
        transparent 40%,
        rgba(127, 168, 216, 0.35) 50%,
        transparent 60%,
        transparent 100%
    );
    transform: translateX(-100%);
    opacity: 0;
}

.tile:hover .shimmer {
    animation: shimmerSweep 900ms ease-out forwards;
}

@keyframes shimmerSweep {
    0%   { transform: translateX(-100%); opacity: 0; }
    20%  { opacity: 0.9; }
    100% { transform: translateX(100%); opacity: 0; }
}

/* ---------- MOON POOL ---------- */
.moonpool-section {
    padding-top: 140px;
    padding-bottom: 160px;
}

.moonpool-stage {
    position: relative;
    height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moonpool-oval {
    position: relative;
    width: clamp(280px, 38vw, 480px);
    height: clamp(220px, 26vw, 320px);
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 50% 50%,
            color-mix(in srgb, var(--district-tint) 30%, var(--field-base)) 0%,
            color-mix(in srgb, var(--district-tint) 12%, var(--field-base)) 40%,
            var(--field-base) 78%);
    box-shadow:
        0 0 0 1px rgba(184, 194, 208, 0.08),
        0 0 80px 0 color-mix(in srgb, var(--district-tint) 26%, transparent),
        inset 0 0 60px 0 rgba(0, 0, 0, 0.55);
    transition: background 800ms ease, box-shadow 800ms ease;
    animation: poolBreath 5200ms ease-in-out infinite;
}

@keyframes poolBreath {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.025); }
}

.moonpool-inner {
    position: absolute;
    inset: 18%;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 40% 35%,
            rgba(255, 255, 255, 0.06) 0%,
            transparent 70%);
    animation: innerGlimmer 7000ms ease-in-out infinite;
}

@keyframes innerGlimmer {
    0%, 100% { opacity: 0.9; transform: rotate(0deg); }
    50%      { opacity: 0.55; transform: rotate(8deg); }
}

.districts {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.district {
    position: absolute;
    font-family: var(--hand);
    font-weight: 400;
    font-size: clamp(22px, 2vw, 28px);
    color: var(--metallic-silver);
    letter-spacing: 0.04em;
    cursor: pointer;
    pointer-events: auto;
    padding: 6px 12px;
    transition: color 320ms ease, transform 320ms ease, text-shadow 320ms ease;
    user-select: none;
}

.district:hover {
    color: var(--phosphor);
    transform: translateY(-2px);
    text-shadow: 0 0 16px rgba(127, 168, 216, 0.45);
}

.district-a { top: 8%;  left: 10%; }
.district-b { top: 18%; right: 12%; }
.district-c { bottom: 18%; left: 14%; }
.district-d { bottom: 10%; right: 14%; }
.district-e { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.district-e:hover { transform: translate(-50%, calc(-50% - 2px)); }

/* ---------- READING BAND ---------- */
.reading-section {
    padding-top: 160px;
    padding-bottom: 160px;
    background:
        linear-gradient(to bottom,
            transparent 0%,
            rgba(6, 14, 28, 0.55) 16%,
            rgba(6, 14, 28, 0.55) 84%,
            transparent 100%);
}

.reading-frame {
    max-width: 720px;
    margin: 0 auto;
}

.reading-para {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(16px, 1.15vw, 18px);
    line-height: 1.85;
    color: var(--moonlight-cream);
    margin-bottom: 32px;
}

.reading-coda {
    font-family: var(--hand);
    font-weight: 400;
    font-size: clamp(20px, 1.6vw, 26px);
    color: var(--metallic-silver);
    text-align: center;
    margin-top: 56px;
    line-height: 1.5;
}

.pull-quote {
    margin: 56px auto;
    padding: 28px 32px;
    border-left: 1px solid var(--metallic-accent);
    text-align: left;
    transition: box-shadow 1200ms ease;
}

.pull-quote.pulse-fired {
    box-shadow: 0 0 0 0 rgba(74, 111, 165, 0);
    animation: quotePulse 2200ms ease-out 1;
}

@keyframes quotePulse {
    0%   { box-shadow: -2px 0 0 0 rgba(74, 111, 165, 0); }
    35%  { box-shadow: -2px 0 28px 0 rgba(74, 111, 165, 0.55); }
    100% { box-shadow: -2px 0 0 0 rgba(74, 111, 165, 0); }
}

.ja-quote {
    display: block;
    font-family: var(--serif-jp);
    font-weight: 500;
    font-size: clamp(20px, 1.8vw, 24px);
    font-style: italic;
    color: var(--metallic-silver);
    margin-bottom: 8px;
}

.en-quote {
    display: block;
    font-family: var(--display);
    font-weight: 300;
    font-size: 13px;
    color: var(--oxidized-chrome);
    letter-spacing: 0.04em;
}

/* ---------- FOOTER ---------- */
.site-footer {
    padding: 80px 32px 100px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.footer-frame {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.medallion {
    width: 96px;
    height: 96px;
    stroke: var(--oxidized-chrome);
    fill: none;
    opacity: 0.7;
}

.medallion-text {
    font-family: var(--serif-jp);
    font-weight: 700;
    font-size: 16px;
    fill: var(--metallic-silver);
    stroke: none;
}

.footer-years {
    font-family: var(--display);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.5em;
    color: var(--oxidized-chrome);
}

.footer-tag {
    font-family: var(--hand);
    font-size: 14px;
    color: var(--oxidized-chrome);
    opacity: 0.7;
}

/* ---------- ENTRY ANIMATIONS for sections ---------- */
.specimen-section,
.moonpool-section,
.reading-section,
.site-footer {
    opacity: 1;
}

.specimen-section .section-frame,
.moonpool-section .section-frame,
.reading-section .reading-frame,
.site-footer .footer-frame {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 900ms ease, transform 900ms ease;
}

.specimen-section.is-in .section-frame,
.moonpool-section.is-in .section-frame,
.reading-section.is-in .reading-frame,
.site-footer.is-in .footer-frame {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 920px) {
    .specimen-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .moonpool-stage {
        height: 440px;
    }
}

@media (max-width: 600px) {
    section {
        padding-left: 22px;
        padding-right: 22px;
    }
    .specimen-grid {
        grid-template-columns: 1fr;
    }
    .moonpool-stage {
        height: 380px;
    }
    .district-a { top: 4%;  left: 4%; }
    .district-b { top: 14%; right: 4%; }
    .district-c { bottom: 14%; left: 6%; }
    .district-d { bottom: 6%; right: 6%; }
    .grid-lines {
        background-image:
            repeating-linear-gradient(
                to right,
                transparent 0,
                transparent 47px,
                var(--grid-line) 47px,
                var(--grid-line) 48px
            );
    }
    .wordmark {
        position: static;
        margin-bottom: 24px;
    }
    .scroll-cue {
        bottom: 24px;
    }
}
