:root {
  --bg-0: #0a0f0e;
  --bg-1: #11191a;
  --ink: #f5f0e6;
  --muted: #9ba59d;
  --line: #27352f;
  --glow: #c6ff62;
  --warm: #ff9c3f;
  --cool: #2fd8ff;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Mono", monospace;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 15% -10%,
      rgba(198, 255, 98, 0.12),
      transparent 40%
    ),
    radial-gradient(
      circle at 100% 10%,
      rgba(255, 156, 63, 0.1),
      transparent 36%
    ),
    linear-gradient(140deg, var(--bg-0) 0%, var(--bg-1) 55%, #0e1413 100%);
  padding: 2rem 1.2rem 4rem;
  overflow-x: hidden;
}

.noise,
.mesh {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.noise {
  opacity: 0.06;
  background-image: radial-gradient(#ffffff 0.7px, transparent 0.7px);
  background-size: 3px 3px;
  mix-blend-mode: screen;
  z-index: -2;
}

.mesh {
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(198, 255, 98, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(198, 255, 98, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 50%, transparent 95%);
}

.hero {
  max-width: 1100px;
  margin: 0 auto 2rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  padding: clamp(1.1rem, 2.5vw, 2.3rem);
  background: linear-gradient(
    170deg,
    rgba(16, 24, 23, 0.92),
    rgba(9, 13, 12, 0.92)
  );
  box-shadow: var(--shadow);
  transform: translateY(16px);
  opacity: 0;
  animation: rise 0.8s 0.05s ease forwards;
}

.kicker {
  margin: 0;
  color: var(--cool);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

h1 {
  font-family: "Archivo Black", sans-serif;
  margin: 0.45rem 0 0;
  line-height: 0.94;
  font-size: clamp(2.1rem, 8vw, 5.4rem);
  text-transform: uppercase;
  text-wrap: balance;
}

.lead {
  max-width: 76ch;
  color: var(--muted);
  margin: 1rem 0 0;
  line-height: 1.5;
}

.hero-metrics {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.hero-metrics article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(23, 34, 31, 0.58);
}

.quick-links-wrap {
  margin-top: 1rem;
}

.quick-links-title {
  margin: 0 0 0.55rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.quick-link {
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  padding: 0.38rem 0.62rem;
  background: rgba(20, 29, 27, 0.72);
  font-size: 0.78rem;
}

.quick-link:hover {
  border-color: var(--cool);
  color: var(--cool);
}

.metric-value {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--glow);
  font-weight: 700;
}

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

main {
  max-width: 1100px;
  margin: 0 auto;
}

.controls {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1rem;
  position: sticky;
  top: 0.55rem;
  z-index: 4;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(6px);
  background: rgba(10, 16, 15, 0.72);
}

#tool-search,
#tier-filter,
#toggle-view {
  border: 1px solid var(--line);
  background: #121b19;
  color: var(--ink);
  border-radius: 12px;
  font-family: inherit;
}

#tool-search {
  flex: 1;
  min-height: 48px;
  padding: 0.8rem 0.95rem;
}

#tool-search:focus-visible,
#tier-filter:focus-visible,
#toggle-view:focus-visible,
.run-btn:focus-visible,
.link-btn:focus-visible {
  outline: 2px solid var(--cool);
  outline-offset: 2px;
}

#tier-filter {
  min-height: 48px;
  padding: 0.75rem 0.8rem;
}

#toggle-view {
  min-height: 48px;
  padding: 0.8rem 1rem;
  cursor: pointer;
}

.tool-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
}

.tool-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(
    165deg,
    rgba(19, 30, 29, 0.92),
    rgba(11, 16, 15, 0.95)
  );
  box-shadow: var(--shadow);
  padding: 1rem;
  overflow: hidden;
  transform: translateY(14px) rotateX(3deg);
  opacity: 0;
  animation: rise 0.62s var(--delay, 0s) cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--accent) 66%, transparent);
  opacity: 0.4;
}

.tool-card::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  right: -80px;
  top: -80px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--accent) 26%, transparent),
    transparent 72%
  );
}

.tool-card:hover {
  transform: translateY(-6px) rotateX(0deg);
  transition: transform 0.22s ease;
}

.tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.tool-name {
  margin: 0;
  font-family: "Archivo Black", sans-serif;
  text-transform: uppercase;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.badge {
  border: 1px solid color-mix(in srgb, var(--accent) 60%, var(--line));
  border-radius: 999px;
  padding: 0.2rem 0.58rem;
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tool-role,
.tool-command,
.tool-note {
  margin: 0.65rem 0 0;
}

.tool-role {
  color: var(--muted);
  min-height: 2.4em;
}

.tool-command {
  border: 1px dashed color-mix(in srgb, var(--accent) 54%, var(--line));
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  color: #f7f4ea;
  background: rgba(0, 0, 0, 0.22);
  overflow-wrap: anywhere;
}

.tool-note {
  color: color-mix(in srgb, var(--accent) 62%, white);
  font-size: 0.83rem;
}

.run-btn {
  margin-top: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, var(--line));
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: #fcfaf3;
  border-radius: 10px;
  min-height: 38px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-family: inherit;
}

.card-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.run-btn {
  margin-top: 0;
}

.link-btn {
  border: 1px solid color-mix(in srgb, var(--cool) 70%, var(--line));
  background: color-mix(in srgb, var(--cool) 16%, transparent);
  color: #e8fbff;
  border-radius: 10px;
  min-height: 38px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.tool-card.active {
  outline: 2px solid color-mix(in srgb, var(--accent) 75%, transparent);
  outline-offset: -2px;
}

.compact .tool-role,
.compact .tool-note {
  display: none;
}

.detail-panel {
  max-width: 1100px;
  margin: 1.1rem auto 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: rgba(15, 21, 20, 0.85);
}

.detail-title {
  margin: 0;
  color: var(--warm);
  font-weight: 700;
}

.detail-text {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  margin: 0;
  border-radius: 10px;
  background: #101917;
  border: 1px solid var(--line);
  color: var(--ink);
  min-width: 220px;
  max-width: min(460px, calc(100vw - 2rem));
  padding: 0.7rem 0.9rem;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.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;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  body {
    padding: 1rem 0.75rem 3.5rem;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .controls {
    flex-direction: column;
  }

  #tool-search,
  #tier-filter,
  #toggle-view {
    width: 100%;
  }
}
