/* prepone.app/basketball -- "The Layout Book". Loaded after styles.css, on basketball.html only. Every
   color is a styles.css token; nothing here adds a font or a palette. */

.bb-page { background: var(--paper); color: var(--paper-text); }
.bb-page .section-inner { padding: 0 clamp(16px, 4vw, 32px); }
.bb-page main { padding-top: 64px; }
.bb-page :focus-visible { outline: 2px solid var(--tally); outline-offset: 3px; }
.bb-dark :focus-visible { outline-color: var(--tally-on-dark); }
.bb-page .btn-ghost { border-color: var(--paper-line); color: var(--paper-text); }
.bb-page .btn-ghost:hover { border-color: var(--paper-muted); }
.bb-quiet { display: inline-block; font: 800 11.5px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--tally-dim); margin: 0 0 18px; }
.bb-dark .bb-quiet { color: var(--tally-on-dark); }

/* ---------- The book: focus list + the sheet on the drafting table ---------- */
.book { padding: clamp(36px, 5vw, 64px) 0 clamp(60px, 8vw, 110px); }
.book-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); grid-template-areas: 'intro plate' 'pick plate'; column-gap: clamp(32px, 6vw, 90px); align-items: start; }
.intro { grid-area: intro; } .pick { grid-area: pick; } .plate { grid-area: plate; }
.crumb { font: 700 12px var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--paper-muted); margin: 0 0 22px; }
.crumb b { color: var(--tally-dim); }
.book h1 { font-family: var(--font-headline); font-weight: 600; font-size: clamp(38px, 5vw, 66px); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 18px; max-width: 13ch; text-wrap: balance; }
.book .lede { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.45; color: var(--paper-muted); margin: 0 0 26px; max-width: 46ch; }
.book .lede b { color: var(--paper-text); font-weight: 600; }

.index { margin: 0 0 34px; padding: 0; border-top: 2px solid var(--paper-text); }
.index button { width: 100%; display: grid; grid-template-columns: 54px 1fr auto; align-items: baseline; gap: 14px; padding: 14px 0 13px; background: none; border: 0; border-bottom: 1px solid var(--paper-line); color: inherit; text-align: left; font: inherit; cursor: pointer; }
.index button > * { transition: transform .35s var(--ease-slow), color .25s; }
.index .n { font: 900 26px/1 var(--font-display); color: var(--paper-muted); font-variant-numeric: tabular-nums; }
.index .nm { font-weight: 600; font-size: clamp(19px, 1.7vw, 23px); letter-spacing: -0.01em; color: var(--paper-muted); }
.index .nm small { display: block; font-weight: 400; font-size: 15px; color: var(--paper-muted); letter-spacing: 0; margin-top: 2px; }
.index button:hover .nm { color: var(--paper-text); }
.index button[aria-selected="true"] .n { color: var(--tally); transform: translateX(6px); }
.index button[aria-selected="true"] .nm { color: var(--paper-text); transform: translateX(6px); }
.index .tag { font: 800 10.5px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--paper-muted); white-space: nowrap; }
.index .tag.def { color: var(--paper-raised); background: var(--tally); padding: 4px 7px; border-radius: 2px; }
.book .actions { display: flex; gap: 12px; flex-wrap: wrap; }

.plate { position: sticky; top: 96px; }
.plate-frame { position: relative; margin: 30px 34px 40px 0; }
.plate-frame img, .plate-blank { width: 100%; background: var(--paper-raised); box-shadow: 0 1px 0 var(--paper-line), 0 30px 70px rgba(24, 20, 15, .18); transition: opacity .3s ease; }
.plate-frame.swap img { opacity: .2; }
.plate-blank { aspect-ratio: 8.5 / 14; display: grid; place-items: center; border: 1px dashed var(--paper-line); box-shadow: none; }
.plate-blank p { margin: 0; text-align: center; padding: 0 24px; color: var(--paper-muted); font-size: 16px; max-width: 30ch; }
.plate-blank b { display: block; font: 800 12px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--paper-text); margin-bottom: 8px; }
.dim-v, .dim-h { position: absolute; color: var(--paper-muted); font: 700 11px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; }
.dim-v { top: 0; bottom: 0; right: -30px; width: 14px; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; }
.dim-v::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; border-left: 1px solid currentColor; }
.dim-v span { position: absolute; top: 50%; left: 7px; transform: translate(-50%, -50%) rotate(90deg); background: var(--paper); padding: 4px 6px; white-space: nowrap; }
.dim-h { left: 0; right: 0; bottom: -30px; height: 14px; border-left: 1px solid currentColor; border-right: 1px solid currentColor; }
.dim-h::before { content: ''; position: absolute; top: 7px; left: 0; right: 0; border-top: 1px solid currentColor; }
.dim-h span { position: absolute; left: 50%; top: 7px; transform: translate(-50%, -50%); background: var(--paper); padding: 0 8px; white-space: nowrap; }
.sheet-no { position: absolute; top: -28px; left: 0; right: 0; display: flex; justify-content: space-between; gap: 12px; font: 700 11px var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--paper-muted); margin: 0; }
.sheet-no b { color: var(--paper-text); }
.plate-open { position: absolute; right: 12px; bottom: 12px; }

/* ---------- Read the sheet: notes on / off ---------- */
.read { background: var(--ink-900); color: var(--ink-text); padding: clamp(80px, 10vw, 130px) 0; }
.read-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 48px; }
.read h2, .studio h2, .bb-prices h2 { font-family: var(--font-headline); font-weight: 600; font-size: clamp(32px, 4vw, 54px); line-height: 1.04; letter-spacing: -0.025em; margin: 0; max-width: 16ch; }
.switch { display: inline-flex; align-items: center; gap: 12px; font: 700 12.5px var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); background: none; border: 0; cursor: pointer; padding: 6px 0; }
.switch .track { width: 46px; height: 26px; border-radius: 6px; background: var(--ink-700); position: relative; border: 1px solid var(--ink-line); transition: background .2s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 4px; background: var(--ink-text); transition: transform .25s var(--ease-slow); }
.switch[aria-checked="true"] .track { background: var(--tally); border-color: var(--tally); }
.switch[aria-checked="true"] .track::after { transform: translateX(20px); }
.switch[aria-checked="true"] { color: var(--ink-text); }
.anno { display: grid; grid-template-columns: 1fr minmax(0, 520px) 1fr; align-items: start; }
.anno-sheet { position: relative; }
.anno-sheet img { width: 100%; box-shadow: 0 40px 90px rgba(0, 0, 0, .5); }
.notes { position: relative; height: 100%; }
.note { position: absolute; display: flex; align-items: center; width: 100%; font-size: 15px; line-height: 1.3; transition: opacity .4s var(--ease-slow), transform .4s var(--ease-slow); }
.notes.l .note { flex-direction: row; text-align: right; }
.notes.r .note { flex-direction: row-reverse; text-align: left; }
.note p { margin: 0; flex: 0 0 auto; max-width: 200px; color: var(--ink-muted); }
.note p b { display: block; font: 800 11px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--tally-on-dark); margin-bottom: 3px; }
.note i { flex: 1; height: 1px; background: rgba(237, 239, 244, .45); position: relative; min-width: 24px; }
.notes.l .note i::after, .notes.r .note i::after { content: ''; position: absolute; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--tally-on-dark); }
.notes.l .note i::after { right: -3px; }
.notes.r .note i::after { left: -3px; }
.notes.l .note p { padding-right: 12px; }
.notes.r .note p { padding-left: 12px; }
.anno[data-notes="off"] .note { opacity: 0; transform: translateY(6px); }
.hl { position: absolute; border: 2px solid var(--tally-on-dark); border-radius: 2px; transition: opacity .4s; pointer-events: none; }
.anno[data-notes="off"] .hl { opacity: 0; }
.anno-list { display: none; list-style: none; padding: 0; margin: 26px 0 0; gap: 12px; counter-reset: a; }
.anno-list li { font-size: 16px; color: var(--ink-muted); padding-left: 34px; position: relative; }
.anno-list li b { color: var(--ink-text); font-weight: 600; }
.anno-list li::before { counter-increment: a; content: counter(a, decimal-leading-zero); position: absolute; left: 0; top: 1px; font: 900 18px var(--font-display); color: var(--tally-on-dark); }
.anno[data-notes="off"] + .anno-list { display: none !important; }

/* ---------- Studio sheets ---------- */
.studio { padding: clamp(80px, 10vw, 130px) 0 clamp(50px, 6vw, 80px); }
.studio-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 5vw, 70px); align-items: end; margin-bottom: 44px; }
.studio-head p { margin: 0; color: var(--paper-muted); font-size: 18px; line-height: 1.5; max-width: 46ch; }
.studio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 56px); }
.studio figure { margin: 0; }
.studio figure button { display: block; padding: 0; border: 0; background: var(--paper-raised); width: 100%; cursor: zoom-in; box-shadow: 0 1px 0 var(--paper-line), 0 26px 60px rgba(24, 20, 15, .16); }
.studio figure button img { width: 100%; aspect-ratio: 560 / 520; object-fit: cover; object-position: top; }
.studio figcaption { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-top: 2px solid var(--paper-text); margin-top: 22px; padding-top: 12px; font-size: 17px; }
.studio figcaption b { font-weight: 600; }
.studio figcaption a { font: 700 12px var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--tally-dim); }
.studio-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--paper-line); }
.studio-foot p { margin: 0; font-size: 18px; }
.studio-foot p b { font: 900 32px/1 var(--font-display); margin-right: 8px; font-variant-numeric: tabular-nums; }

/* ---------- Price ledger ---------- */
.bb-prices { padding: clamp(50px, 6vw, 80px) 0 clamp(80px, 10vw, 130px); }
.bb-prices p.sub { color: var(--paper-muted); font-size: 18px; max-width: 32ch; margin: 14px 0 26px; }

/* ---------- Sheet lightbox with a reading lens ---------- */
.lb { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100vh; }
.lb::backdrop { background: rgba(6, 8, 14, .92); }
.lb-inner { height: 100%; display: grid; grid-template-rows: auto 1fr; gap: 10px; padding: 14px clamp(16px, 4vw, 32px) 18px; }
.lb-bar { display: flex; align-items: center; gap: 14px; justify-content: space-between; color: var(--ink-text); font: 700 12.5px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; }
.lb-actions { display: flex; gap: 10px; align-items: center; }
.lb .btn-ghost { border-color: var(--ink-line); color: var(--ink-text); padding: 10px 16px; }
.lb-close { background: none; border: 1px solid var(--ink-line); color: var(--ink-text); width: 44px; height: 44px; border-radius: 3px; font-size: 22px; cursor: pointer; }
.lb-stage { position: relative; overflow: auto; display: grid; place-items: start center; -webkit-overflow-scrolling: touch; }
.lb-stage img { max-height: calc(100vh - 90px); width: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); cursor: zoom-in; }
.lb-stage.is-zoom img { max-height: none; width: min(1600px, 220vw); max-width: none; cursor: zoom-out; }
.lens { position: fixed; width: 240px; height: 240px; border-radius: 50%; border: 2px solid var(--paper-raised); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); pointer-events: none; background-repeat: no-repeat; display: none; z-index: 5; }
@media (hover: hover) and (pointer: fine) { .lb-stage:hover .lens.on { display: block; } }
.lb-hint { color: var(--ink-muted); font: 400 12.5px var(--font-ui); text-transform: none; letter-spacing: 0; }

@media (max-width: 900px) {
  .book-grid { grid-template-columns: 1fr; grid-template-areas: 'intro' 'plate' 'pick'; }
  .studio-head { grid-template-columns: 1fr; }
  .plate { position: relative; top: 0; }
  .plate-frame { margin: 34px 30px 44px 0; }
  .anno { grid-template-columns: 1fr; }
  .notes { display: none; }
  .anno-list { display: grid; }
  .studio-grid { grid-template-columns: 1fr; }
  .lb-hint { display: none; }
}
@media (max-width: 480px) {
  .index button { grid-template-columns: 40px 1fr; }
  .index .tag { grid-column: 2; justify-self: start; margin-top: 4px; }
  .index .n { font-size: 22px; }
  .plate-open { right: 8px; bottom: 8px; padding: 11px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .bb-page *, .bb-page *::before, .bb-page *::after { transition: none !important; }
}
.bb-page [hidden] { display: none !important; }
.plate-frame { scroll-margin-top: 104px; }

/* review r1 fixes (2026-10-27) */
.intro-actions { margin: 0 0 34px; }
.pick > .actions .btn-primary { display: none; }          /* the intro carries the primary button */
.notes { z-index: 2; }
.notes.r .note { width: calc(100% + var(--reach, 0px)); margin-left: calc(-1 * var(--reach, 0px)); }
.notes.r .note i { background: var(--tally-on-dark); opacity: .8; }
.note p { font-size: 14px; max-width: 210px; }
@media (min-width: 901px) {
  .plate-frame { width: fit-content; max-width: calc(100% - 34px); }
  .plate-frame img { width: auto; max-width: 100%; max-height: calc(100vh - 150px); }
}

/* review r3 fixes (2026-10-27) */
.plate-open { position: absolute; right: -2px; bottom: -82px; padding: 11px 16px; }
.bb-prices.bb-dark { background: var(--ink-900); color: var(--ink-text); padding: clamp(80px, 10vw, 120px) 0; }
.bb-prices-head { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 5vw, 70px); align-items: end; margin-bottom: 40px; }
.bb-prices.bb-dark p.sub { color: var(--ink-muted); margin: 0; max-width: 40ch; }
.price-tiles { list-style: none; margin: 0 0 36px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.price-tiles li { background: var(--ink-800); border: 1px solid var(--ink-line); border-radius: 6px; padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 10px; min-height: 170px; }
.price-tiles .pt-level { font-weight: 600; font-size: 17px; color: var(--ink-text); }
.price-tiles .pt-level small { display: block; font-weight: 400; font-size: 14px; color: var(--ink-muted); margin-top: 2px; }
.price-tiles .pt-price { margin-top: auto; font: 900 52px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink-text); }
.price-tiles .pt-unit { font: 700 11.5px var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.price-tiles .pt-season { border-color: var(--tally); }
.price-tiles .pt-season .pt-price { color: var(--tally-on-dark); }
.bb-dark .btn-ghost { border-color: var(--ink-line); color: var(--ink-text); }
.bb-dark .btn-ghost:hover { border-color: var(--ink-muted); }
.lb-bar { background: var(--ink-900); margin: -14px calc(-1 * clamp(16px, 4vw, 32px)) 0; padding: 12px clamp(16px, 4vw, 32px); border-bottom: 1px solid var(--ink-line); }
@media (max-width: 900px) {
  .bb-prices-head { grid-template-columns: 1fr; }
  .price-tiles { grid-template-columns: 1fr 1fr; }
  .plate-open { bottom: -84px; right: -28px; }
}
@media (max-width: 480px) {
  .price-tiles .pt-price { font-size: 42px; }
  .price-tiles li { min-height: 140px; padding: 18px; }
}
.bb-prices .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.plate-frame { margin-bottom: 104px; }
@media (max-width: 900px) { .plate-frame { margin-bottom: 104px; } }
