/* Chessvera website. Colours follow the app's "brass" palette (lib/ui/theme.dart). */
:root {
  --bg: #121110;
  --bg-2: #0f0e0d;
  --card: #1e1c19;
  --card-low: #181715;
  --text: #f1ebdd;
  --muted: #a39c8c;
  --divider: #2e2b26;
  --gold: #c9a24a;
  --gold-text: #d6b25e;
  --on-gold: #1a1408;
  --sq-light: #ebddbd;
  --sq-dark: #a9845a;
  --good: #3fb950;
  --mistake: #e8833a;
  --blunder: #d946a6;
  --focus: #f0cf7a;
  --radius: 16px;
  --maxw: 1080px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #faf6ec;
    --bg-2: #f3ecdc;
    --card: #ffffff;
    --card-low: #f7f1e3;
    --text: #1f1a12;
    --muted: #5f5747;
    --divider: #e3d9c4;
    --gold: #c9a24a;
    --gold-text: #7d5f17;
    --on-gold: #1a1408;
    --focus: #7d5f17;
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #faf6ec;
  --bg-2: #f3ecdc;
  --card: #ffffff;
  --card-low: #f7f1e3;
  --text: #1f1a12;
  --muted: #5f5747;
  --divider: #e3d9c4;
  --gold: #c9a24a;
  --gold-text: #7d5f17;
  --on-gold: #1a1408;
  --focus: #7d5f17;
  color-scheme: light;
}

:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--gold);
  color: var(--on-gold);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { left: 16px; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--divider);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
}
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--card-low); }
.theme-toggle {
  background: transparent;
  border: 1px solid var(--divider);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }

/* Hero */
.hero { padding: 72px 0 48px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  color: var(--gold-text);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin: 0 0 12px;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}
h1 .accent { color: var(--gold-text); }
.lead { font-size: 1.2rem; color: var(--muted); margin: 0 0 28px; max-width: 34em; }

.stores { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 18px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.15;
}
.store-btn small { display: block; font-weight: 400; font-size: 0.72rem; opacity: 0.8; }
.store-btn svg { width: 24px; height: 24px; flex: none; }
.store-btn[aria-disabled="true"] { opacity: 0.85; }
.store-note { color: var(--muted); font-size: 0.9rem; margin-top: 12px; }

.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 700;
  text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--divider); }

/* Board mock */
.mock {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  max-width: 400px;
  justify-self: center;
  width: 100%;
}
.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.board span { display: block; }
.board .l { background: var(--sq-light); }
.board .d { background: var(--sq-dark); }
.board .hl { box-shadow: inset 0 0 0 100px rgba(156, 199, 0, 0.45); }
.board svg.arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.coach-card {
  margin-top: 14px;
  background: var(--card-low);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.95rem;
}
.coach-card .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blunder);
  color: #ffffff;
  margin-right: 6px;
}
.coach-card p { margin: 6px 0 0; color: var(--muted); }
.coach-card strong { color: var(--text); }

/* Sections */
section { padding: 56px 0; }
section.alt { background: var(--bg-2); border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); line-height: 1.2; margin: 0 0 14px; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; margin: 0 0 6px; }
.section-lead { color: var(--muted); max-width: 40em; margin: 0 0 32px; font-size: 1.08rem; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 22px;
}
.card p { margin: 0; color: var(--muted); }
.card .ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--gold) 18%, transparent);
  color: var(--gold-text);
  margin-bottom: 12px;
}
.card .ico svg { width: 22px; height: 22px; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
}
.steps li::before {
  content: counter(step);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 800;
}
.steps p { margin: 0; color: var(--muted); }

/* Pricing */
.price-card { position: relative; }
.price-card.pro { border-color: var(--gold); }
.price { font-size: 2.2rem; font-weight: 800; margin: 4px 0 6px; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 400; }
.ticks { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.ticks li { padding-left: 26px; position: relative; color: var(--muted); }
.ticks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.5em;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--gold-text);
  border-bottom: 2px solid var(--gold-text);
  transform: rotate(-45deg);
}
.fine { color: var(--muted); font-size: 0.92rem; }

/* Prose pages */
.page { padding: 48px 0 64px; }
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(2rem, 4vw, 2.6rem); }
.prose h2 { font-size: 1.45rem; margin-top: 36px; }
.prose h3 { margin-top: 24px; }
.prose p, .prose li { color: var(--text); }
.prose .meta { color: var(--muted); margin-top: -8px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 6px 0; }
.note {
  background: var(--card);
  border: 1px solid var(--divider);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 20px 0;
}
.note p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 16px 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--divider); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }

details.faq {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 0 18px;
  margin: 10px 0;
}
details.faq summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--gold-text); font-size: 1.3rem; line-height: 1; }
details.faq[open] summary::after { content: "\2212"; }
details.faq > div { padding: 0 0 16px; color: var(--muted); }
details.faq > div p { margin: 0 0 10px; color: var(--muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--divider);
  padding: 36px 0 48px;
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 6px 0; }

@media (max-width: 860px) {
  .hero { padding-top: 40px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; }
  .grid, .grid.two { grid-template-columns: 1fr; }
  .nav { margin-left: 0; width: 100%; padding-bottom: 8px; }
  .site-header { position: static; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Pieces on the hero board (Unicode glyphs, decorative only). */
.board { container-type: inline-size; }
.board span { display: grid; place-items: center; }
.pc {
  font-style: normal;
  font-size: 30px;
  font-size: 10.5cqw;
  line-height: 1;
  font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", "DejaVu Sans", serif;
}
.pc.w { color: #fbf8f1; text-shadow: 0 0 1px #2a2118, 0 0 1px #2a2118, 0 1px 1px #2a2118; }
.pc.b { color: #1d1712; text-shadow: 0 0 1px #f5ecd8; }

/* A URL shown as text (e.g. the source repository before it is live). */
.code-url {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
  color: var(--text);
}

/* Store buttons before the listing exists. */
.store-btn[aria-disabled="true"] { cursor: default; }

/* 404 */
.notfound { text-align: center; }
.notfound .lead { margin: 0 auto; }
.notfound .big { font-size: clamp(3.5rem, 10vw, 6rem); font-weight: 800; color: var(--gold-text); margin: 0; line-height: 1; }
.notfound .links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
