:root {
  --bg: #12191d;
  --bg-2: #0e1417;
  --panel: rgba(22, 31, 36, .82);
  --panel-solid: #172026;
  --line: rgba(232, 228, 220, .12);
  --line-strong: rgba(232, 228, 220, .22);
  --text: #e8e4dc;
  --text-2: #cfcac1;
  --muted: #97a0a3;
  --ice: #6fcdf5;
  --fire: #ff4d1f;
  --fire-2: #ff7a2a;
  --bad: #f87171;
  --ok: #4ade80;
  --head: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --grunge: 'Rubik Dirt', 'Space Grotesk', sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 15% 20%, rgba(111, 205, 245, .05), transparent 60%),
    radial-gradient(1000px 600px at 85% 70%, rgba(255, 77, 31, .04), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.topbar, .subnav, main, .site-footer { position: relative; z-index: 1; }

a { color: var(--ice); text-decoration: none; transition: color .2s; }
a:hover { color: var(--text); }

h1, h2, h3, h4 { font-family: var(--head); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .75rem; }
h1 {
  font-family: var(--grunge);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1;
  margin-bottom: 1.25rem;
}
h1 code.slug { font-family: var(--mono); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; margin-top: 1.25rem; }
h4 { font: 500 .72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 1.6rem 0 .7rem; }
h3 .muted, h4 .muted { font-weight: 400; }
.card-head h2, .card-head h3 { margin-top: 0; }
p { margin: 0 0 1em; }

code {
  font-family: var(--mono);
  font-size: .86em;
  color: var(--ice);
  background: rgba(10, 14, 16, .6);
  border: 1px solid var(--line);
  padding: .1em .4em;
}

.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .85rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.right { text-align: right; }
.center { text-align: center; }

/* header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 72px;
  padding: 0 max(5%, calc((100% - 1180px) / 2));
  background: rgba(14, 20, 23, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { font: 700 .95rem/1 var(--head); text-transform: uppercase; letter-spacing: .14em; color: var(--text); white-space: nowrap; }
.brand span { color: var(--fire-2); }
.brand:hover { color: var(--text); }

.nav, .subnav { display: flex; align-items: center; gap: 1.7rem; }
.nav a, .subnav a, .btn-link {
  position: relative;
  font: 500 .72rem/1 var(--head);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #b9c0c2;
  padding: .4rem 0;
  white-space: nowrap;
}
.nav a:hover, .subnav a:hover, .btn-link:hover, .nav a.active, .subnav a.active { color: var(--text); }
.nav a.active::before, .subnav a.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  background: var(--fire);
  border-radius: 50%;
}

.subnav {
  padding: 0 max(5%, calc((100% - 1180px) / 2));
  height: 48px;
  gap: 2rem;
  background: rgba(12, 17, 20, .92);
  border-bottom: 1px solid var(--line);
}

/* layout */
main { flex: 1; }
.container { width: min(1180px, 90%); margin: 3rem auto 4rem; }
.container.narrow { width: min(460px, 90%); margin-top: 5rem; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: 0; font: 500 .72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  padding: 1.6rem 1.8rem;
  margin-bottom: 1.5rem;
  transition: border-color .3s;
}
.card:hover { border-color: var(--line-strong); }
.card:target { border-color: rgba(255, 77, 31, .55); }
.container.narrow .card { border-top: 2px solid var(--fire-2); }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.card-head p { margin: .35rem 0 0; }
.version { font: 500 .72rem/1 var(--mono); letter-spacing: .1em; color: var(--fire-2); vertical-align: middle; margin-left: .3rem; }
.slug { font-size: .7rem; vertical-align: middle; }

/* flash + badges */
.flash {
  padding: .9rem 1.1rem;
  margin-bottom: 1.25rem;
  background: rgba(10, 14, 16, .7);
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--ice);
  color: var(--text-2);
}
.flash-success { border-left-color: var(--ok); background: rgba(74, 222, 128, .05); }
.flash-error { border-left-color: var(--fire); background: rgba(255, 77, 31, .06); }

.badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.badge {
  display: inline-block;
  font: 500 .64rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .35rem .5rem;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  white-space: nowrap;
}
.badge-good { color: var(--ok); border-color: rgba(74, 222, 128, .45); background: rgba(74, 222, 128, .06); }
.badge-bad { color: var(--bad); border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .05); }
.badge-info { color: var(--ice); border-color: rgba(111, 205, 245, .45); background: rgba(111, 205, 245, .05); }

/* forms */
label {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font: 600 .72rem/1.2 var(--head);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-2);
}
label.checkbox { flex-direction: row; align-items: center; gap: .6rem; font: 400 .9rem var(--body); letter-spacing: 0; text-transform: none; color: var(--text); }

input, select, textarea {
  font: 400 .92rem var(--body);
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  background: rgba(10, 14, 16, .8);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: .8rem 1rem;
  outline: none;
  transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--ice); }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px #0e1417 inset;
  transition: background-color 9999s;
}
input::placeholder, textarea::placeholder { color: #6b7478; }
select { background-color: var(--bg-2); }
input[type="checkbox"] { width: 1rem; height: 1rem; padding: 0; accent-color: var(--fire-2); }
input[type="file"] { padding: .6rem; }
input[type="file"]::file-selector-button {
  font: 600 .66rem/1 var(--head);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ice);
  background: rgba(10, 16, 19, .35);
  border: 1px solid rgba(111, 205, 245, .55);
  padding: .55rem .8rem;
  margin-right: .8rem;
  cursor: pointer;
}

.stack { display: flex; flex-direction: column; gap: 1.2rem; }
.stack + p { margin: 1.4rem 0 0; }
.row-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .7rem; margin: 1rem 0; }
.row-form input[type="text"], .row-form input[type="search"] { min-width: 220px; flex: 1; max-width: 360px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; align-items: end; }
.grid-form .span-all { grid-column: 1 / -1; }
form.inline { display: inline; margin: 0; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .95rem 1.4rem;
  font: 600 .72rem/1 var(--head);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ice);
  background: rgba(10, 16, 19, .35);
  border: 1px solid rgba(111, 205, 245, .55);
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); color: var(--ice); background: rgba(111, 205, 245, .12); border-color: var(--ice); }
.btn-primary { background: var(--fire); border-color: transparent; color: #1a0a05; box-shadow: 0 0 28px rgba(255, 77, 31, .45), inset 0 -2px 0 rgba(0, 0, 0, .2); }
.btn-primary:hover { background: var(--fire-2); border-color: transparent; color: #1a0a05; box-shadow: 0 0 40px rgba(255, 77, 31, .7); }
.btn-danger { color: var(--bad); border-color: rgba(248, 113, 113, .45); }
.btn-danger:hover { color: var(--bad); background: rgba(248, 113, 113, .1); border-color: var(--bad); }
.btn-ghost { color: #b9c0c2; border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, .05); border-color: var(--muted); }
.btn-small { padding: .6rem .9rem; font-size: .64rem; }
.btn-link { background: none; border: 0; cursor: pointer; }

.actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1.3rem 0; }

/* downloads */
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; margin: 1.3rem 0; }
.download { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; padding: 1.1rem 1.2rem; border: 1px solid var(--line); background: rgba(10, 14, 16, .35); margin: 0; }
.download h3 { margin: 0; }
.download .hint { margin: 0; }
.download .btn { margin-top: auto; }
.download-server { border-color: rgba(255, 77, 31, .35); }
.disclaimer { border-left: 2px solid var(--fire); background: rgba(255, 77, 31, .07); padding: .8rem 1rem; color: var(--text-2); font-size: .88rem; }
.disclaimer strong { display: block; color: var(--fire-2); font: 600 .78rem/1.3 var(--head); letter-spacing: .08em; text-transform: uppercase; margin-bottom: .4rem; }
.disclaimer p { margin: 0 0 .7rem; }
.disclaimer label.checkbox { font-size: .88rem; }

/* license block */
.license { border-top: 1px solid var(--line); margin-top: 1.4rem; padding-top: 1.4rem; }
.field-label { font: 500 .72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fire-2); }
.key-row { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; margin: .7rem 0; }
.key-row .key {
  flex: 1;
  min-width: 0;
  max-width: 520px;
  padding: .95rem 1rem;
  font: 500 1rem/1 var(--mono);
  letter-spacing: .04em;
  color: var(--text);
  background: rgba(10, 14, 16, .7);
  border: 1px solid var(--line-strong);
  overflow-wrap: anywhere;
  user-select: all;
}
.key-row .btn { margin-left: -1px; }
.key-row .btn + .btn { margin-left: .6rem; }
.btn.copied { background: var(--ok); border-color: var(--ok); color: #06240f; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left;
  font: 500 .66rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--line-strong);
}
.table td { padding: .7rem .9rem; border-bottom: 1px dashed var(--line); color: #d6d2ca; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .03); }
.table td.right { text-align: right; }
.table td a:not(.btn) { color: var(--text); }
.table td a:not(.btn):hover { color: var(--fire-2); }

/* dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 2rem; background: rgba(12, 17, 20, .92); border: 1px solid var(--line); }
.stat { display: flex; flex-direction: column-reverse; gap: .45rem; padding: 1.3rem 1.5rem; color: var(--text); border-left: 1px solid var(--line); transition: background .2s; }
.stat:first-child { border-left: 0; }
a.stat:hover { background: rgba(255, 77, 31, .06); color: var(--text); }
.stat-value { font: 600 1.6rem/1.1 var(--head); }
.stat-label { font: 500 .7rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat-bad .stat-value { color: var(--fire-2); }

.pager { display: flex; gap: .7rem; justify-content: center; }

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(10, 14, 16, .95);
}
.site-footer .inner {
  width: min(1180px, 90%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem 0;
  color: var(--muted);
  font: 400 .74rem/1.4 var(--mono);
  letter-spacing: .06em;
}

@media (max-width: 760px) {
  .topbar { height: auto; flex-direction: column; align-items: flex-start; padding-top: 1rem; padding-bottom: 1rem; }
  .nav, .subnav { gap: 1.2rem; flex-wrap: wrap; }
  .subnav { height: auto; padding-top: .8rem; padding-bottom: .8rem; }
  .card { padding: 1.3rem 1.2rem; }
  .table { display: block; overflow-x: auto; }
  .stat { border-left: 0; border-bottom: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover { transform: none; }
}
