/* =============================================
   BBATTL.com - Zen Battle Design System
   ============================================= */

/* --- Custom Properties --- */
:root {
    --bg-primary: #FDF6EC;
    --bg-deep: #2C1810;
    --text-primary: #1A0F0A;
    --text-secondary: #6B4226;
    --accent-primary: #D4573B;
    --accent-secondary: #C4943A;
    --gradient-start: #E8A87C;
    --gradient-end: #85456E;
    --neutral-warm: #E8DCC8;
    --shadow-tone: #3D2B1F;

    --font-primary: 'Playfair Display', Georgia, serif;
    --font-secondary: 'Cormorant Garamond', 'Times New Roman', serif;
    --font-accent: 'Noto Serif JP', serif;

    --ease-deliberate: cubic-bezier(0.22, 1, 0.36, 1);
    --duration-slow: 900ms;
    --duration-medium: 600ms;
    --duration-hover: 400ms;

    --scale-ratio: 1.414;
    --section-spacing: 12vh;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.85;
    overflow-x: hidden;
    position: relative;
}

/* --- SVG Filters (Hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Paper Grain Overlay --- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Navigation Dots --- */
.nav-dots {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 900;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--neutral-warm);
    border: 1px solid var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-hover) var(--ease-deliberate);
}

.nav-dot:hover {
    background-color: var(--accent-secondary);
    transform: scale(1.5);
}

.nav-dot.active {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: scale(1.4);
}

/* --- Sections Base --- */
.section {
    position: relative;
    width: 100%;
    padding: var(--section-spacing) 8vw;
}

/* --- Section 1: Hero --- */
.section-hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 38.2%;
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-family: var(--font-primary);
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 9rem);
    letter-spacing: -0.03em;
    line-height: 1;
    background: linear-gradient(180deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 2;
}

.hero-title-closing {
    font-family: var(--font-accent);
    font-size: clamp(2.5rem, 6vw, 7rem);
    background: linear-gradient(180deg, var(--accent-secondary) 0%, var(--accent-primary) 50%, var(--gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
}

.hero-ensou {
    position: absolute;
    top: 50%;
    left: 15%;
    transform: translate(-50%, -50%);
    width: clamp(200px, 30vw, 450px);
    height: clamp(200px, 30vw, 450px);
    opacity: 0.08;
    z-index: 1;
}

.ensou-svg {
    width: 100%;
    height: 100%;
    color: var(--text-secondary);
}

/* --- Section Markers --- */
.section-marker {
    font-family: var(--font-accent);
    font-size: 0.875rem;
    color: var(--accent-secondary);
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: 2rem;
    opacity: 0.7;
}

.section-marker-light {
    color: var(--gradient-start);
}

/* --- Typography --- */
.heading-large {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.heading-medium {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.heading-light {
    color: var(--bg-primary);
}

.body-text {
    font-family: var(--font-secondary);
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--text-secondary);
    max-width: 55ch;
    margin-bottom: 1.5rem;
}

.body-text-secondary {
    font-family: var(--font-secondary);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-secondary);
    max-width: 45ch;
}

.body-text-light {
    color: var(--neutral-warm);
}

/* --- Brushstroke Rule --- */
.brushstroke-rule {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-secondary), transparent);
    border: none;
    margin: 2rem 0;
    border-radius: 2px;
}

.brushstroke-rule-light {
    background: linear-gradient(90deg, var(--gradient-start), transparent);
}

/* --- Asymmetric Grid (Golden Ratio) --- */
.asymmetric-grid {
    display: grid;
    grid-template-columns: 38.2% 1fr;
    gap: 8vw;
    align-items: start;
    min-height: 60vh;
}

.asymmetric-grid-reversed {
    grid-template-columns: 1fr 38.2%;
}

.col-golden,
.col-remainder {
    padding-top: 4vh;
}

/* --- Wave Separators --- */
.wave-separator {
    width: 100%;
    height: 120px;
    overflow: hidden;
    position: relative;
}

.wave-separator svg {
    width: 100%;
    height: 100%;
}

.wave-path {
    stroke: var(--neutral-warm);
    transition: d var(--duration-slow) var(--ease-deliberate);
}

.wave-path-1 {
    stroke: var(--gradient-start);
    opacity: 0.5;
}

.wave-path-2 {
    stroke: var(--neutral-warm);
    opacity: 0.3;
}

.wave-path-light {
    stroke: var(--gradient-start);
    opacity: 0.2;
}

/* Wave Clash */
.wave-clash-left {
    stroke: var(--accent-secondary);
    opacity: 0.6;
}

.wave-clash-right {
    stroke: var(--accent-primary);
    opacity: 0.6;
}

.wave-clash-interference {
    stroke: var(--gradient-end);
    opacity: 0.8;
}

/* --- Confrontation Layout --- */
.section-confrontation {
    padding-top: 8vh;
    padding-bottom: 8vh;
}

.confrontation-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 4vw;
    align-items: center;
    min-height: 60vh;
}

.confrontation-left,
.confrontation-right {
    padding: 3rem 2rem;
}

.confrontation-left {
    text-align: right;
}

.confrontation-left .body-text-secondary {
    margin-left: auto;
}

.confrontation-right {
    text-align: left;
}

.confrontation-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
}

.confrontation-left .confrontation-icon {
    margin-left: auto;
}

.isometric-icon {
    width: 100%;
    height: 100%;
}

/* Confrontation Void (Center) */
.confrontation-void {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    height: 200px;
    justify-content: center;
}

.void-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(180deg, transparent, var(--accent-secondary), transparent);
}

.void-kanji {
    font-family: var(--font-accent);
    font-size: 1.5rem;
    color: var(--accent-primary);
    opacity: 0.7;
}

/* Slide Animations */
.slide-from-left {
    opacity: 0;
    transform: translateX(-80px);
    transition: all 1200ms var(--ease-deliberate);
}

.slide-from-right {
    opacity: 0;
    transform: translateX(80px);
    transition: all 1200ms var(--ease-deliberate);
}

.slide-from-left.visible,
.slide-from-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* --- Section 4: The Void --- */
.section-void {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.void-text {
    font-family: var(--font-primary);
    font-size: clamp(1.25rem, 3vw, 2.5rem);
    font-weight: 400;
    font-style: italic;
    color: var(--text-secondary);
    opacity: 0.6;
    letter-spacing: 0.02em;
}

.void-wave {
    margin-top: 4rem;
    width: 300px;
    height: 60px;
}

.void-wave-svg {
    width: 100%;
    height: 100%;
}

.void-wave-path {
    stroke: var(--neutral-warm);
    opacity: 0.4;
}

/* --- Skeleton Loader --- */
.skeleton-loader {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
    opacity: 0;
    transition: opacity var(--duration-slow) var(--ease-deliberate);
}

.skeleton-loader.active {
    opacity: 1;
}

.skeleton-wave {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        var(--neutral-warm) 0%,
        var(--gradient-start) 50%,
        var(--neutral-warm) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-pulse 2.5s ease-in-out infinite;
}

.skeleton-wave:nth-child(1) { width: 90%; }
.skeleton-wave:nth-child(2) { width: 70%; animation-delay: 0.3s; }
.skeleton-wave:nth-child(3) { width: 50%; animation-delay: 0.6s; }

@keyframes skeleton-pulse {
    0%, 100% { background-position: 200% 0; }
    50% { background-position: -200% 0; }
}

.arena-content {
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--duration-slow) var(--ease-deliberate);
}

.arena-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Isometric Arena Scene --- */
.isometric-scene {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.isometric-arena-svg {
    width: 100%;
    max-width: 280px;
    height: auto;
}

/* --- Section 6: Ritual (Inverted/Dark) --- */
.section-ritual {
    background-color: var(--bg-deep);
    padding-top: 16vh;
    padding-bottom: 16vh;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ritual-content {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.ensou-large {
    width: clamp(150px, 20vw, 300px);
    margin: 0 auto 3rem;
    opacity: 0.12;
}

.ensou-ritual-svg {
    width: 100%;
    height: auto;
    color: var(--gradient-start);
}

/* Floating Stones (Rock Garden) */
.floating-stones {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.stone {
    position: absolute;
    border-radius: 50% 50% 50% 45%;
    background: var(--shadow-tone);
    opacity: 0.15;
}

.stone-1 {
    width: 80px;
    height: 60px;
    top: 15%;
    left: 10%;
    transform: rotate(-15deg);
}

.stone-2 {
    width: 50px;
    height: 40px;
    top: 70%;
    right: 15%;
    transform: rotate(25deg);
}

.stone-3 {
    width: 35px;
    height: 28px;
    bottom: 20%;
    left: 25%;
    transform: rotate(10deg);
}

/* --- Section 7: Closing --- */
.section-closing {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.closing-content {
    max-width: 600px;
}

.closing-subtitle {
    font-family: var(--font-secondary);
    font-style: italic;
    font-size: 1.25rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-bottom: 2rem;
}

.closing-content .brushstroke-rule {
    margin: 2rem auto;
}

.closing-glow {
    margin-top: 3rem;
    display: inline-block;
}

.closing-cta {
    font-family: var(--font-primary);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    padding: 1rem 3rem;
    border: 1px solid var(--neutral-warm);
    cursor: pointer;
    transition: all var(--duration-hover) var(--ease-deliberate);
    display: inline-block;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.closing-cta:hover {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 30px rgba(196, 148, 58, 0.2), 0 0 60px rgba(196, 148, 58, 0.1);
    color: var(--accent-secondary);
}

/* --- Footer --- */
.section-footer {
    padding: 6vh 8vw 4vh;
    text-align: center;
}

.footer-wave {
    width: 200px;
    height: 60px;
    margin: 0 auto 2rem;
    opacity: 0.3;
}

.footer-wave svg {
    width: 100%;
    height: 100%;
}

.footer-text {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    opacity: 0.4;
}

/* --- Reveal Animation --- */
.reveal-element {
    opacity: 0;
    transform: translateY(60px);
    transition: all var(--duration-slow) var(--ease-deliberate);
}

.reveal-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Wave Animation Keyframes --- */
@keyframes wave-calm {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-10px); }
}

@keyframes wave-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.wave-calm .wave-path {
    animation: wave-calm 6s ease-in-out infinite;
}

.wave-tension .wave-path {
    animation: wave-calm 3s ease-in-out infinite;
}

.void-wave-path {
    animation: wave-calm 8s ease-in-out infinite;
}

/* Ensou slow rotation */
.ensou-svg {
    animation: ensou-breathe 12s ease-in-out infinite;
}

@keyframes ensou-breathe {
    0%, 100% { opacity: 0.08; transform: scale(1); }
    50% { opacity: 0.12; transform: scale(1.02); }
}

.ensou-ritual-svg {
    animation: ensou-breathe-light 10s ease-in-out infinite;
}

@keyframes ensou-breathe-light {
    0%, 100% { opacity: 0.12; transform: scale(1); }
    50% { opacity: 0.18; transform: scale(1.03); }
}

/* --- Hover Glow Effect --- */
.confrontation-left:hover,
.confrontation-right:hover {
    cursor: default;
}

.confrontation-left:hover .heading-medium,
.confrontation-right:hover .heading-medium {
    color: var(--accent-secondary);
    transition: color var(--duration-hover) var(--ease-deliberate);
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    :root {
        --section-spacing: 8vh;
    }

    .section-hero {
        padding-left: 8vw;
        justify-content: flex-start;
        align-items: flex-end;
        padding-bottom: 20vh;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .hero-ensou {
        left: 50%;
        top: 40%;
        width: 60vw;
        height: 60vw;
    }

    .asymmetric-grid,
    .asymmetric-grid-reversed {
        grid-template-columns: 1fr;
        gap: 4vh;
    }

    .confrontation-layout {
        grid-template-columns: 1fr;
        gap: 2vh;
        text-align: center;
    }

    .confrontation-left {
        text-align: center;
    }

    .confrontation-left .confrontation-icon {
        margin: 0 auto 2rem;
    }

    .confrontation-left .body-text-secondary {
        margin: 0 auto;
    }

    .confrontation-right {
        text-align: center;
    }

    .confrontation-void {
        flex-direction: row;
        height: auto;
        gap: 1rem;
        padding: 2rem 0;
    }

    .void-line {
        width: 60px;
        height: 1px;
    }

    .nav-dots {
        right: 1rem;
        gap: 1rem;
    }

    .nav-dot {
        width: 6px;
        height: 6px;
    }

    .slide-from-left,
    .slide-from-right {
        transform: translateY(60px);
    }

    .slide-from-left.visible,
    .slide-from-right.visible {
        transform: translateY(0);
    }

    .heading-large {
        font-size: clamp(1.75rem, 7vw, 3rem);
    }

    .void-text {
        font-size: clamp(1.1rem, 5vw, 1.75rem);
        padding: 0 4vw;
    }

    .isometric-scene {
        padding: 1rem;
    }

    .isometric-arena-svg {
        max-width: 200px;
    }

    .hero-title-closing {
        font-size: clamp(2rem, 10vw, 4rem);
    }
}

@media (max-width: 480px) {
    .section {
        padding: var(--section-spacing) 5vw;
    }

    .body-text {
        font-size: 1rem;
    }

    .confrontation-icon {
        width: 80px;
        height: 80px;
    }
}
