/* ── TuneLab ──────────────────────────────────
   Navy-Violet gradient palette with light/dark
   theme support. Mouse glow, grain overlay,
   particles, sharp grid cards.
   ────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;500;600;700&family=DM+Mono:wght@300;400;500&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* ── Dark theme (default) ─────────────────────── */
:root {
    --bg-deep:       #08081a;
    --bg:            #0e0e24;
    --bg-mid:        #121030;
    --surface:       rgba(16, 14, 38, 0.88);
    --surface-solid: #100e26;
    --border:        rgba(30, 28, 68, 0.7);
    --border-solid:  #1e1c44;
    --border-hover:  rgba(60, 56, 120, 0.5);
    --text:          #e0e2f0;
    --text-dim:      #8a88a8;
    --text-muted:    #7a789a;
    --accent:        #60a0ff;
    --accent-dim:    rgba(96, 160, 255, 0.08);
    --accent-glow:   rgba(96, 160, 255, 0.15);
    --warm:          #e8906a;
    --warm-glow:     rgba(232, 144, 106, 0.3);
    --glow-color:    rgba(100, 80, 200, 0.05);
    --glow-card:     rgba(100, 80, 200, 0.06);
    --grain-opacity: 0.035;
    --grad-a:        rgba(100, 80, 200, 0.04);
    --grad-b:        rgba(96, 160, 255, 0.02);
    --body-font:     'DM Sans', system-ui, -apple-system, sans-serif;
    --heading-font:  'Barlow Condensed', sans-serif;
    --mono-font:     'DM Mono', monospace;
}

/* ── Light theme ──────────────────────────────── */
[data-theme="light"] {
    --bg-deep:       #e8e6f0;
    --bg:            #f8f7fc;
    --bg-mid:        #efedf8;
    --surface:       rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --border:        rgba(160, 150, 200, 0.4);
    --border-solid:  #c8c2d8;
    --border-hover:  rgba(140, 130, 190, 0.4);
    --text:          #1a1830;
    --text-dim:      #5a566e;
    --text-muted:    #6a688a;
    --accent:        #4f46e5;
    --accent-dim:    rgba(79, 70, 229, 0.06);
    --accent-glow:   rgba(79, 70, 229, 0.12);
    --warm:          #d06050;
    --warm-glow:     rgba(208, 96, 80, 0.25);
    --glow-color:    rgba(79, 70, 229, 0.03);
    --glow-card:     rgba(79, 70, 229, 0.04);
    --grain-opacity: 0.018;
    --grad-a:        rgba(79, 70, 229, 0.03);
    --grad-b:        rgba(96, 160, 255, 0.02);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--body-font);
    font-weight: 400;
    font-size: 15px;
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    letter-spacing: 0.01em;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── grain overlay ────────────────────────────── */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px;
}

/* ── page-wide mouse glow ─────────────────────── */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        var(--glow-color),
        transparent 40%
    );
}

/* ── background gradient ──────────────────────── */
.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 30% 0%, var(--grad-a) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, var(--grad-b) 0%, transparent 40%),
        linear-gradient(170deg, var(--bg) 0%, var(--bg-deep) 30%, var(--bg-mid) 70%, var(--bg-deep) 100%);
}

/* ── particles ────────────────────────────────── */
#particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    bottom: -4px;
    width: 1px;
    height: 1px;
    background: var(--text-dim);
    border-radius: 50%;
    opacity: 0;
    animation:
        particleDrift var(--dur, 18s) linear var(--delay, 0s) infinite,
        particleTwinkle var(--twinkle, 4s) ease-in-out var(--delay, 0s) infinite;
}

@keyframes particleDrift {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    8%   { opacity: 0.5; }
    88%  { opacity: 0.3; }
    100% { transform: translateY(-105vh) translateX(var(--dx, 20px)); opacity: 0; }
}

@keyframes particleTwinkle {
    0%, 100% { filter: brightness(1); }
    50%      { filter: brightness(2); }
}

[data-theme="light"] .particle { opacity: 0; animation: none; display: none; }
[data-theme="light"] .upload-area {
    border-color: rgba(79, 70, 229, 0.35);
    background: radial-gradient(ellipse at 50% 0%, rgba(79, 70, 229, 0.05) 0%, transparent 70%), var(--surface);
}
[data-theme="light"] .upload-area:hover {
    border-color: rgba(79, 70, 229, 0.55);
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.08), inset 0 1px 0 rgba(79, 70, 229, 0.1);
}
[data-theme="light"] .upload-icon .bar { background: var(--accent); }
[data-theme="light"] .privacy-badge {
    border-color: rgba(22, 163, 74, 0.25);
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(79, 70, 229, 0.03));
    color: var(--text-dim);
    box-shadow: 0 0 12px rgba(22, 163, 74, 0.04);
}
[data-theme="light"] .privacy-badge svg { color: rgba(22, 163, 74, 0.85); }

/* ── light theme depth & polish ──────────────── */
[data-theme="light"] .tool-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(79, 70, 229, 0.03);
}
[data-theme="light"] .tool-card:hover {
    box-shadow: 0 8px 28px rgba(79, 70, 229, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .featured-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(79, 70, 229, 0.04);
    border-left-color: var(--accent);
}
[data-theme="light"] .why-block {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(79, 70, 229, 0.03);
}
[data-theme="light"] .why-block:hover {
    box-shadow: 0 8px 28px rgba(79, 70, 229, 0.08), 0 2px 8px rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .why-icon {
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.15);
}
[data-theme="light"] .faq-item {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .faq-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.06);
}
[data-theme="light"] .faq-section h2 { color: var(--text); }
[data-theme="light"] .related-tool-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(79, 70, 229, 0.03);
}
[data-theme="light"] .related-tool-card:hover {
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.1);
}
[data-theme="light"] .category-section h2::before {
    background: var(--accent);
}
[data-theme="light"] .step-pill {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] footer::before {
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.25;
}

/* ── nav ──────────────────────────────────────── */
nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(14, 14, 36, 0.72);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
[data-theme="light"] nav {
    background: rgba(248, 247, 252, 0.78);
}

nav .logo {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color 0.2s;
}
nav .logo:hover { color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.nav-right a {
    font-family: var(--mono-font);
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--text-dim);
    text-decoration: none;
    letter-spacing: 0.5px;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.nav-right a:hover {
    color: var(--text);
    background: rgba(96, 160, 255, 0.06);
    border-color: rgba(96, 160, 255, 0.12);
}
.nav-right a.active {
    color: var(--accent);
    background: rgba(96, 160, 255, 0.08);
    border-color: rgba(96, 160, 255, 0.15);
}
[data-theme="light"] .nav-right a:hover {
    background: rgba(79, 70, 229, 0.06);
    border-color: rgba(79, 70, 229, 0.12);
}
[data-theme="light"] .nav-right a.active {
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.15);
}
.nav-short { display: none; }
@media (max-width: 900px) {
    .nav-full { display: none; }
    .nav-short { display: inline; }
}

/* ── nav dropdown (All Tools) ────────────────── */
.nav-more { position: relative; }
.nav-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--mono-font);
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.nav-more-btn svg { transition: transform 0.2s; }
.nav-more-btn:hover,
.nav-more.open .nav-more-btn {
    color: var(--text);
    background: rgba(96, 160, 255, 0.06);
    border-color: rgba(96, 160, 255, 0.12);
}
.nav-more.open .nav-more-btn svg { transform: rotate(180deg); }
[data-theme="light"] .nav-more-btn:hover,
[data-theme="light"] .nav-more.open .nav-more-btn {
    background: rgba(79, 70, 229, 0.06);
    border-color: rgba(79, 70, 229, 0.12);
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.2rem 1.5rem;
    min-width: 520px;
    padding: 1.2rem 1.4rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(14, 14, 36, 0.92);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(96, 160, 255, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 100;
}
.nav-more.open .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
[data-theme="light"] .nav-dropdown {
    background: rgba(248, 247, 252, 0.95);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(79, 70, 229, 0.08);
}

.nav-dropdown-heading {
    display: block;
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    padding: 0 0.5rem 0.4rem;
    margin-bottom: 0.2rem;
    border-bottom: 1px solid var(--border);
}
.nav-dropdown-col { display: flex; flex-direction: column; gap: 0.1rem; }
.nav-dropdown a {
    font-family: var(--mono-font);
    font-size: 0.72rem;
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}
.nav-dropdown a:hover {
    color: var(--text);
    background: rgba(96, 160, 255, 0.08);
}
[data-theme="light"] .nav-dropdown a:hover {
    background: rgba(79, 70, 229, 0.06);
}

@media (max-width: 768px) {
    .nav-dropdown {
        grid-template-columns: repeat(2, 1fr);
        min-width: 300px;
        right: -1rem;
    }
}
@media (max-width: 480px) {
    .nav-more-btn span { display: none; }
    .nav-more-btn svg { margin: 0; }
    .nav-dropdown {
        position: fixed;
        top: auto;
        right: 0.5rem;
        left: 0.5rem;
        grid-template-columns: 1fr 1fr;
        min-width: 0;
    }
}

/* ── theme toggle ─────────────────────────────── */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.35rem 0.55rem;
    font-size: 0.85rem;
    line-height: 1;
    transition: color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
}
.theme-toggle:hover {
    color: var(--text);
    border-color: var(--border-hover);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }
:root .theme-toggle .icon-sun { display: inline; }
:root .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: inline; }

/* ── main layout (wider for tools) ────────────── */
main {
    position: relative;
    z-index: 1;
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* ── hero ──────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero-badge {
    display: inline-block;
    font-family: var(--mono-font);
    font-weight: 400;
    font-size: 0.65rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 0.35rem 1rem;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 4rem);
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    color: var(--text);
}

.hero .subtitle {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--text-dim);
    max-width: 480px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

/* ── upload area ──────────────────────────────── */
.upload-area {
    position: relative;
    border: 2px dashed rgba(96, 160, 255, 0.4);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(96, 160, 255, 0.1) 0%, transparent 70%),
        var(--surface);
    box-shadow: 0 0 0 1px rgba(96, 160, 255, 0.06), inset 0 1px 0 rgba(96, 160, 255, 0.08);
    transition: border-color 0.3s, box-shadow 0.3s;
    overflow: hidden;
    cursor: pointer;
    animation: uploadPulse 3s ease-in-out infinite;
}

.upload-area::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(96, 160, 255, 0.08),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.upload-area:hover::before { opacity: 1; }
.upload-area:hover {
    border-color: rgba(96, 160, 255, 0.5);
    border-style: solid;
    box-shadow: 0 0 30px rgba(96, 160, 255, 0.08), inset 0 1px 0 rgba(96, 160, 255, 0.1);
}
.upload-area.drag-over {
    border-color: var(--accent);
    border-style: solid;
    box-shadow: 0 0 40px rgba(96, 160, 255, 0.15), inset 0 0 40px var(--accent-dim);
}

@keyframes uploadPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(96, 160, 255, 0); }
    50%      { box-shadow: 0 0 20px rgba(96, 160, 255, 0.04); }
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}
.upload-prompt p {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-family: var(--mono-font);
}

.upload-icon {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 0.3rem;
    height: 36px;
}
.upload-icon .bar {
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    animation: waveBar 1.4s ease-in-out infinite;
    opacity: 0.5;
}
.upload-icon .bar:nth-child(1) { height: 10px; animation-delay: 0.0s; }
.upload-icon .bar:nth-child(2) { height: 20px; animation-delay: 0.15s; }
.upload-icon .bar:nth-child(3) { height: 30px; animation-delay: 0.3s; }
.upload-icon .bar:nth-child(4) { height: 24px; animation-delay: 0.45s; }
.upload-icon .bar:nth-child(5) { height: 14px; animation-delay: 0.6s; }
.upload-icon .bar:nth-child(6) { height: 26px; animation-delay: 0.75s; }
.upload-icon .bar:nth-child(7) { height: 16px; animation-delay: 0.9s; }

@keyframes waveBar {
    0%, 100% { transform: scaleY(0.4); opacity: 0.25; }
    50%      { transform: scaleY(1); opacity: 0.7; }
}

/* ── buttons ──────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.65rem 1.6rem;
    border: none;
    cursor: pointer;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-deep);
}
.btn-primary:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 24px var(--accent-dim);
}
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    color: var(--text);
    border-color: var(--border-hover);
}

/* ── progress spinner ─────────────────────────── */
.hidden { display: none !important; }

.spinner-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.spinner {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-wrap p {
    color: var(--text-dim);
    font-size: 0.8rem;
    font-family: var(--mono-font);
    letter-spacing: 0.5px;
}

/* ── mode toggle ──────────────────────────────── */
.mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
}
.toggle-label input[type="checkbox"] { display: none; }
.toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    transition: background 0.2s;
}
.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: var(--text);
    border-radius: 50%;
    transition: transform 0.2s;
}
.toggle-label input:checked + .toggle-slider {
    background: var(--accent);
}
.toggle-label input:checked + .toggle-slider::after {
    transform: translateX(16px);
}
.toggle-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── progress bar ────────────────────────────── */
.progress-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0 1rem;
}
.progress-bar {
    width: 100%;
    max-width: 320px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease-out;
}
.progress-wrap p {
    color: var(--text-dim);
    font-size: 0.8rem;
    font-family: var(--mono-font);
    letter-spacing: 0.5px;
}

/* ── result card ──────────────────────────────── */
.result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    animation: result-in 0.3s ease-out;
}
@keyframes result-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.result.match { border-left: 2px solid var(--accent); }
.result.no-match { border-left: 2px solid var(--warm); }
.result h2 {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}
.result .track-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.6rem;
}
.result .track-info span {
    color: var(--text-dim);
    font-size: 0.82rem;
}
.result .meta {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: var(--mono-font);
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* ── tool grid (home page) ────────────────────── */
.features h2 {
    font-family: var(--mono-font);
    font-size: 0.65rem;
    font-weight: 400;
    text-align: center;
    color: var(--text-dim);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* ── Trust strip ─────────────────────────────── */
.trust-strip {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    padding: 0.8rem 1rem;
    margin-bottom: 2rem;
    font-family: var(--mono-font);
    font-size: 0.65rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.trust-strip span::before {
    content: "\2713";
    margin-right: 0.4rem;
    color: var(--accent);
    opacity: 0.6;
}

/* ── Featured grid (3 large cards) ───────────── */
.featured-section { margin-bottom: 2.5rem; }
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.featured-card {
    padding: 2rem 1.8rem;
    border-color: var(--accent-dim);
    border-left: 3px solid var(--accent);
    background: linear-gradient(135deg, var(--surface) 0%, rgba(96, 160, 255, 0.03) 100%);
}
.featured-card .tool-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    filter: drop-shadow(0 4px 12px rgba(96, 160, 255, 0.2));
}
.featured-card h3 { font-size: 1.05rem; }
.featured-card p { font-size: 0.85rem; }
.featured-card:hover {
    border-left-color: var(--accent);
    box-shadow:
        0 12px 40px rgba(96, 160, 255, 0.1),
        -3px 0 16px rgba(96, 160, 255, 0.06);
}
[data-theme="light"] .featured-card:hover {
    box-shadow:
        0 12px 40px rgba(79, 70, 229, 0.08),
        -3px 0 16px rgba(79, 70, 229, 0.04);
}

/* ── Stats strip ────────────────────────────── */
.stats-strip {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem 2.5rem;
    padding: 1.2rem 2rem;
    margin-bottom: 3rem;
    font-family: var(--mono-font);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid rgba(96, 160, 255, 0.12);
    border-radius: 12px;
    background:
        linear-gradient(90deg, transparent, var(--accent-dim), transparent),
        rgba(14, 14, 36, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
[data-theme="light"] .stats-strip {
    border-color: rgba(79, 70, 229, 0.12);
    background:
        linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.04), transparent),
        rgba(255, 255, 255, 0.5);
}

/* ── Why section ────────────────────────────── */
.why-section {
    margin-bottom: 3rem;
    text-align: center;
}
.why-section h2 {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.why-intro {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}
.why-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    text-align: left;
}
.why-block {
    padding: 1.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.3s, transform 0.25s ease;
}
.why-block:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(96, 160, 255, 0.06);
}
[data-theme="light"] .why-block:hover {
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.06);
}
.why-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-dim);
    border: 1px solid rgba(96, 160, 255, 0.12);
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}
.why-block h3 {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.why-block p {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.5;
}

/* ── Category sections ───────────────────────── */
.category-section { margin-bottom: 2.5rem; }
.category-section h2 {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
    padding-left: 0.2rem;
}
.category-section h2::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 2px;
    background: var(--accent);
    margin-right: 0.5rem;
    vertical-align: middle;
    opacity: 0.6;
}
.category-intro {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: 0.8rem;
    padding-left: 0.2rem;
}

/* ── Tool cards ──────────────────────────────── */
.tool-card {
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: background 0.3s, border-color 0.3s, transform 0.25s ease;
    color: var(--text);
}
.tool-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        var(--glow-card),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    border-radius: inherit;
}
/* Full-card click area via ::after on the anchor */
.tool-card h3 a {
    color: inherit;
    text-decoration: none;
}
.tool-card h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover {
    background: var(--bg-mid);
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow:
        0 8px 32px rgba(96, 160, 255, 0.08),
        0 0 0 1px rgba(96, 160, 255, 0.06);
}
[data-theme="light"] .tool-card:hover {
    box-shadow:
        0 8px 32px rgba(79, 70, 229, 0.08),
        0 0 0 1px rgba(79, 70, 229, 0.06);
}
.tool-card:hover h3 a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.tool-icon {
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 0.6rem;
    border-radius: 10px;
    filter: drop-shadow(0 2px 8px rgba(96, 160, 255, 0.15));
}

.tool-card h3 {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    text-align: center;
    transition: color 0.2s;
}
.tool-card p {
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--text-dim);
    line-height: 1.65;
    text-align: center;
}

/* ── entrance animations ────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero { animation: fadeUp 0.5s ease-out both; }
.trust-strip { animation: fadeUp 0.5s ease-out 0.1s both; }
.featured-section { animation: fadeUp 0.5s ease-out 0.15s both; }
.featured-card:nth-child(1) { animation: fadeUp 0.4s ease-out 0.2s both; }
.featured-card:nth-child(2) { animation: fadeUp 0.4s ease-out 0.3s both; }
.featured-card:nth-child(3) { animation: fadeUp 0.4s ease-out 0.4s both; }
.stats-strip { animation: fadeUp 0.4s ease-out 0.45s both; }
.why-section { animation: fadeUp 0.5s ease-out 0.5s both; }

/* ── scroll-triggered reveals (progressive enhancement) ── */
@supports (animation-timeline: view()) {
    @keyframes scrollReveal {
        from { opacity: 0; transform: translateY(24px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .category-section,
    .faq-section,
    .related-tools {
        animation: scrollReveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 30%;
    }
    .category-section .tool-card {
        animation: scrollReveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 25%;
    }
}

/* ── metronome ────────────────────────────────── */
.metronome-wrap {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.metronome-display {
    margin-bottom: 1.5rem;
}

.bpm-display {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 5rem;
    line-height: 1;
    color: var(--text);
}
.bpm-label {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.beat-dots {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.beat-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--border-hover);
    background: rgba(96, 160, 255, 0.06);
    transition: background 0.08s, box-shadow 0.08s, transform 0.08s;
}
.beat-dot.active { transform: scale(1.15); }
.beat-dot.active {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}
.beat-dot.accent.active {
    background: var(--warm);
    box-shadow: 0 0 12px var(--warm-glow);
}

.bpm-slider {
    width: 100%;
    margin-bottom: 1.5rem;
    accent-color: var(--accent);
}

.metronome-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.metronome-play {
    min-width: 100px;
}
.metronome-play.playing {
    background: var(--warm);
}

.metronome-label {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

.metronome-select {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--mono-font);
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
}

/* ── tap BPM ──────────────────────────────────── */
.tap-wrap {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.tap-display {
    margin-bottom: 0.5rem;
}

.tap-bpm {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 6rem;
    line-height: 1;
    color: var(--text);
}
.tap-label {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.tap-stability {
    font-family: var(--mono-font);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    min-height: 1.2em;
}
.tap-stability.stable { color: var(--accent); }
.tap-stability.moderate { color: var(--warm); }
.tap-stability.unstable { color: var(--text-dim); }

.tap-area {
    width: 100%;
    padding: 4rem 3rem;
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-solid) 100%);
    border: 2px solid var(--border-hover);
    color: var(--text);
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.tap-area::after {
    content: "press any key or click";
    display: block;
    font-family: var(--mono-font);
    font-weight: 400;
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-top: 0.8rem;
}
.tap-area:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-dim);
}
.tap-area:active, .tap-area.tapped {
    background: var(--accent-dim);
    border-color: var(--accent);
    transform: scale(0.97);
    box-shadow: 0 0 40px var(--accent-glow);
}

.tap-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tap-info {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Camelot wheel ────────────────────────────── */
.camelot-wrap {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.camelot-svg-container {
    width: 360px;
    max-width: 100%;
}

#camelot-svg {
    width: 100%;
    height: auto;
}

.camelot-info {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.camelot-hint {
    color: var(--text-muted);
    font-family: var(--mono-font);
    font-size: 0.8rem;
}

.camelot-selected {
    margin-bottom: 1rem;
}

.camelot-code {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 3rem;
    color: var(--text);
    line-height: 1;
}

.camelot-key {
    font-family: var(--mono-font);
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.camelot-compat {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.compat-label {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-right: 0.3rem;
}

.compat-tag {
    display: inline-block;
    font-family: var(--mono-font);
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--border);
    color: var(--accent);
    letter-spacing: 0.3px;
}

.key-compat {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ── pitch detector / tuner ──────────────────── */
.tuner-wrap {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.tuner-gauge {
    margin-bottom: 2rem;
}

.tuner-cents-bar {
    position: relative;
    height: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.tuner-cents-center {
    position: absolute;
    left: 50%;
    top: -2px;
    width: 2px;
    height: 12px;
    background: var(--text-muted);
    transform: translateX(-50%);
}

.tuner-cents-indicator {
    position: absolute;
    left: 50%;
    top: -3px;
    width: 10px;
    height: 14px;
    background: var(--accent);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.1s ease;
}
.tuner-cents-indicator.in-tune {
    background: #4ade80;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}

.tuner-cents-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono-font);
    font-size: 0.6rem;
    color: var(--text-muted);
}

.tuner-display {
    margin-bottom: 2rem;
}

.tuner-note {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 5rem;
    line-height: 1;
    color: var(--text);
}

.tuner-freq {
    font-family: var(--mono-font);
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.tuner-cents {
    font-family: var(--mono-font);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tuner-hint {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.8rem;
}

/* ── audio cutter ─────────────────────────────── */
.cutter-wrap {
    margin-top: 1.5rem;
}

.waveform-container {
    position: relative;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
}

#waveform-canvas {
    display: block;
    width: 100%;
}

.trim-handle {
    position: absolute;
    top: 0;
    width: 8px;
    height: 100%;
    background: var(--accent);
    cursor: ew-resize;
    z-index: 5;
    opacity: 0.8;
}
.trim-handle:hover { opacity: 1; }
.trim-handle-left { left: 0; border-radius: 2px 0 0 2px; }
.trim-handle-right { left: 100%; transform: translateX(-100%); border-radius: 0 2px 2px 0; }

.trim-region {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--accent-dim);
    pointer-events: none;
    z-index: 2;
}

.playhead {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--warm);
    z-index: 6;
    pointer-events: none;
}

.cutter-times {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-dim);
    padding: 0.5rem 0;
}

.cutter-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
}

/* ── pills (genre selector etc.) ─────────────── */
.pill {
    background: var(--bg-card, var(--surface));
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.35rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}
.pill:hover { border-color: var(--accent); }
.pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── about page ──────────────────────────────── */
.about-content {
    max-width: 640px;
    margin: 0 auto;
}
.about-content h2 {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 2rem 0 0.8rem;
    color: var(--text);
}
.about-content p, .about-content li {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.7;
}
.about-content ul {
    padding-left: 1.2rem;
}
.about-content li {
    margin-bottom: 0.4rem;
}

/* ── Mix Analyzer Report Card ────────────────── */

/* Score hero */
.mix-score-hero {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 0 1.2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.2rem;
}
.mix-grade-ring {
    position: relative;
    width: 96px;
    height: 96px;
    flex-shrink: 0;
}
.mix-grade-ring svg {
    width: 96px;
    height: 96px;
    transform: rotate(-90deg);
}
.mix-grade-ring .ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 4;
}
.mix-grade-ring .ring-fill {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.mix-grade-letter {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 2.4rem;
    line-height: 1;
    letter-spacing: -0.02em;
}
.mix-score-body {
    flex: 1;
    min-width: 0;
}
.mix-score-numeric {
    font-family: var(--mono-font);
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
}
.mix-score-numeric strong {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text);
}
.mix-sub-scores {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}
.mix-sub-score {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.mix-sub-score-label {
    font-family: var(--mono-font);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}
.mix-sub-score-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
}
.mix-sub-score-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.mix-sub-score-val {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-dim);
}
.mix-summary-line {
    font-family: var(--mono-font);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
    letter-spacing: 0.3px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.75rem;
}

/* Report waveform area */
.mix-waveform-wrap {
    position: relative;
    border-radius: 8px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.mix-waveform-wrap canvas {
    display: block;
    width: 100%;
    cursor: crosshair;
}
.mix-wf-time-axis {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
    font-family: var(--mono-font);
    font-size: 0.55rem;
    color: var(--text-muted);
    margin-top: 2px;
    margin-bottom: 0.6rem;
}

/* Transition markers tooltip on hover */
.mix-marker-tooltip {
    position: absolute;
    top: -24px;
    transform: translateX(-50%);
    font-family: var(--mono-font);
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

/* Transition list */
.mix-transitions-header {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.mix-transition-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.mix-transition-card:hover {
    border-color: var(--border-hover);
    background: var(--surface-solid);
}
.mix-transition-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-glow);
}
.mix-tc-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}
.mix-tc-time {
    font-family: var(--mono-font);
    font-size: 0.8rem;
    font-weight: 500;
    width: 3.5rem;
    flex-shrink: 0;
}
.mix-tc-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.6rem;
    font-size: 0.7rem;
    color: var(--text-dim);
}
.mix-tc-info .tag {
    font-family: var(--mono-font);
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--accent-dim);
    color: var(--accent);
    letter-spacing: 0.3px;
}
.mix-tc-score {
    font-family: var(--mono-font);
    font-size: 0.75rem;
    font-weight: 500;
    flex-shrink: 0;
}

/* Transition detail (expanded below waveform) */
.mix-detail-card {
    padding: 1rem;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--accent);
    border-left: 3px solid var(--accent);
    margin-bottom: 1rem;
    animation: fadeSlideIn 0.25s ease-out;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.mix-detail-header {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 0.6rem;
}
.mix-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.6rem;
}
.mix-detail-item label {
    display: block;
    font-family: var(--mono-font);
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}
.mix-detail-item span {
    font-family: var(--mono-font);
    font-size: 0.8rem;
}

/* Issues list */
.mix-issues-header {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.mix-issue-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.mix-issue-row:last-child { border-bottom: none; }
.mix-issue-badge {
    font-family: var(--mono-font);
    font-size: 0.55rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 5px;
    border-radius: 3px;
    flex-shrink: 0;
}
.mix-issue-badge.error   { background: rgba(239,68,68,0.15);  color: #ef4444; }
.mix-issue-badge.warning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.mix-issue-badge.info    { background: rgba(96,160,255,0.1);  color: var(--accent); }
.mix-issue-time {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 3rem;
}
.mix-issue-msg {
    color: var(--text-dim);
    flex: 1;
}

/* Status colors */
.clr-locked      { color: #4ade80; }
.clr-slight-drift { color: #f59e0b; }
.clr-lost        { color: #ef4444; }
.clr-error       { color: #ef4444; }
.bg-locked       { background: #4ade80; }
.bg-slight-drift { background: #f59e0b; }
.bg-lost         { background: #ef4444; }
.bg-error        { background: #ef4444; }

/* "Analyze another" link */
.mix-analyze-again {
    display: inline-block;
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--accent);
    cursor: pointer;
    margin-top: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.mix-analyze-again:hover { opacity: 1; }

/* No transitions banner */
.mix-info-banner {
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .mix-score-hero { flex-direction: column; text-align: center; gap: 1rem; }
    .mix-sub-scores { grid-template-columns: repeat(2, 1fr); }
    .mix-summary-line { justify-content: center; }
    .mix-detail-grid { grid-template-columns: 1fr 1fr; }
}

/* ── audio-to-midi ───────────────────────────── */
.midi-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.midi-stat {
    flex: 1;
    min-width: 100px;
    padding: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
}
.midi-stat-label {
    font-family: var(--mono-font);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}
.midi-stat-value {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--accent);
}
.piano-roll-wrap {
    position: relative;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.piano-roll-wrap canvas {
    display: block;
    width: 100%;
    cursor: grab;
}
.piano-roll-wrap canvas:active {
    cursor: grabbing;
}
.midi-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── pitch shifter ───────────────────────────── */
.ps-controls {
    max-width: 600px;
    margin: 1.5rem auto 0;
}
.ps-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.ps-label {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 42px;
}
.ps-slider {
    flex: 1;
    accent-color: var(--accent);
}
.ps-value {
    font-family: var(--mono-font);
    font-size: 0.9rem;
    color: var(--text);
    min-width: 50px;
    text-align: right;
}
.ps-step-btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
    min-width: unset !important;
    font-family: var(--mono-font) !important;
}
.ps-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ── ad slots (empty placeholders) ────────────── */
.ad-slot {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}
.ad-leaderboard {
    min-height: 0;
    margin-top: 0.5rem;
}
.ad-rectangle {
    min-height: 0;
    margin-bottom: 0.5rem;
}

/* ── footer ───────────────────────────────────── */
footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-family: var(--mono-font);
    font-size: 0.65rem;
    border-top: none;
    letter-spacing: 0.5px;
}
footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.3;
}
.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
footer a {
    color: var(--text-dim);
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 2px;
    transition: color 0.2s, text-decoration-color 0.2s;
}
footer a:hover { color: var(--text); text-decoration-color: var(--accent); }

/* ── drum machine ────────────────────────────── */
.dm-wrap {
    max-width: 900px;
    margin: 0 auto 2rem;
}

.dm-transport {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.dm-play-btn {
    min-width: 5rem;
}
.dm-play-btn.playing {
    background: var(--warm);
}

.dm-ctrl-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dm-ctrl-label {
    font-family: var(--mono-font);
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dm-bpm-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    min-width: unset;
}

.dm-bpm-val {
    font-family: var(--heading-font);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 2.5rem;
    text-align: center;
}

.dm-slider {
    width: 80px;
    accent-color: var(--accent);
}

.dm-swing-val {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-dim);
    min-width: 2rem;
}

.dm-select {
    font-family: var(--body-font);
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
    background: var(--surface-solid);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
}

/* Desktop grid */
.dm-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dm-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.dm-label {
    width: 50px;
    padding: 0.4rem 0.3rem;
    font-family: var(--mono-font);
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.dm-label:hover {
    color: var(--text);
    background: var(--accent-dim);
}

.dm-steps {
    display: flex;
    gap: 2px;
    flex: 1;
}

.dm-cell {
    flex: 1;
    aspect-ratio: 1;
    max-height: 36px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.1s;
    position: relative;
}
.dm-cell.dm-cell-alt {
    background: var(--accent-dim);
}
.dm-cell:hover {
    border-color: var(--border-hover);
}
.dm-cell.active {
    background: var(--ch-color, var(--accent));
    border-color: var(--ch-color, var(--accent));
    box-shadow: 0 0 6px color-mix(in srgb, var(--ch-color, var(--accent)) 40%, transparent);
}
.dm-cell.playhead::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--text);
    border-radius: 3px;
    opacity: 0.5;
}

.dm-vol-wrap {
    width: 60px;
    flex-shrink: 0;
}
.dm-vol {
    width: 100%;
    accent-color: var(--accent);
}

/* Mobile pads */
.dm-pads {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.dm-pad {
    aspect-ratio: 1;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-dim);
    font-family: var(--mono-font);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dm-pad:active {
    transform: scale(0.95);
}
.dm-pad.selected {
    background: color-mix(in srgb, var(--pad-color) 20%, transparent);
    border-color: var(--pad-color);
    color: var(--text);
    box-shadow: 0 0 12px color-mix(in srgb, var(--pad-color) 30%, transparent);
}

/* Mobile mini-sequencer */
.dm-mobile-seq {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.dm-mini-seq {
    display: flex;
    gap: 3px;
}

.dm-mini-cell {
    flex: 1;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.1s;
}
.dm-mini-cell.dm-cell-alt {
    background: var(--accent-dim);
}
.dm-mini-cell.active {
    background: var(--ch-color, var(--accent));
    border-color: var(--ch-color, var(--accent));
}
.dm-mini-cell.playhead::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--text);
    border-radius: 3px;
    opacity: 0.5;
}
.dm-mini-cell {
    position: relative;
}

.dm-ch-vol-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* SEO content */
.seo-content {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.7;
}
.seo-content h2, .seo-content h3 {
    font-family: var(--heading-font);
    color: var(--text);
    margin: 1.5rem 0 0.5rem;
}
.seo-content h2 { font-size: 1.3rem; }
.seo-content h3 { font-size: 1rem; }
.seo-content p { margin-bottom: 0.8rem; }

/* ── seo components ──────────────────────────── */
.breadcrumb {
    max-width: 700px;
    margin: 0 auto 0.5rem;
    padding: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--mono-font);
}
.breadcrumb ol {
    list-style: none;
    display: flex;
    gap: 0.4rem;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}
.breadcrumb li:not(:last-child)::after {
    content: '>';
    margin-left: 0.4rem;
    opacity: 0.5;
}
.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}
.breadcrumb [aria-current] {
    color: var(--text-muted);
}

.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.1rem;
    border: 1px solid rgba(80, 200, 120, 0.3);
    border-radius: 100px;
    font-size: 0.7rem;
    color: rgba(80, 200, 120, 0.85);
    font-family: var(--mono-font);
    letter-spacing: 0.02em;
    margin: 0.5rem auto 1rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(80, 200, 120, 0.1), rgba(96, 160, 255, 0.05));
    box-shadow: 0 0 20px rgba(80, 200, 120, 0.06), inset 0 1px 0 rgba(80, 200, 120, 0.08);
}
.privacy-badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: rgba(80, 200, 120, 0.9);
}

.how-to-section {
    max-width: 700px;
    margin: 2.5rem auto 0;
}
.how-to-section h2 {
    font-family: var(--heading-font);
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 1rem;
    text-align: center;
}
.steps-pills {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.step-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text);
    flex: 1;
    min-width: 180px;
    max-width: 280px;
}
.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.faq-section {
    max-width: 700px;
    margin: 3rem auto 0;
    padding: 1.5rem 0 0;
    border: none;
    border-top: 1px solid var(--border);
}
.faq-section h2 {
    font-family: var(--heading-font);
    font-size: 1rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 0.5px;
}
.faq-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    background: transparent;
    transition: border-color 0.2s, background 0.2s;
}
.faq-item:hover {
    border-color: var(--border-hover);
    background: rgba(96, 160, 255, 0.03);
}
.faq-item summary {
    padding: 0.9rem 1.2rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.2s;
}
.faq-item summary:hover { color: var(--accent); }
.faq-item summary::after {
    content: '+';
    font-size: 1.1rem;
    color: var(--accent);
    opacity: 0.5;
    transition: transform 0.2s, opacity 0.2s;
}
.faq-item:hover summary::after { opacity: 0.8; }
.faq-item[open] summary::after {
    content: '−';
    opacity: 0.8;
}
.faq-item[open] {
    border-color: rgba(96, 160, 255, 0.25);
    background: rgba(96, 160, 255, 0.06);
}
.faq-answer {
    padding: 0 1.2rem 1rem;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--text-dim);
}
[data-theme="light"] .faq-section {
    border-color: var(--border);
}
[data-theme="light"] .faq-section h2 { color: var(--text-dim); }
[data-theme="light"] .faq-item {
    border-color: rgba(79, 70, 229, 0.12);
    background: rgba(79, 70, 229, 0.03);
}
[data-theme="light"] .faq-item:hover {
    border-color: rgba(79, 70, 229, 0.2);
    background: rgba(79, 70, 229, 0.05);
}

.related-tools {
    max-width: 700px;
    margin: 2.5rem auto 0;
}
.related-tools h2 {
    font-family: var(--heading-font);
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 1rem;
}
.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.8rem;
}
.related-tool-card {
    display: block;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
}
.related-tool-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.related-tool-card h3 {
    font-family: var(--heading-font);
    font-size: 0.85rem;
    color: var(--text);
    margin: 0.4rem 0 0.2rem;
}
.related-tool-card p {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}
.related-tool-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    filter: drop-shadow(0 2px 6px rgba(96, 160, 255, 0.12));
}

.results-crosslink {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}
.results-crosslink:hover {
    background: var(--accent);
    color: #fff;
}

/* ── responsive ───────────────────────────────── */
@media (max-width: 900px) {
    .featured-grid { grid-template-columns: 1fr; gap: 8px; }
    .featured-card { border-left: 2px solid var(--accent); }
    .why-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .tool-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .camelot-wrap { flex-direction: column; align-items: center; }
    .camelot-info { max-width: 100%; text-align: center; }
    .nav-right { gap: 0.5rem; }
    .nav-right a { font-size: 0.6rem; }
}

@media (max-width: 640px) {
    nav { padding: 1rem 1.2rem; }
    main { padding: 1.2rem; }
    .hero { padding: 3rem 0 1.5rem; }
    .hero h1 { font-size: 2.2rem; }
    .upload-area { padding: 2rem 1.2rem; }
    .tool-grid { grid-template-columns: 1fr; gap: 6px; }
    .why-grid { grid-template-columns: 1fr; gap: 6px; }
    .trust-strip { gap: 0.3rem 1rem; font-size: 0.6rem; }
    .stats-strip { gap: 0.3rem 1rem; font-size: 0.6rem; }
    .btn { padding: 0.6rem 1.2rem; font-size: 0.8rem; }
    .tap-area { padding: 5rem 2rem; }
    .bpm-display, .tap-bpm { font-size: 4rem; }

    /* Drum machine mobile layout */
    .dm-grid { display: none; }
    .dm-pads { display: grid; }
    .dm-mobile-seq { display: flex; }
    .dm-transport { gap: 0.5rem; }
    .dm-transport .dm-ctrl-group { flex-wrap: wrap; }

    /* SEO components mobile */
    .steps-pills { flex-direction: column; align-items: stretch; }
    .step-pill { max-width: 100%; }
    .related-tools-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 380px) {
    .nav-right a:not(:first-child):not(:last-child) { display: none; }
}

/* ── Auto-Master ─────────────────────────────── */
.slider-group { display: flex; flex-direction: column; gap: 0.25rem; }
.slider-label { font-size: 0.7rem; font-family: var(--mono-font); color: var(--text-dim); letter-spacing: 0.5px; }
.slider-ends { display: flex; justify-content: space-between; font-size: 0.6rem; color: var(--text-muted); }
.slider-value { font-size: 0.7rem; font-family: var(--mono-font); color: var(--accent); text-align: center; }
.slider { width: 100%; accent-color: var(--accent); }
.ab-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.ab-btn { padding: 0.35rem 0.75rem; font-size: 0.8rem; font-family: var(--mono-font); background: transparent; color: var(--text-dim); border: none; cursor: pointer; transition: background 0.2s, color 0.2s; }
.ab-btn.active { background: var(--accent); color: #fff; }
.ab-btn:hover:not(.active) { background: var(--accent-dim); }

@media (max-width: 600px) {
    #advanced-panel .slider-group { grid-template-columns: 1fr; }
    #results-section > div:first-child { grid-template-columns: 1fr !important; }
}

/* ── Song Analyzer ─────────────────────────────── */
.analyzer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin: 24px auto;
  max-width: 960px;
}
.analyzer-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.analyzer-card.wide { grid-column: span 2; }
.analyzer-card:nth-child(4) { grid-column: 1 / 3; }
.analyzer-card:nth-child(5) { grid-column: 3 / 4; }

.card-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}
.card-body { min-height: 80px; }

/* Skeleton shimmer */
.card-body.skeleton .skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--border) 25%, rgba(96,160,255,0.08) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  margin-bottom: 10px;
}
.card-body.skeleton .skeleton-line.short { width: 60%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Result content fade-in */
.card-body.loaded { animation: cardFadeIn 0.3s ease; }
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Key card */
.key-result-value { font-size: 2.5rem; font-weight: 700; color: var(--text); }
.key-result-sub { font-size: 0.85rem; color: var(--text-dim); margin-top: 4px; }

/* BPM card */
.bpm-result-value { font-size: 2.5rem; font-weight: 700; color: var(--text); }
.bpm-result-sub { font-size: 0.85rem; color: var(--text-dim); margin-top: 4px; }

/* Chords card */
.chord-timeline { max-height: 200px; overflow-y: auto; font-size: 0.85rem; }
.chord-row { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.chord-time { color: var(--text-dim); min-width: 50px; font-family: var(--font-mono); }
.chord-name { color: var(--text); font-weight: 600; }

/* MIDI card */
.midi-roll-container { height: 120px; border-radius: 6px; overflow: hidden; background: var(--bg-deep); }
.midi-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Stems card */
.stem-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.stem-label { font-size: 0.8rem; color: var(--text-dim); min-width: 80px; }
.stem-waveform { flex: 1; height: 40px; background: var(--bg-deep); border-radius: 4px; overflow: hidden; }
.stem-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.stem-mobile-gate {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100px; color: var(--text-dim); text-align: center; font-size: 0.85rem;
}

/* Refined badge */
.badge-refined {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(96,160,255,0.12);
  color: var(--accent);
  margin-left: 8px;
  vertical-align: middle;
}

/* Card action buttons */
.card-btn {
  padding: 6px 12px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
  text-decoration: none;
}
.card-btn:hover { border-color: var(--accent); }

/* Card error state */
.card-error { color: var(--text-dim); font-size: 0.85rem; text-align: center; padding: 20px 10px; }

/* Card progress */
.card-progress { height: 3px; background: var(--border); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.card-progress-fill { height: 100%; background: var(--accent); transition: width 0.3s; width: 0%; }

/* Responsive: single column on mobile */
@media (max-width: 768px) {
  .analyzer-grid { grid-template-columns: 1fr; }
  .analyzer-card.wide,
  .analyzer-card:nth-child(4),
  .analyzer-card:nth-child(5) { grid-column: 1; }
}

/* ── OPFS cross-tool workflow ─────────────────── */
.opfs-suggestions { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.opfs-suggest-group { margin-bottom: 0.75rem; }
.opfs-suggestions-label { display: block; font-size: 0.7rem; font-family: var(--mono-font); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.5rem; }
.opfs-suggest-btns { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.opfs-suggest-btn { display: inline-block; padding: 0.35rem 0.75rem; font-size: 0.8rem; font-family: var(--mono-font); color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent); border-radius: 6px; text-decoration: none; transition: background 0.2s, color 0.2s; cursor: pointer; }
.opfs-suggest-btn:hover { background: var(--accent); color: #fff; }
.opfs-recent { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.opfs-recent-label { font-size: 0.65rem; font-family: var(--mono-font); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.opfs-chip { padding: 0.25rem 0.6rem; font-size: 0.75rem; font-family: var(--mono-font); color: var(--text-dim); background: transparent; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; transition: border-color 0.2s, color 0.2s; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.opfs-chip:hover { border-color: var(--accent); color: var(--accent); }
.opfs-toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(1rem); padding: 0.6rem 1.2rem; font-size: 0.85rem; font-family: var(--mono-font); color: #fff; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; opacity: 0; transition: opacity 0.3s, transform 0.3s; z-index: 9999; pointer-events: none; }
.opfs-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── reduced motion ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .particle { animation: none !important; display: none; }
    .upload-icon .bar { animation: none !important; }
    *, *::before, *::after { transition-duration: 0.01s !important; animation-duration: 0.01s !important; }
}

/* === Turbo Nav === */
.turbo-nav { position: relative; }
.turbo-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--accent);
  color: var(--accent); padding: 6px 14px; border-radius: 8px;
  font-family: var(--mono-font); font-size: 0.85rem;
  cursor: pointer; transition: all 0.2s;
}
.turbo-btn:hover { background: rgba(96,160,255,0.1); }
.turbo-btn.turbo-active {
  background: var(--accent); color: #fff;
  animation: turbo-glow 2s ease-in-out infinite;
}
@keyframes turbo-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(96,160,255,0.3); }
  50% { box-shadow: 0 0 16px rgba(96,160,255,0.6); }
}
.turbo-icon { font-size: 1rem; }

.turbo-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; min-width: 260px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all 0.2s ease; z-index: 100;
  backdrop-filter: blur(20px);
}
.turbo-dropdown.open {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.turbo-dropdown-header {
  font-family: var(--mono-font); font-size: 0.9rem;
  color: var(--text); margin-bottom: 4px;
}
.turbo-boosts, .turbo-pass-info {
  font-size: 0.8rem; color: var(--text-dim); margin-bottom: 8px;
}
.turbo-divider {
  border: none; border-top: 1px solid var(--border); margin: 12px 0;
}
.turbo-options { display: flex; flex-direction: column; gap: 6px; }
.turbo-option {
  display: flex; justify-content: space-between; align-items: center;
  background: transparent; border: 1px solid var(--border);
  color: var(--text); padding: 8px 12px; border-radius: 8px;
  font-family: var(--body-font); font-size: 0.85rem;
  cursor: pointer; transition: all 0.15s;
}
.turbo-option:hover { border-color: var(--accent); background: rgba(96,160,255,0.05); }
.turbo-option span { color: var(--accent); font-family: var(--mono-font); }
.turbo-topup-btn {
  width: 100%; padding: 10px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; font-family: var(--heading-font);
  font-size: 0.95rem; letter-spacing: 0.5px; text-transform: uppercase;
  cursor: pointer; transition: filter 0.15s;
}
.turbo-topup-btn:hover { filter: brightness(1.15); }

/* === Auth Modal === */
.turbo-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center;
  z-index: 500; backdrop-filter: blur(4px);
}
.turbo-modal-overlay.open { display: flex; }
.turbo-modal {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem; max-width: 400px; width: 90%;
  position: relative; animation: modal-in 0.2s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.95); } }
.turbo-modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--text-dim);
  font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.turbo-modal-close:hover { color: var(--text); }
.turbo-modal-title {
  font-family: var(--heading-font); font-size: 1.3rem;
  margin-bottom: 1.5rem; text-align: center;
}
.turbo-auth-buttons { display: flex; flex-direction: column; gap: 10px; }
.turbo-auth-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 16px; border-radius: 10px;
  font-family: var(--body-font); font-size: 0.9rem;
  cursor: pointer; transition: all 0.15s; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.turbo-auth-btn:hover { border-color: var(--accent); }
.turbo-auth-bonus {
  margin-left: auto; font-size: 0.75rem; color: var(--accent);
  font-family: var(--mono-font);
}
.turbo-auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--text-dim); font-size: 0.8rem;
}
.turbo-auth-divider::before, .turbo-auth-divider::after {
  content: ''; flex: 1; border-top: 1px solid var(--border);
}
.turbo-auth-email { display: flex; flex-direction: column; gap: 10px; }
.turbo-auth-input {
  width: 100%; padding: 12px 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-family: var(--body-font); font-size: 0.9rem;
  outline: none; transition: border-color 0.15s; box-sizing: border-box;
}
.turbo-auth-input:focus { border-color: var(--accent); }
.turbo-auth-input::placeholder { color: var(--text-dim); }
.turbo-auth-send { background: var(--accent); color: #fff; border: none; }
.turbo-auth-send:hover { filter: brightness(1.15); }
.turbo-auth-footer {
  text-align: center; color: var(--text-dim); font-size: 0.8rem; margin-top: 16px;
}

/* === Turbo Nudge === */
.turbo-nudge {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.turbo-nudge.hidden { display: none; }
.turbo-nudge-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem; max-width: 380px; width: 90vw;
  animation: modal-in 0.2s ease-out;
}
.turbo-nudge-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 1rem;
}
.turbo-nudge-indicator {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.turbo-cap-green  { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.turbo-cap-yellow { background: #eab308; box-shadow: 0 0 6px rgba(234,179,8,0.4); }
.turbo-cap-red    { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.turbo-nudge-title {
  font-family: var(--heading-font); font-size: 1rem; font-weight: 600;
}
.turbo-nudge-comparison {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 1.25rem;
}
.turbo-nudge-eta {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 8px; border-radius: 8px; border: 1px solid var(--border);
}
.turbo-nudge-server {
  border-color: var(--accent); background: rgba(96,160,255,0.05);
}
.turbo-nudge-label {
  font-size: 0.75rem; color: var(--text-dim); margin-bottom: 4px;
}
.turbo-nudge-time {
  font-family: var(--mono-font); font-size: 1.1rem; font-weight: 600;
}
.turbo-nudge-server .turbo-nudge-time { color: var(--accent); }
.turbo-nudge-actions { display: flex; gap: 8px; }
.turbo-nudge-actions .btn { flex: 1; padding: 10px 12px; font-size: 0.85rem; }
.turbo-nudge-blocked {
  text-align: center; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 1rem;
}
.turbo-nudge-badge {
  font-size: 0.65rem; font-weight: 600; color: var(--accent);
  margin-top: 4px; letter-spacing: 0.5px;
}
.turbo-cap-yellow, .turbo-cap-red {
  animation: turbo-pulse 2s ease-in-out infinite;
}
@keyframes turbo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Turbo progress overlay — shown during server-side processing */
.turbo-progress-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 8, 26, 0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(4px);
  transition: opacity 0.3s;
}
.turbo-progress-overlay.hidden {
  opacity: 0; pointer-events: none;
}
.turbo-progress-box {
  background: var(--bg-card, #1a1a2e);
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 12px;
  padding: 2rem 2.5rem;
  min-width: 320px;
  max-width: 400px;
  text-align: center;
}
.turbo-progress-label {
  font-size: 0.95rem;
  color: var(--text, #e0e0e0);
  margin-bottom: 1rem;
  font-weight: 500;
}
.turbo-progress-bar {
  height: 6px;
  background: var(--bg-deep, #08081a);
  border-radius: 3px;
  overflow: hidden;
}
.turbo-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, #60a0ff), #a855f7);
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 0%;
}
