:root {
  --bg: #f4ecdc;
  --bg-2: #eadfc8;
  --surface: #fffbf3;
  --surface-2: #fff7e6;
  --line: #1a1a1a;
  --line-soft: rgba(26, 26, 26, 0.12);
  --red: #e23e2c;
  --blue: #1e4fd4;
  --yellow: #f5b800;
  --green: #0e7f57;
  --violet: #7333a5;
  --ink: #1a1a1a;
  --ink-2: #3a3a3a;
  --ink-soft: #5f5a55;
  --shadow-hard: 6px 6px 0 0 var(--ink);
  --shadow-soft: 0 18px 45px rgba(26, 26, 26, 0.08);
  --f-display: "Unbounded", "Arial Black", sans-serif;
  --f-body: "Manrope", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", monospace;
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 26px;
  --r-pill: 999px;
}

[data-theme="dark"] {
  --bg: #15130f;
  --bg-2: #1e1b15;
  --surface: #1f1c16;
  --surface-2: #26221b;
  --line: #f4ecdc;
  --line-soft: rgba(244, 236, 220, 0.14);
  --ink: #f4ecdc;
  --ink-2: #d8cfbc;
  --ink-soft: #a69c88;
  --shadow-hard: 6px 6px 0 0 var(--line);
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.42);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
}

.art-bg,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.art-bg {
  z-index: 0;
}

.art-bg svg {
  display: block;
  width: 100%;
  height: 100%;
}

.grain {
  z-index: 1;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-image: radial-gradient(rgba(0, 0, 0, 1) 1px, transparent 1px);
  background-size: 3px 3px;
}

.drift-slow {
  animation: drift 36s ease-in-out infinite alternate;
  transform-origin: center;
}

.drift-med {
  animation: drift 24s ease-in-out infinite alternate;
  transform-origin: center;
}

.spin-slow {
  animation: spin 60s linear infinite;
  transform-origin: center;
  transform-box: fill-box;
}

.pulse {
  animation: pulse 7s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}

@keyframes drift {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(18px, -12px) rotate(3deg);
  }
  100% {
    transform: translate(-14px, 16px) rotate(-4deg);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.wrap {
  position: relative;
  z-index: 2;
  max-width: 1380px;
  margin: 0 auto;
  padding: 20px 32px 64px;
}

.topbar,
.hero,
.rating-card,
.side-card,
.footer {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-hard);
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 20px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-mark {
  width: 38px;
  height: 38px;
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.logo-mark::before,
.logo-mark::after {
  content: "";
  position: absolute;
}

.logo-mark::before {
  left: 0;
  top: 4px;
  width: 25px;
  height: 25px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--line);
}

.logo-mark::after {
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  background: var(--yellow);
  border: 2px solid var(--line);
  transform: rotate(13deg);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-family: var(--f-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-subtitle {
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.search-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 7px 10px 7px 18px;
  height: 48px;
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg);
}

.search-shell svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.search-shell input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 14px;
}

.search-shell input::placeholder {
  color: var(--ink-soft);
}

.search-kbd {
  flex-shrink: 0;
  padding: 3px 8px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-2);
}

.button-row,
.nav-links,
.hero-actions,
.stats-grid,
.hero-notes,
.panel-list,
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-links {
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.nav-link,
.chip-link,
.lang-link,
.table-link,
.category-link,
.pagination-link,
.pagination-current,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link,
.lang-link,
.theme-toggle {
  min-height: 40px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.nav-link:hover,
.lang-link:hover,
.theme-toggle:hover,
.btn:hover,
.chip-link:hover,
.table-link:hover,
.category-link:hover,
.pagination-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0 0 var(--line);
}

.lang-link.is-active {
  background: var(--line);
  color: var(--surface);
}

.theme-toggle {
  width: 40px;
  padding: 0;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 20px;
  padding: 24px;
  margin-bottom: 24px;
  background:
    radial-gradient(circle at top right, rgba(245, 184, 0, 0.18), transparent 28%),
    radial-gradient(circle at bottom left, rgba(30, 79, 212, 0.12), transparent 24%),
    var(--surface);
}

.hero-copy {
  position: relative;
  padding: 10px 4px 4px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 6px 12px;
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--green);
}

.hero-title {
  margin: 0;
  max-width: 11ch;
  font-family: var(--f-display);
  font-size: clamp(32px, 5vw, 62px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-title .accent {
  color: var(--red);
}

.hero-sub {
  max-width: 68ch;
  margin: 18px 0 0;
  color: var(--ink-2);
  font-size: 16px;
}

.hero-actions {
  margin-top: 24px;
}

.btn {
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 4px 4px 0 0 var(--line);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn.primary {
  background: var(--red);
  color: #fff;
}

.btn.secondary {
  background: var(--yellow);
}

.btn.ghost {
  background: transparent;
}

.hero-notes {
  margin-top: 20px;
}

.hero-note {
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  box-shadow: 4px 4px 0 0 rgba(26, 26, 26, 0.06);
}

.hero-note b {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.hero-side {
  display: grid;
  gap: 14px;
}

.stats-grid {
  margin: 0;
}

.stat-card {
  flex: 1 1 180px;
  min-width: 0;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-hard);
}

.stat-card.red {
  background: #fff3ee;
}

.stat-card.yellow {
  background: #fff8d7;
}

.stat-card.blue {
  background: #edf3ff;
}

.stat-card.green {
  background: #edf9f4;
}

.stat-label {
  color: var(--ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-value {
  margin-top: 8px;
  font-family: var(--f-display);
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
}

.stat-sub {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 13px;
}

.ticker {
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}

.ticker-head {
  margin-bottom: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.ticker-item,
.chip-link {
  padding: 7px 12px;
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: 3px 3px 0 0 rgba(26, 26, 26, 0.08);
}

.chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
}

.chip-link.is-active {
  background: var(--line);
  color: var(--surface);
}

.chip-count {
  color: var(--ink-soft);
  font-family: var(--f-mono);
  font-size: 11px;
}

.chip-link.is-active .chip-count {
  color: rgba(255, 255, 255, 0.72);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.rating-card {
  padding: 20px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.04em;
}

.section-subtitle {
  margin-top: 6px;
  color: var(--ink-soft);
  max-width: 72ch;
}

.table-wrap {
  overflow-x: auto;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.rating-table {
  width: 100%;
  border-collapse: collapse;
}

.rating-table th,
.rating-table td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.rating-table th {
  font-family: var(--f-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 1;
}

.rating-table tbody tr:last-child td {
  border-bottom: 0;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-family: var(--f-display);
  font-size: 13px;
}

.site-cell {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
}

.site-mark {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--yellow);
  font-family: var(--f-display);
  font-size: 16px;
}

.site-main {
  min-width: 0;
}

.site-domain {
  display: inline-block;
  font-weight: 800;
  text-decoration: none;
}

.site-project {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 14px;
}

.site-desc {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 13px;
}

.muted {
  color: var(--ink-soft);
}

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

.table-link {
  min-height: 38px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--yellow);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.table-link.ghost {
  background: transparent;
}

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

.empty-state {
  padding: 28px;
  border: 2px dashed var(--line);
  border-radius: 18px;
  text-align: center;
  background: var(--surface-2);
}

.pagination {
  margin-top: 18px;
  justify-content: center;
}

.pagination-link,
.pagination-current {
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
}

.pagination-current {
  background: var(--line);
  color: var(--surface);
}

.side {
  display: grid;
  gap: 16px;
}

.side-card {
  padding: 18px;
}

.side-card h3 {
  margin: 0 0 8px;
  font-family: var(--f-display);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.side-card p {
  margin: 0;
  color: var(--ink-2);
}

.panel-list {
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.category-link {
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.footer {
  margin-top: 24px;
  padding: 18px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.footer-links a {
  text-decoration: none;
}

@media (max-width: 1120px) {
  .topbar,
  .hero,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .wrap {
    padding: 16px 16px 48px;
  }

  .topbar,
  .hero,
  .rating-card,
  .side-card,
  .footer {
    border-radius: 20px;
    box-shadow: 4px 4px 0 0 var(--line);
  }

  .topbar,
  .hero,
  .rating-card {
    padding: 16px;
  }

  .search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .search-shell,
  .btn {
    width: 100%;
  }

  .section-head {
    flex-direction: column;
  }

  .rating-table,
  .rating-table thead,
  .rating-table tbody,
  .rating-table th,
  .rating-table td,
  .rating-table tr {
    display: block;
  }

  .rating-table thead {
    display: none;
  }

  .rating-table tr {
    padding: 14px;
    border-bottom: 1px solid var(--line-soft);
  }

  .rating-table tbody tr:last-child {
    border-bottom: 0;
  }

  .rating-table td {
    padding: 7px 0;
    border: 0;
  }

  .rating-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--ink-soft);
    font-family: var(--f-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .site-cell {
    min-width: 0;
  }

  .table-actions {
    flex-direction: column;
  }

  .table-link {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
