/* ============================================================
   OmniTCG design system — v0.2
   Dark ink ground · foil-gold accent · steel secondary.
   Marketing chrome + logged-in app shell + component library.
   ============================================================ */
:root {
  --bg: #0a0d11;
  --bg-2: #0d1116;
  --panel: #12171e;
  --panel-2: #161c24;
  --elev: #1a222c;
  --surface: rgba(255, 255, 255, 0.028);
  --surface-2: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #edeae1;
  --ink-dim: #b9c1c9;
  --muted: #838f9b;
  --faint: #5a6572;
  --gold: #e6b54a;
  --gold-2: #d4a641;
  --gold-soft: #f0d18a;
  --steel: #7ba6c9;
  --violet: #a99be6;
  --pos: #56c08a;
  --neg: #e0736a;
  --warn: #e6b54a;
  --danger: #e0736a;
  --radius: 16px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --pill: 999px;
  --font: "Inter", "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 8px 24px -12px rgba(0, 0, 0, 0.5);
  --foil: linear-gradient(105deg, #f0d18a 0%, #e6b54a 34%, #d4a641 55%, #7ba6c9 120%);
  --foil-text: linear-gradient(100deg, #f5dc9a 0%, #e6b54a 45%, #cf9f3d 100%);
  --glow-gold: 0 0 0 1px rgba(230, 181, 74, 0.28), 0 12px 34px -12px rgba(230, 181, 74, 0.4);
  --sidebar-w: 244px;
  --topbar-h: 60px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}
:root[data-theme="light"], html[data-theme="light"] {
  --bg: #f2f0ea;
  --bg-2: #ece9e1;
  --panel: #ffffff;
  --panel-2: #faf9f5;
  --elev: #ffffff;
  --surface: rgba(20, 24, 28, 0.028);
  --surface-2: rgba(20, 24, 28, 0.06);
  --line: rgba(20, 24, 28, 0.1);
  --line-2: rgba(20, 24, 28, 0.2);
  --ink: #1b2026;
  --ink-dim: #333c45;
  --muted: #5d6871;
  --faint: #8a949d;
  --gold: #a67c1c;
  --gold-2: #916c17;
  --gold-soft: #7d5d13;
  --steel: #3a6b96;
  --violet: #6d5cc0;
  --pos: #2e8256;
  --neg: #b8483f;
  --shadow: 0 20px 50px -20px rgba(40, 44, 50, 0.28);
  --shadow-sm: 0 8px 22px -14px rgba(40, 44, 50, 0.24);
  --glow-gold: 0 0 0 1px rgba(166, 124, 28, 0.3), 0 12px 30px -14px rgba(166, 124, 28, 0.35);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f2f0ea; --bg-2: #ece9e1; --panel: #ffffff; --panel-2: #faf9f5; --elev: #ffffff;
    --surface: rgba(20, 24, 28, 0.028); --surface-2: rgba(20, 24, 28, 0.06);
    --line: rgba(20, 24, 28, 0.1); --line-2: rgba(20, 24, 28, 0.2);
    --ink: #1b2026; --ink-dim: #333c45; --muted: #5d6871; --faint: #8a949d;
    --gold: #a67c1c; --gold-2: #916c17; --gold-soft: #7d5d13; --steel: #3a6b96; --violet: #6d5cc0;
    --pos: #2e8256; --neg: #b8483f;
    --shadow: 0 20px 50px -20px rgba(40, 44, 50, 0.28); --shadow-sm: 0 8px 22px -14px rgba(40, 44, 50, 0.24);
    --glow-gold: 0 0 0 1px rgba(166, 124, 28, 0.3), 0 12px 30px -14px rgba(166, 124, 28, 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--steel); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { letter-spacing: -0.02em; line-height: 1.12; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 800; }
h2 { font-size: 1.4rem; font-weight: 750; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0 0 1rem; }
.omni, .foil-text {
  background: var(--foil-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.muted { color: var(--muted); }
.dim { color: var(--ink-dim); }
.faint { color: var(--faint); }
.small { font-size: 0.82rem; }
.tiny { font-size: 0.72rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.eyebrow {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 0.5rem;
}
.eyebrow a { color: inherit; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.grow { flex: 1; }
.hide { display: none !important; }
.divider { height: 1px; background: var(--line); border: 0; margin: 1.4rem 0; }

/* -------------------------------- buttons -------------------------------- */
.btn, button.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  font: inherit; font-weight: 650; font-size: 0.9rem; cursor: pointer; text-decoration: none;
  padding: 0.6rem 1.15rem; border-radius: var(--pill); border: 1px solid transparent;
  transition: transform 0.12s var(--ease), box-shadow 0.16s var(--ease), background 0.16s, border-color 0.16s;
  white-space: nowrap; line-height: 1;
}
.btn svg { width: 1.05em; height: 1.05em; }
.btn-primary { background: var(--foil); color: #17130a; box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--glow-gold); text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--gold-2); text-decoration: none; }
.btn-solid { background: var(--elev); color: var(--ink); border-color: var(--line-2); }
.btn-solid:hover { border-color: var(--gold-2); text-decoration: none; }
.btn-danger { background: rgba(224, 115, 106, 0.12); color: var(--neg); border-color: rgba(224, 115, 106, 0.4); }
.btn-danger:hover { background: rgba(224, 115, 106, 0.2); text-decoration: none; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.linklike {
  background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0;
}
.linklike:hover { color: var(--ink); }
.iconbtn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--pill);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-dim); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s; position: relative;
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); }
.iconbtn svg { width: 19px; height: 19px; }

/* -------------------------------- forms -------------------------------- */
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); width: 100%;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 0.6rem 0.85rem;
  transition: border-color 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); background: var(--surface-2); }
select { appearance: none; background-image: none; cursor: pointer; }
label.field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.8rem; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--ink-dim); cursor: pointer; }
.check input { width: auto; }
textarea { resize: vertical; min-height: 80px; }

/* -------------------------------- badges / chips -------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.68rem; font-weight: 650;
  letter-spacing: 0.04em; text-transform: uppercase; padding: 0.18rem 0.5rem; border-radius: var(--pill);
  background: var(--surface-2); color: var(--ink-dim); border: 1px solid var(--line);
}
.badge.gold { color: var(--gold); border-color: rgba(230, 181, 74, 0.34); background: rgba(230, 181, 74, 0.1); }
.badge.pos { color: var(--pos); border-color: rgba(86, 192, 138, 0.34); background: rgba(86, 192, 138, 0.1); }
.badge.neg { color: var(--neg); border-color: rgba(224, 115, 106, 0.34); background: rgba(224, 115, 106, 0.1); }
.badge.violet { color: var(--violet); border-color: rgba(169, 155, 230, 0.34); background: rgba(169, 155, 230, 0.1); }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; padding: 0.34rem 0.8rem;
  border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-dim);
  cursor: pointer; text-decoration: none; transition: all 0.15s;
}
.chip:hover { border-color: var(--gold-2); color: var(--ink); text-decoration: none; }
.chip.active { background: var(--foil); color: #17130a; border-color: transparent; font-weight: 650; }
.chip-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.gamechip { font-size: 0.66rem; padding: 0.14rem 0.45rem; border-radius: 5px; font-weight: 700; letter-spacing: 0.04em; }

/* -------------------------------- panels / cards -------------------------------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem;
}
.panel.tight { padding: 1rem 1.1rem; }
.panel.glass {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  backdrop-filter: blur(8px); box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.panel-head h2, .panel-head h3 { margin: 0; }
.hairline { border: 1px solid var(--line); }

/* -------------------------------- stat tiles -------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.9rem; }
.stat {
  position: relative; padding: 1.1rem 1.2rem; border-radius: var(--radius); overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
}
.stat .label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat .value { font-family: var(--mono); font-size: 1.7rem; font-weight: 700; margin-top: 0.3rem; letter-spacing: -0.02em; }
.stat .sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
.stat.hero { border-color: rgba(230, 181, 74, 0.4); box-shadow: var(--glow-gold); background: linear-gradient(155deg, rgba(230, 181, 74, 0.08), var(--panel) 55%); }
.stat.hero .value { color: var(--gold-soft); font-size: 2.1rem; }
.stat .spark { position: absolute; inset: auto 0 0 0; height: 42px; opacity: 0.7; }

/* -------------------------------- tables -------------------------------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
thead th {
  font-family: var(--mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); text-align: left; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; background: var(--panel); z-index: 1;
}
tbody td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.12s; }
tbody tr:hover td { background: var(--surface); }
td.num, th.num { text-align: right; }

/* -------------------------------- card + set grids -------------------------------- */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1.1rem; }
.cardgrid.dense { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 0.8rem; }
.ctile { display: flex; flex-direction: column; gap: 0.4rem; text-decoration: none; color: var(--ink); }
.ctile:hover { text-decoration: none; }
.ctile .frame {
  position: relative; border-radius: 12px; overflow: hidden; background: var(--bg-2);
  aspect-ratio: 63 / 88; box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.ctile .frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ctile:hover .frame { transform: translateY(-5px) scale(1.015); box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.7); }
.ctile .cname { font-weight: 600; font-size: 0.86rem; line-height: 1.2; }
.ctile .cmeta { font-size: 0.74rem; color: var(--muted); }
.ctile .cprice { font-family: var(--mono); font-size: 0.82rem; color: var(--gold-soft); font-weight: 600; }
.frame .owned-badge, .frame .corner {
  position: absolute; top: 6px; right: 6px; background: rgba(10, 13, 17, 0.82); color: var(--pos);
  border-radius: var(--pill); font-size: 0.66rem; padding: 0.12rem 0.44rem; font-weight: 700; backdrop-filter: blur(6px);
}
.frame .qtypill { left: 6px; right: auto; color: var(--gold-soft); }
.ctile.owned .frame { outline: 2px solid rgba(86, 192, 138, 0.6); outline-offset: -2px; }
.frame.holo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: 0.5;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.5) 45%, transparent 60%);
}

.setgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.95rem; }
.settile {
  display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; padding: 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink);
  text-decoration: none; transition: transform 0.16s var(--ease), border-color 0.16s, background 0.16s;
}
.settile:hover { transform: translateY(-3px); border-color: rgba(230, 181, 74, 0.45); background: var(--panel-2); text-decoration: none; }
.settile .logo { height: 40px; display: grid; place-items: center; }
.settile .logo img { max-height: 40px; object-fit: contain; }
.settile .sname { font-weight: 650; font-size: 0.92rem; }

/* -------------------------------- progress -------------------------------- */
.progress { height: 7px; border-radius: var(--pill); background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--foil); border-radius: inherit; transition: width 0.6s var(--ease); }
.ring { --p: 0; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring::before { content: ""; position: absolute; width: 42px; height: 42px; border-radius: 50%; background: var(--panel); }
.ring b { position: relative; font-size: 0.74rem; font-family: var(--mono); }

/* -------------------------------- avatars -------------------------------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center;
  background: var(--foil); color: #17130a; font-weight: 750; font-size: 0.8rem; overflow: hidden; flex: none;
}
.avatar.lg { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar.sm { width: 26px; height: 26px; font-size: 0.66rem; }

/* -------------------------------- flashes / toasts -------------------------------- */
.toast-wrap { position: fixed; top: 74px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 0.6rem; max-width: min(92vw, 380px); }
.toast {
  padding: 0.8rem 1rem; border-radius: var(--radius-sm); font-size: 0.9rem; border: 1px solid var(--line-2);
  background: var(--elev); box-shadow: var(--shadow); display: flex; gap: 0.6rem; align-items: flex-start;
  animation: toastin 0.32s var(--ease); border-left: 3px solid var(--gold);
}
.toast.ok { border-left-color: var(--pos); }
.toast.error { border-left-color: var(--neg); }
@keyframes toastin { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* -------------------------------- marketing chrome -------------------------------- */
.mkt-head {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1.4rem;
  padding: 0.85rem clamp(1rem, 5vw, 2.6rem); background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.28rem; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 0.1rem; }
.mkt-head nav { display: flex; align-items: center; gap: 1.2rem; margin-left: auto; }
.mkt-head nav a { color: var(--muted); font-size: 0.92rem; }
.mkt-head nav a:hover { color: var(--ink); text-decoration: none; }
.mkt-main { width: min(74rem, 100% - 2.4rem); margin: 0 auto; padding: 2rem 0 5rem; }
.mkt-foot {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 2rem clamp(1rem, 5vw, 2.6rem); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8rem;
}
.mkt-foot a { color: var(--muted); }

/* -------------------------------- app shell -------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg-2);
  border-right: 1px solid var(--line); padding: 1rem 0.8rem; display: flex; flex-direction: column; gap: 0.2rem;
}
.sidebar .brand { padding: 0.4rem 0.7rem 1rem; font-size: 1.24rem; }
.nav-group { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--faint); padding: 0.9rem 0.8rem 0.35rem; }
.nav-link {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.75rem; border-radius: var(--radius-sm);
  color: var(--ink-dim); font-size: 0.9rem; font-weight: 500; text-decoration: none; transition: background 0.14s, color 0.14s;
}
.nav-link:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--gold); }
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav-link .count { margin-left: auto; font-size: 0.68rem; background: var(--surface-2); color: var(--muted); padding: 0.05rem 0.42rem; border-radius: var(--pill); }
.nav-link.active .count { background: rgba(230, 181, 74, 0.18); color: var(--gold); }

.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 0.8rem;
  padding: 0 clamp(1rem, 3vw, 1.8rem); background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.topbar .searchbtn {
  display: flex; align-items: center; gap: 0.6rem; flex: 1; max-width: 460px; padding: 0.5rem 0.9rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); color: var(--faint);
  cursor: pointer; font-size: 0.88rem;
}
.topbar .searchbtn kbd { margin-left: auto; font-family: var(--mono); font-size: 0.68rem; background: var(--surface-2); padding: 0.1rem 0.4rem; border-radius: 5px; border: 1px solid var(--line); }
.appmain { padding: clamp(1.1rem, 3vw, 2rem); max-width: 1240px; width: 100%; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { margin: 0; }
.hamburger { display: none; }

/* menus / dropdowns */
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--elev);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 0.5rem;
  z-index: 60; display: none;
}
.menu-pop.open { display: block; animation: pop 0.16s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left;
  padding: 0.55rem 0.7rem; border-radius: var(--radius-xs); color: var(--ink-dim); font-size: 0.88rem; background: none; border: 0; cursor: pointer; text-decoration: none; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--neg); border: 2px solid var(--bg); }

/* empty states */
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty .emoji { font-size: 2.4rem; display: block; margin-bottom: 0.6rem; opacity: 0.8; }

/* command palette / modal */
.overlay { position: fixed; inset: 0; background: rgba(4, 6, 9, 0.62); backdrop-filter: blur(4px); z-index: 120; display: none; }
.overlay.open { display: block; }
.modal {
  position: fixed; z-index: 130; left: 50%; top: 12vh; transform: translateX(-50%); width: min(620px, 94vw);
  background: var(--elev); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow);
  display: none; overflow: hidden;
}
.modal.open { display: block; animation: pop 0.18s var(--ease); }
.modal .searchrow { display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); }
.modal .searchrow input { border: 0; background: none; font-size: 1.05rem; }
.modal .results { max-height: 54vh; overflow-y: auto; padding: 0.4rem; }
.res-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.7rem; border-radius: var(--radius-xs); cursor: pointer; color: var(--ink); text-decoration: none; }
.res-item:hover, .res-item.active { background: var(--surface-2); text-decoration: none; }
.res-item img { width: 30px; height: 42px; object-fit: contain; border-radius: 4px; background: var(--bg-2); }

/* tabs */
.tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; overflow-x: auto; }
.tab { padding: 0.6rem 0.9rem; color: var(--muted); font-size: 0.9rem; font-weight: 550; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--ink); border-bottom-color: var(--gold); }

/* auth card */
.authwrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1.2rem; }
.authbox { width: min(26rem, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.authbox form { display: flex; flex-direction: column; gap: 0.9rem; }

/* landing bits */
.hero { padding: clamp(2.5rem, 9vh, 6rem) 0 2rem; }
.hero h1 { font-size: clamp(2.4rem, 6.5vw, 4.4rem); font-weight: 850; line-height: 1.02; }
.hero .lede { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--ink-dim); max-width: 40rem; }
.hero .lede strong { color: var(--gold-soft); }
.pillrow { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1.6rem 0; }
.glowcard {
  position: relative; border-radius: var(--radius); padding: 1.4rem 1.6rem; background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.glowcard::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(120deg, rgba(230,181,74,0.6), rgba(123,166,201,0.25) 45%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.pricerow { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.pricerow:first-of-type { border-top: 0; }
.pricerow small { display: block; color: var(--muted); font-size: 0.74rem; }
.pricerow b { font-family: var(--mono); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.pricerow.local span, .pricerow.local b { color: var(--gold-soft); }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.feat { padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: transform 0.16s var(--ease), border-color 0.16s; }
.feat:hover { transform: translateY(-3px); border-color: var(--line-2); }
.feat .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgba(230,181,74,0.12); color: var(--gold); margin-bottom: 0.8rem; }
.feat .ic svg { width: 22px; height: 22px; }
.feat h3 { color: var(--gold-soft); font-size: 1rem; }
.feat p { color: var(--muted); font-size: 0.9rem; margin: 0; }
.logos { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: center; opacity: 0.7; font-family: var(--mono); font-size: 0.8rem; }

/* card detail page */
.cardpage { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; gap: clamp(1.4rem, 4vw, 3rem); align-items: start; }
@media (max-width: 760px) { .cardpage { grid-template-columns: 1fr; } .cardhero { max-width: 320px; margin: 0 auto; } }
.cardhero { position: relative; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 63/88; background: var(--bg-2); }
.cardhero img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.3s var(--ease); }
.cardhero:hover img { transform: scale(1.03); }
.metricgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.7rem; }
.metric { padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.metric .m-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.metric .m-val { font-family: var(--mono); font-size: 1.35rem; font-weight: 700; }
.metric.local { border-color: rgba(230,181,74,0.4); }
.metric.local .m-val { color: var(--gold-soft); }

/* charts */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { width: 100%; display: block; }
.legend { display: flex; gap: 0.9rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }

/* toolbar */
.toolbar { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.2rem; }
.viewtoggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--pill); overflow: hidden; }
.viewtoggle a { padding: 0.4rem 0.7rem; color: var(--muted); font-size: 0.82rem; }
.viewtoggle a.active { background: var(--surface-2); color: var(--ink); }
.bulkbar { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; padding: 0.8rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* misc list rows */
.listrow { display: flex; align-items: center; gap: 0.9rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.listrow:last-child { border-bottom: 0; }
.listrow img.thumb { width: 38px; height: 53px; object-fit: contain; border-radius: 5px; background: var(--bg-2); flex: none; }
.mini-thumb { width: 30px; height: 42px; object-fit: contain; border-radius: 4px; background: var(--bg-2); }

.prose { max-width: 46rem; }
.prose h2 { color: var(--gold-soft); font-size: 1.2rem; margin-top: 2rem; }
.prose li { margin-bottom: 0.4rem; }
.prose code { background: var(--surface-2); padding: 0.1rem 0.35rem; border-radius: 5px; font-family: var(--mono); font-size: 0.85em; }

/* responsive: collapse sidebar */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 260px; z-index: 110; transform: translateX(-100%);
    transition: transform 0.24s var(--ease); box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .hamburger { display: inline-grid; }
  .appmain { padding-bottom: 5rem; }
}
@media (max-width: 560px) {
  .stat .value { font-size: 1.4rem; }
  .page-head h1 { font-size: 1.5rem; }
}

/* ============================================================
   v0.2.1 — ULTRA-MODERN LAYER
   Deeper ground, layered glow, grain, motion, glass, bento,
   3D card tilt, mobile bottom nav. Overrides earlier rules.
   ============================================================ */
:root {
  --bg: #06080b;
  --bg-2: #0a0e13;
  --panel: #0e131a;
  --panel-2: #141a22;
  --glow: rgba(230, 181, 74, 0.5);
  --holo: linear-gradient(120deg, #f6d98a 0%, #e6b54a 25%, #7ba6c9 55%, #a99be6 80%, #f0d18a 100%);
  --sheen: linear-gradient(105deg, transparent 20%, rgba(255,255,255,0.14) 42%, rgba(255,255,255,0.28) 50%, rgba(255,255,255,0.14) 58%, transparent 80%);
}
:root[data-theme="light"] {
  --bg: #eef0f4; --bg-2: #e7e9ef; --panel: #ffffff; --panel-2: #f7f8fb;
  --glow: rgba(166, 124, 28, 0.35);
}

body {
  background:
    radial-gradient(1100px 640px at 88% -8%, rgba(123,166,201,0.13), transparent 55%),
    radial-gradient(900px 560px at -6% 8%, rgba(230,181,74,0.11), transparent 52%),
    radial-gradient(700px 700px at 50% 120%, rgba(169,155,230,0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
/* fine grain overlay for depth */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%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.4'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.app, .mkt-head, .mkt-main, .mkt-foot, .authwrap { position: relative; z-index: 1; }

/* --- motion --- */
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(var(--r,0deg)); } 50% { transform: translateY(-14px) rotate(var(--r,0deg)); } }
@keyframes glowpulse { 0%,100% { box-shadow: 0 0 0 1px rgba(230,181,74,0.22), 0 10px 40px -12px var(--glow); } 50% { box-shadow: 0 0 0 1px rgba(230,181,74,0.4), 0 18px 60px -10px var(--glow); } }
@keyframes shimmer { from { background-position: -180% 0; } to { background-position: 180% 0; } }
@keyframes revealUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal { opacity: 0; }
.reveal.in { animation: revealUp 0.7s var(--ease) forwards; }
.reveal.in.d1 { animation-delay: 0.08s; } .reveal.in.d2 { animation-delay: 0.16s; }
.reveal.in.d3 { animation-delay: 0.24s; } .reveal.in.d4 { animation-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; } .reveal.in { animation: none; } }

/* shimmering foil brand + headings */
.foil-text, .omni {
  background: var(--holo); background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite;
}

/* --- panels: glass + inner highlight --- */
.panel {
  background: linear-gradient(168deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012));
  border: 1px solid var(--line); border-radius: 18px; position: relative;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.panel::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent); pointer-events: none;
}
:root[data-theme="light"] .panel { background: var(--panel); box-shadow: var(--shadow-sm); }
:root[data-theme="light"] body::before { display: none; }

/* --- buttons: glow + sheen --- */
.btn-primary { position: relative; overflow: hidden; box-shadow: 0 8px 30px -10px var(--glow); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; background: var(--sheen); background-size: 220% 100%;
  background-position: -180% 0; opacity: 0; transition: opacity 0.2s;
}
.btn-primary:hover::after { opacity: 1; animation: shimmer 0.9s linear; }
.btn-primary:hover { box-shadow: var(--glow) 0 0 0 1px, 0 14px 44px -8px var(--glow); }

/* --- stat tiles: richer --- */
.stat { background: linear-gradient(165deg, rgba(255,255,255,0.045), rgba(255,255,255,0.01)); backdrop-filter: blur(6px); border-radius: 18px; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: -40% 40% auto -10%; height: 120px; background: radial-gradient(circle, rgba(230,181,74,0.10), transparent 70%); pointer-events: none; }
.stat.hero { animation: glowpulse 5.5s ease-in-out infinite; }
.stat .value { letter-spacing: -0.03em; }

/* --- bento grid --- */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.bento > * { grid-column: span 12; }
@media (min-width: 720px) {
  .col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; }
  .col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; }
  .col-9 { grid-column: span 9; } .col-12 { grid-column: span 12; }
}
.row-2 { grid-row: span 2; }

/* --- 3D card tilt + holo shine --- */
.tilt { transform-style: preserve-3d; transition: transform 0.2s var(--ease); will-change: transform; }
.tilt .shine {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; mix-blend-mode: overlay;
  background: radial-gradient(circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,0.55), transparent 45%);
  transition: opacity 0.2s;
}
.tilt:hover .shine { opacity: 0.9; }

/* floating hero cards */
.hero-cards { position: relative; height: 340px; perspective: 1200px; }
.hero-cards .hc {
  position: absolute; width: 168px; aspect-ratio: 63/88; border-radius: 12px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.75); border: 1px solid rgba(255,255,255,0.08);
  animation: floaty 7s ease-in-out infinite; background: var(--bg-2);
}
.hero-cards .hc img { width: 100%; height: 100%; object-fit: cover; }
.hero-cards .hc::after { content:""; position:absolute; inset:0; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.22) 48%, transparent 56%); }

/* --- hero (marketing) --- */
.hero h1 { letter-spacing: -0.04em; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.85rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 0.78rem; color: var(--ink-dim); }
.hero-eyebrow .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 10px var(--pos); }

/* section headings */
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; letter-spacing: -0.03em; }
.section-lede { color: var(--muted); max-width: 40rem; }

/* feature card upgrade */
.feat { background: linear-gradient(165deg, rgba(255,255,255,0.04), rgba(255,255,255,0.008)); border-radius: 18px; overflow: hidden; position: relative; }
.feat::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, rgba(230,181,74,0.35), transparent 45%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity 0.25s; }
.feat:hover::before { opacity: 1; }
.feat .ic { background: linear-gradient(140deg, rgba(230,181,74,0.22), rgba(230,181,74,0.06)); box-shadow: inset 0 0 0 1px rgba(230,181,74,0.2); }

/* mockup frame for dashboard preview */
.mock { border-radius: 18px; border: 1px solid var(--line-2); overflow: hidden; box-shadow: var(--shadow); background: var(--bg-2); }
.mock .bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.mock .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }

/* count-up nums use tabular */
[data-countup] { font-variant-numeric: tabular-nums; }

/* landing responsive splits */
.hero-split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem; align-items: center; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
@media (max-width: 860px) { .hero-split, .two-col { grid-template-columns: 1fr; } .hero-split .hero-cards { display: none; } }

/* --- MOBILE bottom nav --- */
.mobile-nav { display: none; }
@media (max-width: 860px) {
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px);
    border-top: 1px solid var(--line); padding: 0.4rem 0.3rem calc(0.4rem + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; padding: 0.35rem 0; color: var(--faint); font-size: 0.6rem; text-decoration: none; }
  .mobile-nav a svg { width: 22px; height: 22px; }
  .mobile-nav a.active { color: var(--gold); }
  .appmain { padding-bottom: 5.5rem !important; }
  .topbar .searchbtn span { display: none; }
  .topbar .searchbtn { flex: none; width: 42px; justify-content: center; padding: 0.5rem; }
  .topbar .searchbtn kbd { display: none; }
}
@media (max-width: 640px) {
  .cardgrid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 0.7rem; }
  .cardgrid.dense { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.6rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .stat { padding: 0.85rem 0.9rem; }
  .stat .value { font-size: 1.35rem; }
  .metricgrid { grid-template-columns: 1fr; }
  .page-head { gap: 0.6rem; }
  h1 { font-size: clamp(1.5rem, 7vw, 2.1rem); }
  .panel { padding: 1rem; border-radius: 14px; }
  .toolbar { gap: 0.5rem; }
  .toolbar .field { flex: 1 1 44%; }
  .hero-cards { display: none; }
  .tablewrap { font-size: 0.82rem; }
  .mkt-head nav { gap: 0.7rem; }
  .mkt-head nav a:not(.btn) { display: none; }
}

/* smoother everything */
a, .chip, .settile, .ctile .frame, .nav-link, .iconbtn, .stat, .feat { transition-timing-function: var(--ease); }
::selection { background: rgba(230,181,74,0.28); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }
