/* ═══════════════════════════════════════════════════════════════════
   BagIntel — Luxury Command Center theme
   Obsidian ground · gold leaf accents · editorial serif display.
   Shared across every page; page-specific blocks reference these tokens.
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --bg: #0B0A0E;
  --bg-2: #100F15;
  --card: #16151C;
  --card-2: #1C1A23;
  --card-hi: #211E29;

  --gold: #C9A96A;
  --gold-hi: #EAD9A9;
  --gold-deep: #9A7B3E;
  --gold-light: rgba(201,169,106,.12);   /* legacy token name: tinted gold wash */

  --ink: #F5F2EB;
  --cream: #EFE9DB;
  --muted: #918C9C;
  --muted-2: #6C6878;

  --line: rgba(201,169,106,.16);
  --line-soft: rgba(255,255,255,.07);

  --green: #7FC79B;
  --amber: #E6B463;
  --red: #E28A68;
  --hermes: #D9642C;

  --mine: rgba(201,169,106,.09);
  --shadow: 0 18px 44px -18px rgba(0,0,0,.72);
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(1100px 560px at 84% -10%, rgba(217,100,44,.09), transparent 60%),
    radial-gradient(950px 640px at 4% -2%, rgba(201,169,106,.09), transparent 56%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  letter-spacing: .005em;
}
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 700;
  letter-spacing: -.01em; color: var(--ink);
}
.serif { font-family: 'Playfair Display', Georgia, serif; }
.display { font-family: 'Cormorant Garamond', Georgia, serif; }
.tnum, table, .value, .k-v { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
a { color: inherit; }
::selection { background: rgba(201,169,106,.28); }

/* ── scrollbars ─────────────────────────────────────────────── */
*::-webkit-scrollbar { height: 10px; width: 10px; }
*::-webkit-scrollbar-track { background: rgba(255,255,255,.03); }
*::-webkit-scrollbar-thumb { background: rgba(201,169,106,.22); border-radius: 10px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(201,169,106,.36); }

/* ── header ─────────────────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(11,10,14,.94), rgba(11,10,14,.62));
  backdrop-filter: blur(14px);
  padding: 0 20px; position: sticky; top: 0; z-index: 50;
}
.header-inner {
  max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap;
  align-items: center; gap: 6px 26px; min-height: 60px;
}
header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 19px; font-weight: 700; letter-spacing: .01em;
}
header h1 .accent { color: var(--gold); }
nav { display: flex; gap: 2px; font-size: 13px; flex-wrap: wrap; }
nav a {
  text-decoration: none; color: var(--muted); padding: 7px 12px;
  border-radius: 9px; transition: color .2s, background .2s;
}
nav a:hover { color: var(--ink); background: rgba(255,255,255,.045); }
nav a.active { color: var(--gold); background: var(--gold-light); font-weight: 600; }
.updated {
  margin-left: auto; font-size: 11px; color: var(--muted-2);
  letter-spacing: .08em; text-transform: uppercase;
}

/* ── layout ─────────────────────────────────────────────────── */
main { max-width: 1200px; margin: 0 auto; padding: 30px 16px 72px; }
section { margin-bottom: 44px; }
h2 { font-size: 27px; margin-bottom: 6px; }
h3 { font-size: 16px; margin: 18px 0 10px; }
.sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; max-width: 74ch; }
.sub b, .sub strong { color: var(--cream); font-weight: 600; }
.eyebrow {
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 6px;
}

/* ── KPI cards ──────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; }
.card {
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 19px; box-shadow: var(--shadow);
  position: relative; overflow: hidden; transition: transform .25s, border-color .25s;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(220px 90px at 78% 0%, rgba(201,169,106,.10), transparent 70%);
}
.card:hover { transform: translateY(-2px); border-color: rgba(201,169,106,.32); }
.card .label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--muted-2);
}
.card .value {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 33px; font-weight: 600; margin-top: 3px; line-height: 1.1;
  background: linear-gradient(120deg, var(--gold-hi), var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.card .delta { font-size: 12px; color: var(--muted); }

/* ── tables ─────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 13px; }
th, td {
  padding: 12px 15px; text-align: right;
  border-bottom: 1px solid var(--line-soft); white-space: nowrap;
}
th:first-child, td:first-child { text-align: left; }
th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted-2); font-weight: 600;
  background: rgba(28,26,35,.96); position: sticky; top: 0;
}
tbody tr { transition: background .18s; }
tbody tr:hover > td { background: rgba(201,169,106,.055); }
tr:last-child td { border-bottom: none; }
tr.mine { background: var(--mine); font-weight: 600; }
tr.mine td { color: var(--cream); }
tr.mine td:first-child::after { content: " ★"; color: var(--gold); }
tr.total td {
  border-top: 1px solid rgba(201,169,106,.4); font-weight: 600;
  background: rgba(201,169,106,.07); color: var(--cream);
}
tr.total td:first-child {
  letter-spacing: .16em; font-size: 10.5px; color: var(--gold); text-transform: uppercase;
}
td.title-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.num, th.num { text-align: right; }
th.mine, td.mine { background: var(--mine); }
.pos { color: var(--green); } .neg { color: var(--red); }
table.cmp th:first-child, table.cmp td:first-child {
  text-align: left; font-weight: 600; white-space: nowrap; color: var(--cream);
}
table.cmp th { text-align: right; }
th.sortable { cursor: pointer; user-select: none; transition: color .18s; }
th.sortable:hover { color: var(--gold); }
tr.item { cursor: pointer; }
.detail td { background: rgba(255,255,255,.035); padding: 16px 18px; white-space: normal; }

/* ── badges & pills ─────────────────────────────────────────── */
.badge, .pill {
  display: inline-block; font-size: 10.5px; padding: 3px 9px; border-radius: 100px;
  letter-spacing: .04em; font-weight: 600;
  background: var(--gold-light); color: var(--gold-hi);
  border: 1px solid rgba(201,169,106,.22);
}
.badge.sold, .pill.sold   { background: rgba(226,138,104,.14); color: #F0B79E; border-color: rgba(226,138,104,.3); }
.badge.reserved           { background: rgba(140,160,220,.14); color: #B6C4EC; border-color: rgba(140,160,220,.3); }
.badge.aged, .pill.aged   { background: rgba(230,180,99,.14); color: var(--amber); border-color: rgba(230,180,99,.3); }
.pill.live                { background: rgba(127,199,155,.13); color: var(--green); border-color: rgba(127,199,155,.3); }
.pill.other               { background: rgba(255,255,255,.06); color: var(--muted); border-color: var(--line-soft); }

/* ── charts ─────────────────────────────────────────────────── */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-box {
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.chart-box h3 { margin: 0 0 12px; font-size: 15px; }
.chart-box canvas { max-height: 280px; }

/* ── controls: selects, inputs, buttons ─────────────────────── */
.filter-row { margin: .3rem 0 1.1rem; font-size: 13.5px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: .5rem 0 1.2rem; }
.filters .spacer { flex: 1; }
select, input, textarea {
  padding: 7px 11px; font: inherit; color: var(--ink);
  background: var(--card-hi); border: 1px solid var(--line);
  border-radius: 9px; outline: none; transition: border-color .2s, box-shadow .2s;
}
select:hover, input:hover { border-color: rgba(201,169,106,.34); }
select:focus, input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,169,106,.15); }
select option { background: #1C1A23; color: var(--ink); }
.filters input[type=search] { min-width: 230px; }
.deal input { width: 160px; }
.btn {
  padding: 8px 15px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 600;
  color: #17130B; border: 1px solid transparent;
  background: linear-gradient(120deg, var(--gold-hi), var(--gold));
  transition: filter .2s, transform .12s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.ghost {
  background: transparent; color: var(--gold); border-color: rgba(201,169,106,.4);
}
.btn.ghost:hover { background: var(--gold-light); }

/* ── site picker ────────────────────────────────────────────── */
.site-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.site-picker a {
  text-decoration: none; padding: 8px 15px; border-radius: 100px; font-size: 13px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  transition: .2s;
}
.site-picker a:hover { color: var(--ink); border-color: rgba(201,169,106,.34); }
.site-picker a.active {
  border-color: rgba(201,169,106,.5); color: var(--gold-hi);
  background: var(--gold-light); font-weight: 600;
}

/* ── hero model blocks ──────────────────────────────────────── */
.hero-block {
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.hero-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; margin-bottom: 10px; }
.hero-head h3 { margin: 0; font-size: 18px; }
.hero-stats { font-size: 13px; color: var(--muted); }
.hero-stats b { color: var(--gold-hi); font-weight: 600; }

/* ── benchmark insights ─────────────────────────────────────── */
.insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.insight {
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow);
}
.insight .tag {
  font-size: 10.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold);
}
.insight p { margin: .45rem 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.insight p b { color: var(--cream); }

/* ── AI briefing ────────────────────────────────────────────── */
.ai-note {
  background: rgba(255,255,255,.035); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 15px 18px; font-size: 13.5px; color: var(--muted);
}
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.brief {
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 19px;
  box-shadow: var(--shadow);
}
.brief h4 { margin: 0 0 .4rem; font-size: 16px; }
.brief p { margin: .25rem 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.brief .act { margin-top: .55rem; font-size: 13px; color: var(--muted-2); }
.brief .act b { color: var(--gold-hi); }
.alerts { padding-left: 1.1rem; }
.alerts li { margin: .35rem 0; font-size: 13.5px; color: var(--muted); }
.alerts li b, .alerts li strong { color: var(--cream); }
.price-row {
  padding: .5rem 0; border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px; color: var(--muted);
}
.price-row b { color: var(--gold-hi); }
.deal {
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; max-width: 760px; box-shadow: var(--shadow);
}
.deal .row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: .7rem; }
.verdict {
  margin-top: .7rem; font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 25px; font-weight: 600;
}
.verdict.good { color: var(--green); }
.verdict.mid  { color: var(--amber); }
.verdict.high { color: var(--red); }
.ai-tag { font-size: 11px; color: var(--muted-2); margin-left: .4rem; letter-spacing: .06em; }

/* ── explorer detail ────────────────────────────────────────── */
.hist-stats { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; margin-bottom: .6rem; color: var(--muted); }
.hist-stats b { font-weight: 600; color: var(--gold-hi); }
.hist-list { font-size: 12.5px; color: var(--muted-2); line-height: 1.7; }
.count-note { font-size: 12.5px; color: var(--muted-2); }

.footnote {
  font-size: 12px; color: var(--muted-2); margin-top: 34px; line-height: 1.7;
  border-top: 1px solid var(--line-soft); padding-top: 18px;
}
.footnote b { color: var(--muted); }

/* ── entrance animation ─────────────────────────────────────── */
.fade { opacity: 0; transform: translateY(12px); animation: fadeUp .65s cubic-bezier(.22,1,.36,1) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .chart-grid { grid-template-columns: 1fr; }
  header h1 { font-size: 17px; }
  h2 { font-size: 22px; }
  .card .value { font-size: 27px; }
  main { padding: 20px 11px 52px; }
}
