:root {
  --bg: #0b0c10;
  --surface: #12161a;
  --border: #1f262e;
  --text: #f5f5f2;
  --gray: #888f98;
  --purple: #8b3dff;
  --green: #73ff6b;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, rgba(139, 61, 255, 0.16), transparent 45%),
    var(--bg);
  background-attachment: fixed;
}

.shell {
  min-height: 100dvh;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  flex-shrink: 0;
}

.brand {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--purple);
}

.brand-tag {
  font-size: 0.8rem;
  color: var(--gray);
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero,
.trending-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.hero {
  padding: 22px 24px;
}

h1,
h2 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
}

h1 {
  max-width: none;
  white-space: nowrap;
  font-size: clamp(1.1rem, 3.6vw, 2rem);
  line-height: 1.2;
}

.accent {
  color: var(--purple);
}

.intro {
  max-width: 60ch;
  margin: 8px 0 0;
  color: var(--gray);
  font-size: 0.92rem;
  line-height: 1.5;
}

.mono {
  font-family: var(--mono);
  color: var(--text);
}

.search-panel {
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: 100%;
  width: 680px;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  overflow: hidden;
}

.prompt {
  display: flex;
  align-items: center;
  padding: 0 0 0 16px;
  font-family: var(--mono);
  color: var(--purple);
  font-weight: 700;
}

.search-panel input {
  flex: 1;
  min-height: 50px;
  padding: 0 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.95rem;
}

.search-panel input::placeholder {
  color: var(--gray);
}

.search-panel input:focus {
  outline: none;
}

.search-panel button {
  min-height: 50px;
  padding: 0 20px;
  border: none;
  border-left: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bg);
  cursor: pointer;
  background: var(--purple);
  transition: opacity 140ms ease;
}

.search-panel:focus-within {
  border-color: var(--purple);
}

.search-panel button:hover {
  opacity: 0.88;
}

.trending-card {
  padding: 18px 24px 22px;
  display: flex;
  flex-direction: column;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.section-head h2 {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.section-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(115, 255, 107, 0.7);
}

.status {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--gray);
}

.trending-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 14px;
}

.trending-list li {
  margin: 0;
}

.trending-list a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 3px;
  color: var(--text);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 120ms ease, border-color 120ms ease;
}

.trending-list a:hover,
.trending-list a:focus-visible {
  background: rgba(139, 61, 255, 0.1);
  border-left-color: var(--purple);
}

.term-rank {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--gray);
  flex-shrink: 0;
  width: 2.4ch;
}

.term-label {
  font-size: 0.92rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-panel input:focus-visible,
.search-panel button:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  font-family: var(--mono);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a,
.footer p a {
  color: var(--gray);
  text-decoration: none;
}

.footer-links a:hover,
.footer p a:hover {
  color: var(--purple);
  text-decoration: underline;
}

.footer p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--gray);
}

.footer-links a {
  font-size: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .trending-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 14px 0;
    gap: 12px;
  }

  .hero {
    padding: 18px;
  }

  h1 {
    white-space: normal;
  }

  .search-panel {
    width: 100%;
    flex-wrap: wrap;
  }

  .prompt {
    padding: 12px 0 0 14px;
  }

  .search-panel input {
    min-height: 44px;
    flex-basis: 100%;
    order: 1;
  }

  .search-panel button {
    order: 2;
    flex: 1;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .trending-card {
    padding: 16px;
  }

  .trending-list {
    grid-template-columns: 1fr;
  }
}
