:root {
    --brand: #007bff;
    --brand-light: #3399ff;
    --brand-dark: #0056b3;
    --bg-color: #080c14;
    --code-bg: #0d1117;
    --text-main: #f8fafc;
    --text-light: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dark: #64748b;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    --btn-bg: rgba(255, 255, 255, 0.06);
    --btn-border: rgba(255, 255, 255, 0.15);
    --btn-hover-bg: rgba(0, 123, 255, 0.15);
    --btn-hover-border: rgba(0, 123, 255, 0.4);
    --btn-active-bg: rgba(0, 123, 255, 0.3);

    --font-sans: 'Poppins', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ================= RESET & BASE ================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    scroll-behavior: smooth;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;

    /* Nasconde la barra di scorrimento verticale principale (Firefox, IE, Edge) */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Nasconde la barra di scorrimento verticale principale (Chrome, Safari, Opera) */
body::-webkit-scrollbar {
    display: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

button {
    border: none;
    background: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

ul,
ol {
    padding-left: 1.25rem;
}

.container {
    width: 100%;
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-sm {
    width: 100%;
    max-width: 896px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-brand {
    color: var(--brand);
}

.text-center {
    text-align: center;
}

/* ================= BACKGROUND ANIMATION ================= */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #050810 0%, #001a3a 100%);
}

.shape {
    position: absolute;
    filter: blur(90px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
    border-radius: 50%;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--brand);
    animation-delay: 0s;
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--brand-dark);
    animation-delay: -5s;
}

.shape-3 {
    top: 40%;
    left: 30%;
    width: 40vw;
    height: 40vw;
    background: var(--brand-light);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(5%, 10%) scale(1.05);
    }
}

/* ================= GLASSMORPHISM COMPONENTS ================= */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 12px;
}

.glass-button {
    background: var(--btn-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--btn-border);
    border-radius: 8px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
}

.glass-button:hover {
    background: var(--btn-hover-bg);
    border-color: var(--btn-hover-border);
    transform: translateY(-1px);
}

.glass-button:active {
    background: var(--btn-active-bg);
    transform: translateY(0);
}

/* ================= NAVBAR ================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    height: 4rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    z-index: 20;
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    z-index: 20;
    gap: 1rem;
}

.nav-logo-img {
    height: 2rem;
    width: auto;
    object-fit: contain;
}

.nav-divider {
    width: 1px;
    height: 2rem;
    background: rgba(255, 255, 255, 0.2);
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    margin-right: 1rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-light);
}

.nav-link:hover {
    color: var(--brand);
}

.menu-btn {
    display: none;
    padding: 0.25rem;
    z-index: 50;
    margin-left: 0.5rem;
}

.lang-toggle {
    padding: 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    height: 2rem;
    width: 2.5rem;
    border-radius: 6px;
}

.nav-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.autolabs-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-light);
    display: none;
    white-space: nowrap;
}

.logo-svg {
    width: 34px;
    height: 34px;
}

/* Mobile Menu */
#mobileMenu {
    position: fixed;
    top: 4rem;
    left: 0;
    width: 100%;
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    z-index: 40;
    border-radius: 0 0 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: top;
    display: none;
}

#mobileMenu.hidden-menu {
    opacity: 0;
    pointer-events: none;
    transform: scaleY(0.95);
}

#mobileMenu.active-menu {
    opacity: 1;
    pointer-events: auto;
    transform: scaleY(1);
}

.mobile-link {
    display: block;
    text-align: center;
    padding: 0.75rem;
    background: transparent;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-light);
}

.mobile-link:active {
    background: rgba(0, 123, 255, 0.1);
    color: var(--brand);
}

/* ================= MAIN CONTENT ================= */
main {
    flex-grow: 1;
    padding: 2rem 0 5rem;
    position: relative;
    z-index: 10;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 2.5rem;
    margin-top: 1rem;
}

.hero h2 {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.hero p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.hero p.small {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.btn-primary {
    padding: 0.6rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-brand {
    border-color: rgba(0, 123, 255, 0.3);
    color: var(--brand);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.2);
}

/* ================= SIMULATION CANVAS & OVERLAY ================= */
.sim-section {
    margin-bottom: 3rem;
}

.sim-panel {
    padding: 0.5rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.simulation-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: black;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.simulation-container:fullscreen,
.simulation-container:-webkit-full-screen,
.simulation-container:-moz-full-screen {
    aspect-ratio: auto !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    background: black;
    margin: 0 !important;
    padding: 0 !important;
}

.simulation-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: inherit;
    z-index: 10;
}

.sim-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    pointer-events: none;
    padding: 1rem;
    text-align: center;
    z-index: 1;
}

.sim-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.sim-placeholder p {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ======== CONTROLS HUD (OVERLAY E NORMALI) ======== */
.controls-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;

    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    padding-top: max(1rem, env(safe-area-inset-top));

    box-sizing: border-box;
}

.overlay-top,
.overlay-bottom {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.overlay-bottom {
    align-items: flex-end;
}

/* Contenitore per impilare Slider (sopra) e WASD (sotto) a sinistra */
.bottom-left-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.overlay-group {
    pointer-events: auto;
    display: flex;
    gap: 0.375rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.375rem;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: opacity 0.2s;
}

.cam-group {
    flex-wrap: wrap;
    max-width: 200px;
}

.wasd-group {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.wasd-row {
    display: flex;
    gap: 0.25rem;
}

.actions-group {
    flex-direction: column;
    gap: 0.375rem;
    align-items: flex-end;
}

.overlay-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-sans);
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.overlay-btn:active,
.overlay-btn:hover {
    background: rgba(0, 123, 255, 0.3);
    border-color: rgba(0, 123, 255, 0.5);
}

.btn-square {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
}

.btn-rect {
    padding: 0 0.75rem;
    height: 2.5rem;
    font-size: 0.75rem;
    gap: 0.375rem;
}

.text-danger {
    color: #f87171;
}

/* Speed Slider Verticale Standalone */
.speed-slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem;
    width: fit-content;
}

.slider-wrapper {
    width: 1.5rem;
    height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speed-slider {
    width: 4.5rem;
    height: 4px;
    transform: rotate(-90deg);
    transform-origin: center;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-light);
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.speed-slider::-webkit-slider-thumb:hover {
    background: var(--brand);
}

.speed-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: var(--text-light);
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.speed-slider::-moz-range-thumb:hover {
    background: var(--brand);
}

/* Architecture Section */
.tech-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.tech-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    margin: 0;
    line-height: 1.3;
}

.tech-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    min-width: 0;
}

.theory-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.theory-block h3 {
    color: var(--brand);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 123, 255, 0.2);
}

.theory-block p,
.theory-block li {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.6;
}

.theory-block ul,
.theory-block ol {
    margin-top: 0.375rem;
}

.theory-block li {
    margin-bottom: 0.375rem;
}

.theory-block strong {
    color: var(--text-main);
}

/* Code & Diagrams Column */
.visual-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
    width: 100%;
}

.code-panel {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

.code-header {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-header span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.code-body {
    background: var(--code-bg);
    padding: 1rem;
    flex-grow: 1;
    overflow-x: auto;

    /* Stile barra di scorrimento orizzontale per Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) var(--code-bg);
}

/* Stile barra di scorrimento orizzontale per Chrome, Safari, Edge */
.code-body::-webkit-scrollbar {
    height: 8px;
}

.code-body::-webkit-scrollbar-track {
    background: var(--code-bg);
    border-radius: 4px;
}

.code-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.code-body::-webkit-scrollbar-thumb:hover {
    background: var(--brand);
}

.code-body pre {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-light);
    margin: 0;
}

.t-kw {
    color: #ff7b72;
}

.t-prop {
    color: #79c0ff;
}

.t-op {
    color: #c9d1d9;
}

.t-com {
    color: #8b949e;
    font-style: italic;
}

.t-fn {
    color: #d2a8ff;
}

.diagram-panel {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-grow: 1;
    min-width: 0;
    width: 100%;
}

.diagram-title {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--text-dark);
    position: absolute;
    top: 0.5rem;
    left: 0.75rem;
}

.concept-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    width: 100%;
}

.concept-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.box-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.box-icon.brand {
    background: rgba(0, 123, 255, 0.2);
    border-color: var(--brand);
    color: var(--brand);
    border-radius: 50%;
}

.box-icon.pid {
    background: var(--brand);
    border-color: var(--brand);
    border-radius: 4px;
    width: 2.5rem;
    font-weight: 700;
    font-size: 0.625rem;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.4);
}

.box-label {
    font-size: 0.625rem;
    margin-top: 0.25rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.feedback-line {
    width: 80%;
    height: 1px;
    background: rgba(0, 123, 255, 0.4);
    margin-top: 1.25rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-up {
    position: absolute;
    width: 1px;
    height: 1rem;
    background: rgba(0, 123, 255, 0.4);
    top: -1rem;
}

.feedback-up.left {
    left: 0;
}

.feedback-up.right {
    right: 0;
}

.sensor-tag {
    background: var(--bg-color);
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 10;
    font-size: 0.5625rem;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
}

.pid-internal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-light);
    width: 100%;
    flex-wrap: wrap;
}

.pid-blocks {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    width: 6rem;
}

.pid-block {
    border: 1px solid rgba(0, 123, 255, 0.5);
    background: rgba(0, 123, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-align: center;
    font-size: 0.625rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.sum-node {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid var(--brand);
    background: rgba(0, 123, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--brand);
    font-size: 1.125rem;
    flex-shrink: 0;
}

.svg-wrapper {
    width: 100%;
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.svg-diagram {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.04));
    max-width: 900px;
    min-width: 500px;
}

/* Data Plots Section (Altezza dinamica) */
.plot-section {
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.plot-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.plot-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.plot-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.plot-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    width: 100%;
    min-height: 150px;
    position: relative;
}

.plot-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
    position: relative;
    z-index: 10;
}

.plot-placeholder span {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
    position: absolute;
    z-index: 1;
}

.plot-caption {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    z-index: 20;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.75rem;
    border-radius: 4px;
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s;
    text-align: center;
}

.plot-container:hover .plot-caption {
    opacity: 1;
}

.plot-caption p {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand);
    margin: 0;
}

/* ================= FOOTER ================= */
footer {
    margin-top: auto;
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

footer p {
    margin: 0;
}

.footer-main {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.footer-sub {
    font-size: 0.625rem;
    color: var(--text-dark);
}

/* ================= RESPONSIVE MEDIA QUERIES ================= */

@media (min-width: 1500px) {
    .menu-btn {
        display: none !important;
    }

    .nav-links {
        display: flex !important;
    }

    #mobileMenu {
        display: none !important;
    }
}

@media (max-width: 1499px) {
    .nav-links {
        display: none !important;
    }

    .menu-btn {
        display: block !important;
    }
}

@media (min-width: 768px) {
    .autolabs-text {
        display: block;
    }
}

@media (min-width: 640px) {
    .nav-title {
        font-size: 1.25rem;
    }

    .hero h2 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .concept-row {
        gap: 1rem;
    }

    .tech-header h2 {
        font-size: 1.5rem;
    }

    .theory-card {
        padding: 1.5rem;
    }

    .diagram-panel {
        padding: 1.5rem;
    }

    .svg-wrapper {
        justify-content: center;
        overflow-x: hidden;
    }

    .btn-square {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.125rem;
    }

    .btn-rect {
        height: 2.75rem;
        font-size: 0.875rem;
        padding: 0 1rem;
    }

    .cam-group {
        max-width: none;
    }
}

@media (min-width: 1024px) {
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 639px) {
    .nav-title {
        font-size: 0.85rem;
    }

    .nav-logo-img {
        height: 1.5rem;
        margin: 3px 0 0 0;
    }

    .logo-svg {
        width: 32px;
        height: 32px;
    }

    .autolabs-text {
        font-size: 0.95rem;
    }
}

@media (max-width: 639px),
(max-height: 500px) and (orientation: landscape) {
    .controls-overlay {
        padding: 0.5rem;
        padding-left: max(0.5rem, env(safe-area-inset-left));
        padding-right: max(0.5rem, env(safe-area-inset-right));
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
        padding-top: max(0.5rem, env(safe-area-inset-top));
    }

    .btn-square {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.875rem;
    }

    .btn-rect {
        height: 2.25rem;
        font-size: 0.75rem;
        padding: 0 0.5rem;
    }

    .overlay-group {
        gap: 0.25rem;
        padding: 0.25rem;
        width: fit-content;
    }

    .cam-group {
        max-width: 140px;
    }

    .bottom-left-controls {
        gap: 0.25rem;
    }

    .speed-slider-container {
        display: none;
    }

    .is-fullscreen .speed-slider-container {
        display: flex;
    }
}