/* ChessViz Marketing Site — Premium Dark Theme */

:root {
  --bg: #09090b;
  --bg-surface: rgba(15, 15, 20, 0.8);
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --text: #e4e4e7;
  --text-muted: #71717a;
  --text-dim: #52525b;
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.15);
  --accent-hover: #22d3ee;
  --accent-subtle: rgba(6, 182, 212, 0.08);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --link: #06b6d4;
  --link-hover: #22d3ee;
  --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(6, 182, 212, 0.12), transparent);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------- */
/* Navigation                                                */
/* --------------------------------------------------------- */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
}

nav .logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav .logo .logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

nav .nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

nav .nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

nav .nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

nav .nav-cta {
  color: var(--bg) !important;
  background: var(--accent) !important;
  font-weight: 600 !important;
  margin-left: 0.5rem;
}

nav .nav-cta:hover {
  background: var(--accent-hover) !important;
  color: var(--bg) !important;
}

/* --------------------------------------------------------- */
/* Main content — legal pages                                */
/* --------------------------------------------------------- */
main {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  width: 100%;
}

main h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
  letter-spacing: -0.03em;
}

.meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

/* Legal document sections */
.legal-doc section {
  margin-bottom: 2.5rem;
}

.legal-doc h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.75rem;
  padding-top: 0.5rem;
}

.legal-doc h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-doc p {
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.legal-doc ul {
  margin: 0.5rem 0 1rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.legal-doc ul li {
  margin-bottom: 0.35rem;
}

.legal-doc a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s;
}

.legal-doc a:hover {
  color: var(--link-hover);
}

.legal-caps {
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

/* Tables */
.legal-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.85rem;
}

.legal-doc th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.legal-doc td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}

.legal-doc tr:last-child td {
  border-bottom: none;
}

/* --------------------------------------------------------- */
/* Footer                                                    */
/* --------------------------------------------------------- */
footer {
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--text);
}

/* --------------------------------------------------------- */
/* Landing — Hero                                            */
/* --------------------------------------------------------- */
.hero-section {
  position: relative;
  overflow: hidden;
  padding: 6rem 2rem 4rem;
  text-align: center;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: var(--accent-subtle);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1.5rem;
  letter-spacing: 0.01em;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-section h1 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 1.25rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.hero-section h1 .gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-section .subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.25);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 500;
  font-size: 0.88rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
}

/* --------------------------------------------------------- */
/* Landing — Stats bar                                       */
/* --------------------------------------------------------- */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 2.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

/* --------------------------------------------------------- */
/* Landing — Feature sections                                */
/* --------------------------------------------------------- */
.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.6;
  margin-bottom: 3rem;
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.feature-cell {
  background: var(--bg);
  padding: 2rem;
  transition: background 0.2s;
}

.feature-cell:hover {
  background: var(--bg-card-hover);
}

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-subtle);
  border: 1px solid rgba(6, 182, 212, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.feature-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-cell h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}

.feature-cell p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* --------------------------------------------------------- */
/* Landing — How it works                                    */
/* --------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  counter-reset: step;
}

.step {
  counter-increment: step;
  position: relative;
}

.step::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-subtle);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.step h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}

.step p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* --------------------------------------------------------- */
/* Landing — CTA section                                     */
/* --------------------------------------------------------- */
.cta-section {
  text-align: center;
  padding: 5rem 2rem;
  position: relative;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 100%, rgba(6, 182, 212, 0.08), transparent);
  pointer-events: none;
}

.cta-section h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.cta-section p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* --------------------------------------------------------- */
/* Phone frame mockup                                        */
/* --------------------------------------------------------- */
.phone-frame {
  position: relative;
  width: 260px;
  flex-shrink: 0;
  background: #1a1a1a;
  border-radius: 32px;
  padding: 10px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(6, 182, 212, 0.08);
}

.phone-frame img {
  width: 100%;
  border-radius: 22px;
  display: block;
}

.phone-frame-lg {
  width: 300px;
}

/* --------------------------------------------------------- */
/* Hero with phone mockup                                    */
/* --------------------------------------------------------- */
.hero-content {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
}

.hero-text {
  flex: 1;
  max-width: 480px;
}

.hero-mockup {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.hero-mockup .phone-frame:nth-child(2) {
  transform: translateY(2rem);
}

/* --------------------------------------------------------- */
/* Showcase section — phone + text side-by-side              */
/* --------------------------------------------------------- */
.showcase {
  max-width: 1080px;
  margin: 0 auto;
  padding: 5rem 2rem;
  display: flex;
  align-items: center;
  gap: 4rem;
}

.showcase-reverse {
  flex-direction: row-reverse;
}

.showcase-text {
  flex: 1;
}

.showcase-text .section-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.showcase-text h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.showcase-text p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.showcase-visual {
  flex-shrink: 0;
}

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

/* --------------------------------------------------------- */
/* Broadcast carousel — auto-rotating phone screenshots      */
/* --------------------------------------------------------- */
.carousel-phone {
  position: relative;
  width: 260px;
  flex-shrink: 0;
  background: #1a1a1a;
  border-radius: 32px;
  padding: 10px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(6, 182, 212, 0.08);
  overflow: hidden;
}

.carousel-track {
  position: relative;
  width: 100%;
  border-radius: 22px;
  overflow: hidden;
}

.carousel-track img {
  width: 100%;
  border-radius: 22px;
  display: block;
  animation: carousel-slide 12s ease-in-out infinite;
  opacity: 0;
}

.carousel-track img:nth-child(1) {
  position: relative;
  animation-delay: 0s;
}

.carousel-track img:nth-child(n+2) {
  position: absolute;
  top: 0;
  left: 0;
}

.carousel-track img:nth-child(2) { animation-delay: 3s; }
.carousel-track img:nth-child(3) { animation-delay: 6s; }
.carousel-track img:nth-child(4) { animation-delay: 9s; }

@keyframes carousel-slide {
  0%     { opacity: 0; }
  4%     { opacity: 1; }
  25%    { opacity: 1; }
  29%    { opacity: 0; }
  100%   { opacity: 0; }
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 1rem;
}

.carousel-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
}

/* --------------------------------------------------------- */
/* Screenshot gallery — horizontal scroll                    */
/* --------------------------------------------------------- */
.screenshot-gallery {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 2rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.screenshot-gallery::-webkit-scrollbar {
  display: none;
}

.screenshot-gallery .phone-frame {
  scroll-snap-align: center;
}

/* --------------------------------------------------------- */
/* Responsive                                                */
/* --------------------------------------------------------- */
@media (max-width: 768px) {
  nav {
    padding: 0 1rem;
  }

  .hero-section {
    padding: 4rem 1.5rem 3rem;
  }

  .hero-section h1 {
    font-size: 2.4rem;
  }

  .hero-section .subtitle {
    font-size: 1rem;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 3rem;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-text .hero-badge,
  .hero-text .hero-actions {
    justify-content: center;
  }

  .hero-mockup .phone-frame:nth-child(2) {
    display: none;
  }

  .stats-bar {
    gap: 1.5rem;
    padding: 2rem 1rem;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .section {
    padding: 3rem 1.5rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .showcase {
    flex-direction: column !important;
    text-align: center;
    gap: 2.5rem;
    padding: 3rem 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  main {
    padding: 2rem 1.25rem 3rem;
  }

  main h1 {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  .hero-section h1 {
    font-size: 2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .stats-bar {
    flex-wrap: wrap;
    gap: 1rem 2rem;
  }

  .phone-frame,
  .phone-frame-lg,
  .carousel-phone {
    width: 220px;
  }

  .carousel-track img {
    width: calc(100% - 20px);
  }

  .legal-doc table {
    font-size: 0.78rem;
  }

  .legal-doc th,
  .legal-doc td {
    padding: 0.45rem 0.5rem;
  }
}
