:root {
  --bg: #f4f1ec;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --text: #2a2a33;
  --text-soft: #6b6b78;
  --muted: #9a9aa6;
  --border: #e7e2d9;
  --accent: #3f7d78;
  --accent-soft: #e4efed;
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 8px 24px rgba(20, 20, 30, .06);
  --radius: 16px;
}

:root[data-theme="dark"] {
  --bg: #17171b;
  --surface: #202027;
  --surface-2: #1a1a20;
  --text: #ecebf0;
  --text-soft: #a6a6b2;
  --muted: #77777f;
  --border: #2e2e37;
  --accent: #6fb3ad;
  --accent-soft: #223330;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 40px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6fb3ad);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; letter-spacing: .5px;
  flex-shrink: 0;
}
.brand-text h1 { font-size: 1.05rem; margin: 0; font-weight: 700; }
.brand-text p { font-size: .8rem; margin: 0; color: var(--text-soft); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.btn-profile {
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity .15s;
}
.btn-profile:hover { opacity: .88; }
.btn-icon {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 999px;
  width: 40px; height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text);
}

/* Intro */
.intro { padding: 28px clamp(16px, 4vw, 40px) 8px; max-width: 1200px; margin: 0 auto; }
.intro h2 { margin: 0 0 4px; font-size: 1.6rem; }
.intro-sub { margin: 0 0 20px; color: var(--text-soft); }
.controls {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
}
#busca {
  flex: 1 1 280px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: .95rem;
}
#busca:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.stats {
  font-size: .85rem;
  color: var(--text-soft);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

/* Grid */
.grid {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 clamp(16px, 4vw, 40px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(20,20,30,.12); }

.card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--surface-2);
  overflow: hidden;
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.badge-status {
  position: absolute; top: 10px; left: 10px;
  background: rgba(63, 125, 120, .95);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
}
.badge-dur {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: .72rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
}
.play span {
  width: 46px; height: 46px;
  background: rgba(255,255,255,.9);
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.play span::after {
  content: "";
  border-left: 14px solid var(--accent);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 4px;
}

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-nome {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.card-titulo { font-size: 1rem; font-weight: 650; margin: 0; line-height: 1.3; }
.card-desc { font-size: .84rem; color: var(--text-soft); margin: 0; flex: 1; }

.card-link {
  margin-top: 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.card-link:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.card-link svg { width: 16px; height: 16px; }

.empty { text-align: center; color: var(--text-soft); padding: 40px; }

.rodape {
  max-width: 1200px;
  margin: 48px auto 32px;
  padding: 24px clamp(16px, 4vw, 40px) 0;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-soft);
}
.rodape p { margin: 4px 0; }
.muted { color: var(--muted); }
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: .8rem;
}

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .brand-text p { display: none; }
  .btn-profile { padding: 8px 12px; font-size: .78rem; }
}
