/* Low-level skills TrothByte — landing page */
/* Dark theme per Vercel Web Interface Guidelines: color-scheme, focus-visible,
   transform/opacity-only animations, prefers-reduced-motion, tabular-nums. */

:root {
  --bg: #070b12;
  --bg-2: #0a101a;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e6edf3;
  --text-2: #9fb0c3;
  --text-3: #6b7c8f;
  --sky: #38bdf8;
  --teal: #5eead4;
  --violet: #a78bfa;
  --amber: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --grad: linear-gradient(120deg, var(--sky), var(--violet) 55%, var(--teal));
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --radius: 16px;
  --maxw: 1120px;
  --nav-h: 64px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(56, 189, 248, 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(167, 139, 250, 0.10), transparent 55%),
    radial-gradient(700px 700px at 50% 110%, rgba(94, 234, 212, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Fixed particle field */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

a {
  color: var(--sky);
  text-decoration: none;
}

a:hover {
  color: #7dd3fc;
}

button {
  font: inherit;
  cursor: pointer;
}

::selection {
  background: rgba(56, 189, 248, 0.3);
}

/* Skip link */
.skip {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--sky);
  color: #04202e;
  font-weight: 600;
  border-radius: 8px;
  transition: top 0.2s ease;
}

.skip:focus-visible {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 11, 18, 0.72);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--grad);
  display: grid;
  place-items: center;
  color: #04202e;
  font-size: 14px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.nav-cta:hover {
  border-color: var(--sky);
  color: var(--text);
  transform: translateY(-1px);
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(72px, 12vh, 130px) 0 48px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--teal);
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  text-wrap: balance;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--text-2);
  max-width: 720px;
  margin: 0 auto 12px;
  min-height: 1.8em;
  text-wrap: balance;
}

.hero-sub .cursor {
  display: inline-block;
  width: 2px;
  background: var(--sky);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

.works-with {
  color: var(--text-3);
  font-size: 13px;
  margin: 18px auto 0;
  text-align: center;
}

/* Terminal demo */
.terminal {
  max-width: 640px;
  margin: 36px auto 0;
  text-align: left;
  background: #05080d;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.terminal-bar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a4553;
}

.terminal-bar .dot:nth-child(1) {
  background: #f87171;
}

.terminal-bar .dot:nth-child(2) {
  background: #fbbf24;
}

.terminal-bar .dot:nth-child(3) {
  background: #34d399;
}

.terminal-title {
  margin-left: 8px;
  color: var(--text-3);
  font-size: 12px;
}

#terminal-body {
  margin: 0;
  padding: 14px;
  color: var(--teal);
  white-space: pre-wrap;
  min-height: 132px;
}

#terminal-body .ok {
  color: var(--green);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--grad);
  color: #04202e;
  box-shadow: 0 8px 30px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 10px 36px rgba(56, 189, 248, 0.35);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--sky);
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 56px 0 8px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 4px;
}

/* ---------- Sections ---------- */
.section {
  padding: 72px 0;
}

.section-head {
  text-align: center;
  margin-bottom: 40px;
}

.section-head .kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--sky);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.02em;
  margin: 8px 0 0;
  text-wrap: balance;
}

.section-head p {
  color: var(--text-2);
  max-width: 640px;
  margin: 12px auto 0;
}

/* Explorer */
.explorer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-bottom: 28px;
}

.search {
  position: relative;
  flex: 1 1 320px;
  max-width: 480px;
}

.search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 16px 12px 42px;
  color: var(--text);
  font: inherit;
}

.search input:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.chips {
  display: flex;
  gap: 8px;
}

.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip[aria-pressed="true"] {
  background: rgba(56, 189, 248, 0.14);
  border-color: var(--sky);
  color: var(--sky);
}

.result-meta {
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}

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

.skill-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.skill-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(56, 189, 248, 0.05));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.skill-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--surface-2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.skill-card:hover::after {
  opacity: 1;
}

.skill-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.skill-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 13.5px;
  flex: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-3);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-source-backed {
  color: var(--green);
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
}

.badge-researched {
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

.badge-evaluated,
.badge-stable {
  color: var(--violet);
  border-color: rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.08);
}

.domain-chip {
  color: var(--sky);
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 2px 8px;
  border-radius: 6px;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-3);
  padding: 48px 0;
}

/* Failure cards */
.failure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.failure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.failure-icon {
  font-size: 24px;
}

.failure h3 {
  margin: 12px 0 8px;
  font-family: var(--font-display);
  font-size: 17px;
}

.failure p {
  color: var(--text-2);
  font-size: 14px;
  margin: 0 0 12px;
}

.failure code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--teal);
  background: rgba(94, 234, 212, 0.07);
  padding: 2px 6px;
  border-radius: 5px;
}

/* Research */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.research {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.research:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.research h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 16px;
}

.research p {
  color: var(--text-2);
  font-size: 13.5px;
  margin: 0 0 10px;
}

.research .tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--violet);
}

/* Install */
.install {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 28px;
  max-width: 760px;
  margin: 0 auto;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab {
  background: none;
  border: none;
  color: var(--text-2);
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-selected="true"] {
  color: var(--sky);
  border-bottom-color: var(--sky);
}

.cmd {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #05080d;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.cmd code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--teal);
  overflow-x: auto;
  white-space: nowrap;
}

.copy {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.copy:hover {
  border-color: var(--sky);
  color: var(--text);
}

.copy[data-copied="true"] {
  color: var(--green);
  border-color: var(--green);
}

.install-note {
  margin-top: 14px;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}

/* Quality */
.quality {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.quality-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.quality-item h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quality-item p {
  color: var(--text-2);
  font-size: 14px;
  margin: 0;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  color: var(--text-3);
  font-size: 13.5px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

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

.footer-links a {
  color: var(--text-2);
}

.footer-links a:hover {
  color: var(--text);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  #bg {
    display: none;
  }
}

/* Mobile */
@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding-top: 56px;
  }

  .section {
    padding: 48px 0;
  }

  .explorer-tools {
    flex-direction: column;
  }

  .chips {
    flex-wrap: wrap;
    justify-content: center;
  }
}
