:root {
    --neon-cyan:    #00f6ff;
    --neon-pink:    #ff2ea5;
    --neon-green:   #39ff14;
    --neon-purple:  #d600f9;
    --bg-dark:      #0d0015;
    --bg-darker:    #05000a;
    --text:         #e0f7ff;
    --text-dim:     #a0d4f0;
    --error:        #ff004d;
}

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

body {
    background: var(--bg-dark);
    color: var(--text);
    font-family: 'Space Mono', monospace;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0,246,255,0.07) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255,46,165,0.05) 0%, transparent 30%);
    scrollbar-color: var(--neon-cyan) var(--bg-darker);
    scrollbar-width: thin;
}

/* ═══════════════════════════════════════════════
   2026 cinematic layers: mesh + noise + cursor glow
   (auto-disabled in perf-lite / reduced motion)
   ═══════════════════════════════════════════════ */
.mesh-bg {
    position: fixed;
    inset: -20vh -10vw;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 700px at 18% 28%, rgba(0, 246, 255, 0.16), transparent 60%),
        radial-gradient(800px 620px at 84% 32%, rgba(255, 46, 165, 0.12), transparent 62%),
        radial-gradient(900px 780px at 70% 88%, rgba(214, 0, 249, 0.10), transparent 62%),
        radial-gradient(740px 520px at 26% 86%, rgba(57, 255, 20, 0.08), transparent 60%);
    filter: blur(18px) saturate(1.08);
    opacity: 0.9;
    transform: translateZ(0);
}

.noise-layer {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 0.075;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
    background-size: 220px 220px;
}

.hud-frame {
    position: relative;
}

/* Corner brackets for “HUD” framing */
.hud-frame::before,
.hud-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 18px;
}

.hud-frame::before {
    border: 1px solid rgba(0, 246, 255, 0.20);
    box-shadow: 0 0 0 1px rgba(214, 0, 249, 0.12) inset;
}

.hud-frame::after {
    background:
        linear-gradient(var(--neon-cyan), var(--neon-cyan)) left 14px top 14px / 18px 2px no-repeat,
        linear-gradient(var(--neon-cyan), var(--neon-cyan)) left 14px top 14px / 2px 18px no-repeat,
        linear-gradient(var(--neon-green), var(--neon-green)) right 14px top 14px / 18px 2px no-repeat,
        linear-gradient(var(--neon-green), var(--neon-green)) right 14px top 14px / 2px 18px no-repeat,
        linear-gradient(var(--neon-purple), var(--neon-purple)) left 14px bottom 14px / 18px 2px no-repeat,
        linear-gradient(var(--neon-purple), var(--neon-purple)) left 14px bottom 14px / 2px 18px no-repeat,
        linear-gradient(var(--neon-pink), var(--neon-pink)) right 14px bottom 14px / 18px 2px no-repeat,
        linear-gradient(var(--neon-pink), var(--neon-pink)) right 14px bottom 14px / 2px 18px no-repeat;
    opacity: 0.75;
    filter: drop-shadow(0 0 10px rgba(0, 246, 255, 0.18));
}

.hud-panel {
    position: relative;
    overflow: hidden;
}

.hud-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(380px 220px at 20% 20%, rgba(0, 246, 255, 0.08), transparent 55%);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.hud-panel:hover::before {
    opacity: 1;
}

.hud-panel:hover {
    border-color: rgba(57, 255, 20, 0.28);
    box-shadow: 0 0 20px rgba(0, 246, 255, 0.14), 0 0 34px rgba(57, 255, 20, 0.07);
    transform: translateY(-1px);
    transition: transform 0.16s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.cursor-glow {
    position: fixed;
    left: 0;
    top: 0;
    width: 520px;
    height: 520px;
    border-radius: 999px;
    transform: translate3d(-9999px, -9999px, 0);
    z-index: 3;
    pointer-events: none;
    background:
        radial-gradient(circle at center, rgba(0, 246, 255, 0.20), rgba(214, 0, 249, 0.10) 35%, transparent 65%);
    filter: blur(6px);
    opacity: 0.9;
    transition: opacity 0.25s ease;
    will-change: transform;
}

.cursor-glow.is-hidden {
    opacity: 0;
}

/* ═══════════════════════════════════════════════
   Skip to content (a11y)
   ═══════════════════════════════════════════════ */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 99999;
    padding: 0.6rem 1.2rem;
    background: var(--neon-cyan);
    color: #000;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* ═══════════════════════════════════════════════
   CRT + scanlines + vignette
   ═══════════════════════════════════════════════ */
.crt-overlay, .scanlines, .vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

.crt-overlay {
    background: repeating-linear-gradient(to bottom, transparent 0, rgba(0,0,0,0.04) 1px, transparent 2px, transparent 4px);
    animation: crt-flicker 0.12s infinite;
}

.scanlines {
    background: repeating-linear-gradient(to bottom, transparent, transparent 2px, rgba(0,246,255,0.07) 2px, rgba(0,246,255,0.07) 4px);
    animation: scan 10s linear infinite;
    will-change: transform;
}

.vignette {
    background: radial-gradient(circle at center, transparent 40%, rgba(0,0,0,0.75) 80%);
}

@keyframes crt-flicker { 0%,100% { opacity:0.35 } 50% { opacity:0.6 } 51% { opacity:0.28 } }
@keyframes scan { 0% { transform:translateY(-100%) } 100% { transform:translateY(100%) } }

/* PERF: Disable heavy overlays on mobile to save GPU */
@media (max-width: 600px) {
    .scanlines { display: none; }
    .crt-overlay { animation: none; opacity: 0.3; }
    .vignette { background: radial-gradient(circle at center, transparent 50%, rgba(0,0,0,0.5) 90%); }
}

/* ═══════════════════════════════════════════════
   Glitch effects
   ═══════════════════════════════════════════════ */
.glitch, .glitch-small {
    position: relative;
    display: inline-block;
}

.glitch::before, .glitch::after,
.glitch-small::before, .glitch-small::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.glitch::before  { left:2px; text-shadow:-2px 0 var(--neon-pink);  animation:glitch-1 3.2s infinite; }
.glitch::after   { left:-2px; text-shadow: 2px 0 var(--neon-cyan); animation:glitch-2 2.8s infinite; }

.glitch-small::before  { left:1.2px; text-shadow:-1.2px 0 var(--neon-pink);  animation:glitch-1 4s infinite; }
.glitch-small::after   { left:-1.2px; text-shadow: 1.2px 0 var(--neon-cyan); animation:glitch-2 3.5s infinite; }

@keyframes glitch-1 { 0%,5%,100% { clip:rect(0,9999px,0,0); transform:skew(0.2deg); } 10% { clip:rect(20px,9999px,60px,0); } }
@keyframes glitch-2 { 0%,5%,100% { clip:rect(0,9999px,0,0); } 15% { clip:rect(40px,9999px,80px,0); transform:skew(-0.3deg); } }

/* ═══════════════════════════════════════════════
   Index – Header (FIX: was missing layout)
   ═══════════════════════════════════════════════ */
.header {
    display: flex;
    align-items: center;
    padding: 1.5rem 2rem;
    position: relative;
    z-index: 2;
}

.logo-glitch {
    height: 90px;
    filter: drop-shadow(0 0 8px var(--neon-cyan)) drop-shadow(0 0 15px var(--neon-pink));
    animation: logo-breath 6s infinite alternate;
}

@keyframes logo-breath { to { filter: drop-shadow(0 0 12px var(--neon-cyan)) drop-shadow(0 0 25px var(--neon-pink)); } }

.bg-anim-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.connex-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 5;
    pointer-events: none;
    opacity: 0.78;
    mix-blend-mode: screen;
    filter: saturate(1.06) contrast(1.03);
}

.index-crt-overlay {
    background: rgba(0, 0, 0, 0.06);
}

.index-vignette {
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.06) 60%, rgba(0, 0, 0, 0.16) 100%);
}

.cyber-grid {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(rgba(0, 246, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(214, 0, 249, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    transform-origin: center;
    animation: grid-drift 18s linear infinite;
    opacity: 0.42;
}

@keyframes grid-drift {
    0% { transform: perspective(420px) rotateX(8deg) translateY(0); background-position: 0 0, 0 0; }
    100% { transform: perspective(420px) rotateX(8deg) translateY(-28px); background-position: 0 -56px, 56px 0; }
}

.theme-wrap {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.theme-label {
    color: var(--neon-cyan);
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
}

.theme-select {
    background: var(--bg-darker);
    color: var(--neon-cyan);
    border: 1.5px solid var(--neon-cyan);
    border-radius: 6px;
    padding: 3px 8px;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════
   Dashboard components (moved from inline styles)
   ═══════════════════════════════════════════════ */
.progress-container {
    background: rgba(0, 246, 255, 0.1);
    border: 1px solid var(--neon-cyan);
    border-radius: 8px;
    height: 28px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    box-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-purple);
    transition: width 2.8s cubic-bezier(0.25, 0.1, 0.25, 1);
    animation: neon-pulse 3s infinite alternate;
}

@keyframes neon-pulse {
    from { filter: brightness(1) drop-shadow(0 0 8px var(--neon-cyan)); }
    to { filter: brightness(1.3) drop-shadow(0 0 25px var(--neon-purple)); }
}

.hardware-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.hardware-card {
    position: relative;
    margin: 0;
    background: rgba(13, 0, 21, 0.8);
    border: 1px solid var(--neon-cyan);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 25px rgba(0, 246, 255, 0.3);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.hardware-card::before {
    content: "";
    position: absolute;
    top: -120%;
    left: -45%;
    width: 55%;
    height: 320%;
    background: linear-gradient(120deg, transparent 36%, rgba(255, 255, 255, 0.24) 50%, transparent 64%);
    transform: rotate(18deg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.hardware-card:hover {
    transform: translateY(-4px);
    border-color: var(--neon-green);
    box-shadow: 0 0 24px rgba(0, 246, 255, 0.45), 0 0 38px rgba(57, 255, 20, 0.2);
}

.hardware-card:hover::before {
    opacity: 1;
    animation: hardware-sweep 1.15s ease forwards;
}

.hardware-card img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.3s ease;
}

.hardware-card:hover img {
    transform: scale(1.04);
    filter: saturate(1.08) contrast(1.03);
}

.hardware-card figcaption {
    padding: 0.7rem 0.9rem 1rem;
    color: #9beeff;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

@keyframes hardware-sweep {
    0% { transform: translateX(-130%) rotate(18deg); }
    100% { transform: translateX(260%) rotate(18deg); }
}

.ledstrip-shell {
    background: rgba(5, 0, 10, 0.92);
    border: 1px solid rgba(0, 246, 255, 0.4);
    border-radius: 16px;
    padding: 1.4rem 1rem 1rem;
    box-shadow: 0 0 36px rgba(0, 246, 255, 0.18);
}

.ledstrip-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ledstrip-title {
    color: var(--neon-cyan);
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ledstrip-mode-badge {
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    background: rgba(57, 255, 20, 0.1);
    transition: all 0.2s;
}

#led-strip-canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    background: #0a0014;
    border: 2px solid var(--neon-cyan);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 246, 255, 0.5);
    cursor: crosshair;
}

.ledstrip-hint {
    color: #4ecdc4;
    font-size: 0.82rem;
    margin: 0.6rem 0 1rem;
    text-align: center;
}

.led-btn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.led-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.5rem;
    border-radius: 9px;
    border: 1px solid currentColor;
    background: rgba(0, 0, 0, 0.35);
    font-family: inherit;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
}

.led-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.led-btn:active {
    transform: translateY(0);
}

.led-btn.cyan { color: var(--neon-cyan); }
.led-btn.cyan:hover { box-shadow: 0 0 10px rgba(0, 246, 255, 0.4); }
.led-btn.pink { color: var(--neon-pink); }
.led-btn.pink:hover { box-shadow: 0 0 10px rgba(255, 46, 165, 0.4); }
.led-btn.green { color: var(--neon-green); }
.led-btn.green:hover { box-shadow: 0 0 10px rgba(57, 255, 20, 0.4); }
.led-btn.purple { color: var(--neon-purple); }
.led-btn.purple:hover { box-shadow: 0 0 10px rgba(214, 0, 249, 0.4); }
.led-btn.white { color: #ffffff; }
.led-btn.white:hover { box-shadow: 0 0 10px rgba(255, 255, 255, 0.25); }
.led-btn.off {
    color: #556;
    border-color: #556;
}

.led-btn.active-mode {
    background: rgba(255, 255, 255, 0.13);
    box-shadow: 0 0 14px rgba(0, 246, 255, 0.45);
}

.footage-shell {
    position: relative;
    padding: 1rem;
    border: 1px solid rgba(0, 246, 255, 0.5);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 246, 255, 0.08), rgba(214, 0, 249, 0.08));
    box-shadow: 0 0 30px rgba(0, 246, 255, 0.18);
    overflow: hidden;
}

.footage-shell::before {
    content: "";
    position: absolute;
    inset: -120% auto auto -40%;
    width: 70%;
    height: 300%;
    background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.13) 50%, transparent 65%);
    transform: rotate(18deg);
    animation: footage-sweep 4.8s linear infinite;
    pointer-events: none;
}

.footage-label {
    display: inline-block;
    margin: 0 0 0.9rem;
    padding: 0.28rem 0.72rem;
    border: 1px solid var(--neon-green);
    border-radius: 999px;
    color: var(--neon-green);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: rgba(57, 255, 20, 0.12);
}

.footage-video {
    display: block;
    width: 100%;
    border: 1px solid var(--neon-cyan);
    border-radius: 10px;
    background: #000;
    box-shadow: 0 0 18px rgba(0, 246, 255, 0.33), 0 0 38px rgba(214, 0, 249, 0.15);
}

.footage-caption {
    margin-top: 0.85rem;
    color: #b4f7ff;
    font-size: 0.95rem;
    line-height: 1.55;
}

@keyframes footage-sweep {
    0% { transform: translateX(-120%) rotate(18deg); }
    100% { transform: translateX(240%) rotate(18deg); }
}

.video-noscript-note {
    color: var(--text-dim);
    margin-top: 1rem;
}

/* ═══════════════════════════════════════════════
   Index – Hero
   ═══════════════════════════════════════════════ */
.hero {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 3rem 1.5rem 2rem;
}

.gateway-main {
    max-width: 920px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    letter-spacing: 0.12em;
    text-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-pink);
    margin-bottom: 0.25rem;
}

.subtitle-wrapper {
    margin-top: 0.55rem;
    width: min(100%, 720px);
    text-align: left;
}

.subtitle {
    font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    color: var(--neon-pink);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.status-line {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: var(--neon-green);
    letter-spacing: 0.1em;
    min-height: 1.4em;
    line-height: 1.5;
}

.description {
    margin-top: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-dim);
    width: min(100%, 720px);
    text-align: left;
}

.gateway-description p {
    margin: 0.15rem 0;
}

.gateway-description p + p {
    margin-top: 0.35rem;
}

.typewriter-line {
    display: block;
    min-height: 1.45em;
}

.welcome-message {
    margin: 0.9rem 0 0;
    width: min(100%, 720px);
    text-align: left;
    color: var(--neon-cyan);
    font-size: 0.98rem;
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.welcome-message.visible {
    opacity: 0.9;
    transform: translateY(0);
}

.system-status {
    margin: 0.85rem auto 0.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(57, 255, 20, 0.45);
    background: rgba(57, 255, 20, 0.08);
    color: var(--neon-green);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
    animation: status-blink 1.2s ease-in-out infinite;
}

@keyframes status-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.85); }
}

/* ═══════════════════════════════════════════════
   Neon Button
   ═══════════════════════════════════════════════ */
.neon-button {
    position: relative;
    display: inline-block;
    padding: 16px 48px;
    margin: 2rem 0;
    font-size: 1.35rem;
    font-family: 'Space Mono', monospace;
    color: var(--neon-cyan);
    text-decoration: none;
    border: 2px solid var(--neon-cyan);
    border-radius: 4px;
    background: transparent;
    text-transform: uppercase;
    letter-spacing: 4px;
    overflow: hidden;
    text-shadow: 0 0 8px currentColor;
    box-shadow: 0 0 20px rgba(0,246,255,0.5);
    transition: box-shadow 0.25s, color 0.18s, border-color 0.18s, background 0.18s;
    cursor: pointer;
}

.enter-grid-btn {
    isolation: isolate;
    box-shadow: 0 0 22px rgba(0, 246, 255, 0.55), 0 0 46px rgba(214, 0, 249, 0.22);
    animation: enter-pulse 2.4s ease-in-out infinite;
}

@keyframes enter-pulse {
    0%, 100% { box-shadow: 0 0 18px rgba(0, 246, 255, 0.45), 0 0 36px rgba(214, 0, 249, 0.12); }
    50% { box-shadow: 0 0 28px rgba(0, 246, 255, 0.8), 0 0 58px rgba(214, 0, 249, 0.25); }
}

.neon-button:hover {
    color: #000;
    background: var(--neon-cyan);
    box-shadow: 0 0 40px var(--neon-cyan), 0 0 80px var(--neon-pink);
}

.neon-button:focus-visible {
    outline: 2px solid var(--neon-pink);
    outline-offset: 3px;
}

.neon-button:active::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 180%; height: 180%;
    background: radial-gradient(circle, rgba(0,246,255,0.5) 0%, transparent 80%);
    border-radius: 50%;
    animation: ripple 0.5s linear;
    pointer-events: none;
    z-index: 2;
}

@keyframes ripple {
    to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.button-glitch-layer {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.neon-button:hover .button-glitch-layer { transform: translateX(100%); }

.button-scanline {
    position: absolute;
    left: -120%;
    top: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.24) 50%, transparent 80%);
    transform: skewX(-22deg);
    pointer-events: none;
    z-index: 2;
}

.neon-button:hover .button-scanline {
    animation: button-scan 0.8s ease;
}

@keyframes button-scan {
    from { left: -120%; }
    to { left: 160%; }
}

/* ═══════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════ */
.terminal-footer {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 1.2rem 1rem 1.5rem;
    color: #d8f8ff;
    text-shadow: 0 0 8px rgba(0, 246, 255, 0.35);
}

.gateway-links {
    margin-top: 0.55rem;
    font-size: 0.8rem;
    opacity: 0.8;
    letter-spacing: 0.06em;
}

.gateway-links a {
    color: var(--text-dim);
    text-decoration: none;
    border-bottom: 1px dotted rgba(0, 246, 255, 0.35);
}

.gateway-links a:hover,
.gateway-links a:focus-visible {
    color: var(--neon-cyan);
    border-bottom-color: var(--neon-cyan);
}

.terminal-footer p {
    display: inline-block;
    background: rgba(5, 0, 10, 0.45);
    border: 1px solid rgba(0, 246, 255, 0.28);
    border-radius: 10px;
    padding: 0.6rem 1rem;
}

.terminal-footer a {
    color: var(--neon-cyan);
    text-decoration: none;
    font-family: 'Space Mono', monospace;
}

.terminal-footer a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════
   Dashboard – Header
   ═══════════════════════════════════════════════ */
.dashboard-header {
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(57,255,20,0.2);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.perf-toggle {
    color: var(--neon-green);
    background: rgba(57, 255, 20, 0.08);
    border: 1px solid rgba(57, 255, 20, 0.45);
    border-radius: 6px;
    padding: 0.45rem 0.8rem;
    font-family: inherit;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: box-shadow 0.2s, background 0.2s, color 0.2s;
}

.perf-toggle:hover {
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.32);
}

.perf-toggle.is-active {
    color: #001100;
    background: var(--neon-green);
}

.dashboard-header h1 {
    font-size: 2.2rem;
    letter-spacing: 6px;
    text-shadow: 0 0 10px var(--neon-green);
}

.version { font-size: 0.8em; opacity: 0.7; }

.serial-hub {
    max-width: 1100px;
    margin: 1rem auto 0.4rem;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

.serial-connect-btn {
    width: 100%;
    border: 1.5px solid;
    border-radius: 12px;
    padding: 0.95rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    letter-spacing: 0.11em;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.12s, box-shadow 0.22s, background 0.22s, color 0.22s;
    margin-bottom: 0.85rem;
}

.serial-connect-btn.disconnected {
    color: #ff6a8d;
    border-color: #ff325f;
    background: rgba(255, 50, 95, 0.08);
    box-shadow: 0 0 12px rgba(255, 50, 95, 0.3);
}

.serial-connect-btn.connected {
    color: #021402;
    border-color: var(--neon-green);
    background: var(--neon-green);
    box-shadow: 0 0 18px rgba(57, 255, 20, 0.45), 0 0 34px rgba(57, 255, 20, 0.22);
}

.serial-connect-btn:hover {
    transform: translateY(-1px);
}

.system-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr 1.25fr;
    gap: 0.85rem;
}

.system-panel {
    background: rgba(8, 0, 14, 0.84);
    border: 1px solid rgba(0, 246, 255, 0.35);
    border-radius: 12px;
    padding: 0.85rem 0.9rem;
    box-shadow: 0 0 18px rgba(0, 246, 255, 0.12);
}

.system-title {
    margin-bottom: 0.6rem;
    color: var(--neon-cyan);
    font-size: 0.79rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.status-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.6rem;
}

.status-kpis p {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.35rem 0.45rem;
    border: 1px solid rgba(0, 246, 255, 0.18);
    border-radius: 8px;
    background: rgba(0, 246, 255, 0.03);
}

.status-kpis span {
    color: rgba(160, 212, 240, 0.75);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
}

.status-kpis strong {
    color: #d6fcff;
    font-size: 0.83rem;
    letter-spacing: 0.04em;
}

.oled-screen {
    min-height: 140px;
    margin: 0;
    padding: 0.65rem;
    border: 1px solid rgba(57, 255, 20, 0.4);
    border-radius: 8px;
    background: rgba(2, 8, 2, 0.8);
    color: #7aff8e;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    text-shadow: 0 0 6px rgba(122, 255, 142, 0.35);
}

.ctrl-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.4rem;
    margin-bottom: 0.3rem;
    color: #bef9ff;
    font-size: 0.77rem;
    letter-spacing: 0.08em;
}

.neon-range {
    width: 100%;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 246, 255, 0.35), rgba(214, 0, 249, 0.35));
    outline: none;
}

.neon-range::-webkit-slider-thumb {
    appearance: none;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 1px solid var(--neon-cyan);
    background: #e9ffff;
    box-shadow: 0 0 8px var(--neon-cyan);
    cursor: pointer;
}

.fan-switches {
    margin-top: 0.75rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.fan-toggle,
.mini-neon-btn {
    border: 1px solid rgba(0, 246, 255, 0.45);
    border-radius: 7px;
    background: rgba(0, 246, 255, 0.08);
    color: var(--neon-cyan);
    font-family: inherit;
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    padding: 0.5rem 0.45rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.fan-toggle.active {
    color: #062006;
    background: rgba(57, 255, 20, 0.85);
    border-color: var(--neon-green);
}

.fan-toggle::after,
.mini-neon-btn::after {
    content: "";
    position: absolute;
    left: -100%;
    top: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
}

.fan-toggle.active::after,
.mini-neon-btn:hover::after {
    animation: button-scan 0.7s ease;
}

.static-color-row {
    margin-top: 0.7rem;
}

.color-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#static-color-input {
    width: 52px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid rgba(0, 246, 255, 0.45);
    background: transparent;
    cursor: pointer;
}

.neon-back {
    color: var(--neon-cyan);
    text-decoration: none;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0,246,255,0.3);
    border-radius: 6px;
    transition: background 0.2s, box-shadow 0.2s;
}

.neon-back:hover {
    background: rgba(0,246,255,0.1);
    box-shadow: 0 0 12px rgba(0,246,255,0.3);
}

/* ═══════════════════════════════════════════════
   Dashboard – HUD mast (design-only / no hardware)
   ═══════════════════════════════════════════════ */
.hud-mast {
    max-width: 1100px;
    margin: 1.2rem auto 0.6rem;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

.hud-mast-inner {
    border-radius: 18px;
    padding: 1.1rem 1.1rem;
    background:
        linear-gradient(180deg, rgba(0, 246, 255, 0.10), rgba(214, 0, 249, 0.06)),
        rgba(5, 0, 10, 0.72);
    border: 1px solid rgba(0, 246, 255, 0.28);
    box-shadow:
        0 0 28px rgba(0, 246, 255, 0.14),
        0 0 55px rgba(214, 0, 249, 0.06);
    overflow: hidden;
    position: relative;
}

.hud-mast-inner::before {
    content: "";
    position: absolute;
    inset: -140% auto auto -30%;
    width: 65%;
    height: 340%;
    background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.12) 50%, transparent 65%);
    transform: rotate(18deg);
    animation: hud-sweep 7.2s linear infinite;
    pointer-events: none;
}

@keyframes hud-sweep {
    0% { transform: translateX(-140%) rotate(18deg); }
    100% { transform: translateX(240%) rotate(18deg); }
}

.hud-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

.hud-logo {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(0, 246, 255, 0.22);
    box-shadow: 0 0 16px rgba(0, 246, 255, 0.18);
}

.hud-brand-text {
    flex: 1;
    min-width: 240px;
}

.hud-eyebrow {
    color: var(--neon-cyan);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.95;
}

.hud-tagline {
    margin-top: 0.35rem;
    font-family: 'Inter', sans-serif;
    color: rgba(224, 247, 255, 0.80);
    line-height: 1.55;
    max-width: 64ch;
}

.hud-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.hud-kpi {
    border-radius: 14px;
    padding: 0.85rem 0.9rem;
    background: rgba(8, 0, 14, 0.62);
    border: 1px solid rgba(0, 246, 255, 0.18);
    box-shadow: 0 0 16px rgba(0, 246, 255, 0.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.hud-kpi-label {
    color: rgba(160, 212, 240, 0.70);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hud-kpi-value {
    margin-top: 0.35rem;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    color: #eaffff;
    text-shadow: 0 0 12px rgba(0, 246, 255, 0.22);
}

.hud-kpi-sub {
    margin-top: 0.25rem;
    font-family: 'Inter', sans-serif;
    color: rgba(160, 212, 240, 0.62);
    font-size: 0.85rem;
    line-height: 1.35;
}

/* ═══════════════════════════════════════════════
   Dashboard – Tab Navigation
   ═══════════════════════════════════════════════ */
.terminal-nav {
    padding: 1rem 3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    border-bottom: 1px solid rgba(0,246,255,0.15);
    position: relative;
    --active-x: 0px;
    --active-w: 0px;
    --indicator-opacity: 0;
}

/* Modern sticky glass tabbar */
.terminal-nav {
    position: sticky;
    top: 0;
    z-index: 6;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: linear-gradient(180deg, rgba(5, 0, 10, 0.82), rgba(5, 0, 10, 0.55));
}

.terminal-nav::after {
    content: "";
    position: absolute;
    left: var(--active-x);
    bottom: 0;
    width: var(--active-w);
    height: 3px;
    border-radius: 999px;
    opacity: var(--indicator-opacity);
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
    box-shadow: 0 0 8px var(--neon-cyan), 0 0 16px rgba(57,255,20,0.65);
    transition: left 0.32s cubic-bezier(.22,.61,.36,1), width 0.32s cubic-bezier(.22,.61,.36,1), opacity 0.18s ease;
    pointer-events: none;
}

/* FIX: Single unified .tab-btn — was declared twice causing conflicts */
.tab-btn {
    background: rgba(0,246,255,0.07);
    border: 1px solid var(--neon-cyan);
    border-radius: 8px 8px 0 0;
    color: var(--text-dim);
    padding: 0.7rem 1.3rem;
    margin-bottom: -2px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.tab-btn:hover {
    background: rgba(0,246,255,0.18);
    color: var(--text);
    box-shadow: 0 2px 12px rgba(0,246,255,0.2);
}

.tab-btn.active {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 4px 18px rgba(0,246,255,0.3);
    border-bottom: 2.5px solid var(--neon-green);
}

/* Cyberpunk tab “brackets” */
.tab-btn::before,
.tab-btn::after {
    content: "";
    position: absolute;
    inset: 10px auto 10px auto;
    width: 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.tab-btn::before {
    left: 10px;
    border-left: 2px solid rgba(0, 246, 255, 0.55);
    border-top: 2px solid rgba(0, 246, 255, 0.35);
    border-bottom: 2px solid rgba(0, 246, 255, 0.35);
    transform: translateX(-2px);
}

.tab-btn::after {
    right: 10px;
    border-right: 2px solid rgba(57, 255, 20, 0.55);
    border-top: 2px solid rgba(57, 255, 20, 0.35);
    border-bottom: 2px solid rgba(57, 255, 20, 0.35);
    transform: translateX(2px);
}

.tab-btn:hover::before,
.tab-btn:hover::after,
.tab-btn.active::before,
.tab-btn.active::after {
    opacity: 1;
    transform: translateX(0);
}

/* ═══════════════════════════════════════════════
   Dashboard – Tab Panels
   ═══════════════════════════════════════════════ */
.tab-content {
    position: relative;
    min-height: 340px;
    max-width: 920px;          /* FIX: was 700px — too cramped for hardware grid & LED canvas */
    margin: 2.5rem auto 2rem auto;
    padding: 0 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.tab-panel {
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    opacity: 0;
    transform: translateX(30px) scale(0.985);
    pointer-events: none;
    transition: opacity 0.42s cubic-bezier(.22,.61,.36,1), transform 0.42s cubic-bezier(.22,.61,.36,1);
    background: rgba(13,0,21,0.92);
    border-radius: 18px;
    box-shadow: 0 0 32px rgba(0,246,255,0.08), 0 2px 16px rgba(0,0,0,0.3);
    padding: 2.2rem 2rem 1.5rem 2rem;
    z-index: 1;
    will-change: transform, opacity;
}

.tab-panel.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
    z-index: 2;
}

.reveal {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
    transition: opacity 0.6s cubic-bezier(.22,.61,.36,1), transform 0.6s cubic-bezier(.22,.61,.36,1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.reveal[data-reveal="fast"] {
    transition-duration: 0.42s;
}

.tab-panel.tab-enter-forward  { opacity:0; transform:translateX(52px)  scale(0.985); }
.tab-panel.tab-enter-backward { opacity:0; transform:translateX(-52px) scale(0.985); }
.tab-panel.tab-enter-active   { opacity:1; transform:translateX(0)     scale(1); }
.tab-panel.tab-exit-forward   { opacity:0; transform:translateX(-52px) scale(0.985); pointer-events:none; }
.tab-panel.tab-exit-backward  { opacity:0; transform:translateX(52px)  scale(0.985); pointer-events:none; }

/* Section headers */
.section-header.terminal-header {
    font-size: 1rem;
    letter-spacing: 0.12em;
    color: var(--neon-green);
    margin-bottom: 1.2rem;
    text-shadow: 0 0 6px rgba(57,255,20,0.4);
}

/* Overview list */
.tab-panel ul {
    list-style: none;
    margin-top: 1rem;
}

.tab-panel ul li {
    padding: 0.4rem 0;
    padding-left: 1.2rem;
    position: relative;
    color: var(--text-dim);
}

.tab-panel ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--neon-cyan);
}

/* Worklog tasks */
.task {
    color: var(--text);
    font-size: 0.95rem;
    margin-top: 0.8rem;
    letter-spacing: 0.04em;
}

/* Checkpoints */
.checkpoint {
    padding: 0.6rem 0.8rem;
    margin: 0.5rem 0;
    border-radius: 6px;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
}

.checkpoint.ok {
    color: var(--neon-green);
    border-left: 3px solid var(--neon-green);
    background: rgba(57,255,20,0.06);
}

.checkpoint.work {
    color: var(--neon-pink);
    border-left: 3px solid var(--neon-pink);
    background: rgba(255,46,165,0.06);
}

/* ═══════════════════════════════════════════════
   Empty section placeholders
   ═══════════════════════════════════════════════ */
.placeholder-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    border: 1px dashed rgba(0,246,255,0.25);
    border-radius: 12px;
    background: rgba(0,246,255,0.03);
    text-align: center;
    margin-top: 1rem;
}

.placeholder-icon {
    font-size: 2.4rem;
    margin-bottom: 0.8rem;
    opacity: 0.6;
    filter: drop-shadow(0 0 6px var(--neon-cyan));
}

.placeholder-title {
    color: var(--text-dim);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}

.placeholder-sub {
    color: rgba(160,212,240,0.5);
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
}

.schema-shell {
    margin: 0;
    padding: 0.9rem;
    border: 1px solid rgba(0, 246, 255, 0.45);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(0, 246, 255, 0.05), rgba(214, 0, 249, 0.05));
    box-shadow: 0 0 22px rgba(0, 246, 255, 0.2);
}

.schema-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    border: 1px solid rgba(0, 246, 255, 0.55);
    border-radius: 10px;
    background: #030007;
    box-shadow: 0 0 14px rgba(0, 246, 255, 0.25);
}

.schema-caption {
    margin-top: 0.8rem;
    color: #b4f7ff;
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════
   Journal
   ═══════════════════════════════════════════════ */
#journal-input {
    width: 100%;
    height: 90px;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--neon-cyan);
    border-radius: 6px;
    color: var(--text);
    padding: 0.8rem;
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    resize: vertical;
}

#journal-input:focus {
    outline: none;
    border-color: var(--neon-green);
    box-shadow: 0 0 12px rgba(57,255,20,0.2);
}

#journal-add {
    background: var(--neon-green);
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 0.7rem 1.4rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    letter-spacing: 0.06em;
    transition: box-shadow 0.2s, transform 0.1s;
}

#journal-add:hover {
    box-shadow: 0 0 16px rgba(57,255,20,0.4);
}

#journal-add:active {
    transform: scale(0.97);
}

#journal-entries > div {
    margin: 1rem 0;
    padding: 0.6rem 0 0.6rem 1rem;
    border-left: 3px solid var(--neon-cyan);
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.5;
}

#journal-entries > div small {
    color: rgba(0,246,255,0.6);
}

.journal-empty {
    color: var(--text-dim);
    opacity: 0.5;
    font-size: 0.85rem;
    margin-top: 1rem;
}

/* ═══════════════════════════════════════════════
   Focus & accessibility
   ═══════════════════════════════════════════════ */
select:focus {
    outline: 2px solid var(--neon-green);
}

.tab-btn:focus-visible {
    outline: 2px solid var(--neon-pink);
    outline-offset: 2px;
}

.neon-back:focus-visible {
    outline: 2px solid var(--neon-pink);
    outline-offset: 2px;
}

.led-btn:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
}

#journal-add:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
}

.perf-toggle:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
}

/* ── Progress bar a11y ───────────────────────── */
.progress-container[role="progressbar"] {
    position: relative;
}

/* ── Screenreader only utility ──────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ═══════════════════════════════════════════════
   Reduced motion
   ═══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    body:not(.force-motion) .tab-panel,
    .tab-panel.tab-enter-forward,
    .tab-panel.tab-enter-backward,
    .tab-panel.tab-enter-active,
    .tab-panel.tab-exit-forward,
    .tab-panel.tab-exit-backward {
        transition: none;
        transform: none;
    }
    body:not(.force-motion) .crt-overlay,
    body:not(.force-motion) .scanlines { animation: none; display: none; }
    body:not(.force-motion) .noise-layer,
    body:not(.force-motion) .mesh-bg,
    body:not(.force-motion) .connex-canvas { display: none; }
    body:not(.force-motion) .logo-glitch { animation: none; }
    body:not(.force-motion) .glitch::before,
    body:not(.force-motion) .glitch::after,
    body:not(.force-motion) .glitch-small::before,
    body:not(.force-motion) .glitch-small::after { animation: none; content: none; }
    body:not(.force-motion) .progress-bar { animation: none; }
    body:not(.force-motion) .footage-shell::before { animation: none; }
    body:not(.force-motion) .hardware-card::before { animation: none; }
    body:not(.force-motion) .hud-mast-inner::before { animation: none; display: none; }
    body:not(.force-motion) .neon-button { transition: none; }
    body:not(.force-motion) .button-glitch-layer { display: none; }
    body:not(.force-motion) .reveal { opacity: 1; transform: none; transition: none; }
}

/* Runtime performance mode for constrained devices */
body.perf-lite .scanlines,
body.perf-lite .crt-overlay,
body.perf-lite .noise-layer,
body.perf-lite .mesh-bg,
body.perf-lite .connex-canvas,
body.perf-lite .footage-shell::before,
body.perf-lite .hardware-card::before,
body.perf-lite .glitch::before,
body.perf-lite .glitch::after,
body.perf-lite .glitch-small::before,
body.perf-lite .glitch-small::after {
    display: none !important;
    animation: none !important;
}

body.perf-lite .tab-panel,
body.perf-lite .tab-btn,
body.perf-lite .neon-button,
body.perf-lite .hardware-card,
body.perf-lite .led-btn,
body.perf-lite .progress-bar {
    transition: none !important;
}

body.perf-lite .terminal-nav {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.perf-lite .logo-glitch,
body.perf-lite .progress-bar {
    animation: none !important;
}

body.perf-lite .tab-panel,
body.perf-lite .footage-shell,
body.perf-lite .ledstrip-shell,
body.perf-lite .hardware-card,
body.perf-lite #led-strip-canvas {
    box-shadow: 0 0 10px rgba(0, 246, 255, 0.15) !important;
}

/* ═══════════════════════════════════════════════
   Glitch flash (tab switch)
   ═══════════════════════════════════════════════ */
.glitch-flash {
    animation: glitch-flash-anim 0.35s ease-out;
}

.gateway-transition-out {
    animation: gateway-fade-out 0.28s ease forwards;
}

@keyframes gateway-fade-out {
    from { opacity: 1; filter: none; }
    to { opacity: 0; filter: blur(0.8px) brightness(1.15); }
}

@keyframes glitch-flash-anim {
    0%   { filter: brightness(1.3) hue-rotate(10deg); }
    50%  { filter: brightness(1) hue-rotate(-5deg); }
    100% { filter: none; }
}

/* ═══════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════ */
@media (max-width: 720px) {
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.2rem 1rem;
    }
    .header-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    .serial-hub {
        margin-top: 0.7rem;
        padding: 0 0.7rem;
    }
    .hud-kpis {
        grid-template-columns: 1fr;
    }
    .system-grid {
        grid-template-columns: 1fr;
    }
    .status-kpis {
        grid-template-columns: 1fr 1fr;
    }
    .fan-switches {
        grid-template-columns: 1fr;
    }
    .terminal-nav {
        justify-content: center;
        padding: 0.8rem 1rem;
        gap: 0.5rem;
    }
    .terminal-nav::after { height: 2.5px; }
    .tab-btn {
        font-size: 0.72rem;
        padding: 0.55rem 0.7rem;
    }
    .footage-shell {
        padding: 0.75rem;
        border-radius: 12px;
    }
    .footage-label {
        font-size: 0.72rem;
        letter-spacing: 0.12em;
    }
    .footage-caption {
        font-size: 0.9rem;
    }
    .schema-shell {
        padding: 0.7rem;
    }
    .schema-caption {
        font-size: 0.88rem;
    }
    .hardware-card:hover {
        transform: none;
    }
    .hardware-card:hover img {
        transform: none;
    }
    .led-btn-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .system-status {
        font-size: 0.72rem;
        letter-spacing: 0.1em;
    }
    .welcome-message {
        font-size: 0.92rem;
    }
    .subtitle-wrapper,
    .description,
    .welcome-message {
        width: min(100%, 94vw);
    }
}

@media (max-width: 800px) {
    .tab-content {
        max-width: 99vw;
        padding: 0 0.5rem;
    }
    .tab-panel { padding: 1.2rem 0.8rem; }
    .hero, .terminal-footer {
        max-width: 98vw;
        font-size: 1rem;
    }
    .logo-glitch { height: 60px; }
    .neon-button { font-size: 1rem; padding: 12px 18px; letter-spacing: 2px; }
    .serial-connect-btn {
        font-size: 0.82rem;
        letter-spacing: 0.08em;
    }
}

/* Index-specific responsive tweaks */
@media (max-width: 600px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
        padding: 1rem;
    }
    .logo img {
        width: 60px;
        height: auto;
    }
    .hero {
        padding: 1.5rem 0.8em 1rem;
    }
    .neon-button {
        font-size: 1em;
        padding: 0.7em 1.2em;
    }
    .terminal-footer {
        font-size: 0.95em;
        padding: 0.7em 0.4em;
        word-break: break-word;
    }
    .cyber-grid {
        background-size: 42px 42px;
        opacity: 0.34;
    }
}
