/*
  Shared by every page under site/. Plain CSS, no build step: Caddy serves this
  file as is, and so does `python clutch.py website`.

  The palette is the desktop app's (client/ui/DESIGN.md) so a player moving
  between the app and this site sees one product: charcoal surfaces, the amber
  T-side accent, the CT blue as the second voice. System fonts on purpose -
  a web font from a third-party CDN would hand every visitor's address to it.
*/
:root {
  color-scheme: dark;
  --bg-0: #101116;
  --bg-1: #181922;
  --bg-2: #1f2029;
  --bg-3: #272935;
  --line: #2a2b36;
  --line-strong: #3a3c4a;
  --fg: #ecedf1;
  --fg-muted: #9a9da8;
  --fg-faint: #676a76;
  --primary: #f0a830;
  --primary-hover: #f7b94a;
  --on-primary: #1a1300;
  --ct: #68a3e5;
  --ok: #3ecf8e;
  --warn: #f5c542;
  --danger: #f0564f;
  --radius: 14px;
  --radius-sm: 10px;
  --max: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-0);
  color: var(--fg);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- Header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(16 17 22 / .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}
.brand:hover { color: var(--fg); }
.brand em { font-style: normal; color: var(--primary); }
.brand img { flex: none; border-radius: 8px; }
.nav {
  display: flex;
  gap: 20px;
  margin-left: 8px;
}
.nav a { color: var(--fg-muted); font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
.account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
}
.account .who {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
.account .who strong { font-size: .9rem; }
.account .who small { color: var(--fg-muted); font-size: .8rem; }

@media (max-width: 720px) {
  .nav { display: none; }
  .account .who { display: none; }
}

/* ---- Buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); color: var(--on-primary); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { border-color: var(--fg-muted); color: var(--fg); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: .85rem; }
.btn-steam {
  background: #171a21;
  color: #fff;
  border-color: #3d4450;
}
.btn-steam:hover:not(:disabled) { background: #1f2430; border-color: #66c0f4; color: #fff; }
.btn-block { width: 100%; }

/* ---- Sections ---------------------------------------------------------- */

main { flex: 1; }

section { padding: 72px 0; }
section + section { border-top: 1px solid var(--line); }

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
.section-lead { max-width: 40rem; margin: 12px 0 40px; color: var(--fg-muted); }

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

/* ---- Credit packs ------------------------------------------------------ */

.packs {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.pack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pack.featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.pack .tag {
  position: absolute;
  top: -11px;
  left: 20px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pack .amount { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.pack .amount small { display: block; margin-top: 6px; color: var(--fg-muted); font-size: .85rem; font-weight: 500; letter-spacing: 0; }
.pack .price { font-size: 1.25rem; font-weight: 700; }
.pack .unit { color: var(--fg-faint); font-size: .8rem; font-family: var(--mono); }
.pack .btn { margin-top: auto; }

/* ---- Notices ----------------------------------------------------------- */

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--fg-muted);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  font-size: .95rem;
}
.notice.ok { border-left-color: var(--ok); }
.notice.warn { border-left-color: var(--warn); }
.notice.danger { border-left-color: var(--danger); }
.notice.info { border-left-color: var(--ct); }
.notice p { margin: 0; }
.notice .close {
  margin-left: auto;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--fg-muted);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

/* ---- Status pill (the deployment test, see index.html) ------------------ */

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-faint);
  font-size: .8rem;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fg-faint);
  flex: none;
  transition: background .3s;
}
.dot.up { background: var(--ok); box-shadow: 0 0 0 3px rgb(62 207 142 / .18); }
.dot.down { background: var(--danger); box-shadow: 0 0 0 3px rgb(240 86 79 / .18); }

/* ---- Footer ------------------------------------------------------------ */

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--fg-faint); font-size: .85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.site-footer .spacer { margin-left: auto; }
.site-footer a { color: var(--fg-muted); }
.site-footer a:hover { color: var(--fg); }

.muted { color: var(--fg-muted); }
.flush { margin: 0; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

.skeleton {
  display: inline-block;
  min-width: 4ch;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  color: transparent;
}
@keyframes shimmer { to { background-position: -200% 0; } }

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