/* ============================================
   DAZZ — Global / shared components  (v2)
   ============================================ */

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--ink);
  background: var(--bg-page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }
a   { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── Typography ── */
.display { font-family: var(--font-display); font-size: var(--fs-display); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }
.h1 { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; }
.h2 { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.h3 { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 700; letter-spacing: -0.015em; }
.title { font-family: var(--font-display); font-size: var(--fs-title); font-weight: 700; letter-spacing: -0.01em; }
.eyebrow { font-size: var(--fs-caption); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand); }
.muted { color: var(--ink-3); }
.lead  { font-size: var(--fs-body-lg); color: var(--ink-2); line-height: 1.6; }

.text-grad {
  background: var(--grad-brand-h);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-body);
  border-radius: var(--r-pill); white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-brand   { background: var(--brand); color: #fff; padding: 13px 26px; box-shadow: var(--shadow-brand); }
.btn-brand:hover { background: var(--brand-600); box-shadow: 0 16px 32px rgba(99,102,241,0.36); }

.btn-dark    { background: var(--ink); color: #fff; padding: 13px 26px; }
.btn-dark:hover { background: #000; }

.btn-ghost   { background: var(--bg); color: var(--ink); padding: 12px 24px; border: 1px solid var(--line-strong); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { border-color: var(--brand-300); color: var(--brand-700); }

.btn-soft    { background: var(--brand-soft); color: var(--brand-700); padding: 12px 22px; }
.btn-soft:hover { background: #E4E7FF; }

.btn-light   { background: #fff; color: var(--ink); padding: 13px 26px; }
.btn-light:hover { background: #f2f2f7; }

.btn-sm { padding: 9px 16px; font-size: var(--fs-sm); }
.btn-lg { padding: 16px 32px; font-size: var(--fs-body-lg); }
.btn-block { width: 100%; }

/* ── Pills / chips / badges ── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--bg-soft); color: var(--ink-2);
  font-size: var(--fs-sm); font-weight: 600;
}
.chip-brand { background: var(--brand-soft); color: var(--brand-700); }
.chip-success { background: var(--success-soft); color: var(--success); }
.chip-warning { background: var(--warning-soft); color: var(--warning); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--r-pill);
  font-size: var(--fs-caption); font-weight: 700;
  backdrop-filter: blur(8px);
}
.badge-live { background: rgba(251,113,133,0.92); color: #fff; }
.badge-glass{ background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.25); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot-live { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Stat pill (coins / streak) ── */
.stat-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 8px; border-radius: var(--r-pill);
  background: var(--bg); border: 1px solid var(--line);
  font-weight: 700; font-size: var(--fs-body); color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.stat-pill__ic {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px;
}

/* ── Section header ── */
.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-5);
}
.sec-head__t { display: flex; flex-direction: column; gap: 4px; }
.sec-head__sub { font-size: var(--fs-sm); color: var(--ink-3); }
.sec-link {
  font-size: var(--fs-sm); font-weight: 600; color: var(--brand);
  white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px;
  transition: gap .15s var(--ease);
}
.sec-link:hover { gap: 8px; }

/* ── Card base ── */
.card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }

/* ── Course card ── */
.course {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.course:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.course__media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--bg-soft); }
.course__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.course:hover .course__media img { transform: scale(1.05); }
.course__tag {
  position: absolute; top: 10px; left: 10px;
  padding: 5px 10px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.92); backdrop-filter: blur(6px);
  font-size: var(--fs-caption); font-weight: 700; color: var(--ink);
}
.course__save {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(6px);
  display: grid; place-items: center; color: var(--ink-2);
  transition: color .15s, background .15s;
}
.course__save:hover { color: var(--brand); }
.course__save.saved { color: var(--brand); }
.course__save.saved svg { fill: var(--brand); }
.course__body { padding: 14px; }
.course__title { font-family: var(--font-display); font-size: var(--fs-body-lg); font-weight: 700; line-height: 1.25; }
.course__meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: var(--fs-sm); color: var(--ink-3); }
.course__rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink-2); }
.course__foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.course__avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.course__inst { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; }

/* ── Instructor card ── */
.mentor { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; cursor: pointer; }
.mentor__ph { position: relative; }
.mentor__img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.mentor:hover .mentor__img { transform: scale(1.05); }
.mentor__name { font-weight: 700; font-size: var(--fs-sm); }
.mentor__role { font-size: var(--fs-caption); color: var(--ink-3); }

/* ── Style tile ── */
.style-tile {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  aspect-ratio: 3/4; cursor: pointer; box-shadow: var(--shadow-sm);
}
.style-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.style-tile:hover img { transform: scale(1.07); }
.style-tile::after { content: ''; position: absolute; inset: 0; background: var(--grad-ink); }
.style-tile__label {
  position: absolute; left: 14px; bottom: 14px; z-index: 1;
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-body-lg);
}
.style-tile__count { position: absolute; left: 14px; bottom: -2px; z-index: 1; color: rgba(255,255,255,0.7); font-size: var(--fs-caption); }

/* ── Search ── */
.search {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: var(--r-pill);
  background: var(--bg-soft); border: 1px solid transparent;
  color: var(--ink-3); transition: border-color .15s, background .15s;
}
.search:focus-within { background: #fff; border-color: var(--brand-300); }
.search input { border: none; background: none; outline: none; font: inherit; color: var(--ink); flex: 1; }
.search input::placeholder { color: var(--ink-4); }

/* ── Progress bar ── */
.bar { height: 7px; border-radius: var(--r-pill); background: var(--bg-soft); overflow: hidden; }
.bar__fill { height: 100%; border-radius: var(--r-pill); background: var(--grad-brand-h); }
.bar-thin { height: 4px; }

/* ── Carousel dots ── */
.dots { display: flex; gap: 7px; align-items: center; }
.dots .d { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); transition: all .25s var(--ease); cursor: pointer; }
.dots .d.on { width: 22px; border-radius: var(--r-pill); background: var(--brand); }

/* ── Scroll row ── */
.row { display: flex; gap: var(--space-5); overflow-x: auto; padding: 4px; margin: -4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.row::-webkit-scrollbar { display: none; }
.row > * { scroll-snap-align: start; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid var(--bg-page); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* ── Utilities ── */
.flex { display: flex; }
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; flex-shrink: 0; }
