:root {
  --bg-dark: #0f172a;
  --bg-darker: #0b1120;
  --bg-card: rgba(15, 23, 42, 0.82);
  --bg-soft: rgba(148, 163, 184, 0.08);
  --primary: #6366f1;
  --primary-strong: #4f46e5;
  --accent: #a855f7;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #f97316;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.2);
  --shadow-xl: 0 18px 36px -18px rgba(15, 23, 42, 0.45);
  --shadow-md: 0 12px 24px -18px rgba(148, 163, 184, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.22), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(168, 85, 247, 0.18), transparent 50%),
    linear-gradient(145deg, var(--bg-darker), var(--bg-dark));
  color: var(--text);
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: #c084fc;
}

.guide-header {
  width: 100%;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(14px);
  background: rgba(15, 23, 42, 0.45);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.guide-logo {
  display: inline-block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
}

.guide-logo span {
  color: inherit;
}

.guide-nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.guide-nav-links a {
  font-size: 15px;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

.guide-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 64px 32px;
  flex: 1;
}

.guide-hero {
  text-align: center;
  margin-bottom: 42px;
}

.guide-hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.guide-hero p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.guide-article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
  padding: 48px clamp(24px, 5vw, 56px);
  backdrop-filter: blur(14px);
}

.guide-article h1 {
  font-size: clamp(32px, 5vw, 44px);
  margin-bottom: 8px;
}

.guide-article .subtitle {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 36px;
}

.guide-article h2 {
  margin-top: 48px;
  font-size: clamp(24px, 4vw, 30px);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.guide-article h3 {
  margin-top: 32px;
  font-size: 20px;
}

.guide-article p,
.guide-article li {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
}

.guide-article ul,
.guide-article ol {
  padding-left: 20px;
}

.guide-article ul li,
.guide-article ol li {
  margin-bottom: 12px;
}

pre {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 14px;
  padding: 18px;
  overflow-x: auto;
  box-shadow: var(--shadow-md);
}

pre.good {
  border-left: 4px solid var(--success);
}

pre.bad {
  border-left: 4px solid var(--danger);
}

code {
  font-family: 'Fira Code', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 14px;
}

.comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.example,
.impact-box,
.diagram {
  border-radius: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  box-shadow: var(--shadow-md);
}

.example.good {
  border-left: 4px solid var(--success);
}

.example.bad {
  border-left: 4px solid var(--danger);
}

.example.bad {
  border-left: 4px solid var(--danger);
}

.impact-box h3 {
  margin-top: 0;
  color: var(--text);
}

.example h4,
.example h3,
.diagram h3 {
  margin-top: 0;
  color: var(--text);
}

.guide-footer {
  margin-top: 48px;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
}

.guide-footer a {
  text-decoration: none;
  color: var(--accent);
}

.guide-footer a:hover {
  color: #c084fc;
}

.guide-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.guide-back-link:hover {
  color: var(--text);
  transform: translateX(-4px);
}

.guide-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 48px;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 28px -18px rgba(99, 102, 241, 0.35);
}

.guide-card h3 {
  margin: 0;
  font-size: 22px;
}

.guide-card p {
  margin: 0;
}

.diagram-preview {
  border: 1px solid var(--border);
  padding: 20px;
  margin-top: 20px;
  background: rgba(15, 23, 42, 0.72);
  border-radius: 16px;
  text-align: left;
}

.diagram-preview-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.diagram-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.diagram-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.diagram-url {
  color: var(--success);
  font-size: 14px;
}

.diagram-description {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 14px;
}

.diagram-links {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

.diagram-links span {
  color: var(--accent);
}

.guide-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
  margin-top: auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.16);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.guide-note {
  margin-top: 16px;
  font-weight: 600;
}

.text-danger {
  color: #f87171;
}

.text-success {
  color: #4ade80;
}

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

@media (max-width: 720px) {
  .guide-header {
    padding: 20px 24px;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .guide-container {
    padding: 48px 20px;
  }

  .guide-article {
    padding: 36px 20px;
  }
}
