:root {
  --bg: #090909;
  --bg-elev: #111111;
  --bg-accent: #151515;
  --text: #f5f5f5;
  --muted: #b6b6b6;
  --line: #232323;
  --highlight: #ff3b3b;
  --link: #6ee7ff;
}

* {
  box-sizing: border-box;
}

body {
  background: #010101;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  min-height: 100vh;
}

body a {
  color: #f5f5f5 !important;
}

.hero-shell {
  background: transparent;
}

.hero-brand {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: -1rem;
  text-align: center;
}

.brand-title {
  display: inline-flex;
  align-items: baseline;
  gap: 0.9rem;
  font-size: clamp(2.6rem, 8vw, 6.75rem) !important;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: -1.5rem !important;
  white-space: nowrap;
}

.brand-image {
  height: 1em;
  width: auto;
  border-radius: 0.35rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  transform: translateY(0.05em);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.nav-links {
  margin-top: 0.5rem;
  font-size: clamp(1.05rem, 3.4vw, 2.85rem);
  color: var(--muted);
}

.nav-links a {
  color: var(--link);
}

.title,
.subtitle {
  color: var(--text);
}

.subtitle {
  opacity: 0.7;
}


.search-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.5rem 1.5rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

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

.input,
.select select {
  background: #0f0f0f;
  border-color: var(--line);
  color: var(--text);
}

.input::placeholder {
  color: #6b6b6b;
}

.button.is-link {
  background: var(--highlight);
  border: none;
  color: #fff;
  font-weight: 600;
}

.button.is-dark {
  background: #1d1d1d;
  border: 1px solid #2a2a2a;
  color: var(--text);
}

.button.is-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2rem 0 1rem;
}

.result-count {
  font-size: 1rem;
  font-weight: 600;
}

.result-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.notice {
  background: #1b1111;
  border: 1px solid #3b1b1b;
  color: #ffb3b3;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1.25rem;
}

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

.result-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  min-height: 100%;
}

.thumb-shell {
  border-radius: 0.7rem;
  overflow: hidden;
  background: #0d0d0d;
  border: 1px solid #1c1c1c;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  background: repeating-linear-gradient(
    135deg,
    #141414 0px,
    #141414 12px,
    #101010 12px,
    #101010 24px
  );
}

.result-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.result-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.result-snippet {
  color: #dedede;
  font-size: 0.9rem;
  line-height: 1.5;
}

.result-snippet mark {
  background: rgba(255, 59, 59, 0.2);
  color: #fff;
}

.result-snippet.muted {
  color: #777;
}

.result-actions {
  margin-top: auto;
}

.pagination-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.wordcloud-shell {
  margin-top: 1.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.5rem;
}

.wordcloud-header {
  margin-bottom: 1rem;
}

.wordcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.word-token {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  padding: 0.2rem 0.4rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.2s ease, color 0.2s ease;
  font-weight: 500;
}

.word-token:hover {
  color: var(--link);
  transform: translateY(-2px);
}

.word-size-1 { font-size: 0.85rem; }
.word-size-2 { font-size: 1.05rem; }
.word-size-3 { font-size: 1.3rem; }
.word-size-4 { font-size: 1.6rem; }
.word-size-5 { font-size: 1.95rem; }

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.status-alert {
  background: #1b1111;
  border: 1px solid #3b1b1b;
  color: #ffb3b3;
  padding: 0.9rem 1.2rem;
  border-radius: 0.9rem;
  margin: 1rem 0;
}

.status-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1.25rem;
}

.status-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.status-value {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.status-muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.status-list {
  margin-top: 2rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
}

.status-subtitle {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.table {
  background: transparent;
  color: var(--text);
}

.table thead th {
  color: var(--muted);
}

.table.is-striped tbody tr:not(.is-selected):nth-child(even) {
  background: #101010;
}

.empty-state {
  padding: 2rem;
  border: 1px dashed var(--line);
  border-radius: 1rem;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  max-width: 340px;
  padding: 1rem 1.2rem;
  background: #131313;
  border: 1px solid #262626;
  border-radius: 0.9rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 20;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.modal-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(960px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  background: #0b0b0b;
  border: 2px solid #262626;
  border-radius: 1.2rem;
  padding: 2.5rem 3rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

.modal-card h2 {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  color: #ffd000;
  text-align: center;
  margin-bottom: 1.5rem;
  letter-spacing: 0.12em;
}

.modal-body {
  font-size: clamp(1rem, 2.1vw, 1.35rem);
  line-height: 1.6;
  color: #f0f0f0;
}

.modal-body p + p {
  margin-top: 1rem;
}

.warning-link {
  color: #ffd000;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
}

.modal-checkbox {
  color: var(--muted);
  font-size: 0.95rem;
}

.modal-checkbox input {
  margin-right: 0.5rem;
}

@media (max-width: 640px) {
  .modal-card {
    padding: 2rem 1.5rem;
  }

  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 768px) {
  .hero-meta {
    width: 100%;
  }

  .pill {
    margin: 0.35rem 0.35rem 0 0;
  }
}

@media (max-width: 520px) {
  .brand-title {
    font-size: clamp(1.7rem, 7vw, 2.6rem) !important;
    gap: 0.5rem;
    letter-spacing: 0.03em;
  }

  .nav-links {
    font-size: clamp(0.85rem, 3.8vw, 1.2rem);
  }
}
