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

:root {
    --dusk-violet: #6B4C8A;
    --twilight-teal: #3A8C82;
    --aurora-mint: #7ECBB8;
    --parchment-cream: #F5F0E8;
    --soft-slate: #E8E4F0;
    --deep-indigo: #2A2438;
    --muted-plum: #7E7290;
    --warm-amber: #D4A54A;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    color: var(--deep-indigo);
    background: var(--parchment-cream);
}

/* === Scroll Container === */
#scroll-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: fit-content;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#scroll-container::-webkit-scrollbar {
    display: none;
}

/* === Panel Base === */
.panel {
    position: relative;
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    scroll-snap-align: start;
}

.panel-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Panel 1: The Spear === */
.panel-1 {
    background: var(--parchment-cream);
}

.panel-1 .panel-content {
    justify-content: flex-start;
}

.spear-text {
    padding-left: 8vw;
    z-index: 3;
}

.domain-name {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--deep-indigo);
    letter-spacing: -0.02em;
}

.kanji-subtitle {
    font-family: 'Noto Serif JP', serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--muted-plum);
    margin-top: 0.5rem;
}

.spear-shape {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 30vh solid transparent;
    border-bottom: 30vh solid transparent;
    border-left: 60vw solid var(--dusk-violet);
}

/* === Panel 2: The Shield === */
.panel-2 {
    background: var(--soft-slate);
}

.panel-2 .panel-content {
    justify-content: flex-end;
}

.shield-shape {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 55vw;
    height: 60vh;
    background: var(--twilight-teal);
    border-radius: 0 50% 50% 0 / 0 50% 50% 0;
    clip-path: ellipse(55vw 30vh at 0% 50%);
}

.shield-text {
    padding-right: 8vw;
    max-width: 35vw;
    z-index: 3;
    text-align: right;
}

.question {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    color: var(--deep-indigo);
    line-height: 1.5;
}

/* === Panel 3: The Collision === */
.panel-3 {
    background: linear-gradient(to right, var(--parchment-cream), var(--soft-slate));
}

.panel-3 .panel-content {
    flex-direction: column;
}

.collision-center {
    position: relative;
    width: 300px;
    height: 300px;
}

.collision-spear {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 60px solid transparent;
    border-bottom: 60px solid transparent;
    border-left: 140px solid var(--dusk-violet);
}

.collision-shield {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 140px;
    background: var(--twilight-teal);
    border-radius: 50% 0 0 50% / 50% 0 0 50%;
}

.ripple-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.ripple {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 1px solid var(--dusk-violet);
    animation: ripple-expand 3s ease-out infinite;
    pointer-events: none;
}

.ripple-1 { border-color: var(--dusk-violet); animation-delay: 0s; }
.ripple-2 { border-color: var(--twilight-teal); animation-delay: 0.5s; }
.ripple-3 { border-color: var(--aurora-mint); animation-delay: 1s; }
.ripple-4 { border-color: var(--dusk-violet); animation-delay: 1.5s; }
.ripple-5 { border-color: var(--twilight-teal); animation-delay: 2s; }
.ripple-6 { border-color: var(--aurora-mint); animation-delay: 2.5s; }

@keyframes ripple-expand {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(4); opacity: 0; }
}

.collision-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--deep-indigo);
    margin-top: 3rem;
    text-align: center;
}

/* === Panel 4: Aurora of Contradictions === */
.panel-4 {
    background: var(--deep-indigo);
}

.aurora-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.aurora-curtain {
    position: absolute;
    border-radius: 50% / 80%;
    filter: blur(40px);
    will-change: transform, opacity;
    mix-blend-mode: screen;
}

.aurora-curtain-1 {
    width: 200px;
    height: 80vh;
    left: 15%;
    top: 5%;
    background: linear-gradient(to top, transparent, #6B4C8A44, #3A8C8244, #7ECBB844, transparent);
    animation: aurora-drift-1 22s ease-in-out infinite alternate;
}

.aurora-curtain-2 {
    width: 250px;
    height: 75vh;
    left: 40%;
    top: 10%;
    background: linear-gradient(to top, transparent, #3A8C8244, #7ECBB844, #6B4C8A44, transparent);
    animation: aurora-drift-2 28s ease-in-out infinite alternate;
}

.aurora-curtain-3 {
    width: 180px;
    height: 85vh;
    left: 65%;
    top: 2%;
    background: linear-gradient(to top, transparent, #7ECBB844, #6B4C8A44, #3A8C8244, transparent);
    animation: aurora-drift-3 25s ease-in-out infinite alternate;
}

.aurora-curtain-4 {
    width: 220px;
    height: 70vh;
    left: 82%;
    top: 8%;
    background: linear-gradient(to top, transparent, #6B4C8A44, #D4A54A33, #7ECBB844, transparent);
    animation: aurora-drift-4 20s ease-in-out infinite alternate;
}

@keyframes aurora-drift-1 {
    0% { transform: translateX(0) translateY(0); opacity: 0.6; }
    100% { transform: translateX(60px) translateY(-30px); opacity: 0.9; }
}

@keyframes aurora-drift-2 {
    0% { transform: translateX(0) translateY(0); opacity: 0.5; }
    100% { transform: translateX(-80px) translateY(20px); opacity: 0.8; }
}

@keyframes aurora-drift-3 {
    0% { transform: translateX(0) translateY(0); opacity: 0.7; }
    100% { transform: translateX(40px) translateY(-40px); opacity: 0.5; }
}

@keyframes aurora-drift-4 {
    0% { transform: translateX(0) translateY(0); opacity: 0.4; }
    100% { transform: translateX(-50px) translateY(30px); opacity: 0.7; }
}

.cards-container {
    flex-wrap: wrap;
    gap: 2rem;
    padding: 4rem;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.contradiction-card {
    width: clamp(200px, 25vw, 280px);
    padding: 2rem;
    background: var(--parchment-cream);
    border: 1px solid var(--aurora-mint);
    border-radius: 4px;
    text-align: center;
    transition: transform 0.5s ease;
}

.contradiction-card:hover {
    border-color: var(--warm-amber);
}

.card-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    height: 60px;
    transition: transform 0.5s ease;
}

.contradiction-card:hover .card-icons {
    transform: scaleX(-1);
}

.card-vs {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted-plum);
}

.card-label {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--deep-indigo);
}

/* Contradiction Icons */
.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dusk-violet);
}

.icon-square {
    width: 36px;
    height: 36px;
    background: var(--twilight-teal);
}

.icon-triangle-up {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 36px solid var(--dusk-violet);
}

.icon-triangle-down {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 36px solid var(--twilight-teal);
}

.icon-solid {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--dusk-violet);
}

.icon-outlined {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--dusk-violet);
    background: transparent;
}

.icon-large {
    width: 44px;
    height: 44px;
    background: var(--twilight-teal);
    border-radius: 4px;
}

.icon-small {
    width: 20px;
    height: 20px;
    background: var(--twilight-teal);
    border-radius: 4px;
}

/* Amber sparks */
.spark {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--warm-amber);
    z-index: 3;
    animation: spark-glow 3s ease-in-out infinite alternate;
}

.spark-1 { top: 20%; left: 30%; animation-delay: 0s; }
.spark-2 { top: 60%; left: 70%; animation-delay: 1s; }
.spark-3 { top: 40%; left: 50%; animation-delay: 2s; }

@keyframes spark-glow {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.8); }
}

/* === Panel 5: Resolution === */
.panel-5 {
    background: var(--parchment-cream);
}

.panel-5 .panel-content {
    flex-direction: column;
}

.resolution-circle {
    position: relative;
    width: clamp(200px, 30vw, 350px);
    height: clamp(200px, 30vw, 350px);
    border-radius: 50%;
    background: var(--soft-slate);
    overflow: hidden;
    cursor: pointer;
}

.resolution-spear {
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 40px solid transparent;
    border-bottom: 40px solid transparent;
    border-left: 100px solid var(--dusk-violet);
}

.resolution-shield {
    position: absolute;
    top: 50%;
    right: 10%;
    transform: translateY(-50%);
    width: 80px;
    height: 90px;
    background: var(--twilight-teal);
    border-radius: 50% 0 0 50% / 50% 0 0 50%;
}

.resolution-shimmer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, #6B4C8A22, #3A8C8222, #7ECBB822, transparent);
    animation: shimmer-rotate 12s linear infinite;
}

@keyframes shimmer-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.resolution-ripples {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.ripple-slow {
    animation-duration: 5s;
}

.resolution-text {
    font-family: 'Noto Serif JP', serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--deep-indigo);
    margin-top: 3rem;
    text-align: center;
}

/* === Navigation Dots === */
#panel-nav {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    z-index: 100;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--dusk-violet);
    background: transparent;
    cursor: pointer;
    transition: all 0.4s ease;
    padding: 0;
}

.nav-dot.active {
    background: var(--dusk-violet);
}

/* Adjust dot colors on dark panel */
.panel-4-active .nav-dot {
    border-color: var(--aurora-mint);
}

.panel-4-active .nav-dot.active {
    background: var(--aurora-mint);
    border-color: var(--aurora-mint);
}

/* === Progress Bar === */
#progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 100;
    background: rgba(0,0,0,0.05);
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--dusk-violet), var(--twilight-teal), var(--aurora-mint));
    transition: width 0.1s linear;
}

/* === Leaves === */
.leaf {
    position: absolute;
    width: 40px;
    height: 60px;
    border-radius: 0 50% 0 50%;
    pointer-events: none;
    z-index: 1;
}

.leaf-1 {
    bottom: 10%;
    right: 5%;
    background: var(--dusk-violet);
    opacity: 0.15;
    transform: rotate(30deg);
}

.leaf-2 {
    top: 8%;
    left: 3%;
    background: var(--twilight-teal);
    opacity: 0.1;
    transform: rotate(-45deg);
}

.leaf-3 {
    bottom: 15%;
    right: 8%;
    background: var(--dusk-violet);
    opacity: 0.12;
    transform: rotate(60deg);
}

.leaf-4 {
    top: 12%;
    right: 6%;
    background: var(--twilight-teal);
    opacity: 0.1;
    transform: rotate(-20deg);
}

.leaf-5 {
    bottom: 8%;
    left: 4%;
    background: var(--dusk-violet);
    opacity: 0.15;
    transform: rotate(45deg);
}

/* === Wind Lines === */
.wind-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.wind-line {
    fill: none;
    stroke: var(--muted-plum);
    stroke-width: 1;
    opacity: 0.2;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: wind-blow 15s linear infinite;
}

@keyframes wind-blow {
    0% { stroke-dashoffset: 2000; }
    100% { stroke-dashoffset: 0; }
}

/* === Responsive: Vertical on mobile === */
@media (max-width: 768px) {
    html, body {
        overflow: auto;
    }

    #scroll-container {
        flex-direction: column;
        width: 100%;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
    }

    .panel {
        flex: 0 0 auto;
        width: 100vw;
        min-height: 100vh;
        height: auto;
        scroll-snap-align: start;
    }

    .spear-shape {
        border-top: 20vh solid transparent;
        border-bottom: 20vh solid transparent;
        border-left: 50vw solid var(--dusk-violet);
    }

    .shield-text {
        max-width: 60vw;
        padding-right: 4vw;
    }

    .cards-container {
        padding: 2rem;
    }

    #panel-nav {
        bottom: 16px;
    }
}
