/* ============================================================
   judge.bar v2 -- Tribunal of the Reef
   Aesthetic: flat-design + serif-revival + tropical-fish
   Layout: masonry, gradient hero, ripple micro-interactions
   ============================================================ */

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

html { scroll-behavior: smooth; }

body {
    font-family: "Lora", Georgia, serif;
    font-weight: 400;
    color: #16323a;
    background: #fff4e0;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Palette as custom properties ---------- */
:root {
    --lagoon-teal: #1d8c8c;
    --lagoon-teal-mid: #3eb7a9;
    --sunlit-cyan: #7dd9c8;
    --coral-verdict: #ff6b5b;
    --coral-light: #ffc9c2;
    --mango-buoy: #ffb13d;
    --soft-sand: #fff4e0;
    --reef-pink: #ffc9c2;
    --deep-ink: #16323a;
    --slate-mist: #5f7a82;
    --lemon-wedge: #f7e26b;

    --gutter: 16px;
    --section-pad: clamp(96px, 14vh, 180px);
    --side-pad: clamp(20px, 5vw, 96px);
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* =================================================================
   SECTION 1: HERO
   ================================================================= */

.hero {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    isolation: isolate;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: linear-gradient(135deg,
        var(--lagoon-teal) 0%,
        var(--lagoon-teal-mid) 30%,
        var(--sunlit-cyan) 65%,
        var(--mango-buoy) 100%);
}

/* Subtle caustic dot drift */
.hero-caustics {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.18) 0, rgba(255,255,255,0) 3px),
                      radial-gradient(circle at 80% 60%, rgba(255,255,255,0.15) 0, rgba(255,255,255,0) 3px),
                      radial-gradient(circle at 60% 20%, rgba(255,255,255,0.12) 0, rgba(255,255,255,0) 2px),
                      radial-gradient(circle at 30% 80%, rgba(255,255,255,0.14) 0, rgba(255,255,255,0) 2px);
    background-size: 280px 280px, 240px 240px, 200px 200px, 320px 320px;
    animation: causticsDrift 30s linear infinite;
    opacity: 0.7;
    pointer-events: none;
}

@keyframes causticsDrift {
    from { background-position: 0 0, 0 0, 0 0, 0 0; }
    to { background-position: 280px 280px, -240px 240px, 200px -200px, -320px -320px; }
}

.hero-inner {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 var(--side-pad);
    max-width: 1400px;
    margin: 0 auto;
}

.hero-eyebrow {
    font-family: "JetBrains Mono", monospace;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--deep-ink);
    margin-bottom: 24px;
    opacity: 0;
    animation: heroFadeIn 700ms ease-out 200ms forwards;
}

.hero-logotype {
    font-family: "DM Serif Display", Georgia, serif;
    font-weight: 400;
    font-size: clamp(48px, 9vw, 144px);
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--coral-verdict);
    margin-bottom: 24px;
    text-shadow: 0 0 0 transparent;
}

.hero-logotype .char,
.hero-logotype .char-dot {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    animation: charReveal 500ms cubic-bezier(.2,.8,.2,1) forwards;
}

.hero-logotype .char-dot { color: var(--mango-buoy); }

.hero-logotype .char:nth-child(1)  { animation-delay: 350ms; }
.hero-logotype .char:nth-child(2)  { animation-delay: 400ms; }
.hero-logotype .char:nth-child(3)  { animation-delay: 450ms; }
.hero-logotype .char:nth-child(4)  { animation-delay: 500ms; }
.hero-logotype .char:nth-child(5)  { animation-delay: 550ms; }
.hero-logotype .char-dot           { animation-delay: 600ms; }
.hero-logotype .char:nth-child(7)  { animation-delay: 650ms; }
.hero-logotype .char:nth-child(8)  { animation-delay: 700ms; }
.hero-logotype .char:nth-child(9)  { animation-delay: 750ms; }

@keyframes charReveal {
    to { opacity: 1; transform: translateY(0); }
}

.hero-tagline {
    font-family: "Lora", Georgia, serif;
    font-style: italic;
    font-size: clamp(16px, 1.6vw, 22px);
    color: var(--deep-ink);
    max-width: 540px;
    opacity: 0;
    animation: heroFadeIn 700ms ease-out 1000ms forwards;
}

@keyframes heroFadeIn {
    to { opacity: 1; }
}

/* The Parrotfish */
.hero-fish {
    position: absolute;
    top: 38%;
    right: 6vw;
    width: clamp(180px, 24vw, 360px);
    height: auto;
    transform: rotate(-3deg);
    transform-origin: 60% 50%;
    transition: transform 400ms cubic-bezier(.34,1.56,.64,1);
    opacity: 0;
    animation: heroFadeIn 800ms ease-out 800ms forwards;
    pointer-events: none;
    filter: drop-shadow(0 0 0 transparent); /* keep flat */
    z-index: 1;
}

.hero-scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollPulse 1.6s ease-in-out infinite;
    opacity: 0;
    animation: heroFadeIn 700ms ease-out 1300ms forwards, scrollPulse 1.6s ease-in-out infinite 1300ms;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(4px); }
}

/* =================================================================
   SHARED SECTION HEAD
   ================================================================= */

.section-head {
    padding: var(--section-pad) var(--side-pad) 56px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-eyebrow {
    font-family: "JetBrains Mono", monospace;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--coral-verdict);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.section-title {
    font-family: "DM Serif Display", Georgia, serif;
    font-weight: 400;
    font-size: clamp(36px, 5.5vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.015em;
    color: var(--deep-ink);
    margin-bottom: 20px;
    max-width: 14ch;
}

.section-lede {
    font-family: "Lora", Georgia, serif;
    font-style: italic;
    font-size: clamp(15px, 1.5vw, 19px);
    color: var(--slate-mist);
    max-width: 60ch;
}

/* =================================================================
   SECTION 2: VERDICTS WALL (MASONRY)
   ================================================================= */

.verdicts {
    position: relative;
    background: var(--soft-sand);
    padding-bottom: var(--section-pad);
    overflow: hidden;
    isolation: isolate;
}

/* Caustic light grid overlay */
.verdicts::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: radial-gradient(circle, rgba(125,217,200,0.18) 1.5px, transparent 1.5px);
    background-size: 28px 28px;
    background-position: 0 0;
    animation: causticsDrift 40s linear infinite;
    opacity: 0.5;
    pointer-events: none;
}

.masonry {
    position: relative;
    z-index: 1;
    column-count: 4;
    column-gap: var(--gutter);
    padding: 0 var(--side-pad);
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1100px) { .masonry { column-count: 3; } }
@media (max-width: 800px)  { .masonry { column-count: 2; } }
@media (max-width: 540px)  { .masonry { column-count: 1; } }

.tile {
    display: block;
    break-inside: avoid;
    margin-bottom: var(--gutter);
    padding: 28px 26px 24px;
    border-radius: 6px;
    position: relative;
    transition: transform 420ms cubic-bezier(.34,1.56,.64,1);
    opacity: 0;
    transform: translateY(12px);
    overflow: hidden;
}

.tile.in-view {
    opacity: 1;
    transform: translateY(0);
}

.tile:hover {
    transform: translateY(-4px);
}

.tile:hover .tile-icon {
    transform: rotate(-12deg) scale(1.05);
}

.tile:hover .tile-title::after {
    transform: scaleX(1);
}

.tile-1x1 { min-height: 220px; }
.tile-1x2 { min-height: 380px; }
.tile-2x1 { min-height: 220px; }
.tile-2x2 { min-height: 420px; }

/* Tile color classes (flat, no shadows) */
.tile-coral       { background: var(--coral-verdict);     color: var(--soft-sand); }
.tile-coral-light { background: var(--coral-light);       color: var(--deep-ink); }
.tile-sand        { background: var(--soft-sand);         color: var(--deep-ink); border: 2px solid var(--deep-ink); }
.tile-pink        { background: var(--reef-pink);         color: var(--deep-ink); }
.tile-mango       { background: var(--mango-buoy);        color: var(--deep-ink); }
.tile-cyan        { background: var(--sunlit-cyan);       color: var(--deep-ink); }
.tile-lemon       { background: var(--lemon-wedge);       color: var(--deep-ink); }

.tile-coral .case-number,
.tile-coral .verdict-mark { color: var(--soft-sand); }

.case-number {
    display: inline-block;
    font-family: "JetBrains Mono", monospace;
    font-weight: 500;
    font-size: 10.5px;
    letter-spacing: 0.16em;
    margin-bottom: 14px;
    opacity: 0.8;
    text-transform: uppercase;
    transform: translateX(20px);
    opacity: 0;
    transition: transform 500ms ease-out, opacity 500ms ease-out;
    transition-delay: 220ms;
}

.tile.in-view .case-number {
    transform: translateX(0);
    opacity: 0.85;
}

.tile-title {
    font-family: "DM Serif Display", Georgia, serif;
    font-weight: 400;
    font-size: clamp(20px, 2.1vw, 28px);
    line-height: 1.12;
    letter-spacing: -0.01em;
    margin-bottom: 14px;
    position: relative;
    display: inline-block;
}

.tile-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 360ms cubic-bezier(.2,.8,.2,1);
    opacity: 0.5;
}

.tile-body {
    font-size: 15px;
    line-height: 1.62;
    margin-bottom: 18px;
    opacity: 0.88;
}

.verdict-mark {
    font-family: "Lora", Georgia, serif;
    font-style: italic;
    font-size: 13px;
    letter-spacing: 0.02em;
    display: block;
    margin-top: auto;
}

.verdict-mark strong {
    font-style: normal;
    font-weight: 600;
}

.tile-icon {
    position: absolute;
    bottom: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    transform: rotate(0deg);
    transition: transform 360ms cubic-bezier(.34,1.56,.64,1);
    opacity: 0;
    transform-origin: 50% 50%;
}

.tile.in-view .tile-icon {
    opacity: 1;
    animation: iconSpin 520ms cubic-bezier(.34,1.56,.64,1) 240ms forwards;
}

@keyframes iconSpin {
    0% { opacity: 0; transform: rotate(-30deg) scale(0.8); }
    60% { transform: rotate(8deg) scale(1.08); }
    100% { opacity: 1; transform: rotate(0deg) scale(1); }
}

/* Masonry fish overlay -- positioned absolutely over the wall */
.masonry-fish-overlay {
    position: absolute;
    top: 220px;
    left: 0;
    width: 100%;
    height: calc(100% - 220px);
    pointer-events: none;
    z-index: 2;
    opacity: 0.85;
}

.mini-fish { transform-origin: center; }

/* =================================================================
   SECTION 3: WITNESSES
   ================================================================= */

.witnesses {
    position: relative;
    background: linear-gradient(180deg, var(--soft-sand) 0%, var(--reef-pink) 100%);
    padding-bottom: var(--section-pad);
}

.witness-row {
    display: flex;
    flex-wrap: wrap;
    gap: 36px 28px;
    padding: 0 var(--side-pad);
    max-width: 1400px;
    margin: 0 auto;
    justify-content: flex-start;
    align-items: flex-end;
}

.witness {
    position: relative;
    flex: 1 1 200px;
    max-width: 240px;
    text-align: left;
    padding: 16px 12px;
    transition: transform 360ms cubic-bezier(.34,1.56,.64,1);
}

.witness:nth-child(1) { transform: translateY(0); }
.witness:nth-child(2) { transform: translateY(-24px); }
.witness:nth-child(3) { transform: translateY(8px); }
.witness:nth-child(4) { transform: translateY(-12px); }
.witness:nth-child(5) { transform: translateY(16px); }

.witness:hover { transform: translateY(-8px) !important; }
.witness:hover .witness-fish .mouth-closed { opacity: 0; }
.witness:hover .witness-fish .mouth-open   { opacity: 1; }

.witness:nth-child(odd) .witness-fish { transform: scaleX(1); }
.witness:nth-child(even) .witness-fish { transform: scaleX(-1); }

.witness-fish {
    width: 100%;
    height: auto;
    margin-bottom: 12px;
    transition: filter 280ms ease;
}

.witness-fish .mouth-closed,
.witness-fish .mouth-open {
    transition: opacity 200ms ease;
}

.witness-name {
    display: block;
    font-family: "DM Serif Display", Georgia, serif;
    font-size: 19px;
    line-height: 1.2;
    color: var(--deep-ink);
    margin-bottom: 4px;
}

.witness-role {
    display: block;
    font-family: "JetBrains Mono", monospace;
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--slate-mist);
}

/* Speech bubble */
.speech-bubble {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -100%) translateY(-12px);
    background: var(--deep-ink);
    color: var(--soft-sand);
    padding: 14px 20px 16px;
    border-radius: 4px;
    max-width: 320px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 220ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
    z-index: 50;
    box-shadow: 0 0 0 transparent;
}

.speech-bubble.visible {
    opacity: 1;
    transform: translate(-50%, -100%) translateY(-20px);
}

.speech-quote {
    font-family: "Lora", Georgia, serif;
    font-style: italic;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 6px;
}

.speech-byline {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mango-buoy);
}

.speech-tail {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 9px solid var(--deep-ink);
}

/* =================================================================
   SECTION 4: BAR MENU
   ================================================================= */

.bar-menu {
    position: relative;
    background: var(--soft-sand);
    padding-bottom: var(--section-pad);
}

.menu-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 2fr;
    gap: 64px;
    padding: 0 var(--side-pad);
    max-width: 1400px;
    margin: 0 auto;
    align-items: center;
}

@media (max-width: 800px) {
    .menu-grid { grid-template-columns: 1fr; gap: 40px; }
}

.cocktail-illustration {
    text-align: center;
}

.cocktail-illustration svg {
    width: 100%;
    max-width: 320px;
    height: auto;
}

.cocktail-caption {
    font-family: "Lora", Georgia, serif;
    font-style: italic;
    font-size: 14px;
    color: var(--slate-mist);
    margin-top: 8px;
    max-width: 28ch;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.menu-list {
    list-style: none;
    border-top: 2px solid var(--deep-ink);
}

.menu-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(120px, auto) 1fr minmax(140px, auto);
    align-items: baseline;
    gap: 12px;
    padding: 18px 8px;
    border-bottom: 2px solid var(--deep-ink);
    overflow: hidden;
    cursor: default;
    --rx: 50%;
    --ry: 50%;
}

.menu-item::after {
    content: '';
    position: absolute;
    left: var(--rx);
    top: var(--ry);
    width: 12px;
    height: 12px;
    border: 2px solid var(--coral-verdict);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    opacity: 0.7;
}

.menu-item.rippling::after {
    animation: ripple 700ms cubic-bezier(.2,.8,.2,1) forwards;
}

@keyframes ripple {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 0.55; }
    100% { transform: translate(-50%, -50%) scale(20); opacity: 0; }
}

.menu-name {
    font-family: "DM Serif Display", Georgia, serif;
    font-size: clamp(18px, 1.8vw, 22px);
    color: var(--deep-ink);
}

.menu-leader {
    border-bottom: 2px dotted var(--slate-mist);
    height: 1px;
    align-self: end;
    transform: translateY(-6px);
}

.menu-verdict {
    font-family: "Lora", Georgia, serif;
    font-style: italic;
    font-size: 14px;
    color: var(--slate-mist);
    text-align: right;
}

/* =================================================================
   SECTION 5: CLOSING
   ================================================================= */

.closing {
    position: relative;
    background: var(--lagoon-teal);
    color: var(--soft-sand);
    padding: var(--section-pad) var(--side-pad) 80px;
    overflow: hidden;
}

.closing-band {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        var(--lagoon-teal) 0%,
        var(--lagoon-teal-mid) 25%,
        var(--sunlit-cyan) 50%,
        var(--mango-buoy) 75%,
        var(--coral-verdict) 100%);
    opacity: 0.85;
    z-index: 0;
}

.closing-inner {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    padding: 0;
}

.closing-mark {
    font-family: "DM Serif Display", Georgia, serif;
    font-weight: 400;
    font-size: clamp(64px, 14vw, 220px);
    line-height: 1;
    letter-spacing: -0.025em;
    color: var(--soft-sand);
    margin-bottom: 16px;
}

.closing-sub {
    font-family: "Lora", Georgia, serif;
    font-style: italic;
    font-size: clamp(15px, 1.6vw, 22px);
    color: var(--soft-sand);
    opacity: 0.92;
    max-width: 50ch;
    margin: 0 auto;
}

.closing-school {
    position: relative;
    width: 100%;
    height: 120px;
    margin-top: 40px;
    z-index: 1;
}

.colophon {
    position: relative;
    z-index: 2;
    font-family: "JetBrains Mono", monospace;
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--soft-sand);
    opacity: 0.7;
    text-align: center;
    margin-top: 32px;
    line-height: 1.6;
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
}

/* =================================================================
   Reduced motion preference (still no a11y/focus changes)
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
