/* ============================================================
   A-LAB AUDIO STUDIO — design system
   Espejo de la estética A-Lab (lab/index.html): tokens,
   navbar glass, hero con canvas, tarjetas, botones, pills,
   footer, reveal on scroll y responsive.
   ============================================================ */

/* === Design Tokens === */
:root {
    --bg: #08080c;
    --bg2: #121218;
    --surface: #101016;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f2f2ee;
    --text2: #9a9aa5;
    --accent: #A855F7;
    --accent-glow: rgba(168, 85, 247, 0.4);
    --primary: #00FFFF;
    --danger: #ff6b81;

    --font-display: 'Space Grotesk', 'Poppins', system-ui, sans-serif;
    --font-body: 'Poppins', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, system-ui, monospace;

    --navbar-height: 64px;
    --section-max: 1180px;
    --radius: 14px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; background-color: var(--bg); }

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text);
    line-height: 1.6;
    background-color: var(--bg);
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }

a { color: var(--text); text-decoration: none; }
img, canvas, svg { vertical-align: middle; }

::selection { background: rgba(168, 85, 247, 0.45); color: #ffffff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #23232e; border-radius: 5px; border: 2px solid var(--bg); }

::-webkit-scrollbar-thumb:hover { background: #2f2f3d; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* === Navbar glass === */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: var(--navbar-height);
    background-color: rgba(10, 10, 12, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-brand { flex: 1; display: flex; align-items: center; min-width: 0; }

.nav-brand a {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text);
    white-space: nowrap;
}

.nav-brand a span { color: var(--primary); }

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex: 2;
    gap: 0.1rem;
}

.nav-links li { height: 100%; display: flex; align-items: center; }

.nav-links a {
    color: var(--text2);
    font-weight: 400;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    padding: 0 0.7rem;
    height: 100%;
    display: flex;
    align-items: center;
    letter-spacing: 0.02em;
}

.nav-links a:hover { color: var(--primary); }
.nav-links a.active { color: var(--accent); font-weight: 600; }

.nav-right { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; }

.nav-pill {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 50px;
    padding: 0.3rem 0.7rem;
    white-space: nowrap;
}

/* Hamburguesa (solo móvil) */
.hamburger-menu {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    min-width: 44px;
    min-height: 44px;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text);
    margin: 5px 0;
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.hamburger-menu.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; transform: translateX(-20px); }
.hamburger-menu.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

.mobile-menu-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 19999; }

.mobile-menu-overlay.active { display: block; }

/* === Hero === */
.lab-hero {
    height: 100vh;
    height: 100svh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    background-color: var(--bg);
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
    cursor: crosshair;
}

.lab-hero-content {
    position: relative;
    z-index: 3;
    padding: 2rem;
    pointer-events: none;
    max-width: 880px;
    margin: 2.5rem auto 0;
}

/* Halo radial oscuro para garantizar legibilidad */
.lab-hero-content::before {
    content: "";
    position: absolute;
    inset: -22% -25%;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgba(8, 8, 12, 0.88) 0%, rgba(8, 8, 12, 0.55) 48%, transparent 75%);
    pointer-events: none;
}

.lab-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
    opacity: 0.9;
}

.lab-hero h1 {
    font-size: clamp(3.4rem, 8.5vw, 6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    color: var(--text);
    text-shadow: 0 0 35px rgba(168, 85, 247, 0.25);
}

.lab-hero h1 span { color: var(--accent); }

.lab-subtitle {
    color: var(--text2);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    font-weight: 300;
    max-width: 640px;
    margin: 1.8rem auto 0;
    line-height: 1.6;
}

/* Cue de scroll */
.lab-scroll-cue {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text2);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    transition: color 0.3s ease, transform 0.3s ease;
    padding: 0.5rem 1rem;
    min-width: 44px;
    min-height: 44px;
}

.lab-scroll-cue:hover { color: var(--accent); transform: translateX(-50%) translateY(3px); }

.lab-scroll-line { width: 1px; height: 36px; background: linear-gradient(to bottom, transparent, var(--accent)); }

.lab-scroll-chevron svg { animation: labFloat 2s ease-in-out infinite; }

@keyframes labFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* === Secciones === */
.lab-section { padding: 6rem 2rem; max-width: var(--section-max); margin: 0 auto; position: relative; z-index: 2; }

.lab-section[id],
.panel[id] { scroll-margin-top: calc(var(--navbar-height) + 1rem); }

.section-head { text-align: center; max-width: 700px; margin: 0 auto 3.5rem; }

.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.9rem;
}

.section-head h2 { font-size: 2.6rem; margin-bottom: 0.8rem; }

.section-sub { color: var(--text2); font-size: 1.05rem; font-weight: 300; }

/* === Grid de paneles === */
.panels-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: stretch; }

.panel {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: transform 0.45s var(--ease-out), border-color 0.45s ease, box-shadow 0.45s ease;
}

.panel:hover { transform: translateY(-4px); border-color: rgba(168, 85, 247, 0.5); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 30px rgba(168, 85, 247, 0.12); }

.panel-wide { grid-column: 1 / -1; }

/* Estados de carga / terminado (controla main.js) */
.panel.is-busy,
.btn.is-busy { opacity: 0.5; pointer-events: none; }

.panel.is-done { border-color: rgba(0, 255, 255, 0.5); box-shadow: 0 0 24px rgba(0, 255, 255, 0.1); }

/* === Cabecera de panel === */
.panel-index {
    position: absolute;
    top: 1.1rem;
    right: 1.4rem;
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    color: rgba(168, 85, 247, 0.14);
    user-select: none;
    pointer-events: none;
}

.panel-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.6rem;
    padding-right: 3.5rem;
}

.panel-title { font-size: 1.6rem; letter-spacing: -0.02em; margin-bottom: 0.55rem; }

.panel-desc { font-size: 0.92rem; font-weight: 300; color: var(--text2); line-height: 1.65; }

.panel-body { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 1.2rem; flex: 1; }

/* === Botones === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.68rem 1.25rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(168, 85, 247, 0.06));
    border: 1px solid rgba(168, 85, 247, 0.45);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.18);
}

.btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.45), rgba(168, 85, 247, 0.25));
    border-color: rgba(168, 85, 247, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(168, 85, 247, 0.4);
    color: #ffffff;
}

.btn:active:not(:disabled) { transform: translateY(0); }

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text2);
}

.btn svg { flex: 0 0 auto; }

/* Secundario / fantasma */
.btn-secondary { background: rgba(255, 255, 255, 0.04); border-color: var(--border); color: var(--text2); box-shadow: none; }

.btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); border-color: rgba(168, 85, 247, 0.5); color: var(--text); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }

/* Botón hero (grande) */
.btn-hero { min-height: 62px; font-size: 1.05rem; padding: 0.9rem 1.5rem; }

/* Botón cuadrado de transporte */
.btn-icon { width: 52px; padding: 0; border-radius: 10px; }

/* Toggle activo (main.js agrega la clase) */
.btn-toggle.active,
.btn-toggle.is-active {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.18), rgba(0, 255, 255, 0.05));
    border-color: rgba(0, 255, 255, 0.6);
    color: var(--primary);
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.15);
}

.btn-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }

/* Spinner CSS (disponible para main.js) */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Pills / tags === */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.25);
    color: var(--accent);
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* === Formularios === */
.field { display: flex; flex-direction: column; gap: 0.35rem; flex: 1 1 auto; min-width: 0; }

.field-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text2); }

.field-input {
    min-height: 44px;
    width: 100%;
    padding: 0.6rem 0.9rem;
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.field-input::placeholder { color: rgba(154, 154, 165, 0.6); }
.field-input:hover { border-color: rgba(255, 255, 255, 0.18); }

.field-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18); background: rgba(168, 85, 247, 0.05); }

/* Select con chevron propio */
select.field-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%239a9aa5' stroke-width='1.5'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.6rem;
    cursor: pointer;
}

select.field-input:focus {
 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%23A855F7' stroke-width='1.5'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
 }

textarea.field-input { resize: vertical; min-height: 120px; line-height: 1.55; }

/* Números sin flechas nativas */
input[type="number"].field-input { -moz-appearance: textfield; appearance: textfield; font-family: var(--font-mono); font-size: 0.9rem; }

input[type="number"].field-input::-webkit-outer-spin-button,
input[type="number"].field-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* === Sliders (webkit + moz) === */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    min-width: 120px;
    height: 28px;
    background: transparent;
    cursor: pointer;
    flex: 1 1 auto;
}

input[type="range"]::-webkit-slider-runnable-track,
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(0, 255, 255, 0.35), rgba(168, 85, 247, 0.55)); border: 1px solid var(--border); }

input[type="range"]::-webkit-slider-thumb,
input[type="range"]::-moz-range-thumb {
    border-radius: 50%;
    background: var(--text);
    border: 2px solid var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; }

input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; }

input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:hover::-moz-range-thumb { transform: scale(1.15); box-shadow: 0 0 18px var(--accent-glow); }

input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.range-label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--primary);
    min-width: 3.4em;
    text-align: right;
    flex: 0 0 auto;
}

/* === Dropzone === */
.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 190px;
    padding: 2rem 1.5rem;
    border: 1.5px dashed rgba(255, 255, 255, 0.16);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.drag-over { border-color: var(--accent); background: rgba(168, 85, 247, 0.06); box-shadow: 0 0 30px rgba(168, 85, 247, 0.1); }

.dropzone svg { color: var(--accent); transition: transform 0.3s ease; }

.dropzone:hover svg { transform: translateY(-3px); }

.dropzone-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--text); }

.dropzone-sub { font-size: 0.85rem; font-weight: 300; color: var(--text2); }

/* === Micrófono === */
.mic-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }

.rec-timer { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text2); letter-spacing: 0.08em; min-width: 3.4em; }

#mic-btn.recording { color: var(--danger); border-color: rgba(255, 107, 129, 0.6); animation: recPulse 1.2s ease-in-out infinite; }

@keyframes recPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 107, 129, 0.18); }
    50% { box-shadow: 0 0 22px rgba(255, 107, 129, 0.45); }
}

.mic-level {
    display: block;
    width: 100%;
    height: 20px;
    border-radius: 10px;
    background: #0a0a10;
    border: 1px solid var(--border);
    overflow: hidden;
}

/* === Info de pista === */
.track-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.track-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

.track-duration { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text2); white-space: nowrap; }

/* === Waveform === */
.waveform-frame { background: #0a0a10; border: 1px solid var(--border); border-radius: 12px; padding: 0.5rem; transition: border-color 0.3s ease, box-shadow 0.3s ease; }

.panel.is-done .waveform-frame,
.waveform-frame:hover { border-color: rgba(168, 85, 247, 0.35); }

.waveform-canvas {
    display: block;
    width: 100%;
    height: 200px;
    border-radius: 8px;
    cursor: crosshair;
    background: transparent;
}

/* === Transporte === */
.transport {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.transport-buttons { display: flex; align-items: center; gap: 0.6rem; flex: 0 0 auto; }

.time-display {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text2);
    letter-spacing: 0.05em;
    margin-left: 0.4rem;
    white-space: nowrap;
}

.time-sep { opacity: 0.5; margin: 0 0.25rem; }

.master-row { display: flex; align-items: center; gap: 0.8rem; flex: 1 1 260px; min-width: 0; }

.ctl-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text2);
    flex: 0 0 auto;
    white-space: nowrap;
}

/* === Herramientas (tool blocks) === */
.tool {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.3s ease;
}

.tool:hover { border-color: rgba(255, 255, 255, 0.14); }

.tool-label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text2); }

.tool-row { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }

.tool-row .field { flex: 0 1 130px; }

/* === Stems === */
.stems { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.75rem; width: 100%; }

.stems:empty::after {
    content: "La voz y la música separadas van a aparecer acá, listas para escuchar y elegir.";
    display: block;
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--text2);
    opacity: 0.7;
    padding: 0.4rem 0;
}

.stem-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.6rem 1rem;
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.stem-btn:hover:not(:disabled) { border-color: rgba(0, 255, 255, 0.55); color: var(--primary); background: rgba(0, 255, 255, 0.06); transform: translateY(-2px); }

.stem-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* === Nota explicativa === */
.clean-note {
    font-size: 0.83rem;
    font-weight: 300;
    color: var(--text2);
    line-height: 1.6;
    padding: 0.75rem 1rem;
    border-left: 2px solid rgba(0, 255, 255, 0.4);
    background: rgba(0, 255, 255, 0.03);
    border-radius: 0 10px 10px 0;
}

/* === Registro de estado === */
.status-log {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    min-height: 120px;
    max-height: 280px;
    overflow-y: auto;
}

.status-log:empty::before { content: "Los mensajes del estudio van a aparecer acá."; color: var(--text2); opacity: 0.6; }

.status-line { display: block; padding: 0.15rem 0; color: var(--text2); word-break: break-word; }

.status-line::before { content: "> "; color: var(--accent); }

/* === Overlay de progreso === */
.progress-wrap {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    width: min(560px, calc(100vw - 2rem));
    z-index: 30000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.85rem 1.1rem;
    background: rgba(16, 16, 22, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(168, 85, 247, 0.15);
}

.progress-wrap[hidden] { display: none; }

.progress-label { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--text); }

.progress-track { height: 8px; background: rgba(255, 255, 255, 0.06); border-radius: 4px; overflow: hidden; }

.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 50%, var(--accent) 100%);
    background-size: 200% 100%;
    animation: progressSweep 1.6s linear infinite;
    transition: width 0.25s ease;
}

@keyframes progressSweep {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === Footer === */
footer {
    background: transparent;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3.5rem 2rem 2.5rem;
    position: relative;
    z-index: 2;
}

.footer-inner { max-width: var(--section-max); margin: 0 auto; text-align: center; }

.footer-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; color: var(--text); }

.footer-line { color: var(--text2); font-weight: 300; font-size: 0.95rem; margin-top: 0.3rem; }

.footer-copy { font-size: 0.8rem; color: var(--text2); margin-top: 1.6rem; opacity: 0.7; }

/* === Reveal on scroll === */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }

.reveal.revealed { opacity: 1; transform: translateY(0); }

/* === Responsive === */
@media (max-width: 900px) {
    .panels-grid { grid-template-columns: 1fr; }
    .nav-links a { padding: 0 0.55rem; }
    .section-head h2 { font-size: 2.2rem; }
}

@media (max-width: 768px) {
    .navbar { z-index: 20000; padding: 0 1rem; }
    .nav-brand { flex: auto; }
    .nav-right { flex: auto; gap: 0.5rem; }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 72%;
        max-width: 300px;
        height: 100vh;
        background-color: rgba(10, 10, 12, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: calc(var(--navbar-height) + 1.5rem);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        z-index: 20000;
        transform: translateX(100%);
    }

.nav-links.active { right: 0; transform: translateX(0); }

.nav-links li { height: auto; width: 100%; text-align: center; }

.nav-links a { font-size: 1.1rem; padding: 0.9rem 0; height: auto; width: 100%; justify-content: center; }

    .hamburger-menu { display: block; z-index: 20002; }

    .section-head h2 { font-size: 2rem; }
    .section-sub { font-size: 0.98rem; }
    .panel { padding: 1.5rem; }
}

@media (max-width: 600px) {
    .lab-hero { padding: 6.5rem 1.25rem 3rem; }
    .lab-hero-content { padding: 1rem; margin-top: 1rem; }
    .lab-hero h1 { letter-spacing: -0.02em; }
    .lab-scroll-cue { bottom: 1.5rem; }
    .lab-section { padding: 4rem 1.1rem; }
    .section-head { margin-bottom: 2.5rem; }
    .section-head h2 { font-size: 1.75rem; }
    .panel { padding: 1.25rem; border-radius: 12px; }
    .panel-index { font-size: 3rem; top: 1rem; right: 1.1rem; }
    .panel-title { font-size: 1.35rem; }
    .panel-body { gap: 0.95rem; }
    .btn-duo { grid-template-columns: 1fr; }
    .btn-hero { min-height: 56px; font-size: 1rem; }
    .dropzone { min-height: 160px; padding: 1.5rem 1rem; }
    .waveform-canvas { height: 150px; }
    .transport { gap: 0.8rem; padding: 0.8rem; }
    .master-row { flex-basis: 100%; }
    .tool-row .field { flex: 1 1 100%; }
    .stems { grid-template-columns: 1fr; }
    .footer-brand { font-size: 1.15rem; }
}

/* === Prefers reduced motion === */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }

.reveal { opacity: 1; transform: none; }

    .lab-scroll-chevron svg { animation: none; }
    .progress-bar { animation: none; }
    #mic-btn.recording { animation: none; }
}
