/* ════════════════════════════════════════════════════════════
   SIGNAL.DAT — Landing page
   Built on the Signal.Dat Design System (signal-ds.css).
   Visual language: Nothing OS × Teenage Engineering — dot-matrix
   readouts, registration marks, LED glyphs, tactile hardware UI.
   Light + dark themes inherited from the design system.
   ════════════════════════════════════════════════════════════ */

/* ─── TOKEN BRIDGE ───────────────────────────────────────────
   The HTML/JS reference these local names. Aliased to the
   design-system tokens so they switch automatically per theme. */
:root {
    --bg-base:      var(--sd-bg);
    --bg-panel:     var(--sd-bg-panel);
    --bg-alt:       var(--sd-bg-alt);
    --bg-input:     var(--sd-bg-input);

    --border:       var(--sd-border);
    --border-hi:    var(--sd-border-hi);

    --txt-primary:  var(--sd-txt);
    --txt-muted:    var(--sd-txt-muted);
    --txt-dim:      var(--sd-txt-dim);

    --accent:       var(--sd-accent);
    --accent-dim:   var(--sd-accent-dim);
    --success:      var(--sd-success);

    --font-sans:    var(--sd-font-sans);
    --font-mono:    var(--sd-font-mono);
    --font-dot:     var(--sd-font-dot);

    --r:            var(--sd-r-md);   /* 12px */
    --r-sm:         8px;
}

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

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-base);
    color: var(--txt-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-bottom: 80px;
    counter-reset: module;
    background-image:
        radial-gradient(circle at 50% -10%, var(--accent-dim), transparent 55%),
        radial-gradient(var(--border) 1px, transparent 0);
    background-size: 100% 900px, 24px 24px;
    background-repeat: no-repeat, repeat;
    transition: background-color var(--sd-dur) ease, color var(--sd-dur) ease;
}

h1, h2, h3, h4 {
    font-family: var(--font-sans);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--txt-primary);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { outline: none; font-family: inherit; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── SHARED PRIMITIVES ──────────────────────────────────────── */

/* LED indicator (Nothing glyph) */
.led {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    display: inline-block;
    animation: pulse-led 1.8s ease-in-out infinite;
}
@keyframes pulse-led {
    0%, 100% { opacity: 1;   box-shadow: 0 0 8px var(--accent); }
    50%      { opacity: 0.35; box-shadow: 0 0 1px var(--accent); }
}

/* Registration "+" mark used as a corner signature on modules */
.reg-mark, .pipeline-card::after, .anatomy-card::after, .pricing-card::after {
    content: "+";
    position: absolute;
    top: 12px; right: 14px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1;
    color: var(--txt-dim);
    transition: color 0.18s, transform 0.18s;
    pointer-events: none;
}

/* ─── LAYOUT ─────────────────────────────────────── */
.app-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    background-color: var(--border);
    border: 1px solid var(--border-hi);
    border-radius: var(--sd-r);
    overflow: hidden;
    box-shadow: var(--sd-shadow);
}

/* ─── HEADER ─────────────────────────────────────── */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 64px;
    background: var(--bg-panel);
    gap: 16px;
    position: relative;
}
.app-header::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--border-hi) 0 6px, transparent 6px 12px);
    opacity: 0.6;
}

.logo-area { display: flex; align-items: center; gap: 12px; }

.logo-icon { width: 24px; height: 24px; color: var(--txt-primary); display: inline-flex; }
.logo-icon svg { width: 24px; height: 24px; }

.logo-text h1 {
    font-family: var(--font-dot);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    line-height: 1;
}

.system-status {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--txt-muted);
}
.status-active {
    color: var(--success);
    font-weight: 700;
    padding-left: 14px;
    position: relative;
}
.status-active::before {
    content: "";
    position: absolute; left: 0; top: 50%;
    width: 6px; height: 6px; margin-top: -3px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
    animation: pulse-led 1.8s ease-in-out infinite;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

/* Theme toggle */
.theme-toggle {
    width: 36px; height: 36px;
    border-radius: var(--sd-r-pill);
    border: 1px solid var(--border-hi);
    background: var(--bg-panel);
    color: var(--txt-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.18s, color 0.18s, transform 0.15s;
    flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--txt-primary); transform: scale(1.06); }
.theme-toggle i { width: 15px; height: 15px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ─── HERO SECTION ────────────────────────────────── */
.hero-section {
    background: var(--bg-panel);
    padding: 72px 48px 64px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    overflow: hidden;
}

/* faint scanning line sweeping the hero */
.hero-grain {
    position: absolute; inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, var(--accent) 50%, transparent);
    opacity: 0.05;
    height: 40%;
    animation: hero-scan 6s linear infinite;
}
@keyframes hero-scan {
    0%   { transform: translateY(-100%); }
    100% { transform: translateY(350%); }
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative; z-index: 2;
}
.hero-subtitle i { width: 14px; height: 14px; }

.hero-title {
    font-family: var(--font-sans);
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.02;
    max-width: 860px;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    position: relative; z-index: 2;
}

.hero-desc {
    font-family: var(--font-sans);
    font-size: 18px;
    line-height: 1.6;
    color: var(--txt-muted);
    max-width: 680px;
    position: relative; z-index: 2;
}

.hero-cta-group { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; position: relative; z-index: 2; }

/* Decorative dot-matrix equalizer */
.hero-eq {
    position: absolute;
    right: 40px; bottom: 0;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 150px;
    opacity: 0.5;
    z-index: 1;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%);
            mask-image: linear-gradient(180deg, transparent, #000 60%);
}
.hero-eq span {
    width: 5px;
    height: 20%;
    background: var(--accent);
    border-radius: 2px;
    transform-origin: bottom;
    animation: eq 1.2s ease-in-out infinite alternate;
}
.hero-eq span:nth-child(2n) { animation-delay: -0.2s; opacity: 0.85; }
.hero-eq span:nth-child(3n) { animation-delay: -0.5s; height: 45%; }
.hero-eq span:nth-child(4n) { animation-delay: -0.9s; height: 70%; }
.hero-eq span:nth-child(5n) { animation-delay: -1.1s; height: 30%; }
.hero-eq span:nth-child(7n) { animation-delay: -0.7s; height: 90%; }
@keyframes eq {
    0%   { transform: scaleY(0.25); }
    100% { transform: scaleY(1); }
}

/* hero technical annotations */
.hero-fig, .hero-coord {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--txt-dim);
    z-index: 2;
}
.hero-fig   { bottom: 18px; left: 48px; }
.hero-coord { top: 20px; right: 48px; }
.hero-coord::before { content: "◍ "; color: var(--accent); }
@media (max-width: 640px) { .hero-fig, .hero-coord, .hero-eq { display: none; } }

/* ─── SPEC TICKER ─────────────────────────────────── */
.ticker {
    background: var(--bg-base);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    height: 34px;
    display: flex;
    align-items: center;
    position: relative;
}
.ticker-track {
    display: flex;
    align-items: center;
    gap: 18px;
    white-space: nowrap;
    animation: ticker 38s linear infinite;
    will-change: transform;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span:not(.tick-dot) {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--txt-muted);
}
.tick-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ─── BUTTONS (DS pill + tactile press) ───────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--sd-r-pill);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.14s var(--sd-ease);
    border: 1px solid transparent;
    white-space: nowrap;
}
.btn i { width: 14px; height: 14px; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--sd-on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--sd-accent-hi); border-color: var(--sd-accent-hi); box-shadow: 0 6px 18px var(--accent-dim); }

.btn-secondary { background: transparent; color: var(--txt-primary); border-color: var(--border-hi); }
.btn-secondary:hover { border-color: var(--txt-primary); background: var(--bg-alt); }

.w-full { width: 100%; }

/* ─── SECTION HEADERS (auto-numbered module dividers) ─ */
.section-header {
    background: var(--bg-alt);
    padding: 15px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    counter-increment: module;
    position: relative;
}
.section-header::before {
    content: counter(module, decimal-leading-zero);
    font-family: var(--font-dot);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--accent);
    flex-shrink: 0;
}
.section-header h2 {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--txt-muted);
    flex-shrink: 0;
}
.section-header span {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--txt-dim);
    margin-left: auto;
    padding: 4px 10px;
    border: 1px solid var(--border-hi);
    border-radius: var(--sd-r-pill);
    flex-shrink: 0;
}

/* ─── PIPELINE GRID ───────────────────────────────── */
.pipeline-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--border);
    gap: 1px;
}
@media (max-width: 800px) { .pipeline-grid { grid-template-columns: 1fr; } }

.pipeline-card {
    background: var(--bg-panel);
    padding: 36px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    transition: background 0.18s, box-shadow 0.18s;
}
.pipeline-card:hover { background: var(--bg-alt); box-shadow: inset 0 2px 0 var(--accent); }
.pipeline-card:hover::after { color: var(--accent); transform: rotate(90deg); }

.card-num {
    font-family: var(--font-dot);
    font-size: 30px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.04em;
    line-height: 1;
}

.card-title {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.card-desc { font-family: var(--font-sans); font-size: 13px; line-height: 1.65; color: var(--txt-muted); }

/* ─── DATA PREVIEW CONTAINER ─────────────────────── */
.preview-section {
    background: var(--bg-panel);
    padding: 48px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}
@media (max-width: 800px) { .preview-section { padding: 24px; } }

.preview-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }
@media (max-width: 900px) { .preview-layout { grid-template-columns: 1fr; } }

.preview-controls { display: flex; flex-direction: column; gap: 12px; }

.track-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--txt-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    width: 100%;
    position: relative;
}
.track-btn:hover { border-color: var(--border-hi); background: var(--bg-alt); }
.track-btn.active { border-color: var(--accent); background: var(--accent-dim); }
.track-btn.active::before {
    content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
    width: 3px; border-radius: 2px; background: var(--accent);
}
.track-btn .track-title { font-family: var(--font-sans); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.track-btn .track-artist { font-family: var(--font-mono); font-size: 10px; color: var(--txt-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ─── TERMINAL ────────────────────────────────────── */
.terminal-view {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 420px;
}
.terminal-header {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-alt);
    height: 36px; padding: 0 16px;
    border-bottom: 1px solid var(--border);
}
.terminal-title { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: var(--txt-muted); text-transform: uppercase; }
.terminal-dots { display: flex; gap: 6px; }
.dot-indicator { width: 6px; height: 6px; background: var(--txt-dim); border-radius: 50%; }
.dot-indicator.red { background: var(--accent); }
.terminal-body { padding: 20px; overflow-y: auto; font-family: var(--font-mono); font-size: 11px; color: var(--success); line-height: 1.6; }
.terminal-body pre { white-space: pre-wrap; word-break: break-all; }

/* ─── DATA ANATOMY GRID ──────────────────────────── */
.anatomy-grid { display: grid; grid-template-columns: repeat(2, 1fr); background: var(--border); gap: 1px; }
@media (max-width: 800px) { .anatomy-grid { grid-template-columns: 1fr; } }

.anatomy-card {
    background: var(--bg-panel);
    padding: 32px;
    display: flex;
    gap: 20px;
    position: relative;
    transition: background 0.18s, box-shadow 0.18s;
}
.anatomy-card:hover { background: var(--bg-alt); box-shadow: inset 0 2px 0 var(--accent); }
.anatomy-card:hover::after { color: var(--accent); transform: rotate(90deg); }

.anatomy-icon { width: 24px; height: 24px; color: var(--accent); flex-shrink: 0; }
.anatomy-content { display: flex; flex-direction: column; gap: 8px; }
.anatomy-title { font-family: var(--font-sans); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.anatomy-desc { font-family: var(--font-sans); font-size: 13px; color: var(--txt-muted); line-height: 1.65; }

/* ─── PRICING GRID ────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--border); gap: 1px; }
@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr; } }

.pricing-card {
    background: var(--bg-panel);
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    transition: background 0.18s;
}
.pricing-card:hover { background: var(--bg-alt); }
.pricing-card.featured { background: var(--bg-alt); box-shadow: inset 0 0 0 2px var(--accent); }
.pricing-card.featured::after { color: var(--accent); }

.plan-flag {
    position: absolute;
    top: 0; right: 0;
    background: var(--accent);
    color: var(--sd-on-accent);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-bottom-left-radius: var(--r);
}

.plan-name { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--txt-muted); }
.pricing-card.featured .plan-name { color: var(--accent); }

.plan-price { font-family: var(--font-dot); font-size: 38px; font-weight: 700; line-height: 1; letter-spacing: 0.02em; }
.plan-price span { font-family: var(--font-mono); font-size: 12px; color: var(--txt-muted); font-weight: 400; letter-spacing: 0.04em; }

.plan-features { display: flex; flex-direction: column; gap: 12px; list-style: none; }
.plan-features li { display: flex; align-items: center; gap: 8px; font-family: var(--font-sans); font-size: 13px; color: var(--txt-muted); }
.plan-features li i { width: 14px; height: 14px; color: var(--success); flex-shrink: 0; }

/* ─── FOOTER ─────────────────────────────────────── */
.app-footer {
    background: var(--bg-panel);
    padding: 32px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--txt-dim);
    position: relative;
}
.app-footer::before {
    content: "◍ SIGNAL.DAT";
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.2em;
    color: var(--txt-dim);
    position: absolute;
    top: -1px; left: 24px;
    transform: translateY(-50%);
    background: var(--bg-panel);
    padding: 0 8px;
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--txt-dim); }
.footer-links a:hover { color: var(--accent); }

/* ─── STATISTICS DASHBOARD ────────────────────────── */
.stats-section { background: var(--bg-panel); padding: 32px 24px; display: flex; flex-direction: column; gap: 32px; }

.stats-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 800px) { .stats-summary-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-summary-grid { grid-template-columns: 1fr; } }

.stats-summary-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: var(--r);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s var(--sd-ease), border-color 0.18s;
}
.stats-summary-card::before {
    content: "";
    position: absolute; top: 14px; right: 14px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    opacity: 0.5;
}
.stats-summary-card:hover { transform: translateY(-3px); border-color: var(--border-hi); }

.stats-label { font-family: var(--font-mono); font-size: 9px; font-weight: 700; color: var(--txt-muted); letter-spacing: 0.14em; text-transform: uppercase; }
.stats-value {
    font-family: var(--font-dot);
    font-size: 34px;
    font-weight: 700;
    color: var(--txt-primary);
    letter-spacing: 0.02em;
    line-height: 1;
}
html[data-theme="dark"] .stats-value { text-shadow: 0 0 16px rgba(255,59,51,0.12); }

.stats-charts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .stats-charts-grid { grid-template-columns: 1fr; } }

.stats-chart-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.stats-chart-card h3 {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--txt-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 8px;
}

.chart-container { display: flex; flex-direction: column; gap: 12px; }
.chart-row { display: flex; flex-direction: column; gap: 4px; }
.chart-bar-wrapper { display: flex; align-items: center; gap: 12px; }
.chart-bar-bg { flex-grow: 1; height: 6px; background: var(--bg-alt); border-radius: var(--sd-r-pill); overflow: hidden; position: relative; }
.chart-bar-fill { height: 100%; background: var(--accent); border-radius: var(--sd-r-pill); width: 0%; transition: width 0.6s var(--sd-ease); box-shadow: 0 0 8px var(--accent-dim); }
.chart-label { font-family: var(--font-mono); font-size: 11px; color: var(--txt-primary); display: flex; justify-content: space-between; width: 100%; }
.chart-count { font-family: var(--font-mono); font-size: 10px; color: var(--txt-muted); }

/* ─── SIDEBAR & FILTERS ───────────────────────────── */
.preview-sidebar { display: flex; flex-direction: column; gap: 16px; }
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-group label { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--txt-muted); text-transform: uppercase; letter-spacing: 0.08em; }

.search-wrapper { position: relative; width: 100%; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--txt-muted); }

#search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--sd-r-sm);
    padding: 11px 12px 11px 36px;
    color: var(--txt-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
#search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.filters-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--sd-r-sm);
    padding: 9px 8px;
    color: var(--txt-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238A8A86' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 28px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.matching-count { font-family: var(--font-mono); font-size: 11px; color: var(--txt-muted); border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
#matching-tracks-count { font-weight: 700; color: var(--accent); }

.preview-controls-wrapper { height: 380px; overflow-y: auto; border: 1px solid var(--border); background: var(--bg-input); border-radius: var(--r); padding: 8px; }
.preview-controls-wrapper::-webkit-scrollbar { width: 6px; }
.preview-controls-wrapper::-webkit-scrollbar-track { background: transparent; }
.preview-controls-wrapper::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: var(--sd-r-pill); }

/* ─── EXPLORER VIEW & HEADER ─────────────────────── */
.explorer-view {
    display: flex; flex-direction: column; gap: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 24px;
}
.explorer-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px; flex-wrap: wrap; gap: 16px;
}
.explorer-track-info h3 { font-family: var(--font-sans); font-size: 24px; font-weight: 600; line-height: 1.2; }
.explorer-track-info span { font-family: var(--font-mono); font-size: 11px; color: var(--txt-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.explorer-meta-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
    background: var(--bg-alt);
    border: 1px solid var(--border-hi);
    color: var(--txt-primary);
    padding: 5px 10px;
    border-radius: var(--sd-r-pill);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* ─── AUDIO PLAYER (transport) ────────────────────── */
.audio-player-container {
    background: var(--bg-alt);
    border: 1px solid var(--border-hi);
    border-radius: var(--r);
    padding: 16px;
    display: flex; flex-direction: column; gap: 8px;
}
.custom-audio-player { display: flex; align-items: center; gap: 16px; }
.audio-btn {
    background: transparent;
    border: 1px solid var(--border-hi);
    color: var(--txt-primary);
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.14s;
}
.audio-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-input); }
.audio-btn:active { transform: scale(0.94); }
.audio-btn i { width: 14px; height: 14px; }
.audio-time { font-family: var(--font-mono); font-size: 11px; color: var(--txt-muted); min-width: 35px; }
.audio-progress-container { flex-grow: 1; height: 5px; background: var(--border); border-radius: var(--sd-r-pill); cursor: pointer; position: relative; }
.audio-progress-bar { height: 100%; background: var(--accent); width: 0%; border-radius: var(--sd-r-pill); }
.audio-status-msg { font-family: var(--font-mono); font-size: 10px; color: var(--txt-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.audio-status-msg code { background: var(--bg-input); padding: 1px 5px; border-radius: var(--sd-r-sm); color: var(--txt-muted); }

/* ─── VIEW TOGGLE (segmented control) ─────────────── */
.view-toggle-bar { display: flex; background: var(--bg-alt); padding: 4px; border-radius: var(--sd-r-pill); border: 1px solid var(--border-hi); gap: 4px; }
.toggle-btn {
    flex-grow: 1; background: transparent; border: none;
    color: var(--txt-muted);
    font-family: var(--font-mono); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    padding: 9px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: var(--sd-r-pill);
    transition: all 0.14s;
}
.toggle-btn:hover { color: var(--txt-primary); }
.toggle-btn.active { background: var(--bg-input); color: var(--txt-primary); box-shadow: var(--sd-shadow-sm); }
.toggle-btn i { width: 12px; height: 12px; }

/* ─── EXPLORER PANELS ─────────────────────────────── */
.explorer-content-panel { position: relative; min-height: 380px; }
.explorer-panel { display: none; flex-direction: column; gap: 20px; }
.explorer-panel.active { display: flex; animation: sd-fade-in var(--sd-dur) ease; }

.global-descriptors-box, .emotional-production-box {
    background: var(--bg-alt);
    border: 1px solid var(--border-hi);
    border-radius: var(--r);
    padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
}
.global-descriptors-box h4, .emotional-production-box h4, .timeline-visual-blocks-container h4 {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px dashed var(--border-hi);
    padding-bottom: 6px;
}
.global-desc-grid, .prod-specs-grid {
    display: grid; grid-template-columns: 1fr; gap: 10px;
    font-family: var(--font-sans); font-size: 13px; line-height: 1.55; color: var(--txt-muted);
}
.global-desc-grid strong, .prod-specs-grid strong {
    font-family: var(--font-mono); font-size: 11px; color: var(--txt-primary);
    text-transform: uppercase; letter-spacing: 0.05em;
    display: inline-block; min-width: 140px;
}

/* Timeline Blocks */
.timeline-visual-blocks-container { display: flex; flex-direction: column; gap: 16px; }
.timeline-blocks { display: flex; flex-direction: column; gap: 12px; }
.timeline-block-card {
    border: 1px solid var(--border-hi);
    background: var(--bg-alt);
    border-radius: var(--r);
    padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
    transition: border-color 0.15s;
    position: relative;
}
.timeline-block-card:hover { border-color: var(--txt-muted); }
.block-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.block-time { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-dim); padding: 3px 9px; border-radius: var(--sd-r-pill); }
.block-type { font-family: var(--font-sans); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.block-desc { font-family: var(--font-sans); font-size: 13px; line-height: 1.65; color: var(--txt-primary); }
.block-metadata { display: flex; flex-direction: column; gap: 8px; }
.meta-row { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; }
.meta-row strong { font-family: var(--font-mono); font-size: 10px; color: var(--txt-muted); text-transform: uppercase; letter-spacing: 0.05em; min-width: 90px; padding-top: 3px; }
.meta-tags-container { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill { background: var(--bg-input); border: 1px solid var(--border); color: var(--txt-muted); padding: 3px 9px; border-radius: var(--sd-r-pill); font-family: var(--font-mono); font-size: 10px; }
.tag-pill.instrument { color: var(--txt-primary); border-color: var(--border-hi); }
.contour-tag { font-family: var(--font-mono); font-size: 11px; color: var(--success); background: rgba(48, 209, 88, 0.08); border: 1px solid rgba(48, 209, 88, 0.2); padding: 3px 9px; border-radius: var(--sd-r-pill); }

.explorer-panel .terminal-view { height: 480px; }

/* ─── MOTION SAFETY ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* ─── MOBILE RESPONSIVE ──────────────────────────── */
@media (max-width: 640px) {

    /* Header */
    .app-header {
        padding: 0 16px;
        height: auto;
        min-height: 56px;
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .logo-area { flex: 1; min-width: 0; }
    .logo-text h1 { font-size: 16px; letter-spacing: 0.1em; }
    .logo-icon { width: 18px; height: 18px; }
    .system-status {
        font-size: 9px;
        order: 3;
        width: 100%;
        text-align: center;
        padding-bottom: 4px;
    }
    .header-actions { gap: 6px; }
    .header-actions .btn { display: none; } /* ocultar botones de nav en mobile */
    .theme-toggle { width: 32px; height: 32px; }

    /* Hero */
    .hero-section { padding: 40px 16px 32px; }
    .hero-title { font-size: clamp(20px, 6vw, 32px); }
    .hero-desc { font-size: 13px; }
    .hero-cta-group { flex-direction: column; gap: 10px; }
    .hero-cta-group .btn { width: 100%; text-align: center; justify-content: center; }
    .hero-eq { display: none; }

    /* Stats */
    .stats-summary-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stats-charts-grid { grid-template-columns: 1fr; }

    /* Pipeline */
    .pipeline-grid { grid-template-columns: 1fr; }

    /* Anatomy */
    .anatomy-grid { grid-template-columns: 1fr; }

    /* Explorer */
    .preview-layout { flex-direction: column; }
    .preview-sidebar { width: 100%; max-height: 300px; }
    .explorer-view { width: 100%; }
    .filters-grid { grid-template-columns: 1fr; }

    /* Pricing */
    .pricing-grid { grid-template-columns: 1fr; }

    /* Ticker */
    .ticker { font-size: 9px; }

    /* Section headers — evitar desbordamiento de 01/02/03 y títulos */
    .section-header {
        padding: 12px 16px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .section-header::before { font-size: 13px; }
    .section-header h2 {
        font-size: 11px;
        letter-spacing: 0.08em;
        flex-shrink: 1;
        min-width: 0;
        white-space: normal;
        word-break: break-word;
    }
    .section-header span {
        font-size: 8px;
        padding: 3px 7px;
        margin-left: auto;
    }

    /* Pills de tags — permitir que el texto envuelva y no se salga */
    .meta-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .meta-row strong { min-width: 0; }
    .meta-tags-container { width: 100%; }
    .tag-pill, .contour-tag {
        white-space: normal;
        word-break: break-word;
        max-width: 100%;
    }

    /* Cards — texto y números del pipeline/anatomy */
    .card-num { font-size: 28px; }
    .pipeline-card, .anatomy-card { padding: 20px 16px; }
    .block-desc { font-size: 12px; line-height: 1.5; }

    /* Timeline blocks del explorer */
    .timeline-block-card { padding: 14px; }
    .global-descriptors-box, .emotional-production-box { padding: 14px; }
    .global-desc-grid, .prod-specs-grid { grid-template-columns: 1fr; }
}

