/* ── BPM2OSC website — shared stylesheet ────────────────────────────────── */

:root {
  --dark-bg:  #1a1a2e;
  --panel-bg: #16213e;
  --card-bg:  #111827;
  --accent:   #e94560;
  --accent2:  #0f3460;
  --green:    #00d4aa;
  --fg:       #e0e0e0;
  --fg-dim:   #888888;
  --border:   #1e3a5a;
  --font-mono: 'Consolas', 'Menlo', 'Courier New', monospace;
}

/* ── Reset & base ─────────────────────────────────────────────────────────── */

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--dark-bg);
  color: var(--fg);
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--green); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; }

code, pre {
  font-family: var(--font-mono);
  background: var(--card-bg);
  border: 1px solid var(--border);
}

code {
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--green);
}

pre {
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--fg);
}

/* ── Navigation ───────────────────────────────────────────────────────────── */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 60px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.04em;
}

.navbar-logo .logo-bpm { color: var(--green); }
.navbar-logo .logo-osc { color: var(--accent); }
.navbar-logo .logo-sep { color: var(--fg-dim); }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-left: auto;
  list-style: none;
}

.navbar-links a {
  color: var(--fg-dim);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s;
}

.navbar-links a:hover, .navbar-links a.active { color: var(--fg); }

.btn-nav-download {
  background: var(--accent) !important;
  color: white !important;
  padding: 0.45rem 1.2rem !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
}

.btn-nav-download:hover { background: #c73350 !important; color: white !important; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
  text-decoration: none;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: #c73350; color: white; }

.btn-secondary {
  background: var(--accent2);
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #1a4a80; color: var(--fg); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--panel-bg); color: var(--fg); }

.btn-lg { padding: 1rem 2.25rem; font-size: 1.1rem; border-radius: 10px; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  padding: 6rem 2rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0, 212, 170, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 100%, rgba(233, 69, 96, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  background: var(--accent2);
  border: 1px solid var(--green);
  border-radius: 100px;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.hero h1 .hl-green { color: var(--green); }
.hero h1 .hl-red   { color: var(--accent); }

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--fg-dim);
  max-width: 620px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero-meta {
  font-size: 0.8rem;
  color: var(--fg-dim);
}
.hero-meta span { margin: 0 0.5rem; }

/* ── BPM display mockup ───────────────────────────────────────────────────── */

.bpm-display {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 2.5rem;
  margin: 0 auto 3.5rem;
  box-shadow: 0 0 60px rgba(0, 212, 170, 0.08);
}

.bpm-number {
  font-family: var(--font-mono);
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
  line-height: 1;
}

.bpm-unit {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--fg-dim);
  align-self: flex-end;
  padding-bottom: 0.4rem;
}

/* ── Section base ─────────────────────────────────────────────────────────── */

.section {
  padding: 5rem 2rem;
}

.section-alt { background: var(--panel-bg); }

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.section-desc {
  color: var(--fg-dim);
  font-size: 1.05rem;
  max-width: 600px;
  margin-bottom: 3rem;
  line-height: 1.7;
}

/* ── Features grid ────────────────────────────────────────────────────────── */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--green);
  transform: translateY(-3px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--accent2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--fg-dim);
  line-height: 1.6;
}

/* ── How it works ─────────────────────────────────────────────────────────── */

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--green), var(--accent));
  border-radius: 2px;
}

.step {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  position: relative;
}

.step-num {
  width: 44px;
  height: 44px;
  background: var(--panel-bg);
  border: 2px solid var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
  z-index: 1;
}

.step-content h3 {
  font-size: 1rem;
  color: var(--fg);
  margin-bottom: 0.35rem;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--fg-dim);
  line-height: 1.6;
}

/* ── OSC targets diagram ─────────────────────────────────────────────────── */

.osc-diagram {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg-dim);
  line-height: 2;
}

.osc-diagram .src  { color: var(--green); }
.osc-diagram .msg  { color: var(--accent); }
.osc-diagram .dest { color: var(--fg); }
.osc-diagram .arrow { color: var(--fg-dim); }

/* ── Presets ──────────────────────────────────────────────────────────────── */

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

.preset-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  cursor: default;
  transition: border-color 0.2s;
}

.preset-card:hover { border-color: var(--accent2); }

.preset-card h4 {
  font-size: 0.95rem;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.preset-range {
  font-size: 0.8rem;
  color: var(--green);
  font-family: var(--font-mono);
  margin-bottom: 0.35rem;
}

.preset-desc {
  font-size: 0.8rem;
  color: var(--fg-dim);
}

/* ── Download section ─────────────────────────────────────────────────────── */

.download-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.download-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--green), var(--accent));
}

.download-box h2 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.download-box p {
  color: var(--fg-dim);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.download-meta {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--fg-dim);
}

.download-meta span { margin: 0 0.5rem; }

.sysreq {
  margin-top: 2.5rem;
  text-align: left;
  background: var(--panel-bg);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}

.sysreq h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  margin-bottom: 0.75rem;
}

.sysreq ul {
  list-style: none;
  font-size: 0.88rem;
  color: var(--fg-dim);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sysreq li::before {
  content: '✓ ';
  color: var(--green);
  font-weight: 700;
}

/* ── Table ────────────────────────────────────────────────────────────────── */

.table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead tr { background: var(--accent2); }

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg);
}

td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--fg-dim);
  vertical-align: top;
}

td:first-child { color: var(--fg); font-weight: 500; }

tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
tbody tr:hover { background: rgba(0, 212, 170, 0.04); }

/* ── Footer ───────────────────────────────────────────────────────────────── */

footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
}

.footer-logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.footer-sub {
  font-size: 0.85rem;
  color: var(--fg-dim);
  margin-bottom: 1.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  list-style: none;
  margin-bottom: 2rem;
}

.footer-links a { font-size: 0.9rem; color: var(--fg-dim); }
.footer-links a:hover { color: var(--fg); }

.footer-copy {
  font-size: 0.78rem;
  color: var(--fg-dim);
  line-height: 1.7;
}

.footer-heart { color: var(--accent); }

/* ── Manual page layout ───────────────────────────────────────────────────── */

.manual-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  gap: 3rem;
  align-items: flex-start;
}

.manual-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.35rem 0.6rem;
  font-size: 0.875rem;
  color: var(--fg-dim);
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover { background: var(--accent2); color: var(--fg); }
.sidebar-nav a.active { background: var(--accent2); color: var(--green); }

.sidebar-nav .sub {
  padding-left: 1.25rem;
  font-size: 0.82rem;
}

/* ── Manual content ───────────────────────────────────────────────────────── */

.manual-content {
  flex: 1;
  min-width: 0;
}

.manual-content h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.manual-content .lead {
  font-size: 1.1rem;
  color: var(--fg-dim);
  margin-bottom: 3rem;
  line-height: 1.7;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}

.manual-section {
  margin-bottom: 4rem;
  scroll-margin-top: 80px;
}

.manual-section h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
}

.manual-section h3 {
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem;
  color: var(--green);
}

.manual-section p {
  font-size: 0.95rem;
  color: var(--fg-dim);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.manual-section ul, .manual-section ol {
  padding-left: 1.5rem;
  color: var(--fg-dim);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.manual-section li { margin-bottom: 0.25rem; }

.callout {
  background: rgba(0, 212, 170, 0.06);
  border-left: 3px solid var(--green);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  color: var(--fg-dim);
}

.callout strong { color: var(--green); }

.callout-warn {
  background: rgba(233, 69, 96, 0.06);
  border-left-color: var(--accent);
}

.callout-warn strong { color: var(--accent); }

/* ── Badges ───────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 0.2em 0.55em;
  border-radius: 4px;
  font-size: 0.78em;
  font-weight: 700;
  font-family: var(--font-mono);
  vertical-align: middle;
}

.badge-green { background: rgba(0,212,170,0.15); color: var(--green); }
.badge-red   { background: rgba(233,69,96,0.15);  color: var(--accent); }
.badge-dim   { background: var(--accent2);          color: var(--fg); }

/* ── OSC message block ────────────────────────────────────────────────────── */

.osc-msg-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.osc-msg {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.osc-msg .path  { color: var(--green); min-width: 100px; }
.osc-msg .type  { color: var(--accent); min-width: 60px; }
.osc-msg .desc  { color: var(--fg-dim); font-family: inherit; font-size: 0.85rem; }

/* ── Mobile ───────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .manual-layout { flex-direction: column; gap: 2rem; }
  .manual-sidebar { width: 100%; position: static; max-height: none; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-nav a { padding: 0.3rem 0.6rem; }
}

@media (max-width: 700px) {
  .navbar { padding: 0 1rem; gap: 1rem; }
  .navbar-links { gap: 1rem; }
  .hero { padding: 4rem 1.25rem 3.5rem; }
  .section { padding: 3.5rem 1.25rem; }
  .hero-actions { flex-direction: column; }
  .bpm-number { font-size: 3.5rem; }
  .download-box { padding: 2rem 1.25rem; }
  .manual-layout { padding: 2rem 1rem; }
}

/* ── Animations ───────────────────────────────────────────────────────────── */

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse { animation: pulse 2s ease-in-out infinite; }

/* ── Screenshot placeholder ───────────────────────────────────────────────── */

.screenshot-slot {
  background: var(--panel-bg);
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  color: var(--fg-dim);
  font-size: 0.9rem;
}

.screenshot-slot .slot-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

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

img.screenshot {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
}
