/* Court Vision — NBA broadcast desk. Sibling to the NFL 4th-down bot, own basketball skin. */
:root {
  --bg: #0a0c10;
  --bg-2: #0d1016;
  --panel: #12161d;
  --panel-2: #0e1219;
  --line: #232b36;
  --ink: #eef1f5;
  --muted: #8590a0;
  --chalk: #f4ecdd;
  --rim: #ff6a2b; /* basketball / primary accent */
  --rim-soft: #ff8b57;
  --hot: #ff5a2b; /* shot chart: above league */
  --cold: #3d8bd6; /* shot chart: below league */
  --hardwood: #c98a45;
  --radius: 14px;
  --mono: "Space Mono", ui-monospace, monospace;
  --sans: "Archivo", system-ui, sans-serif;
  --black: "Archivo Black", var(--sans);
  --num: "Teko", var(--sans);
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 78% -12%, #17202b 0%, transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.045;
  mix-blend-mode: overlay;
  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='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.mono {
  font-family: var(--mono);
}
a {
  color: var(--rim-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 139, 87, 0.35);
}
a:hover {
  border-color: var(--rim-soft);
}
b {
  color: #fff;
  font-weight: 700;
}
.hot {
  color: var(--hot);
  font-weight: 600;
}
.cold {
  color: var(--cold);
  font-weight: 600;
}

/* ===================== HERO ===================== */
.hero {
  position: relative;
  height: 175vh;
  z-index: 1;
}
.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}
#swish {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  pointer-events: none;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 9px;
}
.pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rim);
  box-shadow: 0 0 12px var(--rim);
}
.hero h1 {
  font-family: var(--black);
  font-weight: 400;
  line-height: 0.86;
  margin: 0.22em 0 0.24em;
  font-size: clamp(60px, 15vw, 190px);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.hero h1 em {
  font-style: normal;
  color: var(--rim);
  -webkit-text-stroke: 0;
  position: relative;
}
.hero-dek {
  max-width: 44ch;
  color: #c6cdd6;
  font-size: clamp(15px, 1.7vw, 19px);
}
.scroll-cue {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: opacity 0.3s;
}
.scroll-cue svg {
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}

/* ===================== DESK BAR ===================== */
.deskbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 12, 16, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.deskbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 11px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-ball {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--rim-soft), var(--rim));
  position: relative;
  box-shadow: 0 0 10px rgba(255, 106, 43, 0.4);
}
.brand-ball::before,
.brand-ball::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(18, 10, 6, 0.7);
}
.brand-ball::after {
  border: 0;
  border-left: 1px solid rgba(18, 10, 6, 0.6);
  left: 50%;
}
.brand-name {
  font-family: var(--black);
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.switch {
  display: flex;
  gap: 2px;
  margin-left: 8px;
}
.sw {
  background: none;
  border: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: 0.16s;
}
.sw:hover {
  color: var(--ink);
}
.sw.is-active {
  color: #120a06;
  background: var(--rim);
  font-weight: 700;
}
.deskbar-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ===================== VIEWS ===================== */
main {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 24px 60px;
}
.view {
  display: none;
  animation: fade 0.4s ease;
}
.view.is-active {
  display: block;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.view-head h2,
.method h2 {
  font-family: var(--black);
  font-weight: 400;
  font-size: clamp(28px, 4.4vw, 46px);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.view-head p {
  color: #b8c1cc;
  max-width: 74ch;
  margin: 0 0 14px;
}
.compare-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.compare-toggle input {
  accent-color: var(--rim);
  width: 15px;
  height: 15px;
}

/* ===================== COURTS ===================== */
.courts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 8px;
}
.courts.is-compare {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 820px) {
  .courts.is-compare {
    grid-template-columns: 1fr;
  }
}
.court-card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.court-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.court-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 620px) {
  .court-grid {
    grid-template-columns: 1fr;
  }
}
.courts.is-compare .court-grid {
  grid-template-columns: 1fr;
}
.court-canvas-wrap {
  position: relative;
  background: radial-gradient(120% 90% at 50% 100%, #171b16, #0d100d);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.court-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* player picker */
.pick-wrap {
  flex: 1;
  min-width: 220px;
}
.pick-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rim-soft);
  margin-bottom: 7px;
}
.pick {
  position: relative;
  min-width: 220px;
}
.pick-caret {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 12px;
}
.pick-input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
}
.pick-input:focus {
  border-color: var(--rim);
}
.pick-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: #10141b;
  border: 1px solid var(--line);
  border-radius: 10px;
  z-index: 30;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  display: none;
}
.pick-menu.open {
  display: block;
}
.pick-opt {
  padding: 9px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #171d26;
}
.pick-opt:hover,
.pick-opt.hi {
  background: rgba(255, 106, 43, 0.12);
}
.pick-opt .po-name {
  font-weight: 600;
  font-size: 14px;
}
.pick-opt .po-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* scouting / stat card */
.scout .scout-name {
  font-family: var(--black);
  font-size: clamp(22px, 3vw, 30px);
  text-transform: uppercase;
  line-height: 1;
  margin: 0;
}
.scout .scout-sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin: 6px 0 12px;
}
.arch-chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #120a06;
  background: var(--hardwood);
  padding: 3px 9px;
  border-radius: 6px;
  margin-left: 8px;
  vertical-align: middle;
}
.scout-blurb {
  color: #c6cdd6;
  font-size: 14px;
  border-left: 2px solid var(--rim);
  padding-left: 12px;
  margin: 12px 0 16px;
}
.statline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.stat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  text-align: center;
}
.stat .sv {
  font-family: var(--num);
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
  font-weight: 600;
}
.stat .sl {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 3px;
}

/* zone bars */
.zones {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.zone-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 10px;
}
.zone-name {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.zone-track {
  height: 20px;
  background: #0d1210;
  border: 1px solid var(--line);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.zone-lg {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--chalk);
  opacity: 0.6;
  z-index: 2;
}
.zone-fill {
  height: 100%;
  border-radius: 5px 0 0 5px;
  transition: width 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.zone-val {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
}
.zone-val .z-rate {
  color: var(--muted);
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 6px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.legend-bar {
  width: 200px;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--cold),
    #3a4250 48%,
    #4a3830 52%,
    var(--hot)
  );
  border: 1px solid var(--line);
}
.legend-size {
  margin-left: auto;
}

/* ===================== TWINS ===================== */
.twins-wrap {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  margin-top: 10px;
}
@media (max-width: 820px) {
  .twins-wrap {
    grid-template-columns: 1fr;
  }
}
.twins-pick {
  position: sticky;
  top: 74px;
  align-self: start;
}
.anchor-card {
  margin-top: 14px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.twins-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  align-content: start;
}
.twin {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition:
    border-color 0.18s,
    transform 0.18s;
  position: relative;
}
.twin:hover {
  border-color: var(--rim);
  transform: translateY(-2px);
}
.twin.era::after {
  content: "CROSS-ERA";
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--hardwood);
  border: 1px solid var(--hardwood);
  border-radius: 4px;
  padding: 1px 5px;
}
.twin-rank {
  font-family: var(--num);
  font-size: 22px;
  color: var(--rim);
  line-height: 1;
}
.twin-name {
  font-weight: 700;
  font-size: 15px;
  margin: 6px 0 2px;
}
.twin-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.twin-sim {
  margin-top: 10px;
  height: 5px;
  border-radius: 3px;
  background: #0d1210;
  overflow: hidden;
}
.twin-sim > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rim), var(--rim-soft));
}
.twin-simval {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
.anchor-card .scout-name {
  font-family: var(--black);
  font-size: 24px;
  text-transform: uppercase;
  line-height: 1;
  margin: 0 0 4px;
}

/* ===================== METHOD ===================== */
.method {
  max-width: 80ch;
}
.method p {
  color: #c6cdd6;
}
.method h3 {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rim);
  margin: 32px 0 10px;
}
.steps {
  counter-reset: s;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.steps li {
  position: relative;
  padding: 14px 16px 14px 54px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #c6cdd6;
  font-size: 14.5px;
}
.steps li::before {
  counter-increment: s;
  content: counter(s);
  position: absolute;
  left: 14px;
  top: 12px;
  font-family: var(--num);
  font-size: 24px;
  color: var(--rim);
  width: 28px;
  text-align: center;
}
.assump {
  padding-left: 18px;
  color: #c6cdd6;
}
.assump li {
  margin-bottom: 9px;
}
.build-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 2px solid var(--rim);
  background: var(--panel-2);
  border-radius: 0 10px 10px 0;
}

.fineprint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 18px;
  max-width: 78ch;
  line-height: 1.7;
}

/* ===================== FOOTER ===================== */
.foot {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.foot b {
  color: var(--ink);
  font-weight: 700;
}
.foot-data {
  opacity: 0.7;
}
.nr {
  color: #22c55e;
  font-weight: 700;
  border-bottom: 0;
}
.nr:hover {
  border-bottom: 1px solid #22c55e;
}
@media (max-width: 620px) {
  .foot {
    justify-content: flex-start;
  }
  .foot-data {
    display: none;
  }
  .switch .sw {
    padding: 8px 9px;
    font-size: 11px;
  }
  .deskbar-meta {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .scroll-cue svg {
    animation: none;
  }
}
