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

:root {
  --purple-50: #EEEDFE;
  --purple-200: #AFA9EC;
  --purple-800: #3C3489;
  --teal-50: #E1F5EE;
  --teal-200: #5DCAA5;
  --teal-800: #085041;
  --gray-100: #D3D1C7;
  --gray-400: #888780;
  --gray-600: #5F5E5A;
  --text-primary: #1a1a18;
  --text-secondary: #5F5E5A;
  --text-tertiary: #888780;
  --border: rgba(0,0,0,0.12);
  --bg: #ffffff;
  --bg-secondary: #F7F6F2;
  --radius-md: 8px;
  --radius-lg: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #e8e6de;
    --text-secondary: #b4b2a9;
    --text-tertiary: #888780;
    --border: rgba(255,255,255,0.12);
    --bg: #1e1e1c;
    --bg-secondary: #2a2a28;
    --purple-50: #26215C;
    --purple-200: #534AB7;
    --purple-800: #CECBF6;
    --teal-50: #04342C;
    --teal-200: #0F6E56;
    --teal-800: #9FE1CB;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.site-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.site-meta {
  font-size: 13px;
  color: var(--text-tertiary);
}

.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
}

.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
  border-top: 0.5px solid var(--border);
  font-size: 13px;
  color: var(--text-tertiary);
}

.site-footer a { color: var(--text-secondary); text-decoration: underline; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 1.5rem;
  transition: color .15s;
}
.back:hover { color: var(--text-secondary); }
.back svg { width: 14px; height: 14px; }

.filter-bar { margin-bottom: 1.5rem; }
.filter-section { margin-bottom: .75rem; }
.filter-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-divider {
  border: none;
  border-top: 0.5px solid var(--border);
  margin: .75rem 0;
}

.ftag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 0.5px solid var(--border);
  cursor: pointer;
  transition: border-color .1s, background .1s, color .1s;
  font-family: inherit;
}
.ftag:hover { border-color: var(--gray-400); }
.ftag.active-type { background: var(--purple-50); color: var(--purple-800); border-color: var(--purple-200); }
.ftag.active-tool { background: #FAEEDA; color: #633806; border-color: #EF9F27; }

.count {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
  min-height: 1.5em;
}
.count span { color: var(--text-primary); font-weight: 500; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .15s;
  color: inherit;
}
.card:hover { border-color: var(--gray-400); }

.thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
}
.thumb-unavailable svg { width: 18px; height: 18px; opacity: .4; }
.thumb-unavailable span { font-size: 11px; color: var(--text-tertiary); }

.card-body { padding: 12px 14px 14px; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.meta-dot { width: 2px; height: 2px; border-radius: 50%; background: var(--text-tertiary); flex-shrink: 0; }
.meta-text { font-size: 11px; color: var(--text-tertiary); }

.type-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 20px;
}
.type-tutorial { background: var(--teal-50); color: var(--teal-800); border: 0.5px solid var(--teal-200); }
.type-inspiration { background: var(--purple-50); color: var(--purple-800); border: 0.5px solid var(--purple-200); }

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.card-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 0.5px solid var(--border);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 0.5px solid var(--border);
}
.card-license { font-size: 11px; color: var(--text-tertiary); }
.platform-text { font-size: 11px; color: var(--text-tertiary); }

.no-results {
  padding: 3rem 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-tertiary);
}

.entry-page { max-width: 680px; }

.entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.entry-page h1 {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 14px;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1.5rem; }
.tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--purple-50);
  color: var(--purple-800);
  border: 0.5px solid var(--purple-200);
  transition: background .1s;
}
.tag:hover { background: var(--purple-200); }

.video-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.75rem;
  border: 0.5px solid var(--border);
}
.video-wrap iframe { width: 100%; height: 100%; border: none; display: block; }

.video-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border);
  margin-bottom: 1.75rem;
  aspect-ratio: 16/9;
}
.video-unavailable svg { width: 28px; height: 28px; opacity: .4; }
.video-unavailable p { font-size: 14px; color: var(--text-secondary); text-align: center; }
.archive-link { font-size: 13px; color: var(--text-secondary); text-decoration: underline; }

.entry-section { margin-bottom: 1.75rem; }

.section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.entry-content { font-size: 15px; line-height: 1.75; color: var(--text-primary); }
.entry-content p { margin-bottom: 1em; }
.entry-content p:last-child { margin-bottom: 0; }

.divider { border: none; border-top: 0.5px solid var(--border); margin: 1.75rem 0; }

.attribution {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.attr-item { display: flex; flex-direction: column; gap: 3px; }
.attr-full { grid-column: 1 / -1; }
.attr-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.attr-value { font-size: 13px; color: var(--text-primary); }
.attr-link { font-size: 13px; color: var(--text-secondary); text-decoration: underline; word-break: break-all; }

.license-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: var(--radius-md);
  background: var(--purple-50);
  color: var(--purple-800);
  border: 0.5px solid var(--purple-200);
}

.tag-page h1 {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.level-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 20px;
}
.level-beginner { background: #EAF3DE; color: #27500A; border: 0.5px solid #97C459; }
.level-intermediate { background: #FAEEDA; color: #633806; border: 0.5px solid #EF9F27; }
.level-advanced { background: #FAECE7; color: #712B13; border: 0.5px solid #F0997B; }

.tool-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 0.5px solid var(--border);
}
button.ftag:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
  border-color: var(--border);
  background: var(--bg-secondary);
  color: var(--text-tertiary);
}
