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

html {
    overflow-x: hidden;
}

body {
    background: #1a1e24;
    color: #e8eaee;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
}

/* Ripple overlay */
.ripple-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

.ripple-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(180, 190, 200, 0.3);
    pointer-events: none;
    animation: rippleExpand 1.5s ease-out forwards;
}

@keyframes rippleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.6;
        border-width: 2px;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
        border-width: 0.5px;
    }
}

/* Caustic light patterns */
.caustic-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.caustic {
    position: absolute;
    border-radius: 50%;
    background: rgba(200, 220, 240, 0.05);
    filter: blur(40px);
}

.c1 {
    width: 300px;
    height: 300px;
    top: 20%;
    left: 30%;
    animation: causticDrift 12s ease-in-out infinite alternate;
}

.c2 {
    width: 200px;
    height: 200px;
    top: 60%;
    left: 60%;
    animation: causticDrift 15s ease-in-out 3s infinite alternate;
}

.c3 {
    width: 250px;
    height: 250px;
    top: 40%;
    left: 10%;
    animation: causticDrift 18s ease-in-out 6s infinite alternate;
}

.c4 {
    width: 180px;
    height: 180px;
    top: 70%;
    left: 45%;
    animation: causticDrift 10s ease-in-out 9s infinite alternate;
}

@keyframes causticDrift {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.2); }
    100% { transform: translate(-20px, 30px) scale(0.9); }
}

/* Submerged columns (Layer 3) */
.columns-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    filter: blur(3px);
    opacity: 0.4;
}

.column {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100vh;
    background: rgba(140, 160, 175, 0.06);
}

/* Bubbles */
.bubbles-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.bubble {
    position: absolute;
    bottom: -30px;
    left: var(--x);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    border: 1px solid rgba(200, 210, 220, 0.3);
    background: rgba(200, 210, 220, 0.05);
    animation: bubbleRise var(--dur) ease-in-out var(--delay) infinite;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    50% {
        transform: translateY(-50vh) translateX(10px);
    }
    90% {
        opacity: 0.3;
    }
    95% {
        transform: translateY(-100vh) translateX(-5px) scale(1.3);
        opacity: 0;
    }
    100% {
        transform: translateY(-100vh) translateX(0);
        opacity: 0;
    }
}

/* Floating evidence cards */
.evidence-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    filter: blur(1px);
    opacity: 0.85;
}

.evidence-card {
    position: absolute;
    padding: 8px 12px;
    background: rgba(200, 210, 220, 0.06);
    border-radius: 8px;
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: rgba(140, 160, 175, 0.6);
    animation: evidenceDrift var(--dur) ease-in-out infinite alternate;
}

@keyframes evidenceDrift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(var(--drift-x), var(--drift-y)); }
}

/* Depth indicator */
.depth-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.depth-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: rgba(140, 160, 175, 0.4);
    letter-spacing: 0.1em;
}

.depth-bar {
    width: 2px;
    height: 60px;
    background: rgba(140, 160, 175, 0.15);
    position: relative;
    border-radius: 1px;
}

.depth-marker {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6a7a8a;
    transition: top 0.1s linear;
}

/* Descent (Cover) Section */
.descent-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.descent-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: #e8eaee;
    animation: floatText 4s ease-in-out infinite, fadeInDown 1.2s ease-out 0.8s both;
}

.descent-japanese {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #a0aab4;
    margin-top: 12px;
    animation: fadeInDown 1s ease-out 1.5s both;
}

.descent-subtitle {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    color: rgba(140, 160, 175, 0.6);
    margin-top: 20px;
    letter-spacing: 0.08em;
    animation: fadeInDown 1s ease-out 2.2s both;
}

@keyframes floatText {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Panel Sections */
.panel-section {
    position: relative;
    padding: 100px 0;
    z-index: 10;
}

.evidence-chamber {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

/* Content Panels */
.content-panel {
    position: relative;
    padding: 40px;
    background: rgba(200, 210, 220, 0.08);
    -webkit-mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent),
                        linear-gradient(to bottom, transparent, black 20px, black calc(100% - 20px), transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent),
                linear-gradient(to bottom, transparent, black 20px, black calc(100% - 20px), transparent);
    mask-composite: intersect;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Layer depth effects */
.content-panel[data-layer="2"] {
    filter: blur(1px);
    opacity: 0;
}

.content-panel[data-layer="2"].visible {
    opacity: 0.85;
}

/* Panel positioning */
.panel-left {
    margin-left: 8vw;
    width: 55vw;
}

.panel-right {
    margin-left: 35vw;
    width: 50vw;
}

.panel-center {
    margin-left: 20vw;
    width: 45vw;
}

.panel-left-narrow {
    margin-left: 5vw;
    width: 50vw;
}

.panel-wide {
    margin-left: 10vw;
    width: 70vw;
}

.panel-code {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    color: rgba(140, 160, 175, 0.6);
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.panel-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: #e8eaee;
    margin-bottom: 20px;
    line-height: 1.2;
}

.panel-body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    color: #a0aab4;
    line-height: 1.8;
    max-width: 600px;
}

.panel-maxim {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.1rem;
    color: #f0f2f6;
    margin-top: 24px;
    padding-left: 16px;
    border-left: 2px solid #6a7a8a;
}

/* Verdict Section */
.verdict-section {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    position: relative;
    z-index: 10;
}

.verdict-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #e8eaee;
    line-height: 2;
    opacity: 0;
    transition: opacity 1s ease;
}

.verdict-text.visible {
    opacity: 1;
}

.verdict-kanji {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #6a7a8a;
    margin-top: 30px;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
}

.verdict-text.visible ~ .verdict-kanji {
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .panel-left,
    .panel-right,
    .panel-center,
    .panel-left-narrow,
    .panel-wide {
        margin-left: 5vw;
        width: 90vw;
    }

    .content-panel {
        padding: 24px 16px;
    }

    .evidence-layer {
        display: none;
    }
}
