/* Court Logic — On Ball Coverages
   Fonts are self-hosted; licences are in fonts/Barlow-OFL.txt and
   fonts/Inter-OFL.txt and must stay with the files. */

@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/BarlowCondensed-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand palette, from the Court Logic brand guide. */
  --court-ink: #111714;
  --chalk-paper: #F2F0E7;
  --read-signal: #D5FA38;
  --sideline-sage: #87968B;
  --surface: #FFFFFF;

  /* Derived tones. Sage fails contrast for small text on light grounds,
     so light sections use this darker muted tone instead. */
  --muted-on-light: #5A6560;
  --muted-on-ink: #A9B5AC;
  --rule-on-light: #DCD8CA;
  --rule-on-ink: #2C3531;

  --content: 1160px;
  --reading: 68ch;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-y: clamp(3.5rem, 8vw, 6.5rem);

  --radius: 4px;
  --focus: 0 0 0 3px var(--court-ink), 0 0 0 6px var(--read-signal);

  --font-head: "Barlow Condensed", "Arial Narrow", Haettenschweiler, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--court-ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 900px) { body { font-size: 18px; } }

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, .head {
  font-family: var(--font-head);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin: 0;
}

h1 { font-size: clamp(2.75rem, 8.5vw, 5rem); }
h2 { font-size: clamp(2rem, 5.5vw, 3.25rem); }
h3 { font-size: clamp(1.35rem, 3vw, 1.75rem); }

p { margin: 0 0 1.1em; max-width: var(--reading); }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 2px;
}
.on-ink :focus-visible {
  box-shadow: 0 0 0 3px var(--court-ink), 0 0 0 6px var(--read-signal);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--read-signal);
  color: var(--court-ink);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { padding-block: var(--section-y); }

.section-ink { background: var(--court-ink); color: var(--chalk-paper); }
.section-paper { background: var(--chalk-paper); }

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  color: var(--muted-on-light);
}
.section-ink .eyebrow, .hero .eyebrow { color: var(--read-signal); }

.lede { font-size: 1.0625em; }

.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { margin-top: 1.25rem; }

/* ---------- Status banner (preview builds only) ---------- */

.status-banner {
  background: var(--read-signal);
  color: var(--court-ink);
  font-size: 0.9375rem;
  line-height: 1.5;
  padding-block: 0.75rem;
}
.status-banner p { max-width: none; margin: 0; }
.status-banner strong { font-weight: 600; }

/* ---------- Header ---------- */

.site-header {
  background: var(--court-ink);
  color: var(--chalk-paper);
  border-bottom: 1px solid var(--rule-on-ink);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 72px;
  padding-block: 0.875rem;
  flex-wrap: wrap;
}
.site-header .logo { width: 168px; flex: none; }
.site-header .logo svg, .site-header .logo img { width: 100%; }

.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.5rem 0;
  display: inline-block;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--read-signal); }

@media (max-width: 719px) {
  .site-header .wrap { min-height: 64px; gap: 0.75rem 1rem; }
  .site-header .logo { width: 140px; }
  .site-nav { margin-left: auto; width: 100%; order: 3; }
  .site-nav ul { gap: 1.25rem; justify-content: flex-start; flex-wrap: wrap; }
  .site-header .btn { margin-left: auto; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.8rem 1.6rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-sm { min-height: 44px; padding: 0.5rem 1.1rem; font-size: 0.9375rem; }

/* Ink text on lime — the brand's primary action. */
.btn-primary { background: var(--read-signal); color: var(--court-ink); border-color: var(--read-signal); }
.btn-primary:hover { background: #C6EB27; border-color: #C6EB27; }

.btn-secondary { background: transparent; color: var(--chalk-paper); border-color: var(--sideline-sage); }
.btn-secondary:hover { border-color: var(--chalk-paper); background: rgba(242, 240, 231, 0.08); }

.section-paper .btn-secondary, .surface .btn-secondary {
  color: var(--court-ink);
  border-color: var(--court-ink);
}
.section-paper .btn-secondary:hover { background: rgba(17, 23, 20, 0.06); }

/* An action that cannot work yet is a disabled button, never a live-looking link. */
.btn[aria-disabled="true"] {
  background: transparent;
  color: var(--muted-on-ink);
  border-color: var(--rule-on-ink);
  border-style: dashed;
  cursor: not-allowed;
}
.section-paper .btn[aria-disabled="true"] {
  color: var(--muted-on-light);
  border-color: var(--rule-on-light);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-block: 1.75rem 1rem;
}
.actions .btn { flex: 1 1 auto; min-width: 220px; }
@media (min-width: 560px) { .actions .btn { flex: 0 0 auto; } }

.action-note {
  font-size: 0.9375rem;
  color: var(--muted-on-ink);
  max-width: 46ch;
  margin: 0;
}
.action-note + .action-note { margin-top: 1rem; }
.section-paper .action-note, .surface .action-note { color: var(--muted-on-light); }

/* ---------- Hero ---------- */

.hero { background: var(--court-ink); color: var(--chalk-paper); padding-block: clamp(3rem, 7vw, 5.5rem); }
.hero .wrap { display: grid; gap: clamp(2.5rem, 6vw, 4rem); }
@media (min-width: 940px) {
  .hero .wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; }
}

.hero h1 { margin-bottom: 1.5rem; }
.hero .lede { color: var(--chalk-paper); max-width: 34ch; }

.spec-line {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--read-signal);
  letter-spacing: 0.02em;
  margin: 1.5rem 0 0;
  max-width: none;
}
.version-line {
  font-size: 0.875rem;
  color: var(--muted-on-ink);
  margin: 0.75rem 0 0;
  max-width: 44ch;
}

/* Hero art: cover next to a readable practice page. */
.hero-art { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.hero-art figure { margin: 0; }
.hero-art .page-shot { width: 100%; }
.hero-art .shot-cover { transform: rotate(-1.2deg); }
.hero-art .shot-page { transform: rotate(1.2deg); margin-top: 2rem; }
@media (max-width: 939px) {
  .hero-art { grid-template-columns: minmax(0, 340px); justify-content: center; }
  .hero-art .shot-page { display: none; }
  .hero-art .shot-cover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art .shot-cover, .hero-art .shot-page { transform: none; }
}

.page-shot {
  border: 1px solid var(--rule-on-ink);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}
.section-paper .page-shot, .surface .page-shot {
  border-color: var(--rule-on-light);
  box-shadow: 0 10px 26px rgba(17, 23, 20, 0.10);
}

/* ---------- Read window: the brand's open-frame motif ---------- */

.read-window { position: relative; padding: clamp(1.25rem, 3vw, 2rem); }
.read-window::before, .read-window::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2px solid var(--court-ink);
  pointer-events: none;
}
.section-ink .read-window::before,
.section-ink .read-window::after,
.hero .read-window::before,
.hero .read-window::after { border-color: var(--read-signal); }
.read-window::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.read-window::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* ---------- Practice sequence ---------- */

.sequence { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--rule-on-light); border-block: 1px solid var(--rule-on-light); }
@media (min-width: 760px) { .sequence { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .sequence { grid-template-columns: repeat(6, 1fr); } }

.sequence li { background: var(--chalk-paper); padding: 1.25rem 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 0.35rem; }
.sequence .step-time {
  font-family: var(--font-head);
  font-size: 2rem;
  line-height: 1;
  color: var(--court-ink);
}
.sequence .step-time span { font-size: 0.75rem; font-family: var(--font-body); font-weight: 600; letter-spacing: 0.08em; color: var(--muted-on-light); display: block; margin-top: 0.35rem; }
.sequence .step-name { font-weight: 600; }
.sequence .step-note { font-size: 0.9375rem; color: var(--muted-on-light); margin: 0; }
.sequence li:nth-child(5) { background: var(--court-ink); color: var(--chalk-paper); }
.sequence li:nth-child(5) .step-time { color: var(--read-signal); }
.sequence li:nth-child(5) .step-time span,
.sequence li:nth-child(5) .step-note { color: var(--muted-on-ink); }

.sequence-note { margin-top: 2rem; }

/* ---------- Coverage cards ---------- */

.cards { display: grid; gap: clamp(1.25rem, 2.5vw, 1.75rem); }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--rule-on-light);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.card-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-head);
  font-size: 1.6rem;
  line-height: 1;
}
/* The colour names are team language. A shape marker carries the same
   information so colour is never the only identifier. */
.card-mark { width: 16px; height: 16px; flex: none; border: 2px solid var(--court-ink); }
.mark-red { background: var(--court-ink); }
.mark-green { background: transparent; }
.mark-black { background: var(--court-ink); border-radius: 50%; }
.mark-mixed { background: linear-gradient(135deg, var(--court-ink) 0 50%, transparent 50% 100%); }

.card-sub { font-size: 0.9375rem; font-weight: 600; color: var(--muted-on-light); margin: -0.5rem 0 0; }
.card figure { margin: 0; }
.card .diagram { width: 100%; border: 1px solid var(--rule-on-light); background: var(--chalk-paper); }
.card dl { margin: 0; display: grid; gap: 0.75rem; }
.card dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-on-light); }
.card dd { margin: 0.15rem 0 0; }

/* ---------- Sample pages ---------- */

.samples { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
.sample { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 820px) {
  .sample { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: clamp(2rem, 4vw, 3.5rem); }
  .sample:nth-child(even) .sample-figure { order: 2; }
}

.sample-figure { margin: 0; }
.zoom {
  display: block;
  text-align: left;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  width: 100%;
  position: relative;
}
.zoom .page-shot { width: 100%; }
.zoom-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted-on-light);
}
.zoom-hint::before {
  content: "";
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.zoom:hover .zoom-hint { color: var(--court-ink); }

.sample-body h3 { margin-bottom: 0.75rem; }
.sample-body .page-ref { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-on-light); margin-bottom: 0.6rem; }

/* Lightbox */
dialog.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  overflow: auto;
}
dialog.lightbox::backdrop { background: rgba(17, 23, 20, 0.92); }
.lightbox-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 2rem);
}
.lightbox-inner img { max-width: min(920px, 100%); background: #fff; }
.lightbox-caption { color: var(--chalk-paper); font-size: 0.9375rem; max-width: 60ch; text-align: center; margin: 0; }
.lightbox-close { align-self: flex-end; }

/* ---------- Included files ---------- */

.files { display: grid; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 760px) { .files { grid-template-columns: repeat(2, 1fr); } }
.file {
  background: var(--surface);
  border: 1px solid var(--rule-on-light);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
}
.file .file-kind { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-on-light); margin-bottom: 0.5rem; }
.file h3 { margin-bottom: 0.6rem; }
.file ul { margin: 1rem 0 0; padding-left: 1.1rem; }
.file li { margin-bottom: 0.35rem; }

.delivery-note { margin-top: 2rem; }

/* ---------- Coach ---------- */

.coach { display: grid; gap: 2rem; }
@media (min-width: 820px) { .coach { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.coach h2 { margin-bottom: 1.5rem; }
.coach-facts { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; }
.coach-facts li { padding-left: 1.6rem; position: relative; }
.coach-facts li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.65em;
  width: 10px; height: 10px;
  background: var(--read-signal);
  border: 1px solid var(--court-ink);
}
.section-ink .coach-facts li::before { border-color: var(--read-signal); }

/* ---------- Purchase ---------- */

.purchase-panel {
  border: 1px solid var(--rule-on-ink);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: rgba(242, 240, 231, 0.04);
}
.purchase-grid { display: grid; gap: 2rem; }
@media (min-width: 860px) { .purchase-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 3rem; } }
.purchase-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.purchase-list li { padding-left: 1.6rem; position: relative; }
.purchase-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.6em;
  width: 12px; height: 2px;
  background: var(--read-signal);
}
.price {
  font-family: var(--font-head);
  font-size: clamp(2.25rem, 6vw, 3rem);
  line-height: 1;
  color: var(--read-signal);
  margin: 0 0 0.5rem;
}
.price-pending {
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--muted-on-ink);
  text-transform: none;
}

/* ---------- FAQ ---------- */

.faq { max-width: 820px; }
.faq details {
  border-bottom: 1px solid var(--rule-on-light);
  padding: 0.35rem 0;
}
.faq details:first-of-type { border-top: 1px solid var(--rule-on-light); }
.faq summary {
  font-weight: 600;
  font-size: 1.0625rem;
  padding: 1.1rem 2.5rem 1.1rem 0;
  cursor: pointer;
  position: relative;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.4rem;
  top: 1.55rem;
  width: 11px; height: 11px;
  border-right: 2px solid var(--court-ink);
  border-bottom: 2px solid var(--court-ink);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 1.8rem; }
.faq .answer { padding: 0 0 1.35rem; }
.faq .answer p { max-width: 66ch; }

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

/* ---------- Footer ---------- */

.site-footer { background: var(--court-ink); color: var(--chalk-paper); padding-block: clamp(3rem, 6vw, 4.5rem); }
.footer-top { display: grid; gap: 2rem; }
@media (min-width: 760px) { .footer-top { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } }
.site-footer .logo { width: 200px; }
.site-footer .tagline { font-family: var(--font-head); font-size: 1.5rem; margin: 1.25rem 0 0; text-transform: none; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; font-size: 0.9375rem; }
.footer-links a { text-decoration: underline; text-underline-offset: 3px; }
.footer-pending { color: var(--muted-on-ink); }
.footer-bottom {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-on-ink);
  font-size: 0.875rem;
  color: var(--muted-on-ink);
  display: grid;
  gap: 0.75rem;
}
.footer-bottom p { max-width: 78ch; }

/* ---------- Sticky mobile purchase bar ---------- */

.sticky-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: var(--court-ink);
  border-top: 1px solid var(--rule-on-ink);
  padding: 0.75rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 1rem;
  transform: translateY(110%);
  transition: transform 0.2s ease;
}
.sticky-bar[data-visible="true"] { transform: translateY(0); }
.sticky-bar .bar-text { font-size: 0.875rem; color: var(--muted-on-ink); line-height: 1.35; margin: 0; }
.sticky-bar .bar-text strong { display: block; color: var(--chalk-paper); font-weight: 600; font-size: 0.9375rem; }
.sticky-bar .btn { margin-left: auto; flex: none; }
@media (min-width: 760px) { .sticky-bar { display: none; } }
@media (prefers-reduced-motion: reduce) { .sticky-bar { transition: none; } }

/* Keep the bar clear of page content and of a focused element. */
body[data-bar="on"] { padding-bottom: 88px; }
@media (min-width: 760px) { body[data-bar="on"] { padding-bottom: 0; } }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
