/* ============================================
   ChessBot.dev — Landing Page
   ============================================ */

:root {
  --bg: #0c0c0c;
  --bg-raised: #141414;
  --bg-surface: #1a1a1a;
  --text: #e5e5e5;
  --text-muted: #888;
  --text-dim: #555;
  --accent: #4ADE80;
  --accent-hover: #22c55e;
  --accent-dim: rgba(74, 222, 128, 0.08);
  --border: #1e1e1e;
  --border-light: #2a2a2a;
  --radius: 6px;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 1200px;
  --section-pad: clamp(5rem, 10vw, 9rem);
}

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: rgba(74, 222, 128, 0.25);
  color: var(--text);
}

/* ---- Container ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

/* ============================================
   Chess-pattern texture
   ============================================ */
.chess-pattern { position: relative; }

.chess-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg,
      rgba(255,255,255,0.018) 25%, transparent 25%,
      transparent 75%, rgba(255,255,255,0.018) 75%),
    linear-gradient(45deg,
      rgba(255,255,255,0.018) 25%, transparent 25%,
      transparent 75%, rgba(255,255,255,0.018) 75%);
  background-size: 48px 48px;
  background-position: 0 0, 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   Scroll reveal animations
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger.visible > * { opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(1) { transition-delay: 0.04s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.08s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.12s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.16s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.20s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.24s; }

/* ============================================
   Section dividers
   ============================================ */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-light) 25%, var(--accent) 50%, var(--border-light) 75%, transparent);
  opacity: 0.35;
}

.diagonal-strip {
  height: 64px;
  position: relative;
  overflow: hidden;
}
.diagonal-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent, transparent 10px,
    rgba(74,222,128,0.025) 10px,
    rgba(74,222,128,0.025) 11px
  );
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 12px;
  left: 50%;
  translate: -50% 0;
  z-index: 100;
  width: fit-content;
  min-width: 380px;
  height: 46px;
  background: rgba(20,20,20,0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: background 0.3s, border-color 0.3s;
}
.nav.scrolled {
  background: rgba(14,14,14,0.92);
  border-color: var(--border-light);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding-inline: 1.25rem;
  gap: 1.5rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active { color: var(--accent); }

.nav-icon {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-icon:hover { color: var(--accent); }

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--accent); }

/* hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* mobile drawer */
.nav-mobile {
  display: none;
  position: fixed;
  top: 66px;
  left: 50%;
  translate: -50% 0;
  width: calc(100% - 2rem);
  max-width: 320px;
  background: rgba(14,14,14,0.96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.75rem 1.25rem;
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: block;
  padding: 0.75rem 0;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover { color: var(--accent); }

@media (max-width: 768px) {
  .nav-right { display: none; }
  .nav-hamburger { display: flex; }
}

/* ============================================
   Hero
   ============================================ */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(76px + 3rem) clamp(1.25rem, 4vw, 3rem) 3rem;
}

/* subtle green atmospheric glow */
.hero::after {
  content: '';
  position: absolute;
  top: 38%;
  left: 50%;
  translate: -50% -50%;
  width: min(900px, 90vw);
  aspect-ratio: 4 / 3;
  background: radial-gradient(ellipse, rgba(74,222,128,0.045) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.hero-tagline {
  font-size: clamp(2.6rem, 6.5vw, 4.8rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
}
.hero-tagline em {
  font-style: normal;
  color: var(--accent);
}

.hero-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto 2.5rem;
}

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

/* buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  background: var(--accent);
  color: #0c0c0c;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-primary svg {
  width: 18px;
  height: 18px;
}

.btn-secondary {
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.btn-secondary:hover { color: var(--accent); }

/* browser mockup */
.hero-mockup {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 920px;
}

.browser-frame {
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.025);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.browser-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.browser-dot:nth-child(1) { background: #ff5f57; }
.browser-dot:nth-child(2) { background: #ffbd2e; }
.browser-dot:nth-child(3) { background: #28c840; }

.browser-url {
  flex: 1;
  margin-left: 8px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.browser-body {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  overflow: hidden;
}
.browser-body img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.screenshot-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  z-index: 0;
}

/* ============================================
   Supported Sites
   ============================================ */
.supported {
  padding: 3.5rem 0;
}
.supported-label {
  text-align: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}
.sites-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.site-pill {
  padding: 0.45rem 1.1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.site-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================
   Shared section styles
   ============================================ */
section {
  padding: var(--section-pad) 0;
}

.section-header {
  text-align: center;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}
.section-header p {
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================================
   Feature blocks (alternating)
   ============================================ */
.feature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  margin-bottom: clamp(5rem, 9vw, 8rem);
}
.feature-block:last-child { margin-bottom: 0; }

.feature-block.reverse .feature-img { order: 2; }
.feature-block.reverse .feature-text { order: 1; }

.feature-text h3 {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.feature-text h3 span { color: var(--accent); }

.feature-text p {
  color: var(--text-muted);
  line-height: 1.75;
  font-size: clamp(0.9rem, 1.15vw, 1rem);
}

.feature-screenshot {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}
.feature-screenshot img {
  width: 100%;
  display: block;
  position: relative;
  z-index: 1;
}
.feature-screenshot .screenshot-label {
  aspect-ratio: 16 / 10;
}

@media (max-width: 768px) {
  .feature-block {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .feature-block.reverse .feature-img,
  .feature-block.reverse .feature-text { order: unset; }
}

/* ============================================
   Variants
   ============================================ */
.variants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.variant-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.25s;
}
.variant-card:hover { border-color: var(--accent); }

.variant-card h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.6rem;
  font-weight: 600;
}
.variant-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.variants-img {
  margin-top: 3rem;
  max-width: 820px;
  margin-inline: auto;
}

/* ============================================
   How It Works
   ============================================ */
.steps-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.step {
  text-align: center;
  padding: 2rem 1.5rem;
}

.step-number {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
}

.step h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
}
.step p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}
.step-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}
.step-link:hover { opacity: 0.75; }

@media (max-width: 768px) {
  .steps-row { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* connector lines between steps on desktop */
@media (min-width: 769px) {
  .steps-row { position: relative; }
  .steps-row::before {
    content: '';
    position: absolute;
    top: calc(2rem + 26px);
    left: calc(100% / 6 + 26px);
    right: calc(100% / 6 + 26px);
    height: 2px;
    background: repeating-linear-gradient(
      90deg,
      var(--border-light) 0 6px,
      transparent 6px 12px
    );
  }
}

/* ============================================
   Additional features grid
   ============================================ */
.extras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.extra-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.25s;
}
.extra-item:hover { border-color: var(--accent); }

.extra-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 6px;
  color: var(--accent);
}
.extra-icon svg { width: 18px; height: 18px; }

.extra-body h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.extra-body p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.4;
}

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

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.footer-logo {
  font-size: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.footer-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.footer-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.footer-bottom {
  text-align: center;
}

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

@media (max-width: 600px) {
  .footer-top { flex-direction: column; gap: 1rem; }
}
