/* tracks.web.id — tema gelap meniru tampilan skills.sh (Geist + Fira Mono) */

:root {
  --bg: #000000;
  --bg-soft: #0a0a0a;
  --panel: #111111;
  --hover: rgba(255, 255, 255, .04);
  --border: #1f1f1f;
  --border-strong: #2e2e2e;
  --fg: #ededed;
  --muted: #a1a1a1;
  --faint: #6b6b6b;
  --radius: 8px;
  --maxw: 1152px;
  --sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fira: "Fira Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
code, pre, kbd { font-family: var(--mono); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 0, 0, .82);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark { display: inline-flex; color: var(--fg); }
.brand-mark:hover { color: #fff; }
.brand-logo { width: 22px; height: 22px; border-radius: 6px; display: block; }
.brand-name { font-weight: 500; letter-spacing: -.02em; font-size: 18px; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a { font-size: 14px; color: var(--muted); transition: color .15s ease; }
.nav a:hover { color: var(--fg); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--fg); margin: 4px 0; border-radius: 2px; }

/* ---------- Hero ---------- */
.hero { padding: 28px 0 8px; }
.hero-grid {
  display: grid; grid-template-columns: 1fr; gap: 40px;
  padding-bottom: 32px; border-bottom: 1px solid var(--border);
}
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: auto minmax(0, 1fr); gap: 56px; padding: 18px 0 40px; }
}

.hero-mark { display: flex; flex-direction: column; gap: 14px; align-items: center; }
@media (min-width: 1024px) { .hero-mark { align-items: flex-start; } }

.ascii-wrap { position: relative; max-width: 390px; overflow: hidden; }
.ascii {
  margin: 0; white-space: pre; user-select: none;
  font-family: var(--fira);
  font-size: 12px; line-height: 125%; letter-spacing: -1px;
}
@media (min-width: 1024px) { .ascii { font-size: 15px; } }
.ascii-base { visibility: hidden; }
.ascii-fade {
  position: absolute; top: 0; left: 0;
  background: linear-gradient(180deg, #f2f2f2 0%, #c8c8c8 42%, #6f6f6f 78%, #333 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, rgba(0, 0, 0, .18) 100%);
  mask-image: linear-gradient(180deg, #000 72%, rgba(0, 0, 0, .18) 100%);
}

.hero-kicker {
  margin: 0; font-family: var(--mono); text-transform: uppercase;
  font-size: 15px; font-weight: 500; letter-spacing: -.01em; color: var(--fg);
}
@media (min-width: 1024px) { .hero-kicker { font-size: 19px; } }

.hero-copy { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.hero-lead {
  color: var(--muted); max-width: 780px; margin: 0;
  font-size: clamp(20px, 2.4vw, 30px); line-height: 1.25; letter-spacing: -.02em;
  text-wrap: balance;
}
.hero-lead code {
  background: var(--panel); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 5px; font-size: .7em;
}
.hero-lead a { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.hero-lead a:hover { text-decoration-color: #fff; }

.eyebrow {
  font-family: var(--mono); text-transform: uppercase;
  font-size: 14px; font-weight: 500; color: var(--fg); margin: 0 0 14px;
  letter-spacing: 0;
}

.hero-block { display: block; }

/* command box */
.cmd {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-width: 0; max-width: 100%;
  background: rgba(255, 255, 255, .04); border: 1px solid transparent;
  border-radius: var(--radius); padding: 12px 14px; max-width: 348px;
  font-family: var(--mono); font-size: 14px;
}
.cmd.wide { max-width: 100%; }
.cmd.mini { max-width: 100%; padding: 10px 12px; background: rgba(255, 255, 255, .03); }
.cmd code { color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cmd .prompt { color: var(--faint); margin-right: 1ch; }
.cmd-slot { margin-left: 1ch; color: var(--muted); display: inline-block; transition: opacity .35s ease, filter .35s ease; }
.cmd-slot.swap { opacity: 0; filter: blur(4px); }

.icon-btn {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  padding: 6px; border-radius: 6px; display: inline-flex; align-items: center;
  transition: color .15s ease, background .15s ease;
}
.icon-btn:hover { color: var(--fg); background: rgba(255, 255, 255, .07); }
.icon-btn.copied { color: #4ade80; }

/* marquee of track names */
.marquee {
  position: relative; overflow: hidden; width: 100%; max-width: 100%; min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track {
  display: flex; gap: 8px; width: max-content;
  animation: marquee 46s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee .pill {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px;
  white-space: nowrap; flex: 0 0 auto;
}
.marquee .pill:hover { color: var(--fg); border-color: var(--border-strong); }

.stats {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  color: var(--muted); font-size: 13.5px; font-family: var(--mono);
}
.stats strong { color: var(--fg); font-weight: 500; }
.stats .dot { color: var(--faint); }

/* ---------- Leaderboard ---------- */
.leaderboard { padding: 34px 0 20px; }

.search { position: relative; display: flex; align-items: center; border-bottom: 1px solid var(--border-strong); margin-bottom: 20px; }
.search-ico {
  width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2;
  position: absolute; left: 2px; pointer-events: none;
}
.search input {
  width: 100%; background: transparent; border: 0; outline: 0; color: var(--fg);
  font-family: var(--mono); font-size: 15px; padding: 14px 44px;
}
@media (min-width: 640px) { .search input { font-size: 14px; } }
.search input::placeholder { color: var(--muted); }
.search kbd {
  position: absolute; right: 4px; border: 1px solid var(--border-strong); color: var(--muted);
  border-radius: 6px; padding: 1px 7px; font-size: 13px; font-family: var(--mono);
}

.tabs { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.tab {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-family: var(--mono); font-size: 14px; padding: 0 0 8px;
  border-bottom: 2px solid transparent; transition: color .15s ease;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--fg); }
.tab .muted { color: var(--faint); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 8px; }
.chip {
  background: none; border: 1px solid var(--border-strong); color: var(--muted);
  font-family: var(--mono); font-size: 12px; padding: 3px 10px; border-radius: 999px;
  cursor: pointer; transition: color .15s ease, border-color .15s ease;
}
.chip:hover { color: var(--fg); border-color: #454545; }
.chip.active { color: #000; background: var(--fg); border-color: var(--fg); }

.list-head, .row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 44px;
  gap: 12px; align-items: center;
}
@media (min-width: 1024px) {
  .list-head, .row { grid-template-columns: 44px minmax(0, 1fr) 170px 44px; gap: 16px; }
}
.list-head {
  border-bottom: 1px solid var(--border); padding: 12px 0; margin-top: 18px;
  font-size: 13px; text-transform: uppercase; letter-spacing: .02em;
  color: var(--muted); font-family: var(--mono);
}
.list-head .col-copy { text-align: right; }
.list { min-height: 240px; }

.row {
  padding: 10px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s ease;
}
.row:hover { background: var(--hover); }
.row .rank { color: var(--muted); font-family: var(--mono); font-size: 14px; }
.row .name-col { min-width: 0; }
.row .name-line {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
@media (min-width: 1024px) {
  .row .name-line { flex-direction: row; align-items: baseline; gap: 10px; }
}
.row .name {
  font-weight: 600; font-size: 15px; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 8px;
}
.row .row-ico { width: 18px; height: 18px; border-radius: 4px; flex: 0 0 auto; }
.row .inline-desc {
  margin: 0; color: var(--muted); font-size: 13px; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row .repo {
  color: var(--faint); font-family: var(--mono); font-size: 12.5px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row .cat {
  display: none; font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (min-width: 1024px) { .row .cat { display: block; } }
.row .copy-cell { display: flex; justify-content: flex-end; }

.empty, .loading { color: var(--muted); font-family: var(--mono); font-size: 13.5px; padding: 48px 0; text-align: center; }
.load-more {
  display: block; margin: 24px auto 0; background: var(--panel); color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 10px 22px; font-family: var(--mono); font-size: 13px; cursor: pointer;
}
.load-more:hover { background: #1a1a1a; }

/* ---------- Install ---------- */
.install { padding: 44px 0 64px; border-top: 1px solid var(--border); margin-top: 24px; }
.install-lead { color: var(--muted); margin: 0 0 16px; }
.install-lead code { background: var(--panel); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--faint); font-size: 13px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--muted); font-family: var(--mono); }
.footer-links a:hover { color: var(--fg); }

/* ---------- Modal ---------- */
[hidden] { display: none !important; }

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); backdrop-filter: blur(2px); }
.modal-card {
  position: relative; z-index: 1; width: 100%; max-width: 560px;
  background: var(--bg-soft); border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 26px; box-shadow: 0 24px 70px rgba(0, 0, 0, .7);
  animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1;
  cursor: pointer; border-radius: 6px;
}
.modal-close:hover { color: #fff; background: #1a1a1a; }
.modal-icon { width: 36px; height: 36px; border-radius: 8px; margin-bottom: 10px; }
.modal-card h3 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.02em; font-family: var(--mono); word-break: break-all; }
.modal-meta { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.modal-meta .mid-dot { color: var(--faint); }
.modal-desc { color: #c9c9c9; font-size: 14px; margin: 0 0 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-bottom: 7px; }
.field a { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); font-family: var(--mono); font-size: 13px; word-break: break-all; }
.field a:hover { text-decoration-color: #fff; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--fg); color: #000; font-weight: 500; font-size: 14px;
  padding: 9px 16px; border-radius: var(--radius); margin-top: 4px;
}
.btn-primary:hover { background: #fff; color: #000; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .list-head { display: none; }
  .row .rank { align-self: start; padding-top: 2px; }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .nav-toggle { display: block; }
  .nav.open {
    display: flex; position: absolute; top: 56px; right: 16px; left: 16px;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg-soft); border: 1px solid var(--border-strong);
    border-radius: 10px; padding: 8px;
  }
  .nav.open a { padding: 10px 12px; width: 100%; color: var(--fg); }
}
@media (max-width: 560px) {
  .ascii { font-size: 9px; letter-spacing: -.5px; }
  .cmd { max-width: 100%; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}
