:root {
  --bg: #0b0e14;
  --bg-soft: #11151f;
  --bg-card: #151a26;
  --bg-card-hover: #1a2030;
  --border: #232a3a;
  --text: #e7ebf4;
  --text-dim: #9aa3b5;
  --text-faint: #64708a;
  --accent: #ffc64d;
  --accent-2: #ff8a5c;
  --gradient: linear-gradient(135deg, #ffc64d, #ff7b54);
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  background-image: radial-gradient(1000px 500px at 80% -10%, rgba(255, 138, 92, 0.12), transparent 60%),
    radial-gradient(800px 400px at -10% 10%, rgba(255, 198, 77, 0.10), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  width: min(1180px, 92vw);
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(11, 14, 20, 0.78);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-name em {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-dim);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: min(300px, 50vw);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 198, 77, 0.15);
}

.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  width: 100%;
}

.search-box input::placeholder {
  color: var(--text-faint);
}

.github-link {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.github-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ---------- Hero ---------- */
.hero {
  padding-block: 64px 40px;
  max-width: 720px;
}

.hero-kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent);
  border: 1px solid rgba(110, 231, 255, 0.35);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 20px;
  background: rgba(110, 231, 255, 0.06);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 16px;
}

.hero p {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 60ch;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.hero-stats .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
}

/* ---------- Filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-block: 8px 28px;
}

.filter-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-chip:hover {
  border-color: #343d53;
  color: var(--text);
}

.filter-chip.active {
  background: var(--gradient);
  color: #0b0e14;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(255, 198, 77, 0.25);
}

/* ---------- Feed grid ---------- */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  padding-bottom: 60px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 198, 77, 0.45);
  box-shadow: var(--shadow);
  background: var(--bg-card-hover);
}

.card-img-wrap {
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  overflow: hidden;
  position: relative;
}

.card-img-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(21, 26, 38, 0.5));
  pointer-events: none;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card-img {
  transform: scale(1.05);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.card-source {
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-excerpt {
  font-size: 0.88rem;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-readmore {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-2);
}

.card:hover .card-readmore {
  color: var(--accent);
}

/* ---------- Skeleton ---------- */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  padding-bottom: 60px;
}

.skeleton-card {
  padding: 0;
  overflow: hidden;
  cursor: default;
}

.skeleton {
  display: block;
  background: linear-gradient(100deg, var(--bg-card) 40%, #1d2432 50%, var(--bg-card) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.skeleton-img {
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

.skeleton-line {
  height: 14px;
  margin: 12px 16px 0;
}

.skeleton-line.w40 { width: 40%; }
.skeleton-line.w45 { width: 45%; }
.skeleton-line.w50 { width: 50%; }
.skeleton-line.w55 { width: 55%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w65 { width: 65%; }
.skeleton-line.w68 { width: 68%; }
.skeleton-line.w70 { width: 70%; }
.skeleton-line.w75 { width: 75%; }
.skeleton-line.w78 { width: 78%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w85 { width: 85%; }
.skeleton-line.w90 { width: 90%; }

/* ---------- Status / empty ---------- */
.status {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.status.error {
  color: #ff8fa3;
}

.status button {
  margin-top: 14px;
  font: inherit;
  font-weight: 700;
  color: #0b0e14;
  background: var(--gradient);
  border: 0;
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding-block: 34px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.site-footer .brand-name em {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-footer p {
  margin-top: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .hero {
    padding-block: 44px 28px;
  }

  .search-box {
    width: auto;
    flex: 1;
  }

  .github-link {
    display: none;
  }

  .card-title {
    font-size: 0.98rem;
  }

  .feed-grid,
  .skeleton-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

[hidden] {
  display: none !important;
}