@import url("fonts.css");

/* ═══════════════════════════════════════════════════════════════════════
   Gavin Talles — shared brand system
   Same tokens the portfolio homepage uses, so the blog and Hoop Vision
   read as one product rather than three separate sites.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* brand */
  --car:      #4B9CD3;   /* carolina blue */
  --car-dk:   #3A7DB5;
  --car-lt:   #7BB8E0;
  --car-pale: #E8F4FD;
  --gold:     #D4A843;
  --gold-lt:  #E8C96A;
  --gold-pale:#FDF6E3;
  --navy:     #1B2A4A;
  --nd:       #0E1A30;   /* navy dark — the deep ground */
  --nd2:      #16243D;   /* elevated navy panel */
  --nd3:      #1E3050;

  /* light surfaces */
  --white: #FFFFFF;
  --off:   #F5F8FC;
  --g100:  #EDF2F7;
  --g200:  #E2E8F0;
  --g300:  #CBD5E0;
  --g400:  #A0AEC0;
  --g500:  #718096;
  --g600:  #4A5568;
  --g700:  #2D3748;
  --text:  #1A202C;

  /* ink on navy */
  --ink:   #EDF2F8;
  --ink-2: #A9B4C4;
  --ink-3: #6F7E93;
  --line-d: #23344F;

  /* chart series — validated against the navy panel #16243D:
     lightness band, chroma floor, CVD separation, normal-vision floor and
     3:1 contrast all pass. Slots 1 and 2 are the in-band carolina and gold.
     Assigned in this fixed order, never cycled. */
  --s1: #037cb9;  --s2: #926e10;  --s3: #596acb;  --s4: #84a327;
  --s5: #b4514a;  --s6: #01a9b4;  --s7: #9e4cb1;  --s8: #36a36b;

  /* diverging: cool → neutral → warm, for shot efficiency */
  --cold: #2E7FA8;
  --mid:  #4C5A6E;
  --hot:  #C79A3C;

  --r:  12px;
  --rl: 20px;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:  "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1140px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--white); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

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

.sronly {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── shared nav ────────────────────────────────────────────────────────── */

.gnav {
  position: sticky; top: 0; z-index: 80;
  background: rgba(255,255,255,.94); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--g200);
}
.gnav-in {
  max-width: var(--maxw); margin: 0 auto; padding: 0 28px; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.gbrand {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--serif); font-weight: 700; font-size: 1.05rem; color: var(--navy);
}
.gbrand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.gnav-links { display: flex; gap: 24px; align-items: center; }
.gnav-links a {
  text-decoration: none; font-size: .85rem; font-weight: 500; color: var(--g500);
  transition: color .2s;
}
.gnav-links a:hover { color: var(--navy); }
.gnav-links a.on { color: var(--navy); }

/* dark variant, used inside Hoop Vision */
.gnav.dark { background: rgba(14,26,48,.9); border-bottom-color: var(--line-d); }
.gnav.dark .gbrand { color: var(--ink); }
.gnav.dark .gnav-links a { color: var(--ink-2); }
.gnav.dark .gnav-links a:hover, .gnav.dark .gnav-links a.on { color: var(--gold); }

/* ── buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .08em;
  text-transform: uppercase; text-decoration: none;
  padding: 11px 20px; border-radius: 10px;
  border: 1px solid var(--g200); background: var(--white); color: var(--g600);
  transition: all .2s var(--ease);
}
.btn:hover { border-color: var(--gold); color: var(--navy); transform: translateY(-1px); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--nd); border-color: var(--nd); color: #fff; }
.btn.dark { background: transparent; border-color: var(--line-d); color: var(--ink-2); }
.btn.dark:hover { border-color: var(--gold); color: var(--ink); }

/* ═══════════════════════════════════════════════════════════════════════
   Article pages
   ═══════════════════════════════════════════════════════════════════════ */

.article { max-width: 740px; margin: 0 auto; padding: 56px 28px 40px; }

.backlink {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--g400); text-decoration: none;
  display: inline-flex; gap: 8px; margin-bottom: 30px; transition: color .2s, gap .2s;
}
.backlink:hover { color: var(--car-dk); gap: 12px; }

.article h1 {
  font-family: var(--serif); font-weight: 800; color: var(--navy);
  font-size: clamp(2.1rem, 4.6vw, 3.1rem); line-height: 1.1;
  letter-spacing: -.015em; margin: 0 0 18px;
}
.art-meta {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  font-family: var(--mono); font-size: .71rem; color: var(--g400);
  letter-spacing: .07em; padding-bottom: 24px;
  border-bottom: 1px solid var(--g200); margin-bottom: 34px;
}
.art-meta .sep { color: var(--gold); }
.art-meta .tag {
  background: var(--car-pale); color: var(--car-dk); border-radius: 20px;
  padding: 3px 11px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 600; font-size: .64rem;
}

.article .standfirst {
  font-size: 1.16rem; line-height: 1.65; color: var(--navy);
  font-weight: 500; margin-bottom: 32px;
}
.article p { font-size: 1.03rem; line-height: 1.8; color: var(--g600); margin: 0 0 1.15em; }
.article h2 {
  font-family: var(--serif); font-size: 1.6rem; font-weight: 700; color: var(--navy);
  margin: 46px 0 14px; line-height: 1.25; letter-spacing: -.01em;
}
.article h3 { font-size: 1.08rem; font-weight: 600; color: var(--navy); margin: 32px 0 10px; }
.article strong { color: var(--navy); font-weight: 600; }
.article em { color: var(--g700); }
.article ul, .article ol { color: var(--g600); padding-left: 22px; line-height: 1.8; }
.article li { margin-bottom: 9px; }
.article li::marker { color: var(--gold); }
.article a {
  color: var(--car-dk); text-decoration: none;
  border-bottom: 1px solid rgba(75,156,211,.35);
}
.article a:hover { border-bottom-color: var(--car-dk); }

.article blockquote {
  margin: 30px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--gold);
  font-family: var(--serif); font-size: 1.2rem; line-height: 1.55;
  color: var(--navy); font-style: italic;
}
.article blockquote p { font-size: inherit; color: inherit; margin: 0; font-family: inherit; }

.callout {
  background: var(--car-pale); border: 1px solid rgba(75,156,211,.2);
  border-left: 3px solid var(--car); border-radius: var(--r);
  padding: 16px 20px; margin: 30px 0;
}
.callout .lbl {
  font-family: var(--mono); font-size: .63rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--car-dk); margin-bottom: 7px; font-weight: 600;
}
.callout p { margin: 0; font-size: .94rem; color: var(--g700); }

figure { margin: 34px 0; }
figcaption {
  font-size: .8rem; color: var(--g500); line-height: 1.65; margin-top: 12px;
  border-left: 2px solid var(--g200); padding-left: 13px;
}

.article-foot {
  margin-top: 54px; padding-top: 26px; border-top: 1px solid var(--g200);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ── figures that hold a chart ─────────────────────────────────────────── */

.chartbox {
  background: var(--nd); border: 1px solid var(--nd3); border-radius: var(--rl);
  padding: 22px;
}
.chartbox .cb-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.chartbox .cb-title {
  font-family: var(--serif); font-weight: 700; font-size: 1rem; color: var(--ink);
}
.chartbox .cb-sub {
  font-family: var(--mono); font-size: .66rem; color: var(--ink-3); letter-spacing: .05em;
}

/* ═══════════════════════════════════════════════════════════════════════
   Code + the collapsible source panel
   ═══════════════════════════════════════════════════════════════════════ */

.src { margin: 26px 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--nd3); }
.src-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--nd2); padding: 9px 14px; border-bottom: 1px solid var(--nd3);
}
.src-toggle {
  appearance: none; background: none; border: 0; cursor: pointer; padding: 0;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-2); transition: color .2s;
}
.src-toggle:hover { color: var(--gold); }
.src-toggle .caret { transition: transform .25s var(--ease); display: inline-block; }
.src[open] .src-toggle .caret, .src.open .src-toggle .caret { transform: rotate(90deg); }
.src-file {
  font-family: var(--mono); font-size: .66rem; color: var(--ink-3);
  margin-left: auto; letter-spacing: .04em;
}
.src-copy {
  appearance: none; cursor: pointer; background: transparent;
  border: 1px solid var(--line-d); border-radius: 6px; padding: 4px 10px;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); transition: all .18s;
}
.src-copy:hover { border-color: var(--gold); color: var(--gold); }
.src-copy.done { border-color: #36a36b; color: #6ed39c; }

.src-body { max-height: 0; overflow: hidden; background: var(--nd); transition: max-height .35s var(--ease); }
.src.open .src-body { max-height: 1600px; }
.src-body pre { margin: 0; border: 0; border-radius: 0; max-height: 460px; }

pre[class*="language-"], pre {
  background: var(--nd); margin: 24px 0; padding: 16px 18px;
  overflow-x: auto; border-radius: var(--r); border: 1px solid var(--nd3);
  font-size: .82rem; line-height: 1.7;
}
code[class*="language-"], pre code {
  font-family: var(--mono); color: #C9D4E3; text-shadow: none;
  white-space: pre; background: none; border: 0; padding: 0; font-size: inherit;
}
:not(pre) > code {
  font-family: var(--mono); font-size: .87em;
  background: var(--g100); border: 1px solid var(--g200);
  border-radius: 5px; padding: 1px 5px; color: var(--navy);
}

/* Prism theme, tuned to the brand */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6F7E93; font-style: italic; }
.token.punctuation { color: #8896A8; }
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted { color: #E8956A; }
.token.boolean, .token.number { color: #E8C96A; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #8FCB9B; }
.token.operator, .token.entity, .token.url, .token.variable { color: #A9B4C4; }
.token.atrule, .token.attr-value, .token.keyword { color: #7BB8E0; }
.token.function, .token.class-name { color: #B79BE8; }
.token.regex, .token.important { color: #D4A843; }
.token.important, .token.bold { font-weight: 700; }
.token.italic { font-style: italic; }

.codelabel {
  font-family: var(--mono); font-size: .63rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--g400); margin: 26px 0 -14px;
}
.codelabel.bad  { color: #C2554C; }
.codelabel.good { color: #2E8B57; }

/* ═══════════════════════════════════════════════════════════════════════
   Chart primitives (shared by blog + Hoop Vision)
   ═══════════════════════════════════════════════════════════════════════ */

.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--mono); fill: var(--ink-3); }
.axis-line { stroke: var(--line-d); stroke-width: 1; }
.grid-line { stroke: rgba(255,255,255,.055); stroke-width: 1; }
.tick { font-size: 10px; letter-spacing: .05em; }

.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.drawn .draw { transition: stroke-dashoffset 1.15s var(--ease); stroke-dashoffset: 0; }
.rise { opacity: 0; transform: translateY(8px); }
.drawn .rise { transition: opacity .5s var(--ease), transform .5s var(--ease); opacity: 1; transform: none; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; }
.legend button, .legend span.li {
  appearance: none; background: none; border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 7px; padding: 3px 6px; border-radius: 6px;
  color: var(--ink-2); font-size: .79rem; font-family: var(--sans);
  transition: background .15s, color .15s;
}
.legend button:hover { background: var(--nd3); color: var(--ink); }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.legend .sw.ln { height: 3px; width: 15px; border-radius: 2px; }

.tip {
  position: fixed; z-index: 120; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: var(--nd3); border: 1px solid var(--line-d); border-radius: 9px;
  padding: 9px 12px; min-width: 132px; box-shadow: 0 14px 38px rgba(0,0,0,.6);
  font-size: .8rem; color: var(--ink); font-family: var(--sans);
}
.tip.on { opacity: 1; }
.tip .t-name { font-weight: 600; margin-bottom: 5px; display: flex; align-items: center; gap: 7px; }
.tip .t-row {
  display: flex; justify-content: space-between; gap: 18px;
  font-family: var(--mono); font-size: .72rem; color: var(--ink-2);
}
.tip .t-row b { color: var(--ink); font-weight: 500; }
.tip .t-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }

/* ── data table on navy ────────────────────────────────────────────────── */

.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 560px; }
table.data th {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 500;
  text-align: right; padding: 0 12px 11px; border-bottom: 1px solid var(--line-d);
  white-space: nowrap;
}
table.data th:first-child, table.data td:first-child { text-align: left; padding-left: 18px; }
table.data th:nth-child(2) { text-align: left; }
table.data th:last-child, table.data td:last-child { padding-right: 18px; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--ink-2); }
table.data th[aria-sort] { color: var(--gold); }
table.data td {
  text-align: right; padding: 9px 12px; border-bottom: 1px solid rgba(255,255,255,.05);
  font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-2);
}
table.data tbody tr { transition: background .13s; }
table.data tbody tr:hover { background: rgba(75,156,211,.07); }
table.data tbody tr:hover td { color: var(--ink); }
table.data td.name {
  font-family: var(--sans); color: var(--ink); font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  /* the cell is a flex row, but its text still inherits the table's
     right-alignment and wraps ragged-left on narrow screens */
  text-align: left; justify-content: flex-start;
}
.rankcol { color: var(--ink-3) !important; width: 32px; }
.teambadge { width: 3px; height: 20px; border-radius: 2px; flex: none; }
.tabbr { font-family: var(--mono); font-size: .67rem; color: var(--ink-3); letter-spacing: .05em; }

.vbar { position: relative; }
.vbar::before {
  content: ""; position: absolute; right: 12px; bottom: 4px;
  height: 3px; width: var(--w, 0%); border-radius: 2px;
  background: var(--gold); opacity: .8;
}

/* ── states ────────────────────────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, var(--nd2) 25%, var(--nd3) 50%, var(--nd2) 75%);
  background-size: 300% 100%; animation: sk 1.4s ease-in-out infinite; border-radius: var(--r);
}
@keyframes sk { from { background-position: 130% 0; } to { background-position: -30% 0; } }
.sk-row { height: 34px; margin-bottom: 8px; }
.sk-chart { height: 320px; }

.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); font-size: .88rem; }
.empty .big {
  font-family: var(--serif); font-size: 1.15rem; color: var(--ink-2); margin-bottom: 8px;
}

@media (max-width: 700px) {
  .article { padding: 36px 20px 30px; }
  /* a wide table scrolls inside its own container rather than widening the page */
  table.data { min-width: 420px; }
  .gnav-in { padding: 0 20px; }
  .gnav-links { gap: 14px; }
  .gnav-links a { font-size: .8rem; }
  .chartbox { padding: 14px; border-radius: 14px; }
}
