/* ========================================
   courthouse.app -- Holographic Monochrome
   ======================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: #0A0A0A;
    /* Deliberately #000 avoided -- near-black #0A0A0A preferred */
    color-scheme: dark;
}

body {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    color: #B0B0B0;
    background-color: #0A0A0A;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Typography
   ======================================== */

.logotype {
    font-family: 'EB Garamond', serif;
    font-weight: 700;
    font-size: 96px;
    letter-spacing: 0.15em;
    color: #E8E8E8;
    line-height: 1.1;
}

.logotype .highlight {
    color: #FFFFFF;
}

h2.heading-stack {
    font-family: 'EB Garamond', serif;
    font-weight: 600;
    font-size: 48px;
    letter-spacing: 0.08em;
    color: #E8E8E8;
    line-height: 1.3;
    margin-bottom: 16px;
}

.thesis-statement {
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 24px;
    color: #B0B0B0;
    line-height: 1.6;
    max-width: 580px;
}

.body-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    color: #B0B0B0;
    max-width: 680px;
    margin-bottom: 32px;
}

.body-text:last-child {
    margin-bottom: 0;
}

.timestamp-motif {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-variant: small-caps;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: #4A4A4A;
    text-transform: uppercase;
}

.verdict-statement {
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    font-size: 36px;
    color: #E8E8E8;
    line-height: 1.5;
    max-width: 600px;
}

.verdict-statement .highlight {
    color: #FFFFFF;
}

/* ========================================
   Layout: Zones
   ======================================== */

.zone {
    min-height: 100vh;
    position: relative;
    padding: 120px;
    display: flex;
    align-items: stretch;
}

.zone-well {
    min-height: 150vh;
    background-color: #121212;
}

.zone-content {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
}

/* Z-pattern anchors */
.z-top-left {
    align-self: flex-start;
}

.z-bottom-right {
    align-self: flex-end;
    margin-top: auto;
}

/* Section headings vertical stack */
.section-headings {
    display: flex;
    flex-direction: column;
}

/* Body text block */
.body-text-block {
    max-width: 680px;
}

/* ========================================
   Fade-Reveal Animation
   ======================================== */

.fade-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.fade-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for children */
.section-headings .heading-stack:nth-child(1) { transition-delay: 0ms; }
.section-headings .heading-stack:nth-child(2) { transition-delay: 120ms; }
.section-headings .heading-stack:nth-child(3) { transition-delay: 240ms; }

.body-text-block .body-text:nth-child(1) { transition-delay: 0ms; }
.body-text-block .body-text:nth-child(2) { transition-delay: 120ms; }
.body-text-block .body-text:nth-child(3) { transition-delay: 240ms; }
.body-text-block .body-text:nth-child(4) { transition-delay: 360ms; }

/* ========================================
   Holographic Shift Animation
   ======================================== */

@keyframes holographic-shift {
    0%   { stroke: #D4D4E8; }
    33%  { stroke: #E8D4D4; }
    66%  { stroke: #D4E8E0; }
    100% { stroke: #D4D4E8; }
}

@keyframes holographic-shift-color {
    0%   { color: #D4D4E8; }
    33%  { color: #E8D4D4; }
    66%  { color: #D4E8E0; }
    100% { color: #D4D4E8; }
}

@keyframes holographic-shift-bg {
    0%   { background-color: #D4D4E8; }
    33%  { background-color: #E8D4D4; }
    66%  { background-color: #D4E8E0; }
    100% { background-color: #D4D4E8; }
}

/* ========================================
   Geometric Polygon Clusters
   ======================================== */

.polygon-cluster {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.polygon-cluster-1 {
    top: 10%;
    right: 5%;
    width: 500px;
    height: 500px;
    opacity: 0.6;
}

.polygon-cluster-2 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    opacity: 0.5;
}

.polygon-cluster-3 {
    top: 20%;
    left: 10%;
    width: 400px;
    height: 400px;
    opacity: 0.5;
}

.polygon-svg {
    width: 100%;
    height: 100%;
}

.geo-polygon {
    fill: none;
    stroke: #2A2A2A;
    stroke-width: 1;
    mix-blend-mode: screen;
    transition: stroke 2.4s ease-in-out;
}

.geo-polygon.holographic-active {
    animation: holographic-shift 8s linear infinite;
}

/* ========================================
   Prismatic Edge Lines
   ======================================== */

.prismatic-line {
    position: relative;
    z-index: 3;
}

.prismatic-horizontal {
    height: 2px;
    margin: 0 120px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        #D4D4E8 15%,
        #E8D4D4 50%,
        #D4E8E0 85%,
        transparent 100%
    );
    opacity: 0.4;
}

.prismatic-diagonal {
    position: absolute;
    top: 50%;
    left: 15%;
    right: 15%;
    height: 2px;
    border-top: 1px solid #1A1A1A;
    background: linear-gradient(
        90deg,
        transparent 0%,
        #D4D4E8 20%,
        #E8D4D4 50%,
        #D4E8E0 80%,
        transparent 100%
    );
    opacity: 0.25;
    transform: rotate(-8deg);
    z-index: 1;
}

/* ========================================
   Candle Flame
   ======================================== */

.candle-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 120px;
    z-index: 2;
}

.candle-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at 50% 50%, rgba(245,240,232,0.04) 0%, transparent 60%);
    pointer-events: none;
}

.candle-flame {
    width: 80px;
    height: 120px;
    position: relative;
    z-index: 2;
}

@keyframes flicker {
    0%, 100% { transform: translateY(0px) scaleX(1); }
    25%      { transform: translateY(-1px) scaleX(0.97); }
    50%      { transform: translateY(1px) scaleX(1.02); }
    75%      { transform: translateY(-2px) scaleX(0.98); }
}

@keyframes flicker-glow {
    0%, 100% { opacity: 0.04; }
    50%      { opacity: 0.07; }
}

.flame-outer {
    fill: #C0C0C0;
    opacity: 0.45;
    animation: flicker 4s ease-in-out infinite;
}

.flame-middle {
    fill: #E0E0E0;
    opacity: 0.65;
    animation: flicker 3s ease-in-out infinite 0.5s;
}

.flame-inner {
    fill: #F5F0E8;
    opacity: 0.85;
    animation: flicker 2s ease-in-out infinite 1s;
}

.candle-glow {
    animation: flicker-glow 4s ease-in-out infinite;
}

/* ========================================
   Scroll Progress Indicator
   ======================================== */

#scroll-indicator {
    position: fixed;
    top: 0;
    right: 24px;
    width: 1px;
    height: 100vh;
    z-index: 100;
}

#scroll-track {
    position: relative;
    width: 1px;
    height: 100%;
    background-color: #2A2A2A;
}

#scroll-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 0%;
    background-color: #FFFFFF;
    transition: height 100ms linear;
}

.scroll-diamond {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: #2A2A2A;
    transform: translateX(-1.5px) rotate(45deg);
    transition: background-color 300ms ease;
}

.scroll-diamond[data-zone="1"] { top: 28.5%; }
.scroll-diamond[data-zone="2"] { top: 64.3%; }
.scroll-diamond[data-zone="3"] { top: 100%; transform: translateX(-1.5px) translateY(-4px) rotate(45deg); }

.scroll-diamond.active {
    background-color: #FFFFFF;
}

/* ========================================
   Responsive: Tablet
   ======================================== */

@media (max-width: 1200px) {
    .zone {
        padding: 60px;
    }

    .logotype {
        font-size: 64px;
    }

    h2.heading-stack {
        font-size: 36px;
    }

    .thesis-statement {
        font-size: 20px;
    }

    .verdict-statement {
        font-size: 28px;
    }

    .prismatic-horizontal {
        margin: 0 60px;
    }

    .polygon-cluster {
        transform: scale(0.6);
    }

    .polygon-cluster-2 {
        transform: translate(-50%, -50%) scale(0.6);
    }
}

/* ========================================
   Responsive: Mobile
   ======================================== */

@media (max-width: 768px) {
    .zone {
        padding: 24px;
        min-height: 100vh;
    }

    .zone-well {
        min-height: 100vh;
    }

    .zone-content {
        align-items: center;
        text-align: center;
    }

    .z-top-left {
        align-self: center;
    }

    .z-bottom-right {
        align-self: center;
    }

    .logotype {
        font-size: 40px;
        letter-spacing: 0.1em;
    }

    h2.heading-stack {
        font-size: 28px;
        letter-spacing: 0.04em;
    }

    .thesis-statement {
        font-size: 18px;
        max-width: 100%;
    }

    .body-text {
        font-size: 16px;
        max-width: 100%;
    }

    .verdict-statement {
        font-size: 24px;
        max-width: 100%;
    }

    .prismatic-horizontal {
        margin: 0 24px;
    }

    .polygon-cluster {
        display: none;
    }

    .candle-container {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 40px auto;
    }

    .candle-glow {
        width: 200px;
        height: 200px;
    }

    #scroll-indicator {
        right: 8px;
    }

    .prismatic-diagonal {
        display: none;
    }
}

/* ========================================
   Selection styling
   ======================================== */

::selection {
    background: #D4D4E8;
    color: #0A0A0A;
}
