:root {
  /* Vibepad brand: app navy and logo blue */
  --bg: #0f1b2d;
  --surface: #16263d;
  --surface-2: #1e3250;
  --text: #f2f7fc;
  --muted: #9fb3c8;
  --accent: #38b6ff;
  --accent-2: #7dd3ff;
  --on-accent: #0f1b2d;
  --border: #26405f;
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: var(--accent-2); }
img, svg { max-width: 100%; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.brand img { display: block; height: 36px; width: auto; }
.nav { display: flex; gap: 18px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav a:hover { color: var(--text); }
.nav a { white-space: nowrap; }
@media (max-width: 900px) { .nav a.hide-sm { display: none; } }

/* Hero */
.hero { padding: 48px 0 24px; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); margin: 0 0 8px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); margin: 0 auto 24px; max-width: 560px; }
.search { display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.search input { flex: 1; min-width: 0; padding: 14px 16px; font-size: 1rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0 0; padding: 0; list-style: none; }
.tag-btn { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 6px 14px; border-radius: 999px; font: inherit; font-size: .85rem; cursor: pointer; }
.tag-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; padding: 24px 0 48px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 12px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.pad { width: 96px; height: 96px; border-radius: 50%; border: none; cursor: pointer; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 60%, color-mix(in srgb, var(--c) 60%, #000)); box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 55%, #000), 0 10px 18px rgba(0,0,0,.35); transition: transform .06s, box-shadow .06s; display: grid; place-items: center; color: #fff; }
.pad:active, .pad.playing { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 55%, #000), 0 4px 8px rgba(0,0,0,.3); }
.pad:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 4px; }
.pad svg { width: 34px; height: 34px; opacity: .9; }
.card h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.card .meta { font-size: .75rem; color: var(--muted); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
.actions a[download] { grid-column: 1 / -1; }
.actions a, .actions button { min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 7px 6px; border-radius: 10px; font: inherit; font-size: .8rem; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.actions a:hover, .actions button:hover { border-color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; grid-column: 1 / -1; }

/* Sections */
section.block { padding: 48px 0; border-top: 1px solid var(--border); }
section.block h2 { font-size: 1.6rem; margin: 0 0 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.panel h3 { margin-top: 0; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; }
.notice { font-size: .85rem; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: var(--muted); }

/* Legal pages */
.legal { max-width: 760px; padding: 40px 16px 64px; }
.legal h1 { margin-top: 0; }
.legal .draft { background: #fef3c7; color: #78350f; border-radius: 10px; padding: 12px 16px; font-size: .9rem; }
.todo { background: #fde68a; color: #78350f; padding: 0 4px; border-radius: 4px; }
table.credits { width: 100%; border-collapse: collapse; }
table.credits th, table.credits td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); font-size: .9rem; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--surface-2); color: var(--text); border: 1px solid var(--border); padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
