:root {
  --bg: #0f1020;
  --surface: #1a1c33;
  --surface-2: #242747;
  --text: #eef0ff;
  --muted: #a6a9c8;
  --accent: #7c5cff;
  --border: #33365c;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ---------- Header / nav ---------- */

.site-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 20;
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-size: 1rem;
  cursor: pointer;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.site-nav > a,
.nav-dropdown > button {
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.site-nav > a:hover,
.nav-dropdown > button:hover,
.nav-dropdown:hover > button,
.nav-dropdown:focus-within > button {
  color: var(--text);
  background: var(--surface-2);
}

.site-nav > a.active {
  color: var(--text);
  background: var(--surface-2);
}

.nav-dropdown {
  position: relative;
}

.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem;
  display: none;
  flex-direction: column;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu,
.nav-menu.open {
  display: flex;
}

.nav-menu a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
}

.nav-menu a:hover {
  background: var(--surface-2);
}

.nav-menu a span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.1rem;
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem;
  }

  .site-nav.open { display: flex; }

  .nav-dropdown > button { width: 100%; text-align: left; }

  .nav-menu {
    position: static;
    box-shadow: none;
    border: 0;
    padding-left: 1rem;
  }
}

/* ---------- Layout ---------- */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.intro {
  margin-bottom: 1.5rem;
}

.intro h1 {
  margin: 0 0 0.4rem;
  font-size: 1.9rem;
}

.intro p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.intro a {
  color: var(--accent);
}

/* ---------- Prose (content pages) ---------- */

.prose {
  max-width: 68ch;
}

.prose h2 {
  margin: 1.8rem 0 0.6rem;
  font-size: 1.25rem;
}

.prose p {
  margin: 0 0 0.9rem;
  color: var(--text);
}

.prose ul,
.prose ol {
  margin: 0 0 0.9rem;
  padding-left: 1.3rem;
  color: var(--text);
}

.prose li {
  margin: 0.3rem 0;
}

.prose ul ul {
  margin: 0.3rem 0;
}

.prose a {
  color: var(--accent);
}

/* ---------- Resource pages: link cards ---------- */

.link-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 1rem;
}

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

.link-card a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
}

.link-name {
  color: var(--text);
  font-weight: 600;
}

.link-host {
  color: var(--accent);
  font-size: 0.8rem;
}

.link-desc {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Home: hero + news ---------- */

.hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.hero h1 {
  margin: 0 0 0.6rem;
  font-size: 2.4rem;
  color: var(--text);
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .hero h1 {
    background: linear-gradient(90deg, #ffcf6b, #c58bff, #6bc5ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.hero p {
  margin: 0 auto;
  color: var(--muted);
  max-width: 55ch;
  font-size: 1.05rem;
}

.hero p a {
  color: var(--accent);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-title h2 {
  margin: 0;
  font-size: 1.4rem;
}

.section-title a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
}

.section-title a:hover {
  text-decoration: underline;
}

/* ---------- Home: Twitch stream ---------- */

.stream {
  margin-bottom: 2.5rem;
  max-width: 560px;
}

.stream-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stream-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.stream-fallback {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 1rem;
}

.stream-fallback:hover {
  text-decoration: underline;
}

.news-list {
  display: grid;
  gap: 1rem;
}

.news-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.news-item .thumb {
  width: 110px;
  height: 82px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}

.news-item .meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.news-item .source {
  color: var(--accent);
}

.news-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.news-item h3 a {
  color: var(--text);
  text-decoration: none;
}

.news-item h3 a:hover {
  text-decoration: underline;
}

.news-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 560px) {
  .news-item { grid-template-columns: 1fr; }
  .news-item .thumb { width: 100%; height: 160px; }
}

.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer code {
  background: var(--surface-2);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 180px;
}

.filter label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.filter input,
.filter select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
  font-size: 0.95rem;
}

.filter input:focus,
.filter select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.reset-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  height: fit-content;
}

.reset-btn:hover { border-color: var(--accent); }

.result-count {
  color: var(--muted);
  margin: 1rem 0 0.5rem;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card .video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  background-color: #000;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-icon {
  width: 62px;
  height: 44px;
  border-radius: 12px;
  background: rgba(20, 20, 30, 0.75);
  position: relative;
  transition: background 0.15s ease;
}

.video-play:hover .play-icon {
  background: var(--accent);
}

.play-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff;
}

.card-body {
  padding: 0.85rem 1rem 1rem;
}

.card-channel {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.watch-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
}

.watch-link:hover {
  text-decoration: underline;
}

.card-title {
  margin: 0 0 0.5rem;
  font-size: 1.02rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.tag.tag-date {
  background: transparent;
  border-color: transparent;
  padding-left: 0.15rem;
}

.tag.ink-amber { color: #ffcf6b; }
.tag.ink-amethyst { color: #c58bff; }
.tag.ink-emerald { color: #5fd7a0; }
.tag.ink-ruby { color: #ff7b7b; }
.tag.ink-sapphire { color: #6bc5ff; }
.tag.ink-steel { color: #c7ced9; }

.empty {
  color: var(--muted);
  padding: 2rem 0;
  text-align: center;
  grid-column: 1 / -1;
}
