/*
 * Landing page stylesheet — visual identity for sahtutor.com root.
 *
 * Distinct from legal.css (which is utilitarian, dense, optimized
 * for long-form policy text). Landing is marketing surface: needs
 * presence, warmth, and a clear visual rhythm.
 *
 * Palette draws from the app's "Klasika" theme:
 *   - slate-900 (#0f172a) base — same as the chess board background
 *   - warm gold (#f0b830, #fbbf24) for chess-piece accents — calls
 *     back to wooden pieces, hints at premium
 *   - emerald (#10b981) for primary CTAs — the "go" colour
 *   - slate-100/300/400 for text hierarchy
 *
 * No framework. ~6 KB of vanilla CSS. Pure custom-property tokens
 * so future theme tweaks are one-line changes.
 */

:root {
  --bg: #0a0f1c;
  --bg-soft: #111a2e;
  --bg-card: #15203a;
  --bg-card-hover: #1a2745;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --gold: #f0b830;
  --gold-bright: #fbbf24;
  --gold-soft: rgba(240, 184, 48, 0.12);
  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-soft: rgba(16, 185, 129, 0.12);
  --radius: 14px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--emerald-bright);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--gold-bright);
}

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

/* ============================================================
 * HEADER
 * ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 15, 28, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.01em;
}
.brand:hover {
  color: var(--gold-bright);
}

.nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
}
.nav a {
  color: var(--text-dim);
  font-weight: 500;
}
.nav a:hover {
  color: var(--text);
}
.nav .nav-cta {
  color: var(--bg);
  background: var(--emerald);
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 600;
}
.nav .nav-cta:hover {
  background: var(--emerald-bright);
  color: var(--bg);
}

@media (max-width: 640px) {
  .nav {
    gap: 14px;
    font-size: 13px;
  }
  .nav .nav-meta {
    display: none;
  }
}

/* ============================================================
 * HERO
 * ============================================================ */

.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 24px 60px;
}

/* Subtle chess-board pattern in the hero background — only at very */
/* low opacity so it reads as "texture" not "wallpaper". */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, var(--bg-soft) 25%, transparent 25%),
    linear-gradient(-45deg, var(--bg-soft) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--bg-soft) 75%),
    linear-gradient(-45deg, transparent 75%, var(--bg-soft) 75%);
  background-size: 80px 80px;
  background-position:
    0 0,
    0 40px,
    40px -40px,
    -40px 0;
  opacity: 0.4;
  pointer-events: none;
  mask-image: radial-gradient(
    ellipse at center,
    black 0%,
    transparent 70%
  );
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    black 0%,
    transparent 70%
  );
}

.hero-inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-copy {
  max-width: 540px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--gold-soft);
  border: 1px solid rgba(240, 184, 48, 0.3);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(36px, 5.2vw, 56px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  color: var(--text);
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 32px;
}

.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--emerald) 0%, #14b8a6 100%);
  color: white;
  box-shadow:
    0 6px 20px rgba(16, 185, 129, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover {
  transform: translateY(-1px);
  color: white;
  box-shadow:
    0 10px 24px rgba(16, 185, 129, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--gold);
}

.hero-trust {
  margin-top: 26px;
  font-size: 13px;
  color: var(--text-faint);
}
.hero-trust strong {
  color: var(--text-dim);
}

/* Hero visual side — chess board mockup */

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image {
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-lg);
  box-shadow:
    0 25px 60px -10px rgba(0, 0, 0, 0.6),
    0 0 0 1px var(--border-strong);
}

/* Decorative chess piece glyphs floating around the hero image */
.hero-decoration {
  position: absolute;
  font-size: 80px;
  color: var(--gold);
  opacity: 0.18;
  user-select: none;
  pointer-events: none;
}
.hero-decoration.k1 {
  top: -10px;
  left: -20px;
  transform: rotate(-12deg);
}
.hero-decoration.k2 {
  bottom: -10px;
  right: -10px;
  font-size: 100px;
  transform: rotate(8deg);
}

@media (max-width: 880px) {
  .hero {
    padding: 56px 20px 40px;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  /* With the interactive puzzle as the hero visual, the headline
     stays FIRST on mobile (no order:-1 like the old static image) —
     visitors need two seconds of context ("AI šah trener") before a
     chess position makes sense. */
  .hero-image {
    max-width: 380px;
  }
  .hero-decoration {
    display: none;
  }
}

/* ============================================================
 * SECTION SHELL
 * ============================================================ */

.section {
  padding: 80px 24px;
}
.section.alt {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.section-eyebrow {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.section-title {
  text-align: center;
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 auto 16px;
  max-width: 760px;
  line-height: 1.15;
  color: var(--text);
}

.section-lead {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .section {
    padding: 56px 20px;
  }
  .section-lead {
    margin-bottom: 36px;
  }
}

/* ============================================================
 * PRODUCT PREVIEW
 * ============================================================ */

.preview-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 12%, rgba(240, 184, 48, 0.12), transparent 30%),
    radial-gradient(circle at 86% 24%, rgba(16, 185, 129, 0.1), transparent 28%),
    var(--bg);
}

.preview-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent, black 18%, black 82%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 18%, black 82%, transparent);
  pointer-events: none;
}

.preview-section .section-inner {
  position: relative;
}

.product-preview {
  background: rgba(21, 32, 58, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px -46px rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.preview-carousel {
  padding: 22px;
}

.preview-carousel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.preview-copy {
  max-width: 650px;
}

.preview-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 10px;
  border: 1px solid rgba(240, 184, 48, 0.28);
  border-radius: 999px;
  color: var(--gold-bright);
  background: var(--gold-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-copy h3 {
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
}

.preview-copy p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.58;
}

.preview-controls {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.preview-arrow {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(10, 15, 28, 0.7);
  color: var(--text);
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.preview-arrow:hover,
.preview-arrow:focus-visible {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-bright);
  transform: translateY(-1px);
}

.preview-stage {
  display: grid;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 4px);
}

.preview-slide {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateX(18px) scale(0.985);
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

.preview-slide.is-active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.preview-frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 6px);
  background: #070b14;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 18px 40px -24px rgba(0, 0, 0, 0.85);
}

.preview-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  border-radius: inherit;
}

.preview-frame picture {
  display: block;
}

.preview-frame img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.preview-frame-main {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 30px 65px -34px rgba(0, 0, 0, 0.9);
}

.preview-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  padding-top: 18px;
}

.preview-dot {
  width: 38px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  cursor: pointer;
  transition:
    width 0.18s ease,
    background 0.18s ease;
}

.preview-dot:hover,
.preview-dot:focus-visible {
  background: rgba(251, 191, 36, 0.55);
}

.preview-dot.is-active {
  width: 58px;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
}

@media (max-width: 920px) {
  .preview-carousel {
    padding: 16px;
  }
  .preview-carousel-top {
    align-items: flex-start;
    flex-direction: column;
  }
  .preview-controls {
    align-self: stretch;
    justify-content: space-between;
  }
  .preview-arrow {
    width: 46px;
    height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-slide {
    transition: none;
  }
}

/* ============================================================
 * FEATURES GRID
 * ============================================================ */

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

.feature {
  padding: 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}
.feature:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 14px;
  display: inline-block;
}

.feature h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.feature p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-dim);
}

/* ============================================================
 * HOW IT WORKS — three steps
 * ============================================================ */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  counter-reset: step;
}

.step {
  text-align: left;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -16px;
  left: 24px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(240, 184, 48, 0.35);
}

.step h3 {
  margin: 14px 0 8px;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}

.step p {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
}

@media (max-width: 880px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
 * PRICING PREVIEW — 2 cards
 * ============================================================ */

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 880px;
  margin: 0 auto;
}

.plan {
  position: relative;
  padding: 36px 30px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.plan.premium {
  border-color: var(--gold);
  background: linear-gradient(
    160deg,
    var(--bg-card) 0%,
    rgba(240, 184, 48, 0.04) 100%
  );
  box-shadow: 0 12px 40px -8px rgba(240, 184, 48, 0.18);
}

.plan-badge {
  position: absolute;
  top: -14px;
  left: 30px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: #1c1009;
}

.plan h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.plan-price {
  font-size: 38px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.1;
}
.plan-price small {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dim);
}

.plan-sub {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0 0 22px;
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
}
.plan li {
  padding: 7px 0 7px 26px;
  position: relative;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.45;
}
.plan li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 7px;
  color: var(--emerald);
  font-weight: 700;
}

.plan .plan-cta {
  display: block;
  text-align: center;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.plan.free .plan-cta {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.plan.free .plan-cta:hover {
  background: var(--bg-card-hover);
  color: var(--text);
  border-color: var(--gold);
}
.plan.premium .plan-cta {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: #1c1009;
}
.plan.premium .plan-cta:hover {
  filter: brightness(1.08);
  color: #1c1009;
}

@media (max-width: 720px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
 * FAQ — accordion-feel without JS (using <details>)
 * ============================================================ */

.faq {
  max-width: 760px;
  margin: 0 auto;
}

.faq details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.faq details[open] {
  border-color: var(--border-strong);
}

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  font-size: 22px;
  color: var(--gold);
  font-weight: 400;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq summary:hover {
  background: var(--bg-card-hover);
}

.faq-body {
  padding: 0 24px 20px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
}
.faq-body p {
  margin: 0;
}

/* ============================================================
 * TRUST / DIFFERENTIATOR STRIP
 * ============================================================ */

.diff {
  text-align: center;
  padding: 64px 24px;
}

.diff-flag {
  font-size: 38px;
  line-height: 1;
  margin-bottom: 18px;
}

.diff h2 {
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 700;
  margin: 0 auto 14px;
  max-width: 720px;
  line-height: 1.2;
  color: var(--text);
}

.diff p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 17px;
}

/* ============================================================
 * FOOTER
 * ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px 36px;
  background: var(--bg-soft);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 32px;
}

.footer-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}
.footer-tag {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 320px;
  margin: 0 0 16px;
}
.footer-email {
  font-size: 14px;
  color: var(--text-dim);
}
.footer-email a {
  color: var(--gold);
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin: 0 0 14px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col li {
  margin-bottom: 8px;
}
.footer-col a {
  color: var(--text-dim);
  font-size: 14px;
}
.footer-col a:hover {
  color: var(--text);
}

.footer-meta {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-faint);
}
.footer-meta a {
  color: var(--text-faint);
  text-decoration: underline;
}
.footer-meta a:hover {
  color: var(--text-dim);
}

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

/* ============================================================
 * HERO DEMO — interactive mate-in-2 puzzle
 *
 * A real, clickable board in the hero. Square colours are warm
 * wood tones from the gold family so the board reads as "chess"
 * instantly against the dark slate page. The coach card below
 * mirrors the in-app coach card so visitors literally preview
 * the product.
 * ============================================================ */

.hero-demo {
  width: min(440px, 100%);
  margin: 0 auto;
}

.demo-board-wrap {
  position: relative;
  padding: 12px;
  background: linear-gradient(160deg, #2b2012 0%, #1d1509 100%);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 25px 60px -10px rgba(0, 0, 0, 0.6),
    0 0 0 1px var(--border-strong);
}

.demo-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
}

.demo-sq {
  appearance: none;
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(22px, 5.4vw, 36px);
  line-height: 1;
  cursor: default;
  position: relative;
  transition: box-shadow 0.12s ease;
  font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', serif;
}
.demo-sq.light {
  background: #ecd9b4;
}
.demo-sq.dark {
  background: #a97b46;
}
.demo-sq.white-piece,
.demo-sq.black-piece {
  cursor: pointer;
}
.demo-sq.white-piece {
  color: #fafaf6;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.55),
    0 0 1px rgba(0, 0, 0, 0.6);
}
.demo-sq.black-piece {
  color: #161d2e;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.22);
}
.demo-sq.selected {
  box-shadow: inset 0 0 0 3px var(--gold-bright);
}
.demo-sq.last-move::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(240, 184, 48, 0.28);
  pointer-events: none;
}
.demo-sq.check-flash {
  animation: demoCheckFlash 0.6s ease 2;
}
@keyframes demoCheckFlash {
  0%,
  100% {
    box-shadow: none;
  }
  50% {
    box-shadow: inset 0 0 0 4px rgba(244, 63, 94, 0.85);
  }
}
.demo-sq.shake {
  animation: demoShake 0.32s ease;
}
@keyframes demoShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Ghost piece used for the slide animation between squares. */
.demo-ghost {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  transition: transform 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
  font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', serif;
}
.demo-ghost.white-piece {
  color: #fafaf6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.demo-ghost.black-piece {
  color: #161d2e;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.22);
}

/* "Board is alive" hint chip — floats at the bottom of the board
   until the first interaction. */
.demo-touch-hint {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 7px 14px;
  background: rgba(10, 15, 28, 0.88);
  border: 1px solid rgba(240, 184, 48, 0.45);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-bright);
  white-space: nowrap;
  pointer-events: none;
  animation: demoHintPulse 2.2s ease-in-out infinite;
  z-index: 6;
}
.demo-touch-hint.hidden {
  display: none;
}
@keyframes demoHintPulse {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) translateY(-5px);
    opacity: 0.85;
  }
}

/* Coach card — visually rhymes with the in-app coach panel. */
.demo-coach {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.demo-coach-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}
.demo-coach-badge {
  padding: 3px 9px;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: #1c1009;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  border-radius: 5px;
}
.demo-coach-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.demo-coach-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  min-height: 3.1em;
  transition: opacity 0.18s ease;
}
.demo-coach-text.swapping {
  opacity: 0;
}
.demo-coach-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.demo-coach-actions .btn-primary {
  padding: 11px 20px;
  font-size: 15px;
}
.demo-ghost-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}
.demo-ghost-btn:hover {
  color: var(--text);
  border-color: var(--gold);
}

/* Mate celebration — a short shower of gold/emerald glyphs inside
   the board frame. Tasteful: 1.4s and gone. */
.demo-confetti {
  position: absolute;
  top: -24px;
  font-size: 17px;
  pointer-events: none;
  z-index: 7;
  animation: demoConfettiFall 1.25s ease-in forwards;
}
@keyframes demoConfettiFall {
  to {
    transform: translateY(560px) translateX(var(--dx, 0)) rotate(var(--rot, 180deg));
    opacity: 0;
  }
}

@media (max-width: 880px) {
  .hero-demo {
    width: min(400px, 100%);
  }
}
