/* ========================================
   judge.club - Vintage Judicial Broadsheet
   Watercolor Wash Aesthetic
   ======================================== */

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

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: #f5ead6;
    color: #1a1218;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    line-height: 1.75;
}

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

/* ========================================
   ACT I - OPENING STATEMENT
   ======================================== */

.act-opening {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f5ead6;
    background-image:
        repeating-conic-gradient(#6b5b4e 0% 25%, transparent 0% 50%) 0 0 / 3px 3px;
    background-blend-mode: overlay;
    overflow: hidden;
}

.act-opening::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-conic-gradient(#1a1218 0% 25%, transparent 0% 50%) 0 0 / 2px 2px;
    opacity: 0.04;
    pointer-events: none;
}

.wash-hero {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.wash-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.gavel-container {
    position: relative;
    z-index: 5;
    margin-bottom: -40px;
    opacity: 0;
    transform: translateY(-80px) rotate(-15deg);
    animation: gavelStrike 2.5s ease-out 0.3s forwards;
}

@keyframes gavelStrike {
    0% {
        opacity: 0;
        transform: translateY(-80px) rotate(-15deg);
    }
    40% {
        opacity: 1;
        transform: translateY(-80px) rotate(-15deg);
    }
    65% {
        transform: translateY(0) rotate(0deg);
    }
    72% {
        transform: translateY(-5px) rotate(1deg);
    }
    80% {
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

.gavel-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, #a8201a 0%, transparent 70%);
    opacity: 0;
    transform: translate(-50%, -50%);
    z-index: 3;
    pointer-events: none;
    animation: rippleExpand 2s ease-out 2s forwards;
}

@keyframes rippleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.3;
    }
    100% {
        width: 300vh;
        height: 300vh;
        opacity: 0;
    }
}

.hero-title {
    position: relative;
    z-index: 10;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(4rem, 12vw, 14rem);
    letter-spacing: -0.04em;
    line-height: 0.85;
    color: #1a1218;
    text-shadow: 4px 4px 0 #c9952d;
    text-align: center;
    opacity: 0;
    animation: titleReveal 1s ease-out 1.8s forwards;
}

@keyframes titleReveal {
    0% { opacity: 0; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.hero-subtitle {
    position: relative;
    z-index: 10;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: #6b5b4e;
    margin-top: 1.5rem;
    opacity: 0;
    animation: subtitleFade 0.8s ease-out 2.8s forwards;
}

@keyframes subtitleFade {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 0;
    animation: scrollIndicatorFade 0.6s ease-out 3.5s forwards;
}

.scroll-indicator svg {
    animation: scrollBob 2s ease-in-out infinite;
}

@keyframes scrollBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

@keyframes scrollIndicatorFade {
    0% { opacity: 0; }
    100% { opacity: 0.7; }
}

/* ========================================
   ACT II - TESTIMONY
   ======================================== */

.act-testimony {
    position: relative;
    width: 100vw;
    padding: 8vh 0;
    background-color: #f5ead6;
    background-image:
        repeating-conic-gradient(#6b5b4e 0% 25%, transparent 0% 50%) 0 0 / 3px 3px;
    background-blend-mode: overlay;
}

.act-testimony::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-conic-gradient(#1a1218 0% 25%, transparent 0% 50%) 0 0 / 2px 2px;
    opacity: 0.03;
    pointer-events: none;
}

/* Scales - sticky floating */
.scales-container {
    position: sticky;
    top: 50vh;
    float: right;
    margin-right: 5vw;
    z-index: 20;
    mix-blend-mode: multiply;
    transform: translateY(-50%);
}

#scales-beam {
    transform-origin: 0 5px;
    animation: scalesSwing 4s ease-in-out infinite;
}

@keyframes scalesSwing {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

/* Collage clusters */
.collage-cluster {
    position: relative;
    width: 60vw;
    height: 35vh;
    margin: 6vh auto;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.collage-cluster.visible {
    opacity: 1;
}

.cluster-1 { margin-left: 5vw; transform: rotate(-1deg); }
.cluster-2 { margin-left: 30vw; transform: rotate(2deg); }
.cluster-3 { margin-left: 10vw; transform: rotate(-2deg); }
.cluster-4 { margin-left: 35vw; transform: rotate(1deg); }
.cluster-5 { margin-left: 8vw; transform: rotate(2deg); }
.cluster-6 { margin-left: 25vw; transform: rotate(-1deg); }

.collage-wash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.collage-wash svg {
    width: 100%;
    height: 100%;
}

.collage-ink {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 70%;
    height: 70%;
    z-index: 12;
    opacity: 0;
    transform: translateY(30px) rotate(1deg);
    transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
}

.collage-ink svg {
    width: 100%;
    height: 100%;
}

.collage-stamp {
    position: absolute;
    z-index: 22;
    opacity: 0;
    transform: translateY(30px) rotate(-3deg);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.cluster-1 .collage-stamp { top: 10%; right: 10%; }
.cluster-2 .collage-stamp { bottom: 15%; left: 5%; }
.cluster-3 .collage-stamp { top: 5%; left: 15%; }
.cluster-4 .collage-stamp { bottom: 20%; right: 8%; }
.cluster-5 .collage-stamp { top: 15%; right: 5%; }
.cluster-6 .collage-stamp { bottom: 10%; left: 10%; }

.stamp-text {
    font-family: 'Special Elite', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a8201a;
    border: 2px solid #a8201a;
    padding: 0.25em 0.6em;
    display: inline-block;
    transform: rotate(-2deg);
    mix-blend-mode: multiply;
    opacity: 0.85;
}

.collage-scrap {
    position: absolute;
    width: 80px;
    height: 50px;
    background: #f5ead6;
    border: 1px solid rgba(107, 91, 78, 0.2);
    z-index: 8;
    opacity: 0;
    transform: translateY(30px) rotate(4deg);
    transition: opacity 0.6s ease 0.15s, transform 0.6s ease 0.15s;
    clip-path: polygon(2% 0%, 98% 3%, 100% 97%, 3% 100%);
    box-shadow: 2px 3px 8px rgba(26, 18, 24, 0.1);
}

.cluster-1 .collage-scrap { bottom: 10%; left: 20%; transform: rotate(4deg); }
.cluster-2 .collage-scrap { top: 20%; right: 15%; transform: rotate(-3deg); }
.cluster-3 .collage-scrap { bottom: 5%; right: 10%; transform: rotate(2deg); }
.cluster-4 .collage-scrap { top: 10%; left: 30%; transform: rotate(-5deg); }
.cluster-5 .collage-scrap { bottom: 15%; left: 25%; transform: rotate(3deg); }
.cluster-6 .collage-scrap { top: 15%; right: 20%; transform: rotate(-2deg); }

.scrap-extra {
    width: 60px;
    height: 40px;
    bottom: 25%;
    right: 5%;
    transform: rotate(6deg);
}

/* Visible state for collage children */
.collage-cluster.visible .collage-wash,
.collage-cluster.visible .collage-ink,
.collage-cluster.visible .collage-stamp,
.collage-cluster.visible .collage-scrap {
    opacity: 1;
    transform: translateY(0) rotate(var(--target-rotate, 0deg));
}

/* Testimony text passages */
.testimony-text {
    position: relative;
    z-index: 15;
    max-width: 38em;
    padding: 2rem 3vw;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.testimony-text.visible {
    opacity: 1;
    transform: translateY(0) rotate(var(--text-rotate, 0deg));
}

.testimony-text p {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    line-height: 1.75;
    color: #1a1218;
}

.text-left { margin-left: 10vw; --text-rotate: 0.5deg; }
.text-center { margin: 0 auto; --text-rotate: -0.3deg; }
.text-right { margin-left: auto; margin-right: 10vw; --text-rotate: 1deg; }
.text-left-wide { margin-left: 15vw; --text-rotate: -0.5deg; }
.text-center-wide { margin: 0 auto; max-width: 42em; --text-rotate: 0.2deg; }

/* Quill dividers */
.quill-divider {
    width: 80%;
    max-width: 600px;
    margin: 4vh auto;
    height: 60px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.quill-divider.visible {
    opacity: 1;
}

.quill-divider svg {
    width: 100%;
    height: 100%;
}

.quill-stroke {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1.5s ease;
}

.quill-divider.visible .quill-stroke {
    stroke-dashoffset: 0;
}

/* ========================================
   ACT III - DELIBERATION
   ======================================== */

.act-deliberation {
    position: relative;
    width: 100vw;
    min-height: 140vh;
    padding: 15vh 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    overflow: hidden;
}

.deliberation-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, #f5ead6, #2b2d5b);
    z-index: 0;
    pointer-events: none;
}

.ink-blot-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.ink-blot-svg {
    width: 100%;
    height: 100%;
}

.ink-blot-shape {
    transition: rx 1.8s ease-out, ry 1.8s ease-out;
}

.ink-blot-container.active .ink-blot-shape {
    rx: 500;
    ry: 400;
}

.arch-frame {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    max-width: 800px;
    height: 200px;
    z-index: 2;
    pointer-events: none;
}

.arch-inner {
    width: 100%;
    height: 100%;
    border-radius: 50% 50% 0 0;
    background: linear-gradient(to bottom, rgba(201, 149, 45, 0.15), transparent);
    border: 2px solid rgba(201, 149, 45, 0.2);
    border-bottom: none;
}

.deliberation-statement {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 8vh 5vw;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease, transform 1.2s ease, letter-spacing 1.2s ease;
}

.deliberation-statement.visible {
    opacity: 1;
    transform: translateY(0);
}

.statement-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 8rem);
    line-height: 0.9;
    letter-spacing: 0.1em;
    color: #f5ead6;
    transition: letter-spacing 1.2s ease;
}

.deliberation-statement.visible .statement-text {
    letter-spacing: -0.04em;
}

.quill-gold {
    z-index: 5;
}

/* ========================================
   ACT IV - THE VERDICT
   ======================================== */

.act-verdict {
    position: relative;
    width: 100vw;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #1a1218;
    overflow: hidden;
    padding: 10vh 0 15vh;
}

.verdict-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(5rem, 14vw, 14rem);
    letter-spacing: -0.04em;
    line-height: 0.85;
    color: #a8201a;
    text-align: center;
    opacity: 0;
    transform: scale(1.4);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.verdict-title.visible {
    opacity: 1;
    transform: scale(1);
    text-shadow: 0 0 40px rgba(217, 79, 48, 0.5), 2px 2px 0 #d94f30;
}

.verdict-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #c9952d;
    margin-top: 2rem;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease 1s, transform 0.8s ease 1s;
}

.verdict-title.visible ~ .verdict-subtitle {
    opacity: 1;
    transform: translateY(0);
}

/* Wax Seal */
.wax-seal {
    margin-top: 6vh;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1s ease 1.5s, transform 1s ease 1.5s;
}

.verdict-title.visible ~ .wax-seal {
    opacity: 1;
    transform: scale(1);
}

.seal-outer {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #c94a3a, #a8201a 40%, #6b2015 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(168, 32, 26, 0.3);
}

.seal-inner {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid rgba(245, 234, 214, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Drip effects */
.drip-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    pointer-events: none;
    z-index: 1;
}

.drip {
    position: absolute;
    bottom: 100%;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 0px solid #1a1218;
}

.drip-1 { left: 12%; border-left-width: 10px; border-right-width: 6px; border-top-width: 45px; border-top-color: #2b2d5b; }
.drip-2 { left: 28%; border-left-width: 5px; border-right-width: 8px; border-top-width: 60px; border-top-color: #2b2d5b; }
.drip-3 { left: 55%; border-left-width: 7px; border-right-width: 9px; border-top-width: 35px; border-top-color: #1a1218; }
.drip-4 { left: 72%; border-left-width: 6px; border-right-width: 5px; border-top-width: 55px; border-top-color: #2b2d5b; }
.drip-5 { left: 88%; border-left-width: 8px; border-right-width: 7px; border-top-width: 40px; border-top-color: #1a1218; }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .collage-cluster {
        width: 85vw;
        margin-left: 5vw !important;
    }

    .testimony-text {
        margin-left: 5vw !important;
        margin-right: 5vw !important;
        padding: 1.5rem 4vw;
    }

    .scales-container {
        opacity: 0.4;
        margin-right: 2vw;
    }

    .arch-frame {
        width: 95vw;
    }

    .stamp-text {
        font-size: 0.7rem;
    }
}
