/* ── ErriPuku.engineer — Global Styles ──────────────────────────────────── */
/* font loaded in BaseLayout head */

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

:root {
  --bg:        #080810;
  --bg2:       #0f0f1a;
  --bg3:       #16162a;
  --card:      #1a1a2e;
  --card-h:    #1f1f38;
  --border:    rgba(255,255,255,0.07);
  --border-h:  rgba(255,255,255,0.15);
  --accent:    #7c3aed;
  --accent2:   #a855f7;
  --accent3:   #c084fc;
  --gold:      #f59e0b;
  --green:     #10b981;
  --text:      #e8e8f0;
  --text2:     #9999bb;
  --text3:     #555577;
  --radius:    12px;
  --shadow:    0 4px 24px rgba(0,0,0,0.6);
  --glow:      0 0 40px rgba(124,58,237,0.15);
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Accessibility ─────────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
a:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ── Header ────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,8,16,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1380px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px; height: 62px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; white-space: nowrap;
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.logo-text {
  font-weight: 800; font-size: 1.1rem;
  background: linear-gradient(135deg, #fff 30%, var(--accent3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-tld { font-weight: 400; opacity: 0.7; }

.main-nav {
  display: flex; gap: 4px;
}
.main-nav a {
  color: var(--text2); text-decoration: none;
  padding: 6px 12px; border-radius: 8px; font-size: 0.85rem;
  transition: color .15s, background .15s;
}
.main-nav a:hover { color: var(--text); background: var(--bg3); }

.header-search {
  flex: 1; max-width: 380px; position: relative; margin-left: auto;
}
.header-search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text3); pointer-events: none;
}
.header-search input {
  width: 100%; padding: 9px 14px 9px 36px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 50px; color: var(--text); font-size: 0.85rem;
  font-family: inherit; outline: none;
  transition: border .2s, box-shadow .2s;
}
.header-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}
.header-search input::placeholder { color: var(--text3); }

/* ── Page wrapper ──────────────────────────────────────────────────────── */
.container {
  max-width: 1380px; margin: 0 auto; padding: 0 24px;
}
.section { padding: 40px 0; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative; padding: 72px 0 56px;
  text-align: center; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124,58,237,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 20px;
  background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.3);
  font-size: 0.78rem; font-weight: 600; color: var(--accent3);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 900; line-height: 1.15;
  background: linear-gradient(135deg, #fff 30%, var(--accent3) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}
.hero p {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text2); max-width: 560px; margin: 0 auto 28px;
}
.hero-stats {
  display: flex; justify-content: center; gap: 32px; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--text3);
}
.hero-stats strong { font-size: 1.3rem; font-weight: 800; color: var(--accent3); display: block; }

/* ── Section headings ──────────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.section-title {
  font-size: 1.25rem; font-weight: 700;
  background: linear-gradient(90deg, var(--text) 60%, var(--text2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.section-link {
  font-size: 0.8rem; color: var(--accent2); text-decoration: none;
  padding: 5px 12px; border-radius: 6px; border: 1px solid rgba(168,85,247,0.3);
  transition: background .15s;
}
.section-link:hover { background: rgba(168,85,247,0.1); }

/* ── Audio card grid ───────────────────────────────────────────────────── */
.sounds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

/* ── Audio card ────────────────────────────────────────────────────────── */
.audio-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.audio-card:hover {
  transform: translateY(-4px);
  border-color: rgba(168,85,247,0.4);
  box-shadow: 0 8px 32px rgba(124,58,237,0.18);
}
.card-link { text-decoration: none; color: inherit; display: block; }

/* thumbnail */
.card-thumb {
  width: 100%; aspect-ratio: 16/9;
  background: var(--bg3); position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.audio-card:hover .card-thumb img { transform: scale(1.05); }
.thumb-fallback {
  font-size: 2.2rem; opacity: 0.4;
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.card-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35);
  opacity: 0; transition: opacity .2s;
}
.card-play-btn svg {
  width: 48px; height: 48px; padding: 12px; border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,0.5);
  transition: transform .15s;
}
.audio-card:hover .card-play-btn { opacity: 1; }
.audio-card:hover .card-play-btn svg { transform: scale(1.08); }

/* body */
.card-inner-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card-body { padding: 14px 14px 8px; flex-grow: 1; }
.card-title {
  font-size: 0.88rem; font-weight: 600; color: var(--text);
  margin-bottom: 6px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-cat {
  font-size: 0.65rem; font-weight: 600;
  background: rgba(124,58,237,0.15); color: var(--accent3);
  border: 1px solid rgba(124,58,237,0.25);
  padding: 2px 8px; border-radius: 20px;
  display: inline-block; margin-bottom: 8px;
}
.card-tags {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px;
}
.tag-pill {
  font-size: 0.62rem; color: var(--text3);
  background: var(--bg3); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 4px;
}
.card-stats {
  display: flex; gap: 12px; font-size: 0.68rem; color: var(--text3);
  border-top: 1px solid var(--border); padding-top: 8px;
}
.card-stats span {
  display: flex; align-items: center; gap: 3px;
}

/* inline card actions */
.card-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
}
.card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text2);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.card-action-btn:first-child {
  border-right: 1px solid var(--border);
}
.card-action-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}
.card-action-btn.play-btn.playing {
  color: var(--accent3);
}
.card-action-btn.play-btn.playing svg {
  color: var(--accent3);
}
.card-action-btn.download-btn:hover {
  color: var(--green);
}

/* ── Sound detail page ─────────────────────────────────────────────────── */
.sound-hero {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 48px; align-items: center; padding: 48px 0;
}
@media (max-width: 768px) { .sound-hero { grid-template-columns: 1fr; gap: 24px; } }

.sound-thumb {
  aspect-ratio: 16/9; border-radius: 16px; overflow: hidden;
  background: var(--bg3); position: relative;
  border: 1px solid var(--border);
  box-shadow: var(--glow);
}
.sound-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.sound-thumb-fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem; height: 100%; opacity: 0.3;
}

.sound-info h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800; line-height: 1.2; margin-bottom: 12px;
}
.sound-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sound-cat-badge {
  font-size: 0.75rem; font-weight: 600;
  background: rgba(124,58,237,0.15); color: var(--accent3);
  border: 1px solid rgba(124,58,237,0.3);
  padding: 4px 12px; border-radius: 20px; text-decoration: none;
  transition: background .15s;
}
.sound-cat-badge:hover { background: rgba(124,58,237,0.25); }

.sound-description {
  color: var(--text2); font-size: 0.92rem; line-height: 1.7;
  margin-bottom: 20px;
}

.sound-stat-row {
  display: flex; gap: 24px; margin-bottom: 24px; flex-wrap: wrap;
}
.sound-stat {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 20px; min-width: 80px;
}
.sound-stat strong {
  font-size: 1.3rem; font-weight: 800; color: var(--accent3); display: block;
}
.sound-stat span { font-size: 0.68rem; color: var(--text3); margin-top: 2px; }

/* ── Audio player ──────────────────────────────────────────────────────── */
.audio-player-wrap {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px; margin-bottom: 20px;
}
.player-controls {
  display: flex; align-items: center; gap: 16px; margin-bottom: 14px;
}
.play-pause-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
  transition: transform .15s, box-shadow .15s;
}
.play-pause-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(124,58,237,0.55); }
.play-pause-btn svg { color: #fff; }
.player-time { font-size: 0.78rem; color: var(--text3); min-width: 80px; text-align: center; }
.player-progress {
  flex: 1; height: 6px; background: var(--bg2);
  border-radius: 3px; cursor: pointer; position: relative;
}
.player-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px; width: 0%;
  transition: width .1s linear;
}
.player-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 600; font-size: 0.88rem;
  padding: 10px 22px; border-radius: 50px; border: none;
  text-decoration: none; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 16px rgba(124,58,237,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(124,58,237,0.5); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg3); color: var(--text2); font-weight: 500; font-size: 0.88rem;
  padding: 10px 22px; border-radius: 50px;
  border: 1px solid var(--border); text-decoration: none;
  transition: border-color .15s, color .15s;
}
.btn-secondary:hover { border-color: var(--accent2); color: var(--text); }

/* ── Tags section ──────────────────────────────────────────────────────── */
.tags-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag-link {
  font-size: 0.75rem; color: var(--text2);
  background: var(--bg3); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 6px;
  text-decoration: none; transition: border-color .15s, color .15s;
}
.tag-link:hover { border-color: var(--accent2); color: var(--accent3); }

/* ── Breadcrumb ────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 0.78rem; color: var(--text3); padding: 16px 0;
}
.breadcrumb a { color: var(--text3); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent3); }
.breadcrumb span.sep { opacity: 0.4; }

/* ── Category cards ────────────────────────────────────────────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.cat-card {
  position: relative; border-radius: 12px; overflow: hidden;
  aspect-ratio: 4/3; text-decoration: none;
  border: 1px solid var(--border);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.cat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(168,85,247,0.4);
  box-shadow: 0 8px 24px rgba(124,58,237,0.2);
}
.cat-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.cat-card:hover img { transform: scale(1.06); }
.cat-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.75) 0%, transparent 60%);
  display: flex; align-items: flex-end; padding: 12px;
}
.cat-card-name {
  font-size: 0.82rem; font-weight: 700; color: #fff;
  line-height: 1.2;
}
.cat-card-count {
  font-size: 0.65rem; color: rgba(255,255,255,0.65); margin-top: 2px;
}
.cat-fallback {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--bg3), var(--card));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}

/* ── Page hero (category/tag) ──────────────────────────────────────────── */
.page-hero {
  padding: 48px 0 36px; text-align: center;
  border-bottom: 1px solid var(--border); margin-bottom: 40px;
}
.page-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 800; margin-bottom: 10px;
}
.page-hero p { color: var(--text2); font-size: 0.95rem; }

/* ── Search box (homepage) ─────────────────────────────────────────────── */
.home-search-wrap {
  position: relative; max-width: 560px; margin: 0 auto 40px;
}
.home-search-wrap svg {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--text3); pointer-events: none;
}
#home-search {
  width: 100%; padding: 15px 20px 15px 50px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 50px; color: var(--text); font-size: 1rem;
  font-family: inherit; outline: none;
  transition: border .2s, box-shadow .2s;
}
#home-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124,58,237,0.2);
}
#home-search::placeholder { color: var(--text3); }
#search-count { font-size: 0.78rem; color: var(--text3); margin-bottom: 12px; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 24px; margin-top: 60px;
}
.footer-inner {
  max-width: 1380px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start;
}
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand { font-size: 0.85rem; color: var(--text2); }
.footer-brand strong { font-size: 1rem; color: var(--text); display: block; margin-bottom: 6px; }
.footer-brand p { font-size: 0.78rem; color: var(--text3); margin-top: 4px; }
.footer-nav {
  display: flex; flex-direction: column; gap: 8px;
}
.footer-nav a {
  font-size: 0.8rem; color: var(--text2); text-decoration: none;
  transition: color .15s;
}
.footer-nav a:hover { color: var(--accent3); }
.footer-copy {
  grid-column: 1/-1; font-size: 0.72rem; color: var(--text3);
  border-top: 1px solid var(--border); padding-top: 16px; margin-top: 8px;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; }
  .main-nav { display: none; }
  .container { padding: 0 16px; }
  .sounds-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .hero { padding: 48px 0 36px; }
  .hero-stats { gap: 20px; }
}

/* ── Fade-in animation ─────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .4s ease both; }
