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

/* ── Theme Variables ── */
:root {
  --bg: #f8f7f4;
  --bg2: #f0ede8;
  --bg3: #e8e4de;
  --border: #ddd9d3;
  --accent: #c9623f;
  --text: #1a1a1a;
  --muted: #666;
  --card-bg: #ffffff;
  --nav-bg: rgba(248,247,244,0.92);
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --code-bg: #f3f0eb;
  --code-text: #c9623f;
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --bg2: #1a1a1a;
  --bg3: #222;
  --border: #2a2a2a;
  --accent: #d97757;
  --text: #e8e8e8;
  --muted: #888;
  --card-bg: #161616;
  --nav-bg: rgba(15,15,15,0.92);
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --code-bg: #1e1e1e;
  --code-text: #f0a882;
}

/* ── Base ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}

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

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s, border-color 0.3s;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
}

.nav-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #d97757, #e8956d);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  font-weight: bold;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
}

.nav-links a {
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 0.83rem;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

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

.nav-links a.active { font-weight: 600; color: var(--accent); background: transparent; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: border-color 0.2s, transform 0.15s;
}

.theme-toggle:hover { border-color: var(--accent); transform: scale(1.08); }

.btn-github {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.83rem;
  color: var(--muted);
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-github:hover { border-color: var(--accent); color: var(--text); }

/* ── Hero (homepage) ── */
.hero {
  text-align: center;
  padding: 100px 2rem 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(ellipse, rgba(217,119,87,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(217,119,87,0.1);
  border: 1px solid rgba(217,119,87,0.3);
  color: var(--accent);
  font-size: 0.78rem;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 28px;
  font-weight: 500;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero h1 span {
  background: linear-gradient(135deg, #d97757, #f0a882);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 540px;
  margin: 0 auto 40px;
}

/* ── Buttons ── */
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  background: linear-gradient(135deg, #d97757, #c96a47);
  color: white;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.15s;
  display: inline-block;
}

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

.btn-secondary {
  color: var(--text);
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.15s;
  display: inline-block;
}

.btn-secondary:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ── Stats ── */
.stats-bar {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 2rem;
  box-shadow: var(--shadow);
  transition: background 0.3s, border-color 0.3s;
}

.stats-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 30px;
  text-align: center;
}

.stat-num {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #d97757, #f0a882);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

/* ── Homepage feature section ── */
.section { max-width: 1100px; margin: 0 auto; padding: 70px 2rem; }
.section-title { text-align: center; font-size: 1.9rem; font-weight: 700; margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 50px; }

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

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

.feature-card:hover { border-color: rgba(217,119,87,0.5); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(217,119,87,0.1); }

.feature-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 18px; }

.icon-orange { background: rgba(217,119,87,0.15); }
.icon-blue   { background: rgba(88,166,255,0.12); }
.icon-green  { background: rgba(63,185,80,0.12); }
.icon-purple { background: rgba(188,140,255,0.12); }
.icon-pink   { background: rgba(255,121,198,0.12); }
.icon-yellow { background: rgba(255,200,80,0.12); }

.feature-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 10px; }
.feature-card p  { font-size: 0.88rem; color: var(--muted); line-height: 1.7; }

.feature-tag {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.75rem;
  background: rgba(217,119,87,0.1);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(217,119,87,0.25);
}

.divider { height: 1px; background: var(--border); }

/* ── CTA section ── */
.cta-section { text-align: center; padding: 80px 2rem; position: relative; overflow: hidden; }
.cta-section::before {
  content: '';
  position: absolute;
  bottom: -50px; left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 400px;
  background: radial-gradient(ellipse, rgba(217,119,87,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.cta-section h2 { font-size: 2rem; font-weight: 700; margin-bottom: 16px; }
.cta-section > p { color: var(--muted); max-width: 480px; margin: 0 auto 36px; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 30px 2rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  transition: border-color 0.3s;
}
footer a { color: var(--accent); }
footer a:hover { text-decoration: underline; }

/* ── Guide page layout ── */
.guide-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 2rem;
  gap: 40px;
  align-items: flex-start;
}

/* Sidebar */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
}

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
  padding: 0 10px;
}

.sidebar-nav { list-style: none; }

.sidebar-nav li a {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
  border-left: 2px solid transparent;
}

.sidebar-nav li a:hover { color: var(--text); background: var(--bg3); }
.sidebar-nav li a.active { color: var(--accent); font-weight: 600; border-left-color: var(--accent); background: rgba(217,119,87,0.07); }

.sidebar-nav .sidebar-group { margin-top: 4px; }

/* Main content */
.guide-content { flex: 1; min-width: 0; }

.page-header { margin-bottom: 36px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }

.page-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(217,119,87,0.1);
  border: 1px solid rgba(217,119,87,0.25);
  color: var(--accent);
  font-size: 0.74rem;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
  font-weight: 500;
}

.page-header h1 { font-size: 2rem; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.02em; }
.page-header p  { color: var(--muted); font-size: 1rem; }

/* Content typography */
.guide-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

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

.guide-content h3 { font-size: 1.05rem; font-weight: 600; margin: 24px 0 10px; color: var(--text); }

.guide-content p { margin-bottom: 14px; color: var(--text); font-size: 0.93rem; }

.guide-content ul, .guide-content ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.guide-content li { margin-bottom: 6px; font-size: 0.93rem; }

/* Code blocks */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 16px 0;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", Menlo, monospace;
  font-size: 0.83rem;
  line-height: 1.65;
  overflow-x: auto;
  position: relative;
  transition: background 0.3s, border-color 0.3s;
}

.code-block .lang-tag {
  position: absolute;
  top: 10px; right: 14px;
  font-size: 0.68rem;
  color: var(--muted);
  font-family: inherit;
}

.code-block code { color: var(--text); white-space: pre; display: block; }

.copy-btn {
  position: absolute;
  top: 8px; right: 46px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 0.68rem;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }

/* Inline code */
.guide-content code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "SF Mono", "Fira Code", Menlo, monospace;
  font-size: 0.85em;
}

.guide-content .code-block code { color: var(--text); background: none; padding: 0; font-size: inherit; }

/* Info / warning cards */
.info-card {
  padding: 16px 18px;
  border-radius: 10px;
  margin: 20px 0;
  font-size: 0.9rem;
  border-left: 3px solid;
}

.info-card.tip  { background: rgba(63,185,80,0.08);  border-color: #3fb950; }
.info-card.warn { background: rgba(255,165,0,0.08);  border-color: #f0a030; }
.info-card.info { background: rgba(88,166,255,0.08); border-color: #58a6ff; }

.info-card strong { display: block; margin-bottom: 4px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
.info-card.tip  strong { color: #3fb950; }
.info-card.warn strong { color: #f0a030; }
.info-card.info strong { color: #58a6ff; }

/* Tables */
.guide-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.88rem; }
.guide-table th {
  background: var(--bg3);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.guide-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.guide-table tr:last-child td { border-bottom: none; }
.guide-table tr:hover td { background: var(--bg2); }

/* Steps */
.steps { list-style: none; padding: 0; margin: 20px 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}
.steps li::before {
  content: counter(step);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d97757, #c96a47);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.steps li > div h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.steps li > div p  { font-size: 0.88rem; color: var(--muted); margin-bottom: 8px; }

/* Check mark list */
.check-list { list-style: none; padding: 0; }
.check-list li { padding: 4px 0 4px 24px; position: relative; font-size: 0.9rem; }
.check-list li::before { content: '✓'; position: absolute; left: 0; color: #3fb950; font-weight: 700; }

/* Nav pagination */
.guide-pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.page-nav-btn {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  max-width: 48%;
  transition: border-color 0.2s, transform 0.15s;
}
.page-nav-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.page-nav-btn .label { font-size: 0.72rem; color: var(--muted); margin-bottom: 3px; }
.page-nav-btn .title { font-size: 0.9rem; font-weight: 600; }
.page-nav-btn.next { margin-left: auto; text-align: right; }

/* Comparison badge */
.badge-yes  { color: #3fb950; font-weight: 600; }
.badge-no   { color: var(--muted); }
.badge-part { color: #f0a030; font-weight: 600; }

/* Mobile */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .guide-layout { flex-direction: column; padding: 24px 1.2rem; }
  .sidebar { width: 100%; position: static; }
  .hero { padding: 60px 1.5rem 50px; }
}
