/* LegalDebug.com — Inflated-3D Legal Simulation */

:root {
    --void: #0a0a0f;
    --indigo: #12101f;
    --indigo-up: #1a1830;
    --green: #00ff88;
    --pink: #ff3366;
    --blue: #4466ff;
    --magenta: #ff00aa;
    --ghost: #e0dfe6;
    --fog: #8888aa;
    --fog-dim: #555577;

    --serif: "Playfair Display", Georgia, serif;
    --prose: "Source Serif 4", "Source Serif Pro", Georgia, serif;
    --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
    --ui: "DM Sans", system-ui, sans-serif;
}

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

html, body {
    background: var(--void);
    color: var(--ghost);
    font-family: var(--prose);
    font-size: 18px;
    line-height: 1.75;
    overflow-x: hidden;
}

.debug-stack {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100vh;
    scroll-behavior: smooth;
}

.panel {
    position: relative;
    min-height: 100vh;
    scroll-snap-align: start;
    background: var(--indigo);
    border: 2px solid rgba(255, 0, 170, 0.25);
    margin: 8px 0;
    overflow: hidden;
    transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.panel.in-view {
    border-color: var(--magenta);
    box-shadow:
        0 0 40px rgba(255, 0, 170, 0.18),
        inset 0 0 80px rgba(0, 0, 0, 0.6);
}

/* ============== ORB NAV ============== */
.orb-nav {
    position: fixed;
    top: 28px;
    left: 28px;
    z-index: 1000;
    width: 64px;
    height: 64px;
}

.orb {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background:
        radial-gradient(circle at 35% 30%, #1a1830 0%, #0a0a0f 70%);
    box-shadow:
        inset 0 -8px 16px rgba(255, 255, 255, 0.06),
        inset 0 6px 14px rgba(0, 255, 136, 0.25),
        0 8px 24px rgba(0, 0, 0, 0.7),
        0 0 28px rgba(0, 255, 136, 0.55);
    color: var(--green);
    font-family: var(--serif);
    font-size: 28px;
    font-weight: 700;
    transition: transform 0.4s cubic-bezier(.2,.8,.2,1.2), box-shadow 0.4s ease;
    animation: orbPulse 3.2s ease-in-out infinite;
}

.orb:hover {
    transform: translateY(-3px) scale(1.06);
    box-shadow:
        inset 0 -8px 16px rgba(255, 255, 255, 0.08),
        inset 0 6px 14px rgba(0, 255, 136, 0.4),
        0 12px 28px rgba(0, 0, 0, 0.7),
        0 0 48px rgba(0, 255, 136, 0.85);
}

.orb-inner {
    text-shadow: 0 0 12px rgba(0, 255, 136, 0.9);
    display: inline-block;
}

@keyframes orbPulse {
    0%, 100% { box-shadow:
        inset 0 -8px 16px rgba(255, 255, 255, 0.06),
        inset 0 6px 14px rgba(0, 255, 136, 0.25),
        0 8px 24px rgba(0, 0, 0, 0.7),
        0 0 24px rgba(0, 255, 136, 0.45); }
    50% { box-shadow:
        inset 0 -8px 16px rgba(255, 255, 255, 0.08),
        inset 0 6px 14px rgba(0, 255, 136, 0.35),
        0 8px 24px rgba(0, 0, 0, 0.7),
        0 0 44px rgba(0, 255, 136, 0.8); }
}

.orb-menu {
    position: absolute;
    top: 32px;
    left: 32px;
    list-style: none;
    pointer-events: none;
}

.orb-menu li {
    position: absolute;
    transform: translate(0, 0) scale(0);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(.2,.8,.2,1.2), opacity 0.4s ease;
}

.orb-menu a {
    display: inline-block;
    padding: 10px 16px;
    font-family: var(--ui);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ghost);
    text-decoration: none;
    background: var(--indigo-up);
    border: 1px solid rgba(0, 255, 136, 0.4);
    border-radius: 999px;
    box-shadow:
        inset 0 -4px 10px rgba(255, 255, 255, 0.04),
        0 6px 18px rgba(0, 0, 0, 0.6),
        0 0 18px rgba(0, 255, 136, 0.25);
    white-space: nowrap;
    transition: transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.orb-menu a:hover {
    color: var(--green);
    transform: translateY(-2px);
    box-shadow:
        inset 0 -4px 10px rgba(255, 255, 255, 0.06),
        0 8px 22px rgba(0, 0, 0, 0.7),
        0 0 32px rgba(0, 255, 136, 0.55);
}

.orb-nav.open .orb-menu li {
    pointer-events: auto;
    opacity: 1;
    transform: translate(var(--tx, 0), var(--ty, 0)) scale(1);
}

.orb-nav.open .orb-menu { pointer-events: auto; }

.orb-nav.open .orb { transform: rotate(45deg); }

/* ============== PANELS ============== */
.panel-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-inner {
    position: relative;
    z-index: 2;
    padding: 0 24px;
    max-width: 1100px;
}

.tag {
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fog);
    margin-bottom: 16px;
}

.tag.center { text-align: center; }

.hero-title {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin: 8px 0 18px;
    color: var(--ghost);
    text-shadow: 0 0 30px rgba(255, 0, 170, 0.25);
}

.caret {
    color: var(--green);
    text-shadow: 0 0 12px rgba(0, 255, 136, 0.9);
    animation: blink 1s steps(2, end) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
    font-family: var(--prose);
    color: var(--fog);
    font-size: 1.1rem;
    max-width: 640px;
    margin: 0 auto 36px;
}

.scroll-hint {
    margin-top: 32px;
    color: var(--green);
    font-size: 22px;
    animation: pulseDown 2.4s ease-in-out infinite;
    text-shadow: 0 0 14px rgba(0, 255, 136, 0.7);
}

@keyframes pulseDown {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50%      { transform: translateY(8px); opacity: 1; }
}

/* GAVEL */
.gavel-stage {
    width: 280px;
    height: 220px;
    margin: 0 auto 18px;
    position: relative;
    perspective: 800px;
}

.gavel {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: gavelSpin 20s linear infinite;
}

@keyframes gavelSpin { to { transform: rotateY(360deg); } }

.gavel-head, .gavel-handle {
    position: absolute;
    background: radial-gradient(ellipse at 35% 30%, var(--indigo-up) 0%, var(--indigo) 80%);
    box-shadow:
        inset 0 -10px 22px rgba(255, 255, 255, 0.06),
        inset 0 8px 18px rgba(255, 0, 170, 0.18),
        0 12px 36px rgba(0, 0, 0, 0.8),
        0 0 50px rgba(255, 0, 170, 0.35);
    border: 1px solid rgba(255, 0, 170, 0.55);
}

.gavel-head {
    width: 220px;
    height: 80px;
    left: 30px;
    top: 30px;
    border-radius: 40px / 50%;
}

.gavel-handle {
    width: 60px;
    height: 160px;
    left: 110px;
    top: 50px;
    border-radius: 30px / 28%;
}

.gavel-glow {
    position: absolute;
    inset: -40px;
    background: radial-gradient(circle, rgba(255, 0, 170, 0.22) 0%, transparent 60%);
    filter: blur(20px);
    pointer-events: none;
    animation: glowPulse 3.4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}

/* DEBUG PANELS */
.panel-debug { padding: 80px clamp(24px, 6vw, 80px); display: flex; align-items: center; }

.panel-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 60% 40%;
    gap: clamp(24px, 4vw, 56px);
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    align-items: center;
}

.bug-report .panel-title,
.panel-title {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(2rem, 4.4vw, 3.6rem);
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin: 10px 0 22px;
    color: var(--ghost);
    text-shadow: 0 0 24px rgba(0, 255, 136, 0.18);
}

.panel-title.center { text-align: center; margin: 8px auto 36px; }

.prose {
    font-family: var(--prose);
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--ghost);
    margin-bottom: 16px;
    max-width: 60ch;
}

.symbol {
    font-family: var(--serif);
    font-size: clamp(80px, 9vw, 120px);
    color: var(--ghost);
    opacity: 0.85;
    margin-top: 18px;
    text-shadow:
        0 0 18px rgba(0, 255, 136, 0.5),
        0 0 38px rgba(255, 0, 170, 0.35);
    display: inline-block;
    transform-origin: center;
    animation: symbolPulse 3s ease-in-out infinite;
}

@keyframes symbolPulse {
    0%, 100% { transform: scale(1) rotate(-3deg); }
    50%      { transform: scale(1.03) rotate(0deg); }
}

/* STACK TRACE */
.stack-trace {
    position: relative;
    background: var(--indigo-up);
    border: 1px solid rgba(255, 51, 102, 0.45);
    border-radius: 18px;
    padding: 0;
    transform: perspective(900px) rotateY(-3deg);
    box-shadow:
        inset 0 -10px 28px rgba(255, 255, 255, 0.04),
        0 18px 50px rgba(0, 0, 0, 0.75),
        0 0 50px rgba(255, 0, 170, 0.18);
    overflow: hidden;
}

.trace-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 0, 170, 0.3);
    background: rgba(10, 10, 15, 0.6);
}

.dot {
    width: 10px; height: 10px; border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}
.dot-pink  { background: var(--pink);  color: var(--pink); }
.dot-green { background: var(--green); color: var(--green); }
.dot-blue  { background: var(--blue);  color: var(--blue); }

.trace-name {
    margin-left: 10px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--fog);
}

.code {
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.7;
    color: var(--ghost);
    padding: 22px 22px 26px;
    white-space: pre;
    overflow-x: auto;
}

.code .ln  { color: var(--fog-dim); margin-right: 12px; user-select: none; }
.code .err-line { color: var(--pink); }
.code .kw  { color: var(--pink);  text-shadow: 0 0 6px rgba(255,51,102,0.5); }
.code .str { color: var(--green); text-shadow: 0 0 6px rgba(0,255,136,0.45); }
.code .cmt { color: var(--fog-dim); font-style: italic; }
.code .err { color: var(--magenta); text-shadow: 0 0 8px rgba(255,0,170,0.7); }
.code .fn  { color: var(--blue);  text-shadow: 0 0 6px rgba(68,102,255,0.45); }
.code .op  { color: var(--green); }

/* EVIDENCE */
.panel-evidence { padding: 90px 0; display: flex; flex-direction: column; justify-content: center; }
.panel-evidence .tag.center,
.panel-evidence .panel-title { padding: 0 clamp(24px, 6vw, 80px); }

.evidence-strip {
    display: flex;
    gap: 28px;
    overflow-x: auto;
    padding: 30px clamp(24px, 6vw, 80px) 50px;
    scroll-snap-type: x mandatory;
    position: relative;
    z-index: 2;
}

.evidence-strip::-webkit-scrollbar { height: 6px; }
.evidence-strip::-webkit-scrollbar-thumb { background: rgba(0,255,136,0.4); border-radius: 6px; }
.evidence-strip::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }

.evidence-card {
    flex: 0 0 320px;
    min-height: 340px;
    padding: 32px 28px;
    border-radius: 40px;
    background:
        radial-gradient(ellipse at 30% 20%, var(--indigo-up) 0%, var(--indigo) 75%);
    border: 1px solid rgba(0, 255, 136, 0.35);
    box-shadow:
        inset 0 -10px 22px rgba(255, 255, 255, 0.05),
        inset 0 8px 18px rgba(0, 255, 136, 0.12),
        0 18px 44px rgba(0, 0, 0, 0.75),
        0 0 30px rgba(0, 255, 136, 0.18);
    scroll-snap-align: start;
    transition: transform 0.5s cubic-bezier(.2,.8,.2,1.2), box-shadow 0.5s ease;
    position: relative;
    overflow: hidden;
}

.evidence-card:hover {
    transform: translateY(-6px) scale(1.04);
    box-shadow:
        inset 0 -10px 22px rgba(255, 255, 255, 0.07),
        inset 0 8px 18px rgba(0, 255, 136, 0.2),
        0 22px 56px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(255, 0, 170, 0.4);
    border-color: var(--magenta);
}

.evidence-card .card-tag {
    font-family: var(--ui);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--green);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    margin-bottom: 12px;
}

.evidence-card h3 {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
    color: var(--ghost);
}

.evidence-card p {
    font-family: var(--prose);
    color: var(--fog);
    font-size: 0.95rem;
    line-height: 1.65;
}

.evidence-card code {
    font-family: var(--mono);
    font-size: 0.85em;
    color: var(--green);
    background: rgba(0,255,136,0.08);
    padding: 1px 6px;
    border-radius: 4px;
}

.card-symbol {
    position: absolute;
    bottom: -12px;
    right: -8px;
    font-family: var(--serif);
    font-size: 130px;
    color: var(--magenta);
    opacity: 0.18;
    text-shadow: 0 0 28px rgba(255, 0, 170, 0.6);
    pointer-events: none;
}

/* TERMINAL */
.panel-terminal {
    padding: 70px clamp(24px, 6vw, 80px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.terminal {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 980px;
    background: rgba(10, 10, 15, 0.85);
    border: 1px solid rgba(0, 255, 136, 0.45);
    border-radius: 16px;
    box-shadow:
        inset 0 -10px 28px rgba(255, 255, 255, 0.03),
        0 24px 60px rgba(0, 0, 0, 0.85),
        0 0 60px rgba(0, 255, 136, 0.22);
    overflow: hidden;
    backdrop-filter: blur(4px);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
}

.terminal-body {
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.7;
    color: var(--ghost);
    padding: 22px 22px 8px;
    min-height: 320px;
    max-height: 60vh;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.terminal-body .line { display: block; }
.terminal-body .l-prompt { color: var(--green); }
.terminal-body .l-cmd    { color: var(--ghost); }
.terminal-body .l-ok     { color: var(--green); }
.terminal-body .l-warn   { color: var(--magenta); }
.terminal-body .l-err    { color: var(--pink); }
.terminal-body .l-info   { color: var(--blue); }
.terminal-body .l-cmt    { color: var(--fog-dim); font-style: italic; }

.terminal-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px 22px;
    font-family: var(--mono);
    font-size: 14px;
}

.terminal-input .prompt {
    color: var(--green);
    text-shadow: 0 0 8px rgba(0,255,136,0.7);
}

#termInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--ghost);
    font-family: var(--mono);
    font-size: 14px;
    caret-color: var(--green);
}

.caret-block {
    color: var(--green);
    animation: blink 1s steps(2, end) infinite;
    text-shadow: 0 0 10px rgba(0,255,136,0.8);
}

/* FOOTER */
.panel-footer {
    min-height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-color: rgba(0, 255, 136, 0.3);
}

.footer-line {
    position: relative;
    z-index: 2;
    font-family: var(--prose);
    color: var(--fog);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.for-now { color: var(--magenta); text-shadow: 0 0 10px rgba(255,0,170,0.6); }

.pulse-dot {
    display: inline-block;
    width: 10px; height: 10px;
    margin-left: 10px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(0,255,136,0.9);
    animation: dotPulse 1.6s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1);   box-shadow: 0 0 8px  rgba(0,255,136,0.5); }
    50%      { transform: scale(1.4); box-shadow: 0 0 22px rgba(0,255,136,1); }
}

/* ============== BACKGROUND PATTERNS ============== */
.bg-pattern {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.95;
}

/* triangles drifting */
.bg-triangles {
    background-image:
        linear-gradient(45deg, rgba(255,51,102,0.10) 25%, transparent 25%, transparent 75%, rgba(255,51,102,0.10) 75%),
        linear-gradient(-45deg, rgba(0,255,136,0.10) 25%, transparent 25%, transparent 75%, rgba(0,255,136,0.10) 75%);
    background-size: 36px 36px, 52px 52px;
    animation: drift 30s linear infinite;
}
@keyframes drift {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 360px 360px, -520px 520px; }
}

/* concentric polygons (sonar) */
.bg-polygons {
    background:
        radial-gradient(circle at 50% 50%, transparent 0 80px,  rgba(68,102,255,0.07) 80px  82px, transparent 82px),
        radial-gradient(circle at 50% 50%, transparent 0 160px, rgba(0,255,136,0.06)  160px 162px, transparent 162px),
        radial-gradient(circle at 50% 50%, transparent 0 260px, rgba(255,0,170,0.07)  260px 262px, transparent 262px),
        radial-gradient(circle at 50% 50%, transparent 0 380px, rgba(68,102,255,0.06) 380px 382px, transparent 382px),
        radial-gradient(circle at 50% 50%, transparent 0 520px, rgba(0,255,136,0.05)  520px 522px, transparent 522px);
    animation: sonar 6s ease-in-out infinite;
}
@keyframes sonar {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.05); }
}

/* mesh wireframe */
.bg-mesh {
    background-image:
        repeating-linear-gradient(45deg,  rgba(68,102,255,0.10) 0 1px, transparent 1px 64px),
        repeating-linear-gradient(-45deg, rgba(68,102,255,0.08) 0 1px, transparent 1px 64px);
    animation: meshBreath 4s ease-in-out infinite;
}
@keyframes meshBreath {
    0%, 100% { background-size: 64px 64px, 64px 64px; opacity: 0.7; }
    50%      { background-size: 72px 72px, 72px 72px; opacity: 1; }
}

/* wireframe alt for panel 3 */
.bg-wireframe {
    background-image:
        repeating-linear-gradient(30deg,  rgba(68,102,255,0.10) 0 1px, transparent 1px 80px),
        repeating-linear-gradient(-30deg, rgba(255,0,170,0.06)  0 1px, transparent 1px 80px);
    animation: meshBreath 5s ease-in-out infinite;
}

/* glyph wallpaper */
.bg-glyphs {
    background-image:
        radial-gradient(circle at 10% 20%, rgba(224,223,230,0.05), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255,0,170,0.05),   transparent 50%);
}
.bg-glyphs::before {
    content: "§   ¶   †   ‡   §   ¶   †   ‡   §   ¶   †   ‡   §   ¶   †   ‡   §   ¶   †   ‡   §   ¶   †   ‡   §   ¶   †   ‡   §   ¶   †   ‡";
    position: absolute;
    inset: 0;
    color: rgba(224, 223, 230, 0.05);
    font-family: var(--serif);
    font-size: 64px;
    line-height: 120px;
    word-spacing: 28px;
    overflow: hidden;
    transform: rotate(-12deg);
    transform-origin: center;
    animation: glyphRotate 60s linear infinite;
    padding: 80px;
    pointer-events: none;
}
@keyframes glyphRotate {
    from { transform: rotate(-12deg); }
    to   { transform: rotate(348deg); }
}

/* ============== PULSE-IN ANIMATION ============== */
.pulsable {
    opacity: 0;
    transform: scale(0.95);
    filter: drop-shadow(0 0 0 transparent);
    transition:
        opacity 0.7s ease,
        transform 0.7s cubic-bezier(.2,.8,.2,1.2),
        filter 0.9s ease;
}

.pulsable.pulsed {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 18px rgba(255, 0, 170, 0.35));
}

/* ============== RESPONSIVE ============== */
@media (max-width: 900px) {
    .panel-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .stack-trace { transform: none; }
    .gavel-stage { width: 220px; height: 180px; }
    .gavel-head  { width: 180px; left: 20px; }
    .gavel-handle { left: 90px; }
    .evidence-card { flex: 0 0 280px; min-height: 320px; }
    .panel-debug { padding: 70px 22px; }
}

@media (max-width: 560px) {
    body { font-size: 16px; }
    .orb-nav { top: 16px; left: 16px; }
    .orb { width: 54px; height: 54px; font-size: 22px; }
    .code { font-size: 12px; padding: 16px; }
    .symbol { font-size: 80px; }
}
