/* LiquidRank — quiet luxury, single dark world.
   Layout: one narrow editorial column for words, a wide frame for data. Hairlines, not boxes. */
:root {
  --ink: #0a0c10;          /* page ground, faint blue bias */
  --ink-2: #10131a;        /* raised surface */
  --ink-3: #161a22;        /* hover / inputs */
  --line: rgba(232, 226, 212, 0.08);
  --line-2: rgba(232, 226, 212, 0.16);
  --ivory: #e8e4da;        /* primary text */
  --muted: #8f8c85;        /* secondary text */
  --faint: #5d5b57;
  --gold: #b9a780;         /* LiquidRank brand gold */
  --gold-soft: #d9ccab;
  --up: #86b79c;
  --down: #cf8f82;
  --warn: #d4b16a;

  --display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --wrap: 1180px;
  --text-w: 640px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(185, 167, 128, 0.28); }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- Type scale ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.display {
  font-family: var(--display);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
.display em { font-style: italic; color: var(--gold-soft); }
.h1 { font-size: clamp(44px, 7.4vw, 96px); }
.h2 { font-size: clamp(34px, 4.6vw, 56px); }
.h3 { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.15; margin: 0; text-wrap: balance; }
.lede { color: var(--muted); font-size: 17px; line-height: 1.7; max-width: 56ch; margin: 0; }
.small { font-size: 13px; color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: rgba(10, 12, 16, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 32px; height: var(--header-h); }
.brand { display: flex; align-items: baseline; gap: 2px; font-family: var(--display); font-size: 26px; font-weight: 500; letter-spacing: 0.01em; }
.brand b { font-weight: 500; color: var(--gold); font-style: italic; }
.nav-links { display: flex; gap: 28px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.nav-links .m-only { display: none; }
.nav-links a {
  font-size: 13px; letter-spacing: 0.04em; color: var(--muted);
  padding-block: 6px; position: relative; transition: color .25s ease;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .35s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ivory); }
.nav-links a[aria-current="page"]::after, .nav-links a:hover::after { transform: scaleX(1); }
.nav-cta { display: flex; gap: 10px; align-items: center; }
.menu-btn { display: none; background: none; border: 0; color: var(--ivory); padding: 8px; margin-left: auto; cursor: pointer; }
.menu-btn span { display: block; width: 20px; height: 1px; background: currentColor; margin: 5px 0; transition: transform .3s ease, opacity .3s ease; }
.menu-open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
.menu-open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav-links, .nav-cta { display: none; }
  .menu-open .nav-links {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; left: 0; right: 0; top: var(--header-h);
    background: var(--ink); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
  }
  .menu-open .nav-links a { display: block; font-size: 16px; padding-block: 14px; border-bottom: 1px solid var(--line); }
  .menu-open .nav-links a::after { display: none; }
  .nav-links .m-only { display: list-item; }
  .menu-open .nav-links .m-only a { color: var(--gold); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--body); font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.btn-gold { background: var(--gold); color: #14120d; }
.btn-gold:hover { background: var(--gold-soft); }
.btn-ghost { border-color: var(--line-2); color: var(--ivory); background: transparent; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn-sm { padding: 8px 16px; font-size: 12px; }
.arrow { display: inline-block; transition: transform .3s ease; }
.btn:hover .arrow, .link:hover .arrow { transform: translateX(4px); }
.link { color: var(--gold); font-size: 13px; letter-spacing: 0.04em; display: inline-flex; gap: 8px; align-items: center; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding-block: clamp(56px, 9vw, 112px) clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.page-hero .display { margin-top: 18px; }
.page-hero .lede { margin-top: 20px; }

section.block { padding-block: clamp(56px, 8vw, 104px); }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ---------- Pills / chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted);
  white-space: nowrap;
}
.pill-gold { border-color: rgba(185, 167, 128, 0.45); color: var(--gold-soft); }
.pill-warn { border-color: rgba(212, 177, 106, 0.4); color: var(--warn); }
.pill-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(134,183,156,.6); animation: pulse 2.4s infinite; }
.pill-sample::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(134,183,156,.5);} 70% { box-shadow: 0 0 0 7px rgba(134,183,156,0);} 100% { box-shadow: 0 0 0 0 rgba(134,183,156,0);} }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--body); font-size: 12.5px; color: var(--muted);
  background: transparent; border: 1px solid var(--line-2); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; transition: all .2s ease;
}
.chip:hover { color: var(--ivory); border-color: var(--faint); }
.chip[aria-pressed="true"] { color: #14120d; background: var(--gold); border-color: var(--gold); }

.input {
  font-family: var(--body); font-size: 14px; color: var(--ivory);
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 10px 18px; min-width: 0; width: 100%;
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--gold); }

/* ---------- Data table ---------- */
.table-frame { overflow-x: auto; border-top: 1px solid var(--line-2); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
table.data th {
  text-align: left; font-family: var(--mono); font-weight: 400; font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint);
  padding: 14px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--muted); }
table.data th[aria-sort] { color: var(--gold); }
table.data th[aria-sort="ascending"]::after { content: " ↑"; }
table.data th[aria-sort="descending"]::after { content: " ↓"; }
table.data td { padding: 16px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr { transition: background .2s ease; }
table.data tbody tr:hover { background: rgba(232, 226, 212, 0.025); }
table.data .r { text-align: right; }
.up { color: var(--up); }
.down { color: var(--down); }
/* No horizontal scrolling: tables fit the page and wrap. Overrides the inline min-widths on each page. */
.table-frame { overflow-x: visible; }
table.data { min-width: 0 !important; }
table.data th { white-space: normal; }
table.data td { overflow-wrap: anywhere; }
table.data td .num, table.data td.num { overflow-wrap: normal; }

/* Phones: each row becomes a stacked card. site.js copies the column name into data-label on every cell. */
@media (max-width: 860px) {
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tbody tr { padding: 16px 0; border-bottom: 1px solid var(--line-2); }
  table.data tbody tr:hover { background: none; }
  table.data td { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 4px 6px; padding: 7px 0; border-bottom: 0; text-align: right !important; white-space: normal !important; }
  table.data td::before { content: attr(data-label); flex: none; max-width: 45%; margin-right: auto; padding-right: 16px; text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding-top: 2px; }
  /* cells with no column name (name/firm cell, rank, notes, actions) span the card */
  table.data td[data-label=""] { display: block; text-align: left !important; }
  table.data td[data-label=""]::before { display: none; }
  table.data td .small { max-width: none !important; }
}

.verify { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--warn); margin-left: 6px; }

.coin { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.mark {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-family: var(--display); font-size: 15px; font-weight: 500;
  color: var(--gold-soft); border: 1px solid rgba(185, 167, 128, 0.35); background: rgba(185,167,128,.05);
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 56px 40px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.foot-grid h4 { font-family: var(--mono); font-weight: 400; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin: 0 0 14px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid a { color: var(--muted); font-size: 13.5px; }
.foot-grid a:hover { color: var(--ivory); }
.disclosure { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); max-width: 90ch; line-height: 1.7; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Motion ---------- */
.rise { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.rise-2 { animation-delay: .12s; } .rise-3 { animation-delay: .24s; } .rise-4 { animation-delay: .36s; }
@keyframes rise { from { opacity: .001; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Articles ---------- */
.article { max-width: var(--text-w); margin-inline: auto; padding-block: clamp(56px, 9vw, 104px) 40px; }
.article .meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.article h1 { margin-top: 20px; }
.article .dek { font-size: 19px; color: var(--muted); line-height: 1.65; margin: 24px 0 0; }
.prose { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--line); font-size: 16.5px; line-height: 1.85; color: #d4d0c6; }
.prose p { margin: 0 0 22px; }
.prose h2 { font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.15; color: var(--ivory); margin: 52px 0 18px; text-wrap: balance; }
.prose strong { color: var(--ivory); font-weight: 600; }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 22px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--gold); }
.prose .worked { font-family: var(--mono); font-size: 13.5px; line-height: 1.9; background: var(--ink-2); border: 1px solid var(--line); border-radius: 4px; padding: 20px 22px; margin: 0 0 24px; overflow-x: auto; color: var(--ivory); white-space: pre; }
.prose blockquote { margin: 32px 0; padding-left: 24px; border-left: 1px solid var(--gold); font-family: var(--display); font-style: italic; font-size: 26px; line-height: 1.35; color: var(--gold-soft); }
.article-end { max-width: var(--text-w); margin: 0 auto; padding-block: 32px 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Live ticker ----------
   Sits under the header on every page. The track holds two identical rows and
   slides exactly half its width, so the loop has no seam. Hover pauses it. */
.ticker {
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
  overflow: hidden;
  position: relative;
}
.ticker::after {
  /* fade the right edge so cells leave rather than get chopped */
  content: "";
  position: absolute; top: 0; right: 0; bottom: 0; width: 64px;
  background: linear-gradient(90deg, rgba(16,19,26,0), var(--ink-2));
  pointer-events: none;
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 90s linear infinite;
}
.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-row { display: flex; flex: none; }
@keyframes ticker-scroll { to { transform: translateX(-50%); } }

.tk {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  padding: 10px 18px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  transition: background .25s ease;
}
.tk:hover { background: rgba(232, 226, 212, 0.03); }
.tk-c { color: var(--ivory); letter-spacing: 0.06em; }
.tk-p { color: var(--muted); }
.tk-d.up { color: var(--up); }
.tk-d.down { color: var(--down); }
.tk-f {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding-left: 2px;
  border-left: 1px solid var(--line-2);
  margin-left: 2px;
}

/* A frozen marquee reads as broken, so reduced motion gets a real strip
   instead: one row, no animation, swipeable. */
@media (prefers-reduced-motion: reduce) {
  .ticker { overflow-x: auto; }
  .ticker::after { display: none; }
  .ticker-track { width: auto; }
  .ticker-row + .ticker-row { display: none; }
}
