/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-surface: #12121a;
  --bg-surface-hover: #1a1a24;
  --border-color: #1e1e2e;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.3);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --success: #22c55e;
  --danger: #ef4444;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --container-max: 1200px;
  --section-padding: clamp(4rem, 10vw, 8rem);
  --border-radius: 12px;
  --border-radius-lg: 20px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ===== Container ===== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4 {
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

.text-secondary {
  color: var(--text-secondary);
}

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

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 30px var(--primary-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--text-muted);
}

.btn-large {
  padding: 1.25rem 2.5rem;
  font-size: 1.125rem;
}

/* ===== Section Base ===== */
section {
  padding: var(--section-padding) 0;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header p {
  margin-top: 1rem;
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Header/Nav ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo:hover {
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

.nav-cta {
  padding: 0.75rem 1.5rem;
}

.back-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.back-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

@media (max-width: 700px) {
  .nav-links {
    display: none;
  }
}

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

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.footer-emails {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.footer-emails a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-emails a:hover {
  color: var(--primary);
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.875rem;
}

@media (max-width: 600px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-links,
  .footer-emails {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children .fade-in:nth-child(1) { transition-delay: 0.1s; }
.stagger-children .fade-in:nth-child(2) { transition-delay: 0.2s; }
.stagger-children .fade-in:nth-child(3) { transition-delay: 0.3s; }
.stagger-children .fade-in:nth-child(4) { transition-delay: 0.4s; }
.stagger-children .fade-in:nth-child(5) { transition-delay: 0.5s; }
.stagger-children .fade-in:nth-child(6) { transition-delay: 0.6s; }

/* ===== Focus States ===== */
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== Article Styles (Guides) ===== */
.article-page {
  --container-max: 800px;
}

.article-page body {
  line-height: 1.7;
}

.article-page a {
  color: var(--primary);
}

.article-page a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.article-page header {
  background: rgba(10, 10, 15, 0.9);
}

.article-page nav {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

article {
  padding: 8rem 0 4rem;
}

.article-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--text-primary);
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--text-primary);
}

.article-content p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.article-content ul,
.article-content ol {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content code {
  background: var(--bg-surface);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9em;
  color: var(--primary-hover);
}

.article-content pre {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.article-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

.article-content .tip {
  background: rgba(99, 102, 241, 0.1);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  margin: 1.5rem 0;
}

.article-content .tip p {
  margin: 0;
  color: var(--text-primary);
}

.article-content .tip strong {
  color: var(--primary-hover);
}

.article-content .warning {
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid #ef4444;
  padding: 1rem 1.25rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  margin: 1.5rem 0;
}

.article-content .warning p {
  margin: 0;
  color: var(--text-primary);
}

.article-content .warning strong {
  color: #f87171;
}

/* Related Articles */
.related-articles {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.related-articles h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

.related-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.related-card:hover {
  border-color: var(--primary);
  text-decoration: none;
  transform: translateY(-2px);
}

.related-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.related-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ===== Legal Page Styles ===== */
.legal-page {
  --container-max: 800px;
}

.legal-page body {
  line-height: 1.7;
}

.legal-page a {
  color: var(--primary);
}

.legal-page a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.legal-page header {
  background: rgba(10, 10, 15, 0.9);
}

.legal-page nav {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.legal-page .container {
  max-width: var(--container-max);
  padding: 8rem 1.5rem 4rem;
}

.legal-page h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.legal-page .last-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 3rem;
}

.legal-page h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.legal-page h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.legal-page p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.legal-page ul,
.legal-page ol {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-page li {
  margin-bottom: 0.5rem;
}

.highlight-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.highlight-box p:last-child {
  margin-bottom: 0;
}

.warning-box {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.warning-box p:last-child {
  margin-bottom: 0;
}

.legal-page footer {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
}

.legal-page .footer-links {
  justify-content: center;
  margin-bottom: 1rem;
}

/* ===== Guides Index Styles ===== */
.guides-index {
  --container-max: 1000px;
}

.guides-index nav {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.guides-hero {
  padding: 8rem 0 4rem;
  text-align: center;
}

.guides-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.guides-hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.guides-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  padding-bottom: 6rem;
}

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

.guides-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.guides-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--primary);
  transform: translateY(-4px);
}

.guides-card-icon {
  width: 48px;
  height: 48px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.guides-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.guides-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  flex-grow: 1;
  margin-bottom: 1rem;
}

.guides-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.read-more {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: auto;
}

.read-more:hover {
  color: var(--primary-hover);
}
