/* GM Copilot — marketing site
   "Grimoire engine" web system. Obsidian + candlelight.
   Reuses the app's design tokens, scaled up for a full web page.
   Fonts: Manrope + JetBrains Mono (loaded per page via <link>).
   ============================================================ */

:root {
  /* ── Obsidian (default, dark) ─────────────────────────── */
  --bg: #15131c;
  --bg-deep: #0e0d14;
  --surface-1: #1b1825;
  --surface-2: #211e2d;
  --surface-3: #292536;
  --surface-inset: #131019;

  --text: #ece6da;
  --text-2: #b3aa99;
  --text-3: #7e7666;
  --text-4: #585061;

  --gold: #e0a86a;
  --gold-bright: #f3c68c;
  --gold-deep: #b7823f;
  --amethyst: #9a8be0;
  --emerald: #5fbe8c;
  --garnet: #de6760;

  --c-char: #e0a86a;
  --c-loc: #5fb6a8;
  --c-scene: #da7c97;
  --c-lore: #9a8be0;
  --c-faction: #6e9bd9;
  --c-session: #a9be7c;

  --accent: var(--gold);
  --accent-bright: var(--gold-bright);
  --accent-rgb: 224, 168, 106;

  --border: rgba(224, 168, 106, 0.13);
  --border-strong: rgba(224, 168, 106, 0.26);
  --border-cool: rgba(255, 255, 255, 0.07);
  --hairline: rgba(255, 255, 255, 0.05);

  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 16px;
  --radius-xl: 22px;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.025) inset, 0 14px 40px -18px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 30px 80px -22px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--border);
  --glow-candle: 0 0 80px -16px rgba(var(--accent-rgb), 0.42);
  --glow-soft: 0 0 0 1px var(--border-strong), 0 8px 30px -12px rgba(var(--accent-rgb), 0.3);

  --font-display: "Manrope", system-ui, sans-serif;
  --font-ui: "Manrope", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1200px;
  --nav-h: 68px;
}

/* parchment (light) */
[data-theme="parchment"] {
  --bg: #e7ddc6;
  --bg-deep: #ddd2b8;
  --surface-1: #f0e8d5;
  --surface-2: #f7f1e2;
  --surface-3: #fcf8ec;
  --surface-inset: #e3d9c2;

  --text: #2a2316;
  --text-2: #6a5f49;
  --text-3: #93876c;
  --text-4: #b4a888;

  --gold: #b07a2e;
  --gold-bright: #c9923f;
  --gold-deep: #8a5e1f;

  --c-char: #b07a2e;
  --c-loc: #3e8c7e;
  --c-scene: #b85574;
  --c-lore: #6e5db8;
  --c-faction: #4574b0;
  --c-session: #6e8a3e;

  --border: rgba(120, 84, 30, 0.22);
  --border-strong: rgba(120, 84, 30, 0.36);
  --border-cool: rgba(60, 40, 10, 0.12);
  --hairline: rgba(60, 40, 10, 0.09);

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 14px 34px -16px rgba(80, 60, 30, 0.4);
  --shadow-pop: 0 30px 70px -22px rgba(80, 60, 30, 0.4), 0 0 0 1px var(--border);
  --glow-candle: 0 0 70px -20px rgba(var(--accent-rgb), 0.3);
}

/* accent overrides (driven by Tweaks panel) */
[data-accent="amethyst"] {
  --accent: var(--amethyst);
  --accent-bright: #b6a9f0;
  --accent-rgb: 154, 139, 224;
}
[data-accent="emerald"] {
  --accent: var(--emerald);
  --accent-bright: #82d9ac;
  --accent-rgb: 95, 190, 140;
}
[data-theme="parchment"][data-accent="amethyst"] {
  --accent: #6e5db8;
  --accent-bright: #8473c8;
  --accent-rgb: 110, 93, 184;
}
[data-theme="parchment"][data-accent="emerald"] {
  --accent: #3f8e63;
  --accent-bright: #4fa577;
  --accent-rgb: 63, 142, 99;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ambient page background — candlelight wash + vignette */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(70% 50% at 50% -8%, rgba(var(--accent-rgb), 0.1), transparent 60%),
    radial-gradient(80% 60% at 90% 8%, rgba(154, 139, 224, 0.07), transparent 55%),
    radial-gradient(90% 70% at 8% 30%, rgba(95, 182, 168, 0.045), transparent 55%), var(--bg-deep);
}
.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 360px 60px rgba(0, 0, 0, 0.5);
}
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}
[data-theme="parchment"] .grain {
  opacity: 0.5;
  mix-blend-mode: multiply;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── layout ─────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}
.wrap-narrow {
  max-width: 880px;
}
.section {
  padding: 96px 0;
  position: relative;
}
.section-sm {
  padding: 60px 0;
}

/* ── typography ─────────────────────────────────────────── */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.04;
  font-size: clamp(40px, 6vw, 76px);
  margin: 0;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  margin: 0;
}
.h1 {
  font-size: clamp(34px, 4.5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.022em;
  line-height: 1.1;
}
.h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.018em;
  line-height: 1.14;
}
.h3 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.lead {
  font-size: clamp(17px, 1.6vw, 21px);
  color: var(--text-2);
  line-height: 1.6;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.eyebrow.muted {
  color: var(--text-3);
}
.mono {
  font-family: var(--font-mono);
}
.muted {
  color: var(--text-2);
}
.faint {
  color: var(--text-3);
}
.tnum {
  font-variant-numeric: tabular-nums;
}
.balance {
  text-wrap: balance;
}
.pretty {
  text-wrap: pretty;
}

/* sigil rule divider */
.sigil-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--accent);
  opacity: 0.6;
}
.sigil-rule::before,
.sigil-rule::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--border-strong));
}
.sigil-rule::after {
  background: linear-gradient(90deg, var(--border-strong), transparent);
}

/* ── buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-s);
  border: 1px solid var(--border-cool);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.08s,
    box-shadow 0.2s;
}
.btn:hover {
  background: var(--surface-3);
  border-color: var(--border);
}
.btn:active {
  transform: translateY(1px);
}
.btn-lg {
  height: 54px;
  padding: 0 28px;
  font-size: 16.5px;
  border-radius: var(--radius);
}
.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13.5px;
}
.btn-block {
  width: 100%;
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-outline:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}
.btn-primary {
  background: linear-gradient(165deg, var(--accent-bright), var(--accent));
  border-color: transparent;
  color: #211603;
  font-weight: 700;
  box-shadow:
    0 8px 22px -10px rgba(var(--accent-rgb), 0.85),
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
}
.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow:
    0 14px 30px -10px rgba(var(--accent-rgb), 0.95),
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
}
.btn-primary:active {
  transform: translateY(0);
}
[data-theme="parchment"] .btn-primary {
  color: #fff;
}
.btn-danger {
  color: var(--garnet);
  border-color: rgba(222, 103, 96, 0.3);
  background: rgba(222, 103, 96, 0.06);
}
.btn-danger:hover {
  background: rgba(222, 103, 96, 0.12);
}

/* ── chips / badges ─────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-cool);
  background: var(--surface-1);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.chip-accent {
  border-color: var(--border-strong);
  color: var(--accent-bright);
  background: rgba(var(--accent-rgb), 0.08);
}
.dot-cat {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat, var(--accent));
  flex: none;
}
.chip-cat {
  border-color: color-mix(in srgb, var(--cat) 40%, transparent);
  color: var(--cat);
  background: color-mix(in srgb, var(--cat) 11%, transparent);
}
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-pro {
  background: linear-gradient(165deg, var(--gold-bright), var(--gold));
  color: #211603;
}
.badge-soft {
  background: var(--surface-3);
  color: var(--text-3);
}

/* ── cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
}
.card-pad {
  padding: 26px;
}

/* ── nav ────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bg-deep) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}
.nav .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1280px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 17px;
}
.brand .mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, #3a3350, #211d30);
  border: 1px solid var(--border-strong);
  box-shadow: var(--glow-soft);
  color: var(--gold-bright);
}
[data-theme="parchment"] .brand .mark {
  background: linear-gradient(155deg, #f7f1e2, #e7ddc6);
}
.brand .mark.sig {
  background: linear-gradient(155deg, #322c46, #1c1828);
}
[data-theme="parchment"] .brand .mark.sig {
  background: linear-gradient(155deg, #f7f1e2, #e7ddc6);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
}
.nav-link {
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-2);
  transition:
    background 0.14s,
    color 0.14s;
}
.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-link.active {
  color: var(--text);
}
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid var(--border-cool);
  background: var(--surface-2);
  color: var(--text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    background 0.14s,
    color 0.14s;
}
.theme-toggle:hover {
  background: var(--surface-3);
  color: var(--accent-bright);
}

/* mobile nav toggle */
.nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid var(--border-cool);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  place-items: center;
}

/* ── app-window mock frame (for screenshots) ────────────── */
.winframe {
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 1px solid var(--border-cool);
  background: var(--bg);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 50px 120px -34px rgba(0, 0, 0, 0.9),
    var(--glow-candle);
}
.winframe-bar {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
}
.winframe-bar .tl {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.winframe-bar .tl.r {
  background: #e1685f;
}
.winframe-bar .tl.y {
  background: #e0b14e;
}
.winframe-bar .tl.g {
  background: #5fbe7e;
}
.winframe-bar .ttl {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}
.winframe img {
  display: block;
  width: 100%;
  height: auto;
}

/* striped placeholder for missing imagery */
.ph {
  background-image: repeating-linear-gradient(
    45deg,
    var(--surface-1),
    var(--surface-1) 10px,
    var(--surface-2) 10px,
    var(--surface-2) 20px
  );
  border: 1px solid var(--border-cool);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ── feature card ───────────────────────────────────────── */
.feat {
  position: relative;
  overflow: hidden;
  padding: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-l);
  transition:
    transform 0.2s cubic-bezier(0.2, 0.7, 0.3, 1),
    border-color 0.2s,
    box-shadow 0.25s;
}
.feat:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--cat, var(--accent)) 40%, var(--border));
  box-shadow:
    var(--shadow-card),
    0 0 36px -16px var(--cat, var(--accent));
}
.feat-ico {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: var(--cat, var(--accent));
  background: color-mix(in srgb, var(--cat, var(--accent)) 13%, var(--surface-inset));
  border: 1px solid color-mix(in srgb, var(--cat, var(--accent)) 30%, transparent);
}
.feat h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.feat p {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.6;
}

/* ── forms ──────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.input,
.textarea,
.select {
  width: 100%;
  border-radius: var(--radius-s);
  border: 1px solid var(--border-cool);
  background: var(--surface-inset);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  padding: 0 14px;
  height: 46px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.textarea {
  height: auto;
  padding: 13px 14px;
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-4);
}
.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237E7666' d='M0 0h12L6 8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.input-icon {
  position: relative;
}
.input-icon .input {
  padding-left: 42px;
}
.input-icon svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
}
.hint {
  font-size: 13px;
  color: var(--text-3);
}

/* segmented tabs */
.seg {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  background: var(--surface-inset);
  border: 1px solid var(--border-cool);
  border-radius: var(--radius);
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}
.seg button.on {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

/* ── auth split layout ──────────────────────────────────── */
.auth {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-aside {
  position: relative;
  overflow: hidden;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--hairline);
  background: linear-gradient(160deg, var(--surface-1), var(--bg-deep));
}
.auth-form {
  display: grid;
  place-items: center;
  padding: 56px 28px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}

/* ── pricing ────────────────────────────────────────────── */
.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: stretch;
}
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
}
.plan.featured {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card), var(--glow-candle);
}
.plan.featured::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-l);
  padding: 1px;
  background: linear-gradient(160deg, var(--accent-bright), transparent 50%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.plan-price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 44px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.plan-feats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plan-feats li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 14.5px;
  color: var(--text-2);
}
.plan-feats li svg {
  flex: none;
  margin-top: 3px;
  color: var(--emerald);
}
.plan-feats li.off {
  color: var(--text-4);
}
.plan-feats li.off svg {
  color: var(--text-4);
}

/* ── footer ─────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 56px 0 40px;
  margin-top: 40px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.18), transparent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 16px;
}
.footer a {
  display: block;
  color: var(--text-2);
  font-size: 14.5px;
  padding: 5px 0;
  transition: color 0.14s;
}
.footer a:hover {
  color: var(--accent-bright);
}
.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-3);
  font-size: 13px;
}

/* ── dashboard / admin shell ────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: calc(100vh - var(--nav-h));
}
.sidebar {
  border-right: 1px solid var(--hairline);
  padding: 24px 16px;
  background: linear-gradient(180deg, var(--surface-1), var(--bg-deep));
}
.side-group {
  margin-bottom: 26px;
}
.side-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 12px 10px;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.14s,
    color 0.14s;
}
.side-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.side-item.active {
  background: var(--surface-2);
  color: var(--accent-bright);
}
.side-item svg {
  flex: none;
}
.content {
  padding: 36px 40px;
  min-width: 0;
}

/* stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.stat {
  padding: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-l);
}
.stat .k {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.stat .v {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.02em;
  margin-top: 8px;
}
.stat .d {
  font-size: 13px;
  margin-top: 4px;
}
.up {
  color: var(--emerald);
}
.down {
  color: var(--garnet);
}

/* table */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tbl th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
}
.tbl td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  color: var(--text-2);
}
.tbl tr:hover td,
.tbl tbody tr:hover td {
  background: var(--surface-1);
}
.tbl .who {
  display: flex;
  align-items: center;
  gap: 11px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #211603;
  background: linear-gradient(155deg, var(--gold-bright), var(--gold-deep));
  flex: none;
}
.avatar.am {
  background: linear-gradient(155deg, #b6a9f0, #6e5db8);
  color: #fff;
}
.avatar.em {
  background: linear-gradient(155deg, #82d9ac, #3f8e63);
  color: #07140d;
}
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}
.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px 0 currentColor;
}

/* progress bar */
.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-inset);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
}

/* mini bar chart */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
}
.chart .col {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.85), rgba(var(--accent-rgb), 0.25));
  min-height: 4px;
  transition: filter 0.15s;
}
.chart .col:hover {
  filter: brightness(1.2);
}

/* helpers */
.row {
  display: flex;
}
.col {
  display: flex;
  flex-direction: column;
}
.ai {
  align-items: center;
}
.jc {
  justify-content: center;
}
.jb {
  justify-content: space-between;
}
.f1 {
  flex: 1;
  min-width: 0;
}
.wrapf {
  flex-wrap: wrap;
}
.g1 {
  gap: 6px;
}
.g2 {
  gap: 10px;
}
.g3 {
  gap: 14px;
}
.g4 {
  gap: 18px;
}
.g5 {
  gap: 24px;
}
.g6 {
  gap: 32px;
}
.mt1 {
  margin-top: 8px;
}
.mt2 {
  margin-top: 16px;
}
.mt3 {
  margin-top: 24px;
}
.mt4 {
  margin-top: 36px;
}
.mt5 {
  margin-top: 48px;
}
.mb1 {
  margin-bottom: 8px;
}
.mb2 {
  margin-bottom: 16px;
}
.mb3 {
  margin-bottom: 24px;
}
.mb4 {
  margin-bottom: 36px;
}
.mb5 {
  margin-bottom: 48px;
}
.ml-auto {
  margin-left: auto;
}
.center {
  text-align: center;
}
.divider {
  height: 1px;
  background: var(--hairline);
  border: 0;
  margin: 0;
}

/* ── entrance motion ────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes candleFlicker {
  0% {
    opacity: 0.72;
  }
  12% {
    opacity: 0.9;
  }
  26% {
    opacity: 0.66;
  }
  38% {
    opacity: 0.84;
  }
  52% {
    opacity: 0.74;
  }
  63% {
    opacity: 0.95;
  }
  78% {
    opacity: 0.7;
  }
  89% {
    opacity: 0.86;
  }
  100% {
    opacity: 0.75;
  }
}
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
.reveal {
  opacity: 0;
}
.reveal.in {
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
  }
}

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav-links {
    display: none;
  }
  .nav-burger {
    display: grid;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-aside {
    display: none;
  }
  .price-grid {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin: 0 auto;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .content {
    padding: 28px 20px;
  }
}
@media (max-width: 600px) {
  .section {
    padding: 64px 0;
  }
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .wrap {
    padding: 0 18px;
  }
}
