/* courthouse.app - Muji-inspired courthouse design */
/* Colors: #2D2D2D, #6B6560, #8B7355, #3D2C4E, #FFF8F0, #A8E6CF, #C9B1FF, #FFE156, #FF6B6B */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    color: #FFF8F0;
    background: #3D2C4E;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Panel Sections */
.panel {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.section-1 {
    background: #3D2C4E;
    clip-path: polygon(0 0, 100% 0, 100% 87%, 0 100%);
    z-index: 4;
}

.section-2 {
    background: #2D2D2D;
    clip-path: polygon(0 0, 100% 8%, 100% 87%, 0 100%);
    margin-top: -8vh;
    z-index: 3;
    padding-top: 8vh;
}

.section-3 {
    background: #3D2C4E;
    clip-path: polygon(0 0, 100% 8%, 100% 92%, 0 100%);
    margin-top: -8vh;
    z-index: 2;
    padding-top: 8vh;
}

.section-4 {
    background: #2D2D2D;
    clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 100%);
    margin-top: -8vh;
    z-index: 1;
    padding-top: 8vh;
}

.panel-content {
    position: relative;
    width: 100%;
    max-width: 1100px;
    padding: 60px 40px;
    z-index: 2;
}

/* Section 1: The Threshold */
.threshold-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 80vh;
    padding-left: 10vw;
}

.domain-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: clamp(32px, 5vw, 80px);
    letter-spacing: 0.02em;
    color: #FFF8F0;
    line-height: 1.1;
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

.domain-dot {
    color: #A8E6CF;
}

.threshold-subtitle {
    font-weight: 300;
    font-size: clamp(14px, 2vw, 22px);
    color: #C9B1FF;
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

.scroll-indicator {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: #6B6560;
    animation: pulse 2.5s ease-in-out infinite;
    opacity: 0;
    animation: fadeInUp 1s ease-out 1s forwards, pulse 2.5s ease-in-out 2s infinite;
}

.scroll-arrow {
    display: block;
}

/* Section 2: The Chamber */
.chamber-content {
    display: flex;
    align-items: center;
    gap: 80px;
    min-height: 70vh;
}

.chamber-text {
    flex: 1;
    max-width: 600px;
}

.section-heading {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: clamp(24px, 3.5vw, 56px);
    letter-spacing: 0.02em;
    color: #FFE156;
    margin-bottom: 24px;
}

.section-body {
    font-weight: 300;
    font-size: clamp(14px, 1.5vw, 18px);
    line-height: 1.8;
    color: #FFF8F0;
    opacity: 0.9;
}

.horizontal-rule {
    width: 60px;
    height: 2px;
    background: #A8E6CF;
    margin: 28px 0;
    opacity: 0.6;
}

.section-body-secondary {
    font-weight: 400;
    font-size: clamp(12px, 1.2vw, 16px);
    line-height: 1.7;
    color: #8B7355;
    font-style: italic;
}

/* Section 3: The Record */
.record-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    gap: 60px;
}

.record-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    width: 100%;
}

.record-card {
    background: rgba(255, 248, 240, 0.04);
    border: 1px solid rgba(201, 177, 255, 0.12);
    border-radius: 8px;
    padding: 36px 28px;
    transition: transform 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

.record-card:hover {
    transform: translateY(-4px);
    border-color: rgba(201, 177, 255, 0.3);
    background: rgba(255, 248, 240, 0.07);
}

.card-icon {
    margin-bottom: 20px;
    opacity: 0.85;
}

.card-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 20px;
    letter-spacing: 0.02em;
    color: #FFF8F0;
    margin-bottom: 12px;
}

.card-desc {
    font-weight: 300;
    font-size: 14px;
    line-height: 1.7;
    color: #6B6560;
}

/* Section 4: The Seal */
.seal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    gap: 40px;
}

.seal-emblem {
    opacity: 0.8;
    animation: slowRotate 60s linear infinite;
}

.seal-heading {
    color: #C9B1FF;
}

.seal-body {
    max-width: 500px;
    margin: 0 auto;
}

.seal-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
    padding-top: 20px;
}

.footer-text {
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: #6B6560;
    text-transform: uppercase;
}

.footer-separator {
    color: #6B6560;
    font-size: 16px;
}

/* Candle System */
.candle-cluster {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.cluster-threshold {
    position: absolute;
    right: 15vw;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    animation: fadeInUp 1.2s ease-out 0.8s forwards;
}

.cluster-chamber {
    flex-shrink: 0;
}

.cluster-record {
    align-self: flex-end;
}

.candle {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.candle-body {
    border-radius: 3px 3px 2px 2px;
}

.candle-tall .candle-body {
    width: 18px;
    height: 100px;
}

.candle-medium .candle-body {
    width: 16px;
    height: 70px;
}

.candle-short .candle-body {
    width: 14px;
    height: 45px;
}

.candle-tiny .candle-body {
    width: 10px;
    height: 30px;
}

.flame {
    width: 10px;
    height: 16px;
    background: radial-gradient(ellipse at 50% 80%, #FFE156 0%, #FF6B6B 60%, transparent 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    margin-bottom: 2px;
    animation: flicker 3s ease-in-out infinite alternate;
    transform-origin: center bottom;
}

.flame-small {
    width: 7px;
    height: 11px;
    animation-duration: 4s;
}

.flame-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.flame-small .flame-glow {
    width: 36px;
    height: 36px;
}

.candle-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    justify-content: center;
}

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.8; transform: translateX(-50%) translateY(6px); }
}

@keyframes flicker {
    0% { transform: rotate(-3deg) scale(0.95); }
    25% { transform: rotate(2deg) scale(1.02); }
    50% { transform: rotate(-1deg) scale(1.05); }
    75% { transform: rotate(3deg) scale(0.97); }
    100% { transform: rotate(-2deg) scale(1.0); }
}

@keyframes slowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .panel-content {
        padding: 40px 24px;
    }

    .threshold-content {
        padding-left: 24px;
        align-items: center;
        text-align: center;
    }

    .cluster-threshold {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin-bottom: 32px;
        justify-content: center;
    }

    .chamber-content {
        flex-direction: column;
        gap: 40px;
    }

    .record-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .seal-emblem svg {
        width: 150px;
        height: 150px;
    }
}
