/* ================================================================
   Archy Docs — Design System
   ================================================================ */

:root {
  --bg: #07070e;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.055);
  --bg-elevated: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.12);
  --text: #eeeef5;
  --text-2: rgba(238,238,245,0.6);
  --text-3: rgba(238,238,245,0.35);
  --accent: #7c3aed;
  --accent-2: #4f46e5;
  --accent-bright: #a78bfa;
  --teal: #14b8a6;
  --blue: #3b82f6;
}

/* ================================================================
   Reset + Base
   ================================================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

/* Animated grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ================================================================
   Navigation
   ================================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 60px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(7,7,14,0.8);
  border-bottom: 1px solid var(--border);
}

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

.nav-logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

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

.nav-links a {
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s;
}

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

.nav-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 14px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.nav-cta:hover {
  background: rgba(255,255,255,0.12) !important;
  color: var(--text) !important;
}

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

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: background 0.15s;
}

.nav-toggle:hover span {
  background: var(--text);
}

/* ================================================================
   Buttons
   ================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 0 20px rgba(124,58,237,0.35);
}

.btn-primary:hover {
  box-shadow: 0 0 32px rgba(124,58,237,0.55);
  transform: translateY(-1px);
  color: white;
}

.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

/* ================================================================
   Hero Section
   ================================================================ */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: 20%;
  left: 30%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  z-index: 1;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 24px;
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

.hero-headline {
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-headline .grad {
  background: linear-gradient(135deg, #a78bfa 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 17px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 32px;
  max-width: 460px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-install {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 16px;
}

.hero-install code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--accent-bright);
}

.hero-install-label {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}

/* ================================================================
   Code Window
   ================================================================ */

.code-window {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 32px 64px rgba(0,0,0,0.5),
    0 0 80px rgba(124,58,237,0.08);
}

.code-window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}

.cw-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.cw-dot:nth-child(1) { background: #ff5f57; }
.cw-dot:nth-child(2) { background: #febc2e; }
.cw-dot:nth-child(3) { background: #28c840; }

.cw-filename {
  font-size: 12px;
  color: var(--text-3);
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-left: 8px;
}

.code-window pre {
  padding: 20px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.75;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  overflow-x: auto;
}

/* Syntax token colors */
.tok-key   { color: #60a5fa; }
.tok-str   { color: #a78bfa; }
.tok-num   { color: #34d399; }
.tok-punc  { color: rgba(238,238,245,0.4); }
.tok-colon { color: rgba(238,238,245,0.3); }

.tok-type-service  { color: #64748b; }
.tok-type-kafka    { color: #fb923c; }
.tok-type-db       { color: #34d399; }
.tok-type-frontend { color: #60a5fa; }
.tok-type-gateway  { color: #22d3ee; }
.tok-type-actor    { color: #f472b6; }
.tok-type-external { color: #a78bfa; }
.tok-type-queue    { color: #f59e0b; }

/* ================================================================
   Features Section
   ================================================================ */

.features {
  padding: 80px 24px;
  position: relative;
  z-index: 1;
}

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

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

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

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.feature-icon--git   { background: rgba(52,211,153,0.12); }
.feature-icon--code  { background: rgba(96,165,250,0.12); }
.feature-icon--write { background: rgba(167,139,250,0.12); }
.feature-icon--flow  { background: rgba(251,146,60,0.12); }

.feature-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ================================================================
   Node Types Section
   ================================================================ */

.example-section {
  padding: 80px 24px;
  position: relative;
  z-index: 1;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 10px;
  margin-top: 32px;
}

.node-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  transition: background 0.15s, border-color 0.15s;
}

.node-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.node-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.node-chip-info {}

.node-chip-name {
  font-size: 12px;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', monospace;
  display: block;
}

.node-chip-desc {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
  display: block;
}

/* ================================================================
   Install Section
   ================================================================ */

.install-section {
  padding: 80px 24px;
  position: relative;
  z-index: 1;
}

.install-card {
  background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(59,130,246,0.08));
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 20px;
  padding: 48px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.install-card h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.install-card p {
  color: var(--text-2);
  margin-bottom: 32px;
  font-size: 15px;
}

.install-cmd {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 24px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 14px;
  color: var(--accent-bright);
}

.install-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ================================================================
   Inner Page Layout
   ================================================================ */

.page-header {
  padding: 120px 24px 64px;
  position: relative;
  overflow: hidden;
}

.page-header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(124,58,237,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.page-header-inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.page-header h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.page-header p {
  font-size: 17px;
  color: var(--text-2);
  line-height: 1.6;
}

.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 80px;
  position: relative;
  z-index: 1;
}

.page-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 48px 0 16px;
  letter-spacing: -0.01em;
  padding-top: 48px;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.page-content h2:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.page-content h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text);
}

.page-content p {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 16px;
}

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

.page-content li {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 6px;
}

.page-content strong {
  color: var(--text);
  font-weight: 600;
}

.page-content a {
  color: var(--accent-bright);
  text-decoration: none;
}

.page-content a:hover {
  text-decoration: underline;
}

/* Code blocks */
.page-content pre {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  margin: 20px 0;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
  position: relative;
}

.page-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--accent-bright);
}

.page-content pre code {
  background: none;
  padding: 0;
  color: var(--text-2);
  font-size: 13px;
}

/* Tables */
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.page-content th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-strong);
}

.page-content td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
}

.page-content tr:last-child td {
  border-bottom: none;
}

.page-content td code {
  font-size: 11px;
}

/* Steps */
.step {
  display: flex;
  gap: 20px;
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.step:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-content h2 {
  border-top: none !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
  font-size: 18px;
  margin-bottom: 12px;
}

/* Tips callout */
.tip {
  background: rgba(124,58,237,0.07);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 20px 0;
}

.tip p {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
}

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

/* Note callout */
.note {
  background: rgba(59,130,246,0.07);
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 20px 0;
}

.note p {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
}

.note strong {
  color: #60a5fa;
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  line-height: 1.5;
}

.copy-btn:hover {
  background: rgba(255,255,255,0.14);
}

/* ================================================================
   Footer
   ================================================================ */

footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-3);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}

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

/* ================================================================
   Animations
   ================================================================ */

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up   { animation: fadeUp 0.5s ease forwards; }
.fade-up-2 { animation: fadeUp 0.5s 0.1s ease forwards; opacity: 0; }
.fade-up-3 { animation: fadeUp 0.5s 0.2s ease forwards; opacity: 0; }
.fade-up-4 { animation: fadeUp 0.5s 0.3s ease forwards; opacity: 0; }

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .code-window {
    display: none;
  }

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .install-card {
    padding: 32px 20px;
  }

  .step {
    flex-direction: column;
    gap: 12px;
  }

  .page-content table {
    font-size: 12px;
  }

  .page-content th,
  .page-content td {
    padding: 8px;
  }
}
