/* judge.club — brutalist tribunal */
/* Palette:
   #1a1a2e  Deep Midnight  (bg primary)
   #0a0a14  Void Black     (bg deep)
   #3a3a42  Concrete Grey  (surface)
   #e8e4d0  Parchment      (text)
   #00ff88  Phosphor Green (accent primary)
   #ff6b35  Hazard Orange  (accent secondary)
   #c4b5fd  Lavender       (accent tertiary)
   #4a4a5a  Muted Steel    (rules)
*/

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

html {
    scroll-behavior: smooth;
    background: #1a1a2e;
}

body {
    font-family: "Source Serif 4", Georgia, serif;
    background: #1a1a2e;
    color: #e8e4d0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1, "liga" 1;
    line-height: 1.7;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.08;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
}

.noise-svg {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ============================ */
/* Typography Base              */
/* ============================ */
h1, h2, h3, h4 {
    font-family: "Archivo Black", "Archivo", Impact, sans-serif;
    font-weight: 400;
    line-height: 1.0;
    letter-spacing: -0.03em;
}

.section-number,
.section-label,
.meta-item,
.menu-list a,
.principle,
.card-index,
.card-word,
.blob-text,
.seal-footer span {
    font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    text-transform: uppercase;
}

/* ============================ */
/* Rules (horizontal lines)    */
/* ============================ */
.rule {
    border: 0;
    height: 1px;
    background: #4a4a5a;
    margin: 0;
}

.rule--full {
    width: 100%;
}

.rule--partial {
    width: 40%;
    margin: 2.5rem 0;
}

.rule--docket {
    width: 0;
    background: #00ff88;
    height: 1px;
    margin-bottom: 2rem;
    transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 12px #00ff8840;
}

.rule--docket.draw {
    width: 60%;
}

/* ============================ */
/* Menu Indicator              */
/* ============================ */
.menu-indicator {
    position: fixed;
    top: 32px;
    right: 32px;
    z-index: 100;
    width: 32px;
    height: 32px;
    transition: width 300ms cubic-bezier(0.22, 1, 0.36, 1),
                height 300ms cubic-bezier(0.22, 1, 0.36, 1),
                background 300ms ease;
    border: 2px solid #00ff88;
    background: rgba(10, 10, 20, 0.0);
    cursor: pointer;
    overflow: hidden;
}

.menu-square {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.menu-list {
    list-style: none;
    padding: 16px 20px;
    margin: 0;
    display: none;
    flex-direction: column;
    gap: 10px;
}

.menu-list a {
    color: #e8e4d0;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.2em;
    transition: color 180ms ease;
    display: block;
    white-space: nowrap;
}

.menu-list a:hover {
    color: #00ff88;
}

.menu-indicator:hover,
.menu-indicator.open {
    width: 220px;
    height: auto;
    min-height: 200px;
    background: rgba(10, 10, 20, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.menu-indicator:hover .menu-list,
.menu-indicator.open .menu-list {
    display: flex;
}

.menu-indicator:hover .menu-square,
.menu-indicator.open .menu-square {
    display: none;
}

/* ============================ */
/* Section base                */
/* ============================ */
.section {
    position: relative;
    width: 100%;
}

/* ============================ */
/* 1. THE DOCKET               */
/* ============================ */
.section--docket {
    min-height: 100vh;
    background: #0a0a14;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 80px;
    overflow: hidden;
}

.mesh {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.mesh--docket .mesh-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 800ms ease-out;
}

.mesh--docket.reveal .mesh-layer--green {
    opacity: 1;
    transition-delay: 300ms;
}

.mesh--docket.reveal .mesh-layer--orange {
    opacity: 1;
    transition-delay: 500ms;
}

.mesh--docket.reveal .mesh-layer--lavender {
    opacity: 1;
    transition-delay: 700ms;
}

.mesh--docket.reveal .mesh-layer--base {
    opacity: 1;
    transition-delay: 100ms;
}

.mesh-layer--base {
    background:
        conic-gradient(from 180deg at 60% 40%, #1a1a2e 0deg, #0a0a14 120deg, #1a1a2e 240deg, #0a0a14 360deg);
    animation: drift-base 28s ease-in-out infinite alternate;
}

.mesh-layer--green {
    background: radial-gradient(ellipse at 20% 30%, #00ff8844 0%, transparent 55%);
    animation: drift-green 18s ease-in-out infinite alternate;
}

.mesh-layer--orange {
    background: radial-gradient(ellipse at 80% 70%, #ff6b3544 0%, transparent 52%);
    animation: drift-orange 22s ease-in-out infinite alternate;
}

.mesh-layer--lavender {
    background: radial-gradient(ellipse at 50% 50%, #c4b5fd33 0%, transparent 60%);
    animation: drift-lavender 20s ease-in-out infinite alternate;
}

@keyframes drift-green {
    0%   { background-position: 0% 0%; transform: translate(0,0); }
    100% { transform: translate(6%, 4%); }
}
@keyframes drift-orange {
    0%   { transform: translate(0,0); }
    100% { transform: translate(-5%, -6%); }
}
@keyframes drift-lavender {
    0%   { transform: translate(0,0); }
    100% { transform: translate(4%, -3%); }
}
@keyframes drift-base {
    0%   { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.05) rotate(4deg); }
}

.docket-content {
    position: relative;
    z-index: 2;
    max-width: 100%;
}

.docket-title {
    font-size: clamp(4rem, 10vw, 9rem);
    color: #e8e4d0;
    letter-spacing: -0.03em;
    line-height: 1.0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1) 400ms,
                transform 600ms cubic-bezier(0.22, 1, 0.36, 1) 400ms;
}

.docket-title.reveal {
    opacity: 1;
    transform: translateY(0);
}

.docket-meta {
    position: absolute;
    top: 80px;
    left: 80px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 0.3em;
    color: #00ff88;
    opacity: 0;
    transition: opacity 800ms ease 1200ms;
}

.section--docket.reveal .docket-meta {
    opacity: 0.85;
}

.meta-item {
    display: block;
}

.meta-item::before {
    content: "▸ ";
    color: #ff6b35;
}

/* ============================ */
/* 2. THE BRIEF                */
/* ============================ */
.section--brief {
    background: #1a1a2e;
    min-height: 100vh;
    padding: 6rem 80px 8rem;
    position: relative;
}

.brief-header,
.evidence-header {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin: 2.5rem 0 4rem;
    font-size: 12px;
    letter-spacing: 0.3em;
    color: #4a4a5a;
}

.section-number {
    font-family: "Archivo Black", sans-serif;
    font-size: 14px;
    letter-spacing: 0.1em;
    color: #e8e4d0;
}

.section-label {
    color: #e8e4d0;
    opacity: 0.7;
}

.brief-grid {
    display: grid;
    grid-template-columns: 30% 1fr;
    gap: 10%;
    max-width: 1400px;
    margin: 0 auto;
}

.brief-sidebar {
    position: relative;
    min-height: 500px;
}

.principles {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.4em;
    transform: rotate(-90deg);
    transform-origin: top left;
    position: absolute;
    top: 0;
    left: 24px;
    white-space: nowrap;
    width: max-content;
}

.principle {
    font-size: 13px;
    letter-spacing: 0.3em;
    color: #4a4a5a;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 500ms ease,
                transform 500ms cubic-bezier(0.22, 1, 0.36, 1),
                color 250ms ease;
    display: inline-block;
    padding: 6px 0;
    border-top: 1px solid #3a3a42;
    padding-top: 10px;
    letter-spacing: 0.3em;
}

.principle.reveal {
    opacity: 1;
    transform: translateX(0);
}

.principle:hover {
    color: #00ff88;
}

.brief-body {
    max-width: 580px;
    color: #e8e4d0;
    font-size: 20px;
    line-height: 1.7;
    font-weight: 300;
}

.brief-para {
    margin-bottom: 1.8em;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.brief-para.reveal {
    opacity: 1;
    transform: translateY(0);
}

.brief-body .rule--partial {
    background: #4a4a5a;
}

/* ============================ */
/* 3. THE EVIDENCE CHAMBER     */
/* ============================ */
.section--evidence {
    background: #1a1a2e;
    padding: 4rem 80px 8rem;
    position: relative;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    background: #4a4a5a;
    border: 1px solid #4a4a5a;
    max-width: 1400px;
    margin: 0 auto;
    perspective: 1200px;
}

.card {
    aspect-ratio: 3 / 4;
    position: relative;
    cursor: pointer;
    background: #1a1a2e;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.card.reveal {
    opacity: 1;
    transform: scale(1);
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 300ms ease;
}

.card:hover .card-inner,
.card.flipped .card-inner {
    transform: rotateY(180deg) scale(1.02);
    box-shadow: 6px 0 0 #0a0a14, -6px 0 0 #0a0a14;
}

.card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-face--front {
    background: #3a3a42;
    flex-direction: column;
    gap: 18px;
}

.scale-icon {
    width: 56px;
    height: 56px;
    opacity: 0.85;
}

.card-index {
    font-size: 11px;
    letter-spacing: 0.35em;
    color: #4a4a5a;
    position: absolute;
    top: 16px;
    left: 16px;
}

.card-face--front::after {
    content: "";
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 18px;
    height: 18px;
    border: 1px solid #4a4a5a;
    opacity: 0.6;
}

.card-face--back {
    transform: rotateY(180deg);
    background: #0a0a14;
    color: #e8e4d0;
}

.card-face--back::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.95;
}

.card-back--green::before {
    background:
        radial-gradient(ellipse at 25% 30%, #00ff8866 0%, transparent 55%),
        radial-gradient(ellipse at 75% 70%, #1a1a2e 0%, transparent 60%),
        conic-gradient(from 180deg at 60% 40%, #1a1a2e, #0a0a14, #1a1a2e);
}

.card-back--orange::before {
    background:
        radial-gradient(ellipse at 30% 70%, #ff6b3566 0%, transparent 55%),
        radial-gradient(ellipse at 70% 30%, #c4b5fd33 0%, transparent 55%),
        conic-gradient(from 0deg at 50% 50%, #1a1a2e, #0a0a14, #1a1a2e);
}

.card-back--lavender::before {
    background:
        radial-gradient(ellipse at 50% 40%, #c4b5fd66 0%, transparent 55%),
        radial-gradient(ellipse at 20% 80%, #00ff8844 0%, transparent 55%),
        conic-gradient(from 90deg at 40% 60%, #1a1a2e, #0a0a14, #1a1a2e);
}

.card-back--orange-green::before {
    background:
        radial-gradient(ellipse at 20% 20%, #ff6b3566 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, #00ff8855 0%, transparent 50%),
        conic-gradient(from 135deg at 50% 50%, #1a1a2e, #0a0a14, #1a1a2e);
}

.card-back--green-lavender::before {
    background:
        radial-gradient(ellipse at 70% 30%, #00ff8866 0%, transparent 55%),
        radial-gradient(ellipse at 30% 70%, #c4b5fd66 0%, transparent 55%),
        conic-gradient(from 45deg at 50% 50%, #1a1a2e, #0a0a14, #1a1a2e);
}

.card-back--full-mesh::before {
    background:
        radial-gradient(ellipse at 20% 30%, #00ff8866 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, #ff6b3566 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, #c4b5fd55 0%, transparent 55%),
        conic-gradient(from 180deg at 60% 40%, #1a1a2e, #0a0a14, #1a1a2e);
}

.card-word {
    position: relative;
    z-index: 1;
    font-family: "Archivo Black", sans-serif;
    font-weight: 400;
    font-size: clamp(1.3rem, 2.6vw, 2.4rem);
    letter-spacing: -0.02em;
    color: #e8e4d0;
    text-shadow: 0 2px 14px rgba(0,0,0,0.5);
    transform: translateY(12px);
    opacity: 0;
    transition: opacity 350ms ease 250ms, transform 350ms cubic-bezier(0.22, 1, 0.36, 1) 250ms;
}

.card:hover .card-word,
.card.flipped .card-word {
    opacity: 1;
    transform: translateY(0);
}

/* ============================ */
/* 4. THE DELIBERATION         */
/* ============================ */
.section--deliberation {
    min-height: 100vh;
    background: #0a0a14;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px;
    position: relative;
}

.section--deliberation::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 50%, #00ff8810 0%, transparent 60%);
    pointer-events: none;
}

.deliberation-inner {
    max-width: 700px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.deliberation-text {
    font-family: "Source Serif 4", Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    line-height: 1.5;
    color: #00ff88;
    text-shadow: 0 0 20px #00ff8840;
    letter-spacing: 0.01em;
}

.deliberation-text .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 300ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
    margin-right: 0.25em;
}

.deliberation-text .word.reveal {
    opacity: 1;
    transform: translateY(0);
}

/* ============================ */
/* 5. THE SEAL                 */
/* ============================ */
.section--seal {
    min-height: 100vh;
    background: #0a0a14;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 80px;
}

.blob {
    width: min(60vw, 60vh);
    height: min(60vw, 60vh);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: blob-morph 20s ease-in-out infinite;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(0, 255, 136, 0.15);
}

.blob-mesh {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 30%, #ff6b35cc 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, #00ff88cc 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, #c4b5fdaa 0%, transparent 55%),
        conic-gradient(from 180deg at 60% 40%, #1a1a2e, #0a0a14, #1a1a2e, #0a0a14);
    animation: mesh-spin 28s linear infinite;
}

.blob-text {
    position: relative;
    z-index: 2;
    font-family: "Archivo", sans-serif;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0.4em;
    color: #e8e4d0;
    mix-blend-mode: difference;
    text-transform: lowercase;
}

@keyframes blob-morph {
    0%   { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25%  { border-radius: 58% 42% 48% 52% / 62% 35% 65% 38%; }
    50%  { border-radius: 40% 60% 35% 65% / 55% 45% 55% 45%; }
    75%  { border-radius: 65% 35% 55% 45% / 40% 60% 45% 55%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

@keyframes mesh-spin {
    0%   { transform: rotate(0deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1.2); }
}

.seal-footer {
    position: absolute;
    left: 80px;
    right: 80px;
    bottom: 40px;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    letter-spacing: 0.35em;
    color: #4a4a5a;
}

/* ============================ */
/* Responsive                  */
/* ============================ */
@media (max-width: 960px) {
    .section--docket { padding: 40px; }
    .section--brief { padding: 4rem 40px 6rem; }
    .section--evidence { padding: 3rem 40px 6rem; }
    .section--seal { padding: 40px; }
    .docket-meta { top: 40px; left: 40px; }
    .seal-footer { left: 40px; right: 40px; }

    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .brief-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .brief-sidebar {
        min-height: auto;
    }
    .principles {
        transform: none;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        width: 100%;
        white-space: normal;
    }
    .principle {
        border-top: none;
        border-left: 1px solid #3a3a42;
        padding: 2px 10px;
    }
    .menu-indicator {
        top: 16px;
        right: 16px;
    }
    .section--docket { padding: 24px; }
    .section--brief { padding: 3rem 24px 4rem; }
    .section--evidence { padding: 2rem 24px 4rem; }
    .section--seal { padding: 24px; }
    .docket-meta { top: 24px; left: 24px; font-size: 10px; }
    .seal-footer { left: 24px; right: 24px; font-size: 10px; flex-direction: column; gap: 6px; }
}

@media (max-width: 520px) {
    .cards {
        grid-template-columns: 1fr;
    }
    .docket-title {
        font-size: clamp(3rem, 16vw, 5rem);
    }
    .brief-body {
        font-size: 17px;
    }
}

/* ============================ */
/* Reduced motion              */
/* ============================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .mesh-layer,
    .rule--docket,
    .docket-title,
    .principle,
    .brief-para,
    .card,
    .deliberation-text .word {
        opacity: 1 !important;
        transform: none !important;
    }
}
