/* SoundZapp: sampler-pad design system
   Cobalt chassis, ink outlines, hard shadows that press flat when you tap. */

:root {
  --blue: #2d3bff;
  --ink: #0e1033;
  --pale: #eef0ff;
  --white: #ffffff;
  --yellow: #ffd400;
  --muted: #484b7a;
  --line: rgba(14, 16, 51, 0.16);
  --radius: 18px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--pale);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 450;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 800; font-stretch: 80%; line-height: 1.04; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.on-blue :focus-visible, .on-ink :focus-visible { outline-color: var(--yellow); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--yellow); color: var(--ink); padding: 10px 16px; border: 3px solid var(--ink); border-radius: 12px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: min(1200px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }

/* ---------- top block: header + hero ---------- */
.top { position: relative; background: var(--blue); color: var(--white); padding-bottom: 26px; }
.top::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='14' viewBox='0 0 32 14'%3E%3Cpath d='M0 14L32 0V14Z' fill='%23EEF0FF'/%3E%3C/svg%3E") repeat-x left bottom / 32px 14px;
}

.site-header { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 18px 0; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--white); }
.logo-mark { display: grid; place-items: center; width: 38px; height: 38px; background: var(--ink); border-radius: 11px; }
.logo-mark svg { width: 22px; height: 22px; }
.logo-word { font-size: 1.7rem; font-weight: 800; font-stretch: 78%; letter-spacing: -0.01em; line-height: 1; }

.main-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.main-nav a { color: var(--white); text-decoration: none; font-weight: 650; padding: 6px 0; border-bottom: 3px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current="page"] { border-bottom-color: var(--yellow); }

.search { margin-left: auto; display: flex; align-items: stretch; background: var(--white); border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; box-shadow: 0 4px 0 var(--ink); }
.search input { border: 0; background: transparent; padding: 9px 4px 9px 14px; width: min(230px, 52vw); color: var(--ink); outline: none; }
.search input::placeholder { color: var(--muted); }
.search:focus-within { outline: 3px solid var(--yellow); outline-offset: 3px; }
.search button { display: grid; place-items: center; width: 44px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.search svg { width: 20px; height: 20px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(28px, 4.5vw, 56px); align-items: center; padding: clamp(12px, 3vw, 32px) 0 clamp(36px, 5vw, 60px); }
.hero h1 { font-size: clamp(3rem, 5.6vw, 5.4rem); font-stretch: 75%; line-height: 0.93; letter-spacing: -0.015em; }
.lede { max-width: 34ch; margin: 22px 0 26px; font-size: 1.2rem; line-height: 1.45; font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.link-light { color: var(--white); font-weight: 650; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.key-hint { display: none; margin: 26px 0 0; font-size: 0.95rem; opacity: 0.9; }
@media (hover: hover) and (pointer: fine) { .key-hint { display: block; } }

.hero-pads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 16px; padding-bottom: 6px; }
.hero-pads .pad-hit { min-height: 130px; }

/* ---------- pads ---------- */
.pad { position: relative; min-width: 0; --pad: var(--yellow); }
.pad-hit {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  width: 100%; min-height: 132px; padding: 14px 14px 12px;
  background: var(--pad); color: var(--ink);
  border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: 0 6px 0 var(--ink);
  text-align: left; cursor: pointer;
  transition: transform 0.06s, box-shadow 0.06s, background-color 0.12s, color 0.12s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.pad-hit:active, .pad-hit[data-playing] { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.pad-hit[data-playing] { background: var(--ink); color: var(--pad); }
.pad-label { display: block; width: 100%; }
.pad-name { display: block; font-weight: 750; font-size: 1.1rem; font-stretch: 84%; line-height: 1.12; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.hero-pads .pad-name { font-size: clamp(0.86rem, 1.2vw, 1rem); }
.pad-meta { display: block; margin-top: 3px; font-size: 0.82rem; font-weight: 550; opacity: 0.78; }

.pad-bars { display: flex; align-items: flex-end; gap: 3px; height: 24px; }
.pad-bars i { display: block; width: 5px; height: 8px; border-radius: 2px; background: currentColor; }
.pad-bars i:nth-child(2) { height: 15px; }
.pad-bars i:nth-child(3) { height: 11px; }
.pad-bars i:nth-child(4) { height: 20px; }
.pad-bars i:nth-child(5) { height: 9px; }
[data-playing] .pad-bars i { animation: eq 0.46s ease-in-out infinite alternate; }
[data-playing] .pad-bars i:nth-child(2) { animation-duration: 0.38s; animation-delay: -0.1s; }
[data-playing] .pad-bars i:nth-child(3) { animation-duration: 0.52s; animation-delay: -0.22s; }
[data-playing] .pad-bars i:nth-child(4) { animation-duration: 0.42s; animation-delay: -0.05s; }
[data-playing] .pad-bars i:nth-child(5) { animation-duration: 0.34s; animation-delay: -0.3s; }
@keyframes eq { from { height: 4px; } to { height: 24px; } }

.pad-key { display: none; position: absolute; top: 10px; right: 10px; min-width: 26px; height: 26px; padding: 0 6px; place-items: center; background: rgba(255, 255, 255, 0.7); border: 2px solid var(--ink); border-radius: 8px; font: 800 0.8rem/1 var(--font); }
[data-playing] .pad-key { background: transparent; border-color: currentColor; }
@media (hover: hover) and (pointer: fine) { .pad-key { display: grid; } }

.pad-tools { display: flex; justify-content: flex-end; gap: 2px; padding: 8px 2px 0; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: rgba(14, 16, 51, 0.09); }
.icon-btn svg { width: 20px; height: 20px; }
.pad-fav[aria-pressed="true"] svg { fill: currentColor; }

.pad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px 18px; }

/* ---------- buttons, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; background: var(--white); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
  font-weight: 700; line-height: 1.1; text-decoration: none; cursor: pointer;
  transition: transform 0.06s, box-shadow 0.06s; touch-action: manipulation;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--yellow); }
.btn[hidden] { display: none; }
.btn.pad-fav[aria-pressed="true"] { background: var(--ink); color: var(--white); }

.chips { display: flex; flex-wrap: wrap; gap: 16px 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 10px 9px 16px;
  background: var(--pad, var(--white)); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 4px 0 var(--ink);
  font-weight: 700; text-decoration: none; transition: transform 0.06s, box-shadow 0.06s;
}
.chip:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.chip-count { min-width: 28px; padding: 1px 8px; border-radius: 999px; background: var(--ink); color: var(--pad, var(--white)); font-size: 0.82rem; text-align: center; }

/* ---------- page sections ---------- */
.block { padding: clamp(28px, 5vw, 52px) 0 0; }
.block + .block { padding-top: clamp(36px, 6vw, 64px); }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 26px; }
.block h2, .page-head h1 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
.block-head a { font-weight: 650; text-underline-offset: 4px; }
.page-head { padding: clamp(28px, 5vw, 48px) 0 0; }
.page-head h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); font-stretch: 76%; }
.count { margin: 10px 0 0; color: var(--muted); font-weight: 600; }
.lede-dark { max-width: 56ch; margin: 12px 0 0; font-size: 1.15rem; color: var(--muted); }
main { padding-bottom: clamp(48px, 8vw, 96px); }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.95rem; color: var(--muted); font-weight: 550; }
.crumbs li + li::before { content: "/"; margin-right: 10px; opacity: 0.6; }
.crumbs a { text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--ink); }

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 44px; }
.pager a, .pager span { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 14px; border: 3px solid var(--ink); border-radius: 12px; background: var(--white); font-weight: 700; text-decoration: none; }
.pager a:hover { background: var(--yellow); }
.pager [aria-current="page"] { background: var(--ink); color: var(--white); }
.pager .gap { border-color: transparent; background: transparent; min-width: 0; padding: 0 2px; }

.cat-list { display: grid; gap: 22px; }
.cat-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 22px; padding: 18px 22px; background: var(--pad); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: 0 6px 0 var(--ink); text-decoration: none; transition: transform 0.06s, box-shadow 0.06s; }
.cat-row:hover { transform: translateY(3px); box-shadow: 0 3px 0 var(--ink); }
.cat-row h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.cat-row p { margin: 4px 0 0; font-weight: 500; }
.cat-row .chip-count { font-size: 1rem; padding: 4px 12px; }

/* ---------- sound page ---------- */
.sound-page { padding-top: clamp(20px, 3vw, 32px); }
.sound-page h1 { margin: 18px 0 28px; font-size: clamp(2.6rem, 6vw, 4.6rem); font-stretch: 75%; }
.sound-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 56px); align-items: start; }
.pad-hit.big { min-height: clamp(210px, 30vw, 300px); padding: 22px 22px 20px; border-radius: 26px; box-shadow: 0 9px 0 var(--ink); }
.pad-hit.big:active, .pad-hit.big[data-playing] { transform: translateY(6px); box-shadow: 0 3px 0 var(--ink); }
.pad-hit.big .pad-bars { height: 44px; gap: 6px; }
.pad-hit.big .pad-bars i { width: 9px; }
.pad-hit.big .pad-name { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-stretch: 76%; }
@keyframes eq-big { from { height: 6px; } to { height: 44px; } }
.pad-hit.big[data-playing] .pad-bars i { animation-name: eq-big; }

.wave { display: flex; align-items: center; gap: 3px; height: 84px; margin: 34px 0 6px; }
.wave i { flex: 1; min-width: 2px; height: calc(var(--h, 0.3) * 100%); min-height: 5px; border-radius: 3px; background: var(--ink); opacity: 0.22; }
.wave i.on { opacity: 1; }
.actions { display: flex; flex-wrap: wrap; gap: 16px 14px; margin-top: 26px; }

.sound-info dl { margin: 0; border: 3px solid var(--ink); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.sound-info dl > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; padding: 14px 18px; }
.sound-info dl > div + div { border-top: 2px solid var(--line); }
.sound-info dt { color: var(--muted); font-weight: 600; }
.sound-info dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { display: inline-block; padding: 2px 11px; background: var(--pale); border: 2px solid var(--ink); border-radius: 999px; font-size: 0.9rem; font-weight: 600; text-decoration: none; }
.tags a:hover { background: var(--yellow); }
.report { margin-top: 16px; font-size: 0.95rem; color: var(--muted); }
.about-sound { max-width: 62ch; margin-top: clamp(32px, 5vw, 52px); }
.about-sound h2 { font-size: 1.7rem; margin-bottom: 10px; }

/* ---------- search & favorites ---------- */
.search-big { display: flex; max-width: 640px; margin-top: 22px; background: var(--white); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 5px 0 var(--ink); overflow: hidden; }
.search-big input { flex: 1; min-width: 0; padding: 15px 18px; border: 0; background: transparent; font-size: 1.15rem; outline: none; }
.search-big:focus-within { outline: 3px solid var(--blue); outline-offset: 3px; }
.search-big button { padding: 0 22px; border: 0; border-left: 3px solid var(--ink); background: var(--yellow); font-weight: 700; cursor: pointer; }
.results-status { margin: 26px 0 22px; color: var(--muted); font-weight: 600; min-height: 1.55em; }
.empty { max-width: 56ch; padding: 6px 0 10px; }
.empty h2 { font-size: 1.8rem; margin-bottom: 10px; }
.more { margin-top: 38px; }

/* ---------- text pages ---------- */
.prose { max-width: 68ch; padding-top: 26px; }
.prose h2 { font-size: 1.7rem; margin: 2em 0 0.5em; }
.prose h3 { font-size: 1.25rem; font-stretch: 90%; margin: 1.6em 0 0.4em; }
.prose p, .prose li { line-height: 1.65; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.3em; list-style: revert; }
.prose li { margin-bottom: 0.4em; }
.prose a { text-underline-offset: 3px; }
.prose .note { padding: 14px 18px; background: var(--white); border: 3px solid var(--ink); border-radius: 14px; }

.ad { margin: 36px 0 0; text-align: center; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--white); padding: 52px 0 28px; margin-top: 0; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.site-footer h2 { font-size: 1.15rem; font-stretch: 90%; margin-bottom: 12px; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { text-underline-offset: 4px; }
.site-footer p { max-width: 38ch; opacity: 0.85; margin-top: 14px; }
.legal { margin-top: 36px !important; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.2); font-size: 0.92rem; max-width: none !important; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; max-width: calc(100% - 32px); padding: 12px 20px; background: var(--ink); color: var(--white); border-radius: 12px; font-weight: 650; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .lede { max-width: 44ch; }
  .sound-layout { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .search { order: 3; margin-left: 0; width: 100%; }
  .search input { width: 100%; flex: 1; }
  .main-nav { margin-left: auto; }
  .hero-pads { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; }
  .hero-pads .pad-hit { min-height: 104px; padding: 10px 10px 9px; }
  .hero-pads .pad-name { font-size: 0.88rem; }
  .hero-pads .pad-bars { height: 18px; }
  .pad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .pad-hit { min-height: 118px; }
  .cat-row { grid-template-columns: 1fr auto; }
  .cat-row .swatch { display: none; }
  .sound-info dl > div { grid-template-columns: 1fr; gap: 2px; }
  .foot-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
