/* ============================================================
   toron.day - Dialectical Split-Screen Debate
   Colors: #000000, #1A1A2E, #A8DADC, #F4A261, #1D3557, #E63946, #F1FAEE
   Fonts: Bebas Neue, Source Serif 4, IBM Plex Mono
   ============================================================ */

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

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

body {
    font-family: 'Source Serif 4', Georgia, serif;
    background: #000000;
    color: #F1FAEE;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h2 {
    font-family: 'Bebas Neue', Impact, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.05;
}

.round-title {
    font-size: clamp(2rem, 6vw, 6rem);
    margin-bottom: 1.5rem;
}

.body-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.65;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.citation {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-top: 1.5rem;
}

.citation-ref {
    color: #F4A261;
}

/* --- Round Navigation Pill --- */
#round-pill {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1A1A2E;
    border: 1px solid #F4A261;
    padding: 0.6rem 1.2rem;
    border-radius: 2px;
    z-index: 1000;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #F4A261;
    transition: background 0.3s ease, transform 0.2s ease;
}

#round-pill:hover {
    background: #F4A261;
    color: #1A1A2E;
    transform: scale(1.05);
}

#round-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: #F4A261;
    transition: width 0.3s ease;
    width: 0%;
}

/* --- Round Overlay --- */
#round-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.4s ease;
}

#round-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#overlay-inner {
    position: relative;
    width: 90%;
    max-width: 500px;
}

#overlay-close {
    position: absolute;
    top: -3rem;
    right: 0;
    background: none;
    border: none;
    color: #F1FAEE;
    font-size: 2rem;
    cursor: pointer;
    font-family: 'Bebas Neue', Impact, sans-serif;
    transition: color 0.2s ease;
}

#overlay-close:hover {
    color: #F4A261;
}

#round-list {
    list-style: none;
}

#round-list li {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
    letter-spacing: 0.04em;
    color: #A8DADC;
    padding: 0.8rem 0;
    cursor: pointer;
    border-bottom: 1px solid rgba(168, 218, 220, 0.1);
    transition: color 0.2s ease, padding-left 0.3s ease;
}

#round-list li:hover {
    color: #F4A261;
    padding-left: 1rem;
}

#round-list li.active {
    color: #F4A261;
}

.round-num {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: #F4A261;
    margin-right: 1rem;
    vertical-align: middle;
}

/* --- Sections / Rounds --- */
.round {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* --- ROUND 0: The Chamber --- */
#round-0 {
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chamber-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

#toron-text {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: clamp(6rem, 20vw, 20rem);
    line-height: 1;
    letter-spacing: 0.04em;
    color: #F1FAEE;
    display: flex;
    justify-content: center;
    gap: 0;
}

.toron-char {
    display: inline-block;
    opacity: 0;
    transition: opacity 1s ease, transform 2s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 1.5s ease;
}

.toron-char.visible {
    opacity: 1;
}

#char-to.split {
    transform: translateX(-15vw);
    color: #1D3557;
}

#char-ron.split {
    transform: translateX(15vw);
    color: #E63946;
}

#chamber-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #A8DADC;
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 1s ease 2.5s;
}

#chamber-subtitle.visible {
    opacity: 1;
}

.chamber-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    opacity: 0;
    transition: opacity 1.5s ease 1.8s;
}

.chamber-bg.visible {
    opacity: 1;
}

#chamber-bg-left {
    left: 0;
    background: #1D3557;
}

#chamber-bg-right {
    right: 0;
    background: #E63946;
}

/* --- Split Rounds --- */
.split-round {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.split-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.split-50-50 .position-a { flex: 0 0 calc(50% - 2px); }
.split-50-50 .position-b { flex: 0 0 calc(50% - 2px); }

.split-60-40 .position-a { flex: 0 0 calc(60% - 2px); }
.split-60-40 .position-b { flex: 0 0 calc(40% - 2px); }

.split-40-60 .position-a { flex: 0 0 calc(40% - 2px); }
.split-40-60 .position-b { flex: 0 0 calc(60% - 2px); }

/* --- Position A (Cerulean / Left) --- */
.position-a {
    background: #1D3557;
    color: #A8DADC;
    padding: clamp(2rem, 5vw, 6rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.position-a .round-title {
    color: #F1FAEE;
}

.position-a .body-text {
    color: #A8DADC;
}

/* --- Position B (Crimson / Right) --- */
.position-b {
    background: #E63946;
    color: #F1FAEE;
    padding: clamp(2rem, 5vw, 6rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-align: right;
}

.position-b .round-title {
    color: #F1FAEE;
}

.position-b .body-text {
    color: rgba(241, 250, 238, 0.9);
}

.position-b .position-content {
    text-align: right;
}

/* --- Divider Line --- */
.divider-line {
    width: 4px;
    background: #E63946;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(230, 57, 70, 0.4);
    animation: divider-pulse 3s ease-in-out infinite;
}

@keyframes divider-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(230, 57, 70, 0.4); }
    50% { box-shadow: 0 0 16px rgba(230, 57, 70, 0.7); }
}

/* --- Quotation Mark Watermarks --- */
.quote-watermark {
    position: absolute;
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: clamp(15rem, 40vw, 40rem);
    line-height: 0.7;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
    top: 50%;
    transform: translateY(-50%);
}

.position-a .quote-watermark {
    color: #E63946;
    left: -5%;
}

.position-b .quote-watermark {
    color: #1D3557;
    right: -5%;
}

.quote-full-opacity {
    opacity: 0.15;
}

/* --- Typewriter Effect --- */
.typewriter .tw-char {
    opacity: 0;
    transform: translateY(4px);
    display: inline-block;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.typewriter .tw-char.tw-space {
    width: 0.3em;
}

.typewriter .tw-char.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Stats / Counters --- */
.stats-row {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.position-b .stats-row {
    justify-content: flex-end;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.position-b .stat-item {
    align-items: flex-end;
}

.stat-number {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1;
    color: #F1FAEE;
}

.stat-unit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.5rem;
    font-weight: 500;
    color: #F4A261;
    display: inline;
    margin-left: 0.2rem;
    vertical-align: super;
}

.stat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.7;
    max-width: 180px;
}

/* --- Counter Badge --- */
.counter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #F4A261;
    color: #1A1A2E;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* --- Gavel Icon --- */
.gavel-icon {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    color: #F4A261;
    z-index: 20;
    transition: transform 0.6s ease-in-out;
}

.gavel-icon.gavel-animate {
    animation: gavel-rock 0.6s ease-in-out;
}

.gavel-pronounced.gavel-animate {
    animation: gavel-rock-big 0.8s ease-in-out;
}

@keyframes gavel-rock {
    0% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-50%) rotate(-5deg); }
    75% { transform: translateX(-50%) rotate(5deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}

@keyframes gavel-rock-big {
    0% { transform: translateX(-50%) rotate(0deg); }
    20% { transform: translateX(-50%) rotate(-8deg); }
    40% { transform: translateX(-50%) rotate(8deg); }
    60% { transform: translateX(-50%) rotate(-5deg); }
    80% { transform: translateX(-50%) rotate(5deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}

/* --- Portrait Silhouettes --- */
.portrait-silhouette {
    width: 120px;
    height: 160px;
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

.silhouette-a {
    background: #1D3557;
}

.silhouette-a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 45% at 50% 30%, #A8DADC 0%, #1D3557 70%);
    filter: grayscale(100%) contrast(200%);
    mix-blend-mode: multiply;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.silhouette-a.duotone-active::before {
    opacity: 1;
}

.silhouette-b {
    background: #E63946;
    margin-left: auto;
}

.silhouette-b::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 45% at 50% 30%, #F1FAEE 0%, #E63946 70%);
    filter: grayscale(100%) contrast(200%);
    mix-blend-mode: multiply;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.silhouette-b.duotone-active::before {
    opacity: 1;
}

/* Silhouette SVG shapes inside the boxes */
.portrait-silhouette::after {
    content: '';
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.silhouette-a::after {
    background: #A8DADC;
    box-shadow: 0 60px 0 30px #A8DADC;
}

.silhouette-b::after {
    background: #F1FAEE;
    box-shadow: 0 60px 0 30px #F1FAEE;
}

/* --- ROUND 5: The Verdict --- */
#round-5 {
    background: #F1FAEE;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#verdict-amber-fill {
    position: absolute;
    inset: 0;
    background: #F4A261;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
}

#verdict-amber-fill.expand {
    transform: scaleX(1);
}

#verdict-amber-fill.fade {
    opacity: 0;
    transition: opacity 1s ease;
}

#verdict-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 1.5s, transform 1s ease 1.5s;
}

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

#verdict-title {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: clamp(4rem, 12vw, 14rem);
    letter-spacing: 0.04em;
    color: #1A1A2E;
    line-height: 1;
    margin-bottom: 1.5rem;
}

#verdict-subtitle {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 1.5vw, 1.35rem);
    line-height: 1.65;
    color: #1A1A2E;
    margin-bottom: 2rem;
    opacity: 0.8;
}

#verdict-cta {
    margin-bottom: 2rem;
}

#verdict-engage {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #1A1A2E;
    border: 2px solid #1A1A2E;
    padding: 0.8rem 2rem;
    display: inline-block;
    transition: background 0.3s ease, color 0.3s ease;
    cursor: pointer;
    border-radius: 2px;
}

#verdict-engage:hover {
    background: #1A1A2E;
    color: #F1FAEE;
}

#verdict-badge {
    margin: 0 auto;
}

/* --- Round Transition Divider Animation --- */
.round-transition-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 0;
    background: #E63946;
    z-index: 30;
    transition: height 0.5s ease;
}

/* --- Rebuttal Flash Effect (Round 3) --- */
#round-3 .split-container {
    transition: none;
}

#round-3.flash-invert .position-a {
    background: #E63946;
}

#round-3.flash-invert .position-b {
    background: #1D3557;
}

#round-3 .position-a,
#round-3 .position-b {
    transition: background 0.3s ease;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .split-container {
        flex-direction: column;
    }

    .split-50-50 .position-a,
    .split-50-50 .position-b,
    .split-60-40 .position-a,
    .split-60-40 .position-b,
    .split-40-60 .position-a,
    .split-40-60 .position-b {
        flex: none;
        width: 100%;
        min-height: 50vh;
    }

    .divider-line {
        width: 100%;
        height: 4px;
    }

    .position-b,
    .position-b .position-content {
        text-align: left;
    }

    .position-b .stats-row {
        justify-content: flex-start;
    }

    .position-b .stat-item {
        align-items: flex-start;
    }

    .position-b .portrait-silhouette {
        margin-left: 0;
    }

    #toron-text {
        font-size: clamp(4rem, 15vw, 10rem);
    }

    #char-to.split {
        transform: translateX(-8vw);
    }

    #char-ron.split {
        transform: translateX(8vw);
    }

    .quote-watermark {
        font-size: clamp(8rem, 30vw, 20rem);
    }

    .stats-row {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }

    .gavel-icon {
        bottom: 1rem;
    }

    #round-pill {
        bottom: 1rem;
        right: 1rem;
    }
}

/* --- Scroll-triggered fade-in for positions --- */
.position-a,
.position-b {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease, background 0.3s ease;
}

.position-a.in-view,
.position-b.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* --- Selection styles --- */
::selection {
    background: #F4A261;
    color: #1A1A2E;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

::-webkit-scrollbar-thumb {
    background: #E63946;
}

::-webkit-scrollbar-thumb:hover {
    background: #F4A261;
}
