:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  --bg: #101318;
  --text: #f5f3ed;
  --surface: #1b2027;
  --line: #39404a;
  --muted: #b9bec7;
  --accent: #ff964a;
  --ink: #21140e;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: .15em; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 4px;
}
.frame { width: min(1120px, 100% - 3rem); margin-inline: auto; }
header { border-bottom: 1px solid var(--line); }
header .frame { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1.1rem; }
header a { font-weight: 750; text-decoration: none; }
.brand { color: inherit; }
.hero { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: clamp(1.4rem, 6vw, 6rem); padding-block: clamp(2.4rem, 8vw, 6rem); }
h1, h2 { margin: 0; line-height: 1.02; letter-spacing: -.045em; }
h1 { font-size: clamp(2.7rem, 7.1vw, 6.6rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.65rem); }
h3 { margin-bottom: .25rem; line-height: 1.25; }
p, li { line-height: 1.62; }
.lead { font-size: 1.13rem; max-width: 38ch; }
.note, footer { color: var(--muted); font-size: .875rem; }
.tool { padding: clamp(1.1rem, 3vw, 2rem); border: 1px solid var(--line); border-top: .32rem solid var(--accent); border-radius: .65rem; background: var(--surface); }
.tool h2 { font-size: 1.55rem; letter-spacing: -.025em; }
.tool fieldset { border: 0; padding: 0; min-width: 0; }
.tool label { display: flex; align-items: start; gap: .6rem; padding-block: .48rem; }
input { flex: none; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
select, button { font: inherit; border-radius: .35rem; padding: .55rem .7rem; }
select { width: 100%; border: 1px solid var(--line); color: inherit; background: var(--bg); }
button { cursor: pointer; border: 0; background: var(--accent); color: var(--ink); font-weight: 750; }
button:hover { transform: translateY(-1px); }
nav { display: flex; flex-wrap: wrap; gap: .45rem 1.2rem; padding-block: 1rem; border-block: 1px solid var(--line); }
nav a { padding-block: .35rem; }
.guide { display: grid; grid-template-columns: 1fr 1.75fr; gap: 1.2rem 2.5rem; padding-block: clamp(1.85rem, 5vw, 3.5rem); border-bottom: 1px solid var(--line); scroll-margin-top: .6rem; }
.guide p:first-child { margin-top: 0; }
.guide p:last-child { margin-bottom: 0; }
.guide ul, .guide ol { padding-left: 1.3rem; }
.guide li + li { margin-top: .45rem; }
footer { padding-block: 2rem; }
@media (max-width: 700px) {
  .frame { width: calc(100% - 2rem); }
  .hero, .guide { grid-template-columns: 1fr; }
  header .frame { align-items: start; }
  header a:last-child { text-align: right; }
}
@media (prefers-reduced-motion: no-preference) {
  [data-enter] { animation: enter .32s ease-out both; }
  @keyframes enter { from { opacity: .35; transform: translateY(.4rem); } }
}
.calculator { margin-block: 1.3rem; padding-block: .75rem; border-block: 1px solid var(--line); }
.calculator form { display: flex; flex-wrap: wrap; gap: .7rem 1.2rem; }
.calculator form p { flex-basis: 100%; margin: 0; }
.calculator label { flex: 1 1 9rem; }
.calculator input { display: block; width: 100%; height: auto; margin-top: .25rem; padding: .55rem; background: var(--surface); border: 1px solid var(--line); border-radius: .35rem; color: inherit; font: inherit; }
.frame { width: min(1160px, 100% - 3rem); }
.site-header { background: var(--surface); }
.site-header .frame { gap: 1.2rem; min-height: 70px; padding-block: .65rem; }
.site-header .brand { white-space: nowrap; font-size: 1.12rem; }
.site-header nav { gap: .55rem 1.35rem; padding: 0; border: 0; }
.site-header nav a { color: inherit; font-size: .9rem; font-weight: 650; }
.site-header nav a:hover, .site-header nav a:focus-visible { color: var(--accent); }
.site-header .play-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid currentColor;
  border-radius: .45rem;
  padding: .55rem .8rem;
  min-height: 44px;
  text-align: center;
  font-size: .875rem;
}
.road .site-header { border-top: 5px solid var(--accent); }
.road .site-header .play-link { background: var(--play); color: var(--text); border-color: var(--text); }

body .editorial-hero, body.road .editorial-hero {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  align-items: center;
  border: 0;
  gap: clamp(1.25rem, 4vw, 3.75rem);
  padding-block: clamp(2rem, 6vw, 5.1rem);
}
.editorial-hero h1, .article h1 {
  font-size: clamp(2.75rem, 5.9vw, 5.3rem);
  line-height: 1.02;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.editorial-hero .lead { max-width: 40ch; color: var(--muted); }
.hero-art, .article-art { margin: 0; min-width: 0; }
.hero-art img, .article-art img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 16 / 10;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .8rem;
}
.road .hero-art img, .road .article-art img { border-radius: .6rem; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  align-items: center;
  margin-block: 1.45rem 1rem;
}
.hero-actions a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.hero-actions .primary-action { color: var(--ink); background: var(--accent); padding: .65rem 1rem; border-radius: .45rem; text-decoration: none; }
.hero-actions a:hover, .play-link:hover { text-decoration: underline; }
.court .key-pair { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.3rem 0 0; }
.key-pair > div { padding: .6rem .8rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--surface); }
.key-pair dt { color: var(--muted); font-size: .82rem; }
.key-pair dd { margin: .2rem 0 0; font-weight: 700; }
.key-pair kbd { font: inherit; }
.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: start;
  border-top: 1px solid var(--line);
  padding-block: clamp(1.7rem, 4vw, 3rem);
  scroll-margin-top: 1rem;
}
body .tool, body.road .tool { border: 1px solid var(--line); border-top: .24rem solid var(--accent); }
.tool output { display: block; min-height: 3.7rem; padding: .75rem; border-inline-start: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.tool select { background: var(--bg); color: var(--text); }
button { min-height: 44px; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline-color: var(--accent); }
.chapter-index { padding: 1.1rem 1.3rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); }
.chapter-index h2 { font-size: 1.28rem; line-height: 1.2; }
.chapter-index nav { display: grid; gap: 0; margin-top: .55rem; padding: 0; border: 0; }
.chapter-index nav a { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--line); text-decoration: none; }
.chapter-index nav a::after { content: '↗'; opacity: .7; }
.chapter-index nav a:hover { text-decoration: underline; }

.article { max-width: 1160px; padding-block: clamp(2rem, 6vw, 4.8rem); }
.article.article-plain { max-width: 76ch; }
.article h2 { margin-top: 1.8rem; }
.article p, .article li { max-width: 69ch; }
.article img, .guide img { max-width: 100%; height: auto; }
.article .breadcrumb { display: inline-block; margin-bottom: 1rem; font-size: .875rem; }
.article h1 { max-width: 23ch; }
.article-art { max-width: 840px; margin-block: 1.4rem 2rem; }
.article-art img { aspect-ratio: 16 / 8.5; }
.article-content { max-width: 73ch; }
.article-content p, .article-content li { line-height: 1.72; }
.article-content h2 { line-height: 1.15; }
.article-content code { color: var(--accent); }
.road .article-content { padding: clamp(0rem, 3vw, 1.75rem); background: var(--surface); border-radius: .6rem; }
@media (max-width: 920px) {
  .site-header nav { gap: .45rem .75rem; }
  .editorial-hero h1, .article h1 { font-size: clamp(2.6rem, 6.7vw, 4.3rem); }
}
@media (max-width: 700px) {
  .frame { width: calc(100% - 2rem); }
  .site-header .frame { flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .1rem .55rem; padding-block: .55rem; }
  .site-header nav { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .site-header nav a { padding-block: .55rem; min-height: 44px; display: flex; align-items: center; }
  .site-header .play-link { padding-inline: .6rem; font-size: .8rem; }
  body .editorial-hero, body.road .editorial-hero, .workbench { grid-template-columns: minmax(0, 1fr); }
  .editorial-hero h1, .article h1 { text-wrap: initial; font-size: clamp(2.4rem, 10vw, 3.4rem); }
  .editorial-hero .lead { font-size: 1.02rem; }
  .hero-art img { aspect-ratio: 16 / 9; }
  .road .article-content { background: transparent; padding: 0; }
}

/* Schematic practice board. The numbered positions correspond to the adjacent steps. */
.article-next > .dunk-drill {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:1rem}
.drill-court {position:relative;min-width:0;aspect-ratio:5 / 3;isolation:isolate;overflow:hidden;border:1px solid #a2896d;border-radius:8px;background:#332a22;color:#ffe2ca}
.drill-court::before {content:"";position:absolute;inset:8%;border:1px solid #b9a488;border-radius:4px}
.drill-key {position:absolute;inset:8% 35% 43%;border:1px solid #b9a488}
.drill-rim {position:absolute;inset:13% auto auto 50%;width:1.25em;height:1.25em;border:2px solid #ff964a;border-radius:50%;translate:-50% 0}
.drill-path {position:absolute;top:23%;left:53%;height:58%;border-left:2px dashed #ffb681;transform:rotate(-30deg);transform-origin:top}
.drill-point {display:grid;position:absolute;place-items:center;border-radius:50%;width:1.45em;height:1.45em;background:#ffc69d;color:#21140e;font-weight:800}
.drill-start {top:69%;left:74%}
.drill-lane {top:44%;left:61%}
.drill-finish {top:21%;left:53%}
.dunk-drill ol {padding-inline-start:1.35rem;margin:0}
.dunk-drill li+li {margin-top:.45rem}
.article-next > .drill-devices {margin-top:1rem}
.budget-result {display:flex;flex-wrap:wrap;align-items:center;gap:0 .85rem;padding-top:.65rem;border-top:1px solid var(--line)}
.budget-result output {flex:1 0 100%;font-weight:750;font-variant-numeric:tabular-nums}
.budget-result a {display:inline-flex;align-items:center;min-height:44px;overflow-wrap:anywhere}
.budget-result a[hidden] {display:none}
@media (max-width:550px) {
  .article-next > .dunk-drill {grid-template-columns:minmax(0,1fr)}
}

.article-ad {
  width: min(100%, 300px);
  margin-block: 2.2rem;
  margin-inline: auto;
}
.article-next { max-width: 73ch; margin-top: 2rem; padding-top: 1.35rem; border-top: 1px solid var(--line); }
.article-next h2 { font-size: 1.45rem; line-height: 1.2; }
.article-next > div { display: flex; flex-wrap: wrap; gap: .55rem .75rem; margin-top: .8rem; }
.article-next a { display: inline-flex; align-items: center; min-height: 44px; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--surface); text-decoration: none; }
.article-next a:hover { text-decoration: underline; }

/* Homepage media uses real demonstrations and images at a stable aspect ratio. */
.media-library { margin-block: clamp(2.5rem, 6vw, 5.75rem); }
.media-library h2 { margin: 0 0 1rem; font-size: clamp(1.65rem, 3vw, 2.55rem); line-height: 1.12; letter-spacing: -.03em; }
.media-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; gap: clamp(.9rem, 2.4vw, 1.6rem); }
.media-feature { margin: 0; min-width: 0; }
.media-feature figcaption { padding-block: .7rem 0; font-size: .94rem; line-height: 1.45; }
.media-feature figcaption strong { display: block; }
.media-gallery { list-style: none; display: grid; gap: .85rem; margin: 0; padding: 0; }
.media-gallery a { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: .85rem; min-height: 44px; padding-block: .45rem; border-block-end: 1px solid var(--line); text-underline-offset: .2em; }
.media-gallery img { display: block; width: 100%; height: auto; max-height: 10rem; aspect-ratio: 16 / 9; border-radius: 9px; object-fit: cover; }
.media-gallery a span { overflow-wrap: anywhere; font-weight: 650; line-height: 1.35; }
.media-library :focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.media-library a { touch-action: manipulation; }
@media (max-width: 650px) {
  .media-grid { grid-template-columns: minmax(0, 1fr); }
  .media-library { margin-block: 2rem 2.75rem; }
  .media-gallery img { max-height: 7rem; }
}
.media-demo { position: relative; }
.media-demo summary { display: block; list-style: none; position: relative; cursor: pointer; border-radius: 12px; }
.media-demo summary::-webkit-details-marker { display: none; }
.media-demo summary > img, .media-motion { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--board, var(--bg)); border-radius: 12px; }
.media-demo summary > span { position: absolute; inset: auto auto .75rem .75rem; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .55rem .9rem; color: var(--board-ink, var(--text)); background: var(--board, var(--surface)); border: 1px solid currentColor; font-weight: 700; border-radius: 8px; }
.media-demo .demo-hide,[open].media-demo .demo-play { display: none; }
[open].media-demo .demo-hide { display: inline; }
.media-demo[open] .media-motion { margin-block-start: .6rem; }
.media-demo[open] summary { position: absolute; inset: 0 0 auto; min-height: 56px; z-index: 1; }
.media-demo[open] summary > img { visibility: hidden; height: 56px; aspect-ratio: auto; }
.media-demo[open] summary > span { inset: .6rem .6rem auto auto; }
.media-demo[open] .media-motion { margin-block-start: 0; }


/* Keep the visual and the primary task together on the first screen. */
body .editorial-hero { gap: clamp(16px, 3.8vw, 52px); }
.editorial-hero .hero-copy { min-width: 0; }
.editorial-hero .hero-copy h1 { margin-block-end: .25em; text-wrap: balance; letter-spacing: -.035em; }
.hero-art img { object-fit: cover; aspect-ratio: 16 / 9; }
.court .hero-art img { object-position: center 45%; }
.court .key-pair { display: grid; grid-template-columns: repeat(2,minmax(0, 1fr)); gap: .45rem; }
.key-pair :is(dt, dd) { overflow-wrap: anywhere; }
.workbench :is(select, input[type="number"]), .calculator input { font-size: 1rem; min-width: 0; max-width: 100%; }
.workbench :is(a, button, select),.chapter-index a { touch-action: manipulation; }
a.skip-link { position: absolute; z-index: 10; inset: .5rem auto auto .5rem; padding: .75rem 1rem; background: var(--surface); color: var(--text); transform: translateY(-180%); }
a.skip-link:focus { transform: none; }
@media (max-width: 700px) {
  body .editorial-hero, body.road .editorial-hero { grid-template-columns: minmax(0, 1fr); gap: .65rem; padding-block: 1.25rem 1.6rem; }
  body .editorial-hero .hero-copy { display: contents; }
  body .editorial-hero .hero-copy h1 { grid-row: 1; margin: 0; }
  body .editorial-hero .hero-art { grid-row: 2; }
  body .editorial-hero .hero-copy .lead { grid-row: 3; margin: 0; }
  body .editorial-hero .hero-copy .hero-actions { grid-row: 4; margin: .15rem 0 0; gap: .35rem .8rem; }
  body .editorial-hero .hero-copy .key-pair { grid-row: 5; margin-block: .55rem 0; }
  body .editorial-hero .hero-copy .note { grid-row: 6; margin-block: .15rem 0; }
  .hero-actions .primary-action { padding-inline: .8rem; }
  .article-art { margin-block: 1rem 1.4rem; }
  .article-art img { aspect-ratio: 16 / 9; }
}
