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

:root {
  --bg:          #0f1117;
  --bg-card:     #141a18;
  --bg-card-hover: #1a2420;
  --border:      #1e2d28;
  --accent:      #1f9962;
  --accent-glow: rgba(62, 207, 142, 0.12);
  --text:        #dff0e8;
  --text-muted:  #557363;
  --nav-bg:      rgba(15, 17, 23, 0.75);
  --nav-height:  64px;
  --radius:      12px;
  --font:        'Inter', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.nav-logo:hover { color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 8px;
}

.nav-links a {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}

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

.nav-links a.active { color: var(--accent); }

/* ── Dropdown ───────────────────────────────────────────────── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > a {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-dropdown > a::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
}

.nav-dropdown.open > a::after {
  transform: rotate(-135deg) translateY(-2px);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  background: rgba(15, 20, 18, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  list-style: none;
  z-index: 200;
}

.nav-dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-menu li a {
  display: block;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}

.dropdown-menu li a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 48px) 24px 80px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(62, 207, 142, 0.07) 0%, transparent 70%),
    var(--bg);
}

.hero-content {
  max-width: 680px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.accent { color: var(--accent); }

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 36px;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: opacity 0.2s, transform 0.2s;
}

.btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* ── Sections ───────────────────────────────────────────────── */
.section {
  padding: 80px 24px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-3px);
}

.card-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 14px;
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.card-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  transition: opacity 0.2s;
}

.card-link:hover { opacity: 0.7; }

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  padding: calc(var(--nav-height) + 56px) 24px 48px;
  background:
    radial-gradient(ellipse 60% 80% at 20% 50%, rgba(62, 207, 142, 0.06) 0%, transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.page-header p {
  font-size: 1rem;
  color: var(--text-muted);
}

/* ── Prose (About / Guide content) ─────────────────────────── */
.prose {
  max-width: 680px;
}

.prose h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 40px 0 12px;
  color: var(--text);
}

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

.prose p {
  color: var(--text-muted);
  font-size: 0.975rem;
  margin-bottom: 16px;
}

/* ── Guide Article ──────────────────────────────────────────── */
.guide-header {
  padding: calc(var(--nav-height) + 56px) 24px 48px;
  background:
    radial-gradient(ellipse 60% 80% at 20% 50%, rgba(62, 207, 142, 0.06) 0%, transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.guide-header .card-tag {
  margin-bottom: 16px;
}

.guide-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 14px;
  max-width: 760px;
}

.guide-header p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 640px;
}

.guide-meta {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.guide-meta span { display: flex; align-items: center; gap: 5px; }

/* Guide body layout */
.guide-body {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 48px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* Table of Contents */
.guide-toc {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.guide-toc h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.guide-toc ol {
  list-style: none;
  counter-reset: toc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-toc ol li {
  counter-increment: toc;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.guide-toc ol li::before {
  content: counter(toc);
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 700;
  min-width: 14px;
}

.guide-toc ol li a {
  font-size: 0.825rem;
  color: var(--text-muted);
  transition: color 0.2s;
  line-height: 1.4;
}

.guide-toc ol li a:hover { color: var(--text); }

/* Guide content area */
.guide-content { min-width: 0; }

.guide-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 48px 0 14px;
  padding-top: 8px;
  color: var(--text);
}

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

.guide-content p {
  font-size: 0.975rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.75;
}

/* Step blocks */
.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 24px 0;
}

.step-number {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 6px;
}

.step h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.step p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Video embed */
.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  transition: opacity 0.3s ease;
  cursor: pointer;
  z-index: 2;
}

.video-play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: rgba(0, 0, 0, 0.6);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(6px);
}

.video-play-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
}

.video-play-btn svg {
  width: 32px;
  height: 32px;
  margin-left: 4px;
}

.video-container video.blurred {
  filter: blur(12px);
  transform: scale(1.05);
  transition: filter 0.4s ease, transform 0.4s ease;
}

.video-container video.playing {
  filter: none;
  transform: scale(1);
}

/* Screenshot */
.screenshot {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
}

.screenshot {
  position: relative;
}

.screenshot img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.screenshot:hover img {
  opacity: 0.85;
}

.screenshot-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.screenshot:hover .screenshot-hint {
  opacity: 1;
}

.screenshot-hint svg {
  width: 40px;
  height: 40px;
  color: #fff;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7));
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox.active {
  display: flex;
  animation: lb-fade 0.2s ease;
}

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

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
  animation: lb-scale 0.2s ease;
}

@keyframes lb-scale {
  from { transform: scale(0.95); }
  to   { transform: scale(1); }
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.lightbox-close:hover {
  opacity: 1;
}

/* Screenshot placeholder (no image) */
.screenshot:not(:has(img)) {
  aspect-ratio: 16 / 9;
  border-style: dashed;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  gap: 8px;
}

.screenshot:not(:has(img))::before {
  content: '📷';
  font-size: 1.2rem;
}

/* Code block */
.code-block {
  background: #0a0d0c;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0;
  overflow-x: auto;
}

.code-block code {
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.85rem;
  color: #a8d8b9;
  white-space: pre;
}

/* Note / tip callout */
.callout {
  background: var(--accent-glow);
  border: 1px solid rgba(62, 207, 142, 0.2);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.callout strong { color: var(--accent); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(15, 17, 23, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    gap: 4px;
  }

  .nav-links.open { display: flex; }

  .nav-toggle { display: flex; }

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

  .guide-body {
    grid-template-columns: 1fr;
  }

  .guide-toc { position: static; }

  .dropdown-menu {
    position: static;
    background: rgba(255,255,255,0.04);
    border: none;
    border-radius: 8px;
    margin-top: 4px;
    padding: 4px 0 4px 12px;
  }
}
