/* Chess Mastery Trainer -- marketing site.

   Shares the desktop app's design tokens (static/css/app.css in the
   chessmaster-productization repo, Phase 31/32/35): dark-first, the
   warm bronze/amber accent, the near-black "ink" and warm "paper"
   neutrals, the cream/slate board colours and the Inter typeface.

   The app gets its dark surfaces from Bootstrap 5.3's own dark theme
   (data-bs-theme="dark"). This site is a single static page and does
   not load Bootstrap at all -- the handful of Bootstrap dark-theme
   values the app inherits (body background/text, border, muted text,
   alert colours, the 6px radius) are reproduced below as plain custom
   properties instead, so the two look like one product without the
   site paying for a framework it barely uses. If app.css's tokens
   change, change the block below to match.
*/

:root {
  /* -- Tokens copied from the app's app.css -- */
  --cmt-accent: #c98a35;
  --cmt-accent-hover: #dc9c46;
  --cmt-accent-active: #a86f26;
  --cmt-accent-ink: #1c1200;
  --cmt-ink: #15171b;
  --cmt-paper: #f3ede2;
  --cmt-surface-2: #262b34;
  --cmt-heat-1: #4a3822;
  --cmt-heat-2: #7a5b28;
  --cmt-heat-3: #a8792f;
  --cmt-board-light: #eae5d8;
  --cmt-board-dark: #4b5563;
  --cmt-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* -- Bootstrap 5.3 dark-theme values the app inherits -- */
  --cmt-body-bg: #212529;
  --cmt-body-color: #dee2e6;
  --cmt-heading: #f8f9fa;
  --cmt-muted: #a9afb5;
  --cmt-border: rgba(255, 255, 255, 0.15);
  --cmt-border-strong: #495057;
  --cmt-radius: 6px;
  --cmt-radius-lg: 10px;
  --cmt-success-bg: #051b11;
  --cmt-success-border: #0f5132;
  --cmt-success-text: #75b798;
  --cmt-danger-bg: #2c0b0e;
  --cmt-danger-border: #842029;
  --cmt-danger-text: #ea868f;

  --max-width: 1080px;
  --header-height: 64px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--cmt-font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--cmt-body-color);
  background: var(--cmt-body-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--cmt-heading);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--cmt-accent);
  text-decoration: none;
}

a:hover {
  color: var(--cmt-accent-hover);
  text-decoration: underline;
}

code {
  font-size: 0.9em;
  background: var(--cmt-surface-2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* Honeypot field -- present in the DOM (so a bot's form-filler sees a
   normal-looking input) but never visible or reachable by a real
   visitor: off-screen, not tab-focusable. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-height);
  background: rgba(33, 37, 41, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cmt-border);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--cmt-heading);
}

.brand:hover {
  color: var(--cmt-heading);
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a.nav-link {
  padding: 6px 12px;
  color: var(--cmt-body-color);
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.site-nav a.nav-link:hover {
  color: var(--cmt-heading);
  text-decoration: none;
  border-bottom-color: rgba(201, 138, 53, 0.35);
}

.site-nav .btn {
  margin-left: 8px;
}

/* -- Buttons and forms ------------------------------------------- */

.btn {
  display: inline-block;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--cmt-radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: var(--cmt-accent-ink);
  background: var(--cmt-accent);
  border-color: var(--cmt-accent);
}

.btn-primary:hover {
  color: var(--cmt-accent-ink);
  background: var(--cmt-accent-hover);
  border-color: var(--cmt-accent-hover);
}

.btn-primary:active {
  background: var(--cmt-accent-active);
  border-color: var(--cmt-accent-active);
}

.btn-outline {
  color: var(--cmt-accent);
  background: transparent;
  border-color: var(--cmt-accent);
}

.btn-outline:hover {
  color: var(--cmt-accent-ink);
  background: var(--cmt-accent);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.9rem;
}

.waitlist-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 12px;
}

.waitlist-form input[type="email"] {
  flex: 1 1 260px;
  min-width: 0;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--cmt-body-color);
  background: var(--cmt-body-bg);
  border: 1px solid var(--cmt-border-strong);
  border-radius: var(--cmt-radius);
}

.waitlist-form input[type="email"]::placeholder {
  color: #6c757d;
}

.waitlist-form input[type="email"]:focus {
  outline: none;
  border-color: var(--cmt-accent);
  box-shadow: 0 0 0 0.2rem rgba(201, 138, 53, 0.25);
}

.form-note {
  font-size: 0.85rem;
  color: var(--cmt-muted);
  margin: 0;
}

/* -- Flash messages ------------------------------------------------ */

.flash-container {
  max-width: var(--max-width);
  margin: 16px auto 0;
  padding: 0 24px;
}

.flash {
  padding: 12px 16px;
  border-radius: var(--cmt-radius);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.flash-success {
  background: var(--cmt-success-bg);
  color: var(--cmt-success-text);
  border: 1px solid var(--cmt-success-border);
}

.flash-error {
  background: var(--cmt-danger-bg);
  color: var(--cmt-danger-text);
  border: 1px solid var(--cmt-danger-border);
}

/* -- Sections -------------------------------------------------------- */

main {
  animation: cmt-fade-in 0.18s ease-out;
}

@keyframes cmt-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

section {
  scroll-margin-top: calc(var(--header-height) + 8px);
}

.section {
  padding: 72px 0;
}

.section + .section {
  border-top: 1px solid var(--cmt-border);
}

.section-head {
  max-width: 680px;
  margin-bottom: 36px;
}

.section-head h2 {
  font-size: 2rem;
}

.section-head p {
  color: var(--cmt-muted);
  font-size: 1.05rem;
  margin: 0;
}

.eyebrow {
  display: block;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cmt-accent);
}

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

.hero {
  padding: 72px 0 64px;
  background:
    radial-gradient(60% 90% at 88% 0%, rgba(201, 138, 53, 0.16), transparent 70%),
    var(--cmt-body-bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  color: var(--cmt-accent);
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--cmt-muted);
  max-width: 560px;
  margin-bottom: 28px;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 18px;
  font-size: 0.95rem;
}

/* The decorative board: a real checkerboard built exactly the way the
   app builds its own (app.css's cg-board rule -- one repeating conic
   gradient tile, percentage-sized so it stays correct at any width),
   with the app's own board colours, eval bar and move highlight. Pure
   CSS/SVG, no images. */
.board-demo {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: stretch;
}

.board-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  container-type: inline-size;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  background-color: var(--cmt-board-light);
  background-image: repeating-conic-gradient(var(--cmt-board-dark) 0% 25%, var(--cmt-board-light) 0% 50%);
  background-size: 25% 25%;
  overflow: hidden;
}

.board-frame .sq {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
}

.board-frame .sq-hl {
  background: rgba(201, 138, 53, 0.55);
}

.board-frame .piece {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  display: grid;
  place-items: center;
  font-size: 10cqw;
  line-height: 1;
  font-family: 'Segoe UI Symbol', 'Apple Symbols', 'DejaVu Sans', sans-serif;
}

.board-frame .piece.w {
  color: #ffffff;
  text-shadow: 0 0 1px #15171b, 0 1px 2px #15171b, 0 0 4px rgba(21, 23, 27, 0.7);
}

.board-frame .piece.b {
  color: #15171b;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.35);
}

.board-frame .board-arrow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.eval-bar {
  flex: 0 0 18px;
  width: 18px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--cmt-ink);
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.eval-bar-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--cmt-paper);
}

.board-caption {
  max-width: 460px;
  margin: 14px auto 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--cmt-muted);
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  margin-right: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cmt-accent-ink);
  background: var(--cmt-accent);
  border-radius: 999px;
}

/* -- Proof strip ---------------------------------------------------------- */

.proof {
  padding: 28px 0;
  background: var(--cmt-ink);
  border-top: 1px solid var(--cmt-border);
  border-bottom: 1px solid var(--cmt-border);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  text-align: center;
}

.proof-figure {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cmt-accent);
  font-variant-numeric: tabular-nums;
}

.proof-label {
  display: block;
  font-size: 0.85rem;
  color: var(--cmt-muted);
}

/* -- Cards ----------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  padding: 22px;
  background: var(--cmt-surface-2);
  border: 1px solid var(--cmt-border);
  border-radius: var(--cmt-radius-lg);
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.card p {
  color: var(--cmt-muted);
  margin: 0;
  font-size: 0.95rem;
}

.card p + p {
  margin-top: 10px;
}

.card .tag {
  display: inline-block;
  margin-top: 12px;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cmt-accent);
  border: 1px solid rgba(201, 138, 53, 0.45);
  border-radius: 999px;
}

.card-wide {
  grid-column: 1 / -1;
}

/* -- "Your games become puzzles" flow -------------------------------- */

.flow {
  background: var(--cmt-ink);
}

.steps {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 22px 20px 20px;
  background: var(--cmt-surface-2);
  border: 1px solid var(--cmt-border);
  border-radius: var(--cmt-radius-lg);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--cmt-accent-ink);
  background: var(--cmt-accent);
  border-radius: 50%;
}

.steps h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.steps p {
  margin: 0;
  color: var(--cmt-muted);
  font-size: 0.93rem;
}

.review-note {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

/* -- Own it / trust ------------------------------------------------------ */

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.trust-item h3 {
  font-size: 1.1rem;
}

.trust-item p {
  color: var(--cmt-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* -- Beta ---------------------------------------------------------------- */

.beta {
  text-align: center;
}

.beta .section-head {
  margin-left: auto;
  margin-right: auto;
}

.beta-panel {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px;
  background: var(--cmt-surface-2);
  border: 1px solid rgba(201, 138, 53, 0.4);
  border-radius: var(--cmt-radius-lg);
}

.beta-progress {
  display: inline-block;
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--cmt-accent);
  font-variant-numeric: tabular-nums;
}

.beta-panel p:not(.beta-progress):not(.form-note) {
  color: var(--cmt-muted);
}

.beta-panel .waitlist-form {
  justify-content: center;
}

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

.faq {
  max-width: 760px;
}

.faq details {
  border-bottom: 1px solid var(--cmt-border);
  padding: 14px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--cmt-heading);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  color: var(--cmt-accent);
  font-weight: 700;
}

.faq details[open] summary::after {
  content: '\2212';
}

.faq details p {
  margin: 10px 0 0;
  color: var(--cmt-muted);
}

/* -- Closing CTA ------------------------------------------------------------ */

.cta {
  text-align: center;
  background:
    radial-gradient(50% 120% at 50% 100%, rgba(201, 138, 53, 0.14), transparent 70%),
    var(--cmt-body-bg);
}

.cta .waitlist-form {
  max-width: 520px;
  margin: 0 auto 12px;
}

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

.site-footer {
  padding: 32px 0 40px;
  color: var(--cmt-muted);
  font-size: 0.85rem;
  background: var(--cmt-ink);
  border-top: 1px solid var(--cmt-border);
}

.site-footer p {
  margin: 0 0 10px;
}

.site-footer .legal {
  max-width: 820px;
  font-size: 0.8rem;
}

/* -- Responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .proof-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-nav a.nav-link {
    display: none;
  }

  .section {
    padding: 52px 0;
  }

  .section-head h2 {
    font-size: 1.6rem;
  }
}

@media (max-width: 520px) {
  .container {
    padding: 0 16px;
  }

  .brand {
    font-size: 1rem;
    white-space: nowrap;
  }

  .site-nav .btn {
    margin-left: 0;
    padding: 6px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .hero {
    padding: 44px 0 44px;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .steps,
  .card-grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .beta-panel {
    padding: 22px 18px;
  }
}

/* Anyone who has asked their OS for reduced motion gets none of the
   animation -- same courtesy the app's own Phase 37 rules extend. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  main,
  .btn,
  .btn:active,
  .site-nav a.nav-link {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* -- SEO landing pages ---------------------------------------------------- */

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 16px;
}

.footer-nav a {
  color: var(--cmt-muted);
}

.footer-nav a:hover {
  color: var(--cmt-accent-hover);
}

.section-more {
  margin: 28px 0 0;
}

.page-hero {
  padding: 56px 0 48px;
}

.page-hero h1 {
  font-size: 2.4rem;
  max-width: 820px;
}

.page-hero .lead {
  max-width: 720px;
  font-size: 1.15rem;
  color: var(--cmt-muted);
  margin-bottom: 24px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--cmt-muted);
}

.prose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}

.prose {
  max-width: 680px;
}

.prose h2 {
  font-size: 1.5rem;
  margin: 1.6em 0 0.5em;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  color: var(--cmt-body-color);
}

.checklist ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checklist li {
  position: relative;
  padding: 6px 0 6px 24px;
  color: var(--cmt-muted);
  font-size: 0.95rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cmt-accent);
}

@media (max-width: 900px) {
  .prose-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 520px) {
  .page-hero h1 {
    font-size: 1.8rem;
  }
}
