/* ========================================
   rironbusou.net — 理論武装
   Armed with Theory
   ======================================== */

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

:root {
    --void-primary: #0a1628;
    --void-secondary: #1e3a5f;
    --ethereal-mid: #3a7bd5;
    --ethereal-light: #7eb8ff;
    --frost-surface: rgba(255,255,255,0.06);
    --frost-border: rgba(126,184,255,0.25);
    --text-primary: #e4edf9;
    --text-display: #ffffff;
    --inversion-bg: #e8f0ff;
    --inversion-text: #0a1628;
    --accent-pulse: #ff6b3d;
}

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--void-primary);
    color: var(--text-primary);
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ---- Background SVG ---- */
#bg-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.decision-path {
    animation: dashFlow 8s linear infinite;
}

@keyframes dashFlow {
    to { stroke-dashoffset: -48; }
}

/* ---- Sections ---- */
.section {
    position: relative;
    min-height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
    clip-path: inset(0% 0);
    transition: clip-path 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

.section.clip-hidden {
    clip-path: inset(50% 0);
}

.section-tall {
    min-height: 120vh;
}

.section-content {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
    z-index: 2;
}

/* ---- Gradient backgrounds per section ---- */
#armory-gate {
    background: linear-gradient(180deg, var(--void-primary) 0%, var(--void-secondary) 100%);
}

#theorem-arsenal {
    background: linear-gradient(180deg, var(--void-secondary) 0%, #0d2240 50%, var(--void-primary) 100%);
}

#logic-engine {
    background: linear-gradient(180deg, var(--void-primary) 0%, #0f1f38 50%, var(--void-secondary) 100%);
}

.section-inverted {
    background: var(--inversion-bg);
    color: var(--inversion-text);
}

/* ---- Kanji Background ---- */
.kanji-bg {
    position: absolute;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    font-size: 30vw;
    color: var(--void-secondary);
    opacity: 0.12;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    line-height: 1;
    user-select: none;
}

.kanji-dark {
    color: var(--ethereal-mid);
    opacity: 0.08;
}

/* ---- Section Labels ---- */
.section-label {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ethereal-light);
    margin-bottom: 1rem;
    padding: 20vh 0 0 5vw;
}

.section-label-dark {
    color: var(--ethereal-mid);
}

/* ---- Typography ---- */
h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.04em;
    line-height: 1.0;
    color: var(--text-display);
    padding-left: 5vw;
    margin-bottom: 2rem;
}

h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.04em;
    line-height: 1.0;
    color: var(--text-display);
    padding-left: 5vw;
    margin-bottom: 2rem;
}

h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-display);
    margin-bottom: 0.5rem;
}

.kinetic-dark {
    color: var(--inversion-text);
}

/* ---- Kinetic Text Characters ---- */
.kinetic-text .char {
    display: inline-block;
    transform: translateY(40px) rotate(8deg);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.4s ease;
}

.kinetic-text.revealed .char {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
}

/* ---- Glassmorphic Cards ---- */
.glass-card {
    position: absolute;
    left: var(--card-x, 10vw);
    top: var(--card-y, 30vh);
    z-index: var(--card-z, 1);
    backdrop-filter: blur(16px) saturate(1.8);
    -webkit-backdrop-filter: blur(16px) saturate(1.8);
    background: var(--frost-surface);
    border: 1px solid var(--frost-border);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 8px 32px rgba(0,0,0,0.3);
    padding: 1.5rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    border-color: var(--ethereal-light);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 12px 40px rgba(0,0,0,0.4), 0 0 20px rgba(126,184,255,0.1);
}

.glass-lg {
    width: min(70vw, 900px);
    min-height: 40vh;
    position: relative;
    left: auto;
    top: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
}

.glass-md {
    width: min(30vw, 380px);
}

.glass-sm {
    width: min(22vw, 280px);
}

.glass-card-inverted {
    background: rgba(10,22,40,0.05);
    border-color: rgba(58,123,213,0.3);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 8px 32px rgba(0,0,0,0.08);
}

.glass-card-inverted h2 {
    padding-left: 0;
}

.card-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ethereal-light);
    margin-bottom: 0.75rem;
}

.card-label-dark {
    color: var(--ethereal-mid);
    margin-top: 1.5rem;
    margin-bottom: 0;
}

/* ---- Logic Engine Section ---- */
.engine-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10vh 10vw;
}

.logic-phase {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logic-phase.phase-visible {
    opacity: 1;
    transform: translateY(0);
}

.logic-statement {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    line-height: 1.5;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    max-width: 65ch;
}

.accent-text {
    color: var(--accent-pulse);
    font-weight: 700;
}

.glass-divider {
    width: 60%;
    height: 1px;
    background: var(--frost-border);
    margin: 3rem 0;
    position: relative;
    overflow: hidden;
}

.divider-dot {
    width: 6px;
    height: 6px;
    background: var(--ethereal-light);
    border-radius: 50%;
    position: absolute;
    top: -2.5px;
    animation: dotTravel 4s linear infinite;
}

@keyframes dotTravel {
    0% { left: -6px; }
    100% { left: 100%; }
}

/* ---- Armament Complete Section ---- */
.complete-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 5vh 5vw;
}

.complete-content .section-label {
    padding: 0;
    margin-bottom: 2rem;
}

.conclusion-text {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.8;
    color: var(--inversion-text);
    max-width: 55ch;
    margin-bottom: 1rem;
}

/* ---- Arsenal content ---- */
.arsenal-content {
    position: relative;
    min-height: 100vh;
}

/* ---- Card drift animation ---- */
@keyframes cardDrift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(3px, -3px); }
}

.glass-card.glass-sm,
.glass-card.glass-md {
    animation: cardDrift 6s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.glass-card:nth-child(3) { animation-delay: -1s; }
.glass-card:nth-child(4) { animation-delay: -2s; }
.glass-card:nth-child(5) { animation-delay: -3s; }
.glass-card:nth-child(6) { animation-delay: -4s; }
.glass-card:nth-child(7) { animation-delay: -0.5s; }
.glass-card:nth-child(8) { animation-delay: -2.5s; }
.glass-card:nth-child(9) { animation-delay: -4.5s; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .glass-card {
        position: static !important;
        width: 90vw !important;
        margin: 1rem auto;
    }

    .arsenal-content {
        display: flex;
        flex-direction: column;
        padding: 2rem 0;
    }

    .engine-content {
        padding: 10vh 5vw;
    }

    .glass-lg {
        width: 90vw !important;
        min-height: auto;
        padding: 2rem;
    }

    h1 { padding-left: 5vw; }
    h2 { padding-left: 5vw; }
    .section-label { padding: 10vh 0 0 5vw; }

    .kanji-bg {
        font-size: 50vw;
    }

    .glass-card.glass-sm,
    .glass-card.glass-md {
        animation: none;
    }
}
