:root {
  color-scheme: dark;

  /* Surface & Base Colors */
  --bg-main: #090d16;
  --card-bg: #131c2e;
  --card-hover: #1e293b;
  --border: #24334a;

  /* Typography */
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;

  /* Brand Accents */
  --hn-color: #ff6600;
  --hn-bg: rgba(255, 102, 0, 0.12);
  --gh-color: #38bdf8;
  --gh-bg: rgba(56, 189, 248, 0.12);

  /* Status Indicators */
  --status-online: #22c55e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body::before {
  position: fixed;
  inset: 0 0 auto;
  height: 360px;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle at 50% -40%, rgba(56, 189, 248, 0.14), transparent 70%);
}

main {
  position: relative;
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 32px;
}

.hero {
  display: flex;
  max-width: 820px;
  gap: 22px;
  align-items: flex-start;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  color: var(--bg-main);
  border-radius: 12px;
  background: var(--gh-color);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .05em;
  box-shadow: 0 8px 30px rgba(56, 189, 248, .18);
}

.eyebrow {
  margin: 2px 0 10px;
  color: var(--gh-color);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.06;
  letter-spacing: -.045em;
}

.intro {
  max-width: 660px;
  margin: 20px 0 0;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .3);
  transition: transform .2s ease, border-color .2s ease, background-color .2s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, .15);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 52px 0 68px;
}

.status-grid article { min-width: 0; padding: 20px; }
.status-grid span {
  display: block;
  margin-bottom: 9px;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.status-grid strong {
  display: block;
  overflow: hidden;
  color: var(--status-online);
  font-size: .9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}

h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: -.03em;
}

.controls { display: flex; gap: 8px; flex-wrap: wrap; }

button {
  padding: 9px 14px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

button:hover { color: var(--text-primary); border-color: var(--gh-color); }
button.active { color: var(--bg-main); border-color: var(--gh-color); background: var(--gh-color); font-weight: 700; }

.notice {
  min-height: 22px;
  margin: 24px 0 12px;
  color: var(--text-muted);
  font-size: .88rem;
}

.trend-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.trend {
  display: grid;
  min-width: 0;
  min-height: 154px;
  padding: 20px;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: var(--card-bg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .3);
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, background-color .2s ease;
}

.trend:hover {
  color: var(--gh-color);
  border-color: rgba(255, 255, 255, .15);
  background-color: var(--card-hover);
  transform: translateY(-2px);
}

.trend-source {
  width: max-content;
  height: max-content;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.tag-hn { color: var(--hn-color); border: 1px solid rgba(255, 102, 0, .3); background-color: var(--hn-bg); }
.tag-gh { color: var(--gh-color); border: 1px solid rgba(56, 189, 248, .3); background-color: var(--gh-bg); }

.trend div { min-width: 0; align-self: end; }
.trend h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 22px 0 8px;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.trend p {
  overflow: hidden;
  margin: 0;
  color: var(--text-muted);
  font-size: .8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 600;
}

.empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 64px 20px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding-top: 20px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

a { color: var(--text-primary); transition: color .15s ease; }
a:hover { color: var(--gh-color); }

@media (max-width: 760px) {
  main { width: min(100% - 28px, 1080px); padding-top: 40px; }
  .hero { gap: 14px; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 9px; }
  .status-grid { grid-template-columns: repeat(2, 1fr); margin: 40px 0 52px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .trend-list { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 440px) {
  .hero { display: block; }
  .brand-mark { margin-bottom: 20px; }
  .status-grid { grid-template-columns: 1fr; }
}
