:root {
  --bg: #121212;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.34);
  --text: #d7d7d7;
  --text-muted: #969696;
  --red: #d84c3f;
  --radius: 24px;
  --nav-height: 64px;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Saira Semi Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  background: radial-gradient(1200px 700px at 76% 84%, #1b1b1b 0%, var(--bg) 58%);
  overflow-x: hidden;
}

body { padding: 20px; }

.shell {
  position: relative;
  min-height: calc(100vh - 40px);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.01));
  overflow: hidden;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.13;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.16) 0.5px, transparent 0.5px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px);
  background-size: 3px 3px, 100% 4px;
  mix-blend-mode: overlay;
}

.content-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(12, 12, 12, 0.58) 0%, rgba(12, 12, 12, 0.26) 40%, rgba(12, 12, 12, 0.06) 100%);
}

.topbar {
  position: relative;
  z-index: 3;
  height: var(--nav-height);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(4px);
  background: linear-gradient(180deg, rgba(19, 19, 19, 0.88), rgba(19, 19, 19, 0.4));
}

.brand {
  position: absolute;
  left: 26px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}

.brand-avatar {
  width: 34px;
  height: 34px;
  object-fit: cover;
  object-position: center 28%;
  display: block;
  border-radius: 50%;
  transform: scale(1.34);
}

.nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link,
.nav-link-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid rgba(220, 220, 220, 0.72);
  border-radius: 6px;
  background: rgba(220, 220, 220, 0.16);
  text-decoration: none;
  color: #efefef;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
  font-family: "Share Tech Mono", "SFMono-Regular", monospace;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link-box:hover,
.nav-link-box:focus-visible {
  color: #ffffff;
  text-decoration: none;
  border-color: rgba(244, 244, 244, 0.95);
  background: rgba(232, 232, 232, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.14);
  outline: none;
}

.wrap {
  position: relative;
  z-index: 2;
  padding: 28px 26px 30px;
}

.hero { margin-bottom: 14px; }

.kicker,
.seq,
.pill,
.sub,
.card-meta,
.card-rank,
.score,
.toolbar,
.btn,
.modal-card {
  font-family: "Share Tech Mono", "SFMono-Regular", monospace;
  text-transform: uppercase;
}

.kicker {
  margin: 0;
  color: #7f7f7f;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
}

.headline {
  margin: 10px 0 0;
  font-size: clamp(2rem, 3vw, 2.7rem);
  font-weight: 600;
  color: #d2d2d2;
}

.seq {
  margin-top: 8px;
  display: flex;
  gap: 52px;
  color: #7e7e7e;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
}

.sub {
  margin: 10px 0 0;
  color: #8f8f8f;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 14px 0 14px;
}

.btn {
  border: 1px solid var(--line);
  background: rgba(18, 18, 18, 0.74);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { filter: brightness(1.08); }

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, #171717 0%, #111111 62%);
  padding: 12px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
}

.card-rank {
  color: #8a8a8a;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.card-model {
  color: #d7d7d7;
  font-size: 0.96rem;
  line-height: 1.25;
  word-break: break-word;
  min-height: calc(1.25em * 2);
  max-height: calc(1.25em * 2);
  overflow: hidden;
}

.score {
  display: inline-flex;
  width: fit-content;
  align-self: start;
  border-radius: 999px;
  border: 1px solid rgba(216, 76, 63, 0.4);
  padding: 4px 10px;
  font-size: 0.75rem;
  color: #ff8c80;
  background: rgba(216, 76, 63, 0.1);
  letter-spacing: 0.05em;
}

.card-meta {
  color: var(--text-muted);
  font-size: 0.7rem;
  display: grid;
  gap: 5px;
  letter-spacing: 0.08em;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 18px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.01);
  font-family: "Share Tech Mono", "SFMono-Regular", monospace;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal.open { display: flex; }

.modal-card {
  width: min(760px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, #161616 0%, #111111 100%);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  padding: 14px;
  color: #9d9d9d;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-top h2 {
  margin: 0;
  color: #d0d0d0;
  font-size: 1rem;
}

.close {
  border: 1px solid var(--line);
  background: rgba(18, 18, 18, 0.7);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  cursor: pointer;
}

.modal-card p,
.modal-card ul { margin: 8px 0; }
.modal-card ul { padding-left: 16px; }

@media (max-width: 720px) {
  body { padding: 10px; }
  .shell { min-height: calc(100vh - 20px); }
  .topbar {
    padding: 0 12px;
    justify-content: space-between;
    gap: 8px;
  }
  .brand {
    position: static;
    flex: 0 0 auto;
  }
  .nav {
    width: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
  }
  .nav-link {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
  }
  .nav-link-box {
    min-height: 30px;
    padding: 5px 9px;
  }
  .wrap { padding: 20px 12px 18px; }
}
