:root {
  --bg: #121014;
  --surface: #1c181e;
  --surface-2: #251f27;
  --border: #3a3139;
  --text: #ece6e0;
  --muted: #a89e98;
  --accent: #d33b3b;
  --accent-2: #f0a03a;
  --ok: #6cbf6c;
  --radius: 10px;
  --max: 1080px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
}
a { color: var(--accent-2); }
a:hover { color: #ffc070; }
img { max-width: 100%; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.is-hidden { display: none !important; }
.muted { color: var(--muted); }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(18, 16, 20, 0.92);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(6px);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); text-decoration: none; letter-spacing: .5px; }
.logo span { color: var(--accent); margin-left: -10px; }
.logo img { border-radius: 7px; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* Hero */
.hero { padding: 72px 0 48px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; margin: 0 0 16px; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p.lead { font-size: 20px; color: var(--muted); max-width: 680px; margin: 0 0 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 13px; color: var(--accent-2); font-weight: 700; }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: var(--radius);
  font-weight: 700; text-decoration: none; border: 1px solid var(--border);
  color: var(--text); background: var(--surface-2); cursor: pointer; font-size: 16px;
}
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #e24a4a; color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Sections and cards */
section { padding: 36px 0; }
h2 { font-size: 28px; margin: 0 0 16px; }
h3 { font-size: 20px; margin: 0 0 8px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.card p:last-child { margin-bottom: 0; }

.callout {
  background: linear-gradient(135deg, #2a1a1d, #1f1a22);
  border: 1px solid #5a2a2e; border-radius: var(--radius); padding: 22px;
}
.callout .disclosure { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* Article */
.article { max-width: 760px; }
.article h2 { margin-top: 36px; }
.article li { margin-bottom: 6px; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 22px; }

/* Ranked lists */
.ranked { list-style: none; padding: 0; margin: 0; counter-reset: r; }
.ranked li {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(40px, 1fr) auto; gap: 12px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.ranked li::before { content: none; }
.ranked-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranked-bar { height: 10px; border-radius: 5px; background: var(--surface-2); position: relative; }
.ranked-bar::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w);
  background: var(--accent); border-radius: 5px;
}
.ranked-value { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 2ch; text-align: right; }

/* Stats tiles */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.tile .num { font-size: 32px; font-weight: 800; }
.tile .lbl { color: var(--muted); font-size: 14px; }

/* Forms */
textarea {
  width: 100%; min-height: 140px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
  font-family: Consolas, monospace; font-size: 13px;
}
label.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; }
.msg { margin-top: 12px; }
.msg.error { color: #ff8080; }
.msg.ok { color: var(--ok); }

code, kbd {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; font-family: Consolas, monospace; font-size: .9em;
}
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 28px 0; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.site-footer a { color: var(--muted); }

@media (max-width: 640px) {
  .site-header .wrap { height: auto; flex-direction: column; align-items: flex-start; padding: 12px 20px; gap: 6px; }
  .ranked li { grid-template-columns: 1fr auto; }
  .ranked-bar { grid-column: 1 / -1; grid-row: 2; }
}
