/* ── Tokens ── */
:root {
  --bg:       #0a0a0a;
  --surface:  #111111;
  --card:     #161616;
  --border:   #1f1f1f;
  --accent:   #ffffff;
  --muted:    #555555;
  --tag-bg:   #1c1c1c;
  --tag-text: #888888;
  --green:    #3ddc84;
  --amber:    #f5a623;
  --blue:     #4fa3e0;
  --purple:   #a06eff;
  --red:      #ff5050;
  --font-display: 'Oxanium', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --radius: 10px;
  --grid-size: 32px;
}

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

body {
  background-color: var(--bg);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  z-index: 0;
}

/* ── Layout ── */
.page { position: relative; z-index: 1; max-width: 940px; margin: 0 auto; padding: 0 16px 80px; }

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
  background: rgba(10,10,10,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-logo {
  font-family: var(--font-display); font-size: 22px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); text-decoration: none; user-select: none;
}
.nav-logo span { color: var(--muted); }
.nav-icons { display: flex; align-items: center; gap: 6px; }
.nav-icon-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent; border-radius: 10px;
  cursor: pointer; color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.nav-icon-btn:hover { color: var(--accent); border-color: #2a2a2a; background: var(--surface); }
.nav-icon-btn svg { display: block; width: 20px; height: 20px; }

/* ── SEARCH OVERLAY ── */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.72); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 80px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.search-overlay.open { opacity: 1; pointer-events: all; }
.search-box {
  width: 100%; max-width: 560px;
  background: var(--card); border: 1px solid #2a2a2a; border-radius: 14px;
  overflow: hidden; margin: 0 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  transform: translateY(-10px); transition: transform .2s;
}
.search-overlay.open .search-box { transform: translateY(0); }
.search-input-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.search-input-row svg { color: var(--muted); flex-shrink: 0; }
#search-input {
  flex: 1; background: none; border: none; outline: none;
  font-family: var(--font-body); font-size: 15px; color: var(--accent);
}
#search-input::placeholder { color: var(--muted); }
.search-close {
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 4px; font-size: 18px; line-height: 1; transition: color .15s;
}
.search-close:hover { color: var(--accent); }
.search-results { padding: 10px 0; max-height: 360px; overflow-y: auto; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; cursor: pointer; transition: background .1s;
  text-decoration: none; color: inherit;
}
.search-result-item:hover { background: var(--surface); }
.sri-thumb {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  overflow: hidden;
}
.sri-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sri-body { flex: 1; min-width: 0; }
.sri-title { font-family: var(--font-display); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sri-sub { font-size: 11px; color: var(--muted); }
.search-empty { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }

/* ── DRAWER ── */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 160;
  width: 280px; background: var(--surface); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform .25s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.drawer-title { font-family: var(--font-display); font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.drawer-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; transition: color .15s; }
.drawer-close:hover { color: var(--accent); }
.drawer-nav { display: flex; flex-direction: column; padding: 10px; gap: 2px; }
.drawer-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; transition: color .15s, background .15s;
}
.drawer-link:hover { color: var(--accent); background: var(--card); }
.drawer-link.active { color: var(--accent); background: var(--card); }
.drawer-link svg { width: 14px; height: 14px; opacity: .5; flex-shrink: 0; }
.drawer-link.active svg { opacity: 1; }
.drawer-divider { height: 1px; background: var(--border); margin: 8px 10px; }

/* ── Hero ── */
.hero { padding: 40px 0 36px; }
.hero-eyebrow {
  font-family: var(--font-display); font-size: 10px; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.hero-title {
  font-family: var(--font-display); font-size: clamp(26px, 5vw, 40px);
  font-weight: 800; letter-spacing: -.01em; line-height: 1.1; margin-bottom: 12px;
}
.hero-title em { font-style: normal; color: var(--muted); }
.hero-sub { font-size: 13px; color: var(--muted); max-width: 480px; line-height: 1.6; }

/* ── Chip bar ── */
.chip-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 28px; }
.chip {
  font-family: var(--font-display); font-size: 10px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); background: var(--surface);
  cursor: pointer; transition: all .15s; user-select: none;
}
.chip:hover { color: var(--accent); border-color: #333; }
.chip.active { color: #0a0a0a; background: var(--accent); border-color: var(--accent); }

/* ── Section label ── */
.section-label {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-display); font-size: 9px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.count-pill {
  font-family: var(--font-display); font-size: 9px; font-weight: 700;
  letter-spacing: .1em; padding: 2px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}

/* ── FEATURED CARD ── */
.featured-card {
  position: relative; overflow: hidden;
  background: #0e1a14;
  border: 1px solid rgba(61,220,132,.2);
  border-radius: 14px;
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 200px;
  text-decoration: none; color: inherit;
  transition: border-color .25s, box-shadow .25s, transform .25s;
  cursor: pointer;
}
.featured-card:hover {
  border-color: rgba(61,220,132,.45);
  box-shadow: 0 0 40px rgba(61,220,132,.08), 0 12px 48px rgba(0,0,0,.5);
  transform: translateY(-2px);
}
.featured-card::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(61,220,132,.06) 55%, transparent 70%);
  background-size: 200% 100%;
  animation: sweep 4s ease-in-out infinite;
  z-index: 1;
}
@keyframes sweep {
  0%   { background-position: 200% 0; }
  50%  { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
.featured-visual {
  position: relative; overflow: hidden;
  border-right: 1px solid rgba(61,220,132,.15);
}
.featured-visual img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
  filter: brightness(0.55) saturate(0.7);
  transition: filter .3s;
}
.featured-card:hover .featured-visual img {
  filter: brightness(0.65) saturate(0.85);
}
/* green tint overlay */
.featured-visual::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(61,220,132,.18) 0%, rgba(61,220,132,.04) 100%);
  pointer-events: none;
  z-index: 1;
}
.featured-content {
  padding: 28px 28px 24px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative; z-index: 2;
}
.featured-eyebrow {
  font-family: var(--font-display); font-size: 9px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--green);
  display: flex; align-items: center; gap: 6px;
}
.featured-eyebrow::before {
  content: ''; display: block; width: 16px; height: 1px; background: var(--green); opacity: .6;
}
.featured-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 800;
  letter-spacing: -.01em; line-height: 1.25; color: var(--accent);
}
.featured-desc { font-size: 12.5px; color: #777; line-height: 1.6; }
.featured-meta {
  display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap;
}
.featured-meta .meta-item {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-display); font-size: 10px; font-weight: 600;
  letter-spacing: .06em; color: var(--muted);
}
.featured-meta .meta-item svg { opacity: .5; }
.featured-badge {
  font-family: var(--font-display); font-size: 9px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 4px;
  background: rgba(61,220,132,.12); color: var(--green);
}
.featured-progress { margin-top: 6px; }
.featured-progress-label {
  font-family: var(--font-display); font-size: 9px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 5px;
  display: flex; justify-content: space-between;
}
.progress-bar { height: 2px; background: rgba(255,255,255,.06); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; background: var(--green); transition: width .6s ease; }
.featured-status {
  position: absolute; top: 16px; right: 16px;
  font-family: var(--font-display); font-size: 9px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  display: flex; align-items: center; gap: 5px;
  z-index: 3;
}
.status-inprogress { background: rgba(245,166,35,.12); color: var(--amber); border: 1px solid rgba(245,166,35,.2); }
.status-completed  { background: rgba(61,220,132,.1);  color: var(--green);  border: 1px solid rgba(61,220,132,.2); }
.status-dot {
  width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0;
}
.status-inprogress .status-dot { background: var(--amber); animation: pulse-dot 1.4s ease-in-out infinite; }
.status-completed  .status-dot { background: var(--green); }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.7); }
}
@media (max-width: 600px) {
  .featured-card { grid-template-columns: 1fr; min-height: auto; }
  .featured-visual { height: 160px; border-right: none; border-bottom: 1px solid rgba(61,220,132,.15); }
}

/* ── Tutorial grid ── */
.tut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin-bottom: 40px;
}

/* ── Card entrance animation ── */
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tut-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
  opacity: 0;
  animation: card-in .4s ease forwards;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.tut-card:hover {
  border-color: #2e2e2e;
  transform: translateY(-3px);
  box-shadow: 0 10px 36px rgba(0,0,0,.45);
}
/* stagger delays */
.tut-card:nth-child(1)  { animation-delay: .05s; }
.tut-card:nth-child(2)  { animation-delay: .1s; }
.tut-card:nth-child(3)  { animation-delay: .15s; }
.tut-card:nth-child(4)  { animation-delay: .2s; }
.tut-card:nth-child(5)  { animation-delay: .25s; }
.tut-card:nth-child(6)  { animation-delay: .3s; }
.tut-card:nth-child(7)  { animation-delay: .35s; }
.tut-card:nth-child(8)  { animation-delay: .4s; }
.tut-card:nth-child(9)  { animation-delay: .45s; }

/* card progress status ribbon */
.card-status-ribbon {
  position: absolute; top: 8px; right: 8px; z-index: 10;
  font-family: var(--font-display); font-size: 8px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  display: flex; align-items: center; gap: 4px;
}
.ribbon-inprogress { background: rgba(245,166,35,.15); color: var(--amber); border: 1px solid rgba(245,166,35,.25); }
.ribbon-completed  { background: rgba(61,220,132,.12); color: var(--green); border: 1px solid rgba(61,220,132,.22); }
.ribbon-inprogress .status-dot { background: var(--amber); animation: pulse-dot 1.4s ease-in-out infinite; }
.ribbon-completed  .status-dot { background: var(--green); }

/* ── Thumbnail ── */
.card-thumb {
  width: 100%; height: 118px;
  position: relative; overflow: hidden; flex-shrink: 0;
}
.card-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .4s ease, filter .3s ease;
  filter: brightness(0.5) saturate(0.6);
}
.tut-card:hover .card-thumb img {
  transform: scale(1.05);
  filter: brightness(0.6) saturate(0.75);
}
/* colour tint overlay per card type */
.card-thumb::before {
  content: '';
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
}
.card-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 35%, var(--card) 100%);
  z-index: 2;
}
.thumb-green::before  { background: rgba(61,220,132,.18); }
.thumb-amber::before  { background: rgba(245,166,35,.18); }
.thumb-blue::before   { background: rgba(79,163,224,.18); }
.thumb-purple::before { background: rgba(160,110,255,.18); }
.thumb-red::before    { background: rgba(255,80,80,.18); }

/* Card body */
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 0; }
.card-title {
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  letter-spacing: .01em; line-height: 1.3; color: var(--accent);
}
.card-desc { font-size: 11.5px; color: var(--muted); line-height: 1.55; }

/* Card progress bar (inline) */
.card-progress { padding: 8px 14px 0; }
.card-progress-bar { height: 2px; background: rgba(255,255,255,.06); border-radius: 2px; overflow: hidden; }
.card-progress-fill { height: 100%; border-radius: 2px; transition: width .5s ease; }
.fill-green  { background: var(--green); }
.fill-amber  { background: var(--amber); }

/* Card footer */
.card-footer {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: auto; padding: 10px 14px 14px;
}
.meta-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--muted);
  font-family: var(--font-display); font-weight: 600; letter-spacing: .06em;
}
.meta-item svg { opacity: .55; width: 11px; height: 11px; }

.card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-family: var(--font-display); font-size: 9px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
  background: var(--tag-bg); color: var(--tag-text); border: 1px solid var(--border);
}
.card-badge {
  font-family: var(--font-display); font-size: 9px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px; flex-shrink: 0; margin-left: auto;
}
.badge-beginner     { background: rgba(61,220,132,.12); color: var(--green); }
.badge-intermediate { background: rgba(245,166,35,.12);  color: var(--amber); }
.badge-advanced     { background: rgba(255,80,80,.12);   color: var(--red); }

/* ── Empty ── */
.empty {
  display: none; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 0; gap: 10px;
  color: var(--muted); text-align: center;
}
.empty-icon { opacity: .25; margin-bottom: 4px; }
.empty-text { font-size: 13px; }

.tut-card[hidden] { display: none !important; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* re-animate visible cards when filter changes */
.tut-card.animate-in {
  animation: card-in .35s ease forwards;
}
