/* ─── Axpo Documentation — Design Tokens ─── */
:root {
  --purple: #6C3CE1;
  --purple-dark: #3B1A9E;
  --purple-deep: #2D1580;
  --purple-light: #F0EEFF;
  --purple-tint: #EEE8FF;
  --purple-alt: #8C6BFF;

  --bg-root: #0F0E1A;
  --bg-page: #F8F9FC;
  --bg-card: #FFFFFF;
  --bg-input: #F3F4F8;
  --bg-section: #F7F7FC;

  --text-primary: #1A1A2E;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border: #E5E7EB;

  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;
  --yellow: #F5E642;

  --sidebar-width: 280px;
  --header-height: 64px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 12px 40px rgba(108, 60, 225, 0.15);

  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

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

a { color: var(--purple); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--purple-dark); }

/* ─── Header ─── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.header-brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.header-nav a:hover {
  background: var(--purple-light);
  color: var(--purple);
}

.header-nav .btn-store {
  background: var(--purple);
  color: #fff !important;
  padding: 8px 18px;
}

.header-nav .btn-store:hover {
  background: var(--purple-dark);
  color: #fff !important;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
}

/* ─── Layout ─── */
.layout {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 24px 16px 48px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  z-index: 50;
}

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

.sidebar-label:first-child { margin-top: 0; }

.sidebar nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: var(--purple-light);
  color: var(--purple);
  font-weight: 600;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  max-width: 900px;
  padding: 40px 48px 80px;
}

/* ─── Hero ─── */
.hero {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 55%, var(--purple-deep) 100%);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  color: #fff;
  margin-bottom: 48px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 40px solid rgba(255, 255, 255, 0.08);
  top: -80px;
  right: -60px;
}

.hero::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  bottom: -30px;
  left: 40px;
}

.hero-content { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.82);
  max-width: 560px;
  margin-bottom: 28px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tag {
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ─── Sections ─── */
section {
  margin-bottom: 56px;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

section h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text-primary);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--purple-light);
}

section > .section-desc {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 1rem;
}

section h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text-primary);
}

section h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--text-secondary);
}

/* ─── Cards & Grid ─── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

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

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-primary);
}

.card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ─── Steps ─── */
.steps {
  counter-reset: step;
  margin: 24px 0;
}

.step {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.125rem;
}

.step-body h4 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--text-primary);
}

.step-body p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin: 0 0 12px;
}

/* ─── Code blocks ─── */
pre {
  background: var(--bg-root);
  color: #E2E8F0;
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  margin: 16px 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

:not(pre) > code {
  background: var(--purple-light);
  color: var(--purple-dark);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.code-comment { color: #64748B; }
.code-string { color: #A5F3FC; }
.code-keyword { color: #C4B5FD; }

/* ─── Tables ─── */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--purple-light);
}

th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--purple-dark);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

td:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Color swatches ─── */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.color-swatch {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.color-swatch-preview {
  height: 72px;
}

.color-swatch-info {
  padding: 12px;
}

.color-swatch-info strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.color-swatch-info span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.color-swatch-info small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ─── Alert / Callout boxes ─── */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 16px 0;
  font-size: 0.9375rem;
  border-left: 4px solid;
}

.callout-info {
  background: #EFF6FF;
  border-color: var(--info);
  color: #1E40AF;
}

.callout-tip {
  background: var(--purple-light);
  border-color: var(--purple);
  color: var(--purple-dark);
}

.callout-warn {
  background: #FFFBEB;
  border-color: var(--warning);
  color: #92400E;
}

/* ─── Folder tree ─── */
.tree {
  background: var(--bg-root);
  color: #CBD5E1;
  padding: 24px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.8;
  overflow-x: auto;
  margin: 16px 0;
}

.tree .dir { color: #C4B5FD; }
.tree .file { color: #94A3B8; }
.tree .comment { color: #64748B; }

/* ─── Language flags ─── */
.lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.lang-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.lang-chip span:first-child { font-size: 1.25rem; }

/* ─── Branding guide ─── */
.brand-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  align-items: flex-start;
}

.brand-item-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.brand-item h4 { margin: 0 0 6px; font-size: 1rem; }
.brand-item p { margin: 0; font-size: 0.875rem; color: var(--text-secondary); }
.brand-item code { margin-top: 8px; display: inline-block; }

/* ─── Shortcut keys ─── */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  box-shadow: 0 2px 0 var(--border);
}

/* ─── Footer ─── */
.site-footer {
  margin-left: var(--sidebar-width);
  background: var(--bg-root);
  color: rgba(255, 255, 255, 0.7);
  padding: 48px;
  text-align: center;
}

.footer-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 0.9375rem;
  margin-bottom: 24px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.footer-links a {
  color: var(--purple-alt);
  font-weight: 600;
  font-size: 0.9375rem;
}

.footer-links a:hover { color: #fff; }

.footer-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--purple);
  color: #fff !important;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  transition: background 0.2s, transform 0.2s;
  margin-bottom: 32px;
}

.footer-store-btn:hover {
  background: var(--purple-alt);
  color: #fff !important;
  transform: translateY(-2px);
}

.footer-copy {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open { transform: translateX(0); }

  .main,
  .site-footer { margin-left: 0; }

  .main { padding: 32px 24px 64px; }

  .menu-toggle { display: block; margin-left: auto; }

  .header-nav { display: none; }

  .hero h1 { font-size: 2rem; }
  .hero { padding: 32px 24px; }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .color-grid { grid-template-columns: repeat(2, 1fr); }
  .step { flex-direction: column; gap: 12px; }
  .site-footer { padding: 32px 20px; }
}
