/* ── Design Tokens ─────────────────────────────────────────── */

:root {
  color-scheme: dark;
  --bg:      #000;
  --card:    #12121a;
  --panel:   #070707;
  --panel2:  #0d0d0d;
  --text:    #f8fafc;
  --muted:   #9ca3af;
  --line:    #27272f;
  --accent:  #38bdf8;
  --accent2: #7dd3fc;
  --danger:  #fb7185;
  --warn:    #f59e0b;
  --good:    #38bdf8;
  --bad:     #ff6b6b;
}

/* ── Reset ─────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text); }

/* ── Header / Nav ──────────────────────────────────────────── */

header { border-bottom: 1px solid var(--line); background: rgba(0,0,0,.72); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 2; }
nav { width: min(1120px, calc(100% - 36px)); min-height: 64px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; position: relative; }
.brand { display: flex; align-items: center; }
.brand-logo { display: block; width: 52px; height: 52px; object-fit: contain; }
.nav-center-image { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 146px; height: 58px; object-fit: contain; object-position: center; opacity: .96; }
.navlinks { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.navlinks a { color: var(--muted); }
.navlinks a:hover { color: var(--text); }
.navlinks a.button, .navlinks a.button:hover { color: #000; border-radius: 6px; padding: 5px 14px; margin: 0; font-size: 14px; font-weight: 600; box-shadow: none; transform: none; }

/* ── Typography ────────────────────────────────────────────── */

h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.1; margin: 0 0 10px; letter-spacing: -.04em; }
h2 { font-size: clamp(20px, 3vw, 28px); line-height: 1.2; margin: 0 0 10px; letter-spacing: -.02em; }
h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.02em; }
p  { color: var(--muted); line-height: 1.5; margin: 0 0 18px; }

.muted  { color: var(--muted); }
.ok     { color: var(--good); }
.bad    { color: var(--bad); }
.warn   { color: var(--warn); }
.small  { font-size: 13px; }
.nowrap { white-space: nowrap; }
.stat   { font-size: 34px; font-weight: 900; letter-spacing: -.04em; text-align: center; }

/* ── Code ──────────────────────────────────────────────────── */

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #050505;
  border: 1px solid var(--line);
  border-radius: 10px;
}
code { padding: 2px 5px; }
pre  { white-space: pre-wrap; overflow: auto; padding: 14px; color: #e7e7e7; }

/* ── Layout Primitives ─────────────────────────────────────── */

.wrap      { width: min(1120px, calc(100% - 36px)); margin: 0 auto; }
.row       { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack     { display: grid; gap: 16px; min-width: 0; }
.grid      { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grid-3    { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.two       { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.statsGrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.tableWrap { max-width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.hidden    { display: none !important; }

/* ── Card ───────────────────────────────────────────────────── */

.card {
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, .25);
  min-width: 0;
  overflow: hidden;
}
a.card       { display: block; transition: border-color .18s ease; }
a.card:hover { border-color: #555; }
.card.soft   { background: rgba(13, 13, 13, .9); }

/* ── Buttons ────────────────────────────────────────────────── */

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid #fff;
  border-radius: 999px;
  padding: 11px 16px;
  margin: 8px 8px 0 0;
  background: #fff;
  color: #000;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 2px 0 #8a8a8a;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
button:hover, .button:hover  { transform: translateY(-1px); box-shadow: 0 3px 0 #8a8a8a; }
.button:hover { color: #000; }
button:active, .button:active { transform: translateY(1px);   box-shadow: 0 1px 0 #8a8a8a; }

button.secondary, .button.secondary {
  background: #050505;
  color: var(--text);
  border-color: #3a3a3a;
  box-shadow: 0 2px 0 #1f1f1f;
}
button.secondary:hover, .button.secondary:hover { border-color: #777; box-shadow: 0 3px 0 #1f1f1f; }

button.danger, .button.danger {
  background: #991b2b;
  color: #fff;
  border-color: #6b1220;
  box-shadow: 0 2px 0 #3d0b12;
}
button.danger:hover, .button.danger:hover { transform: translateY(-1px); box-shadow: 0 3px 0 #3d0b12; }
button.danger:active, .button.danger:active { transform: translateY(1px); box-shadow: 0 1px 0 #3d0b12; }

button:disabled, .button.disabled, .button[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: 0 1px 0 #555;
}

/* ── Pill ───────────────────────────────────────────────────── */

.pill {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 12px;
}

/* ── Notices ────────────────────────────────────────────────── */

.notice { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; white-space: pre-wrap; }
.notice.info    { background: #07111f; border-color: #1e3a5f; color: #c7e7ff; }
.notice.success { background: #052016; border-color: #14532d; color: #b9f6d3; }
.notice.error   { background: #2a0b13; border-color: #7f1d1d; color: #fecdd3; }

/* ── Forms ──────────────────────────────────────────────────── */

label { display: block; color: var(--muted); font-size: 13px; margin: 12px 0 6px; }

input, select, textarea {
  width: 100%;
  background: #09090f;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
}
textarea {
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

/* ── Tables ─────────────────────────────────────────────────── */

table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 9px 7px; vertical-align: top; overflow-wrap: anywhere; word-break: break-word; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

/* ── Secret Box ─────────────────────────────────────────────── */

.secretBox         { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.secretBox input   { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* ── OAuth Buttons (kebab-case — site pages) ────────────────── */

.oauth-buttons { display: grid; gap: 10px; max-width: 360px; margin: 18px auto 0; }
.oauth-button {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center;
  gap: 12px; border-radius: 4px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; text-decoration: none;
  cursor: pointer; box-shadow: none; transition: filter .12s ease, border-color .12s ease;
}
.oauth-button:hover { filter: brightness(1.05); }
.oauth-button:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.oauth-logo  { width: 20px; height: 20px; display: block; flex: 0 0 20px; }
.oauth-google  { background: #fff; color: #3c4043; border-color: #dadce0; font-family: Roboto, Arial, sans-serif; }
.oauth-google:hover { color: #3c4043; border-color: #c5c9ce; }
.oauth-github  { background: #24292f; color: #fff; border-color: #24292f; }
.oauth-github:hover { color: #fff; }
.oauth-discord { background: #5865f2; color: #fff; border-color: #5865f2; }
.oauth-discord:hover { color: #fff; }

/* OAuth Buttons (camelCase — app dashboard) */
.oauthButtons { display: grid; gap: 10px; max-width: 360px; margin: 18px auto 0; }
.oauthButton  {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center;
  gap: 12px; border-radius: 4px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; text-decoration: none;
  cursor: pointer; box-shadow: none; transition: filter .12s ease, border-color .12s ease;
}
.oauthButton:hover { filter: brightness(1.05); }
.oauthButton:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.oauthLogo   { width: 20px; height: 20px; display: block; flex: 0 0 20px; }
.oauthGoogle  { background: #fff; color: #3c4043; border-color: #dadce0; font-family: Roboto, Arial, sans-serif; }
.oauthGoogle:hover { color: #3c4043; border-color: #c5c9ce; }
.oauthGithub  { background: #24292f; color: #fff; border-color: #24292f; }
.oauthGithub:hover { color: #fff; }
.oauthDiscord { background: #5865f2; color: #fff; border-color: #5865f2; }
.oauthDiscord:hover { color: #fff; }

/* ── Promo ──────────────────────────────────────────────────── */

.promo-card  { border-color: rgba(56, 189, 248, .7); box-shadow: 0 18px 80px rgba(56, 189, 248, .12); }
.promo-active {
  display: inline-flex; gap: 6px; align-items: center;
  border: 1px solid rgba(56, 189, 248, .65); border-radius: 999px; padding: 5px 10px;
  color: #e0f2fe; background: rgba(56, 189, 248, .12); font-size: 12px; font-weight: 900;
}

/* ── Terminal ───────────────────────────────────────────────── */

.terminal { position: relative; }
.terminal::before {
  content: ""; display: block; width: 44px; height: 10px; margin-bottom: 13px;
  background:
    radial-gradient(circle, #fb7185 0 4px, transparent 5px),
    radial-gradient(circle, #facc15 0 4px, transparent 5px),
    radial-gradient(circle, #22c55e 0 4px, transparent 5px);
  background-size: 14px 10px; background-position: 0 0, 14px 0, 28px 0;
  background-repeat: no-repeat;
}

/* ── Lists ──────────────────────────────────────────────────── */

ul { color: #cfcfcf; padding-left: 18px; }
li { margin: 7px 0; }

.beta-ribbon {
  border-top: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(56, 189, 248, .18), rgba(125, 211, 252, .06));
  color: #e0f2fe;
  font-size: 14px;
}
.beta-ribbon-inner {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  font-weight: 850;
}
.beta-ribbon a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 1020px) { .statsGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px)  { .grid, .grid-3, .two { grid-template-columns: 1fr; } }
@media (max-width: 760px)  { .hero { display: block; } .nav-center-image { display: none; } }
@media (max-width: 520px)  { .statsGrid { grid-template-columns: 1fr; } .secretBox { display: block; } }

/* ── Modal ──────────────────────────────────────────────────── */

.modalOverlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 28px 16px; background: rgba(0,0,0,.78); backdrop-filter: blur(4px); }
.modalPanel   { width: min(760px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: 0 24px 80px rgba(0,0,0,.55); }
