/* ===================================================================
   CertDax — Promotional & Documentation Site
   Modern dark theme with emerald/amber accents
   =================================================================== */

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

:root {
  --bg:          #0a0f1a;
  --bg-raised:   #111827;
  --bg-card:     #1a2233;
  --bg-code:     #0d1117;
  --bg-sidebar:  #111827;
  --border:      #1e293b;
  --border-light:#2d3a4f;
  --text:        #e2e8f0;
  --text-muted:  #94a3b8;
  --text-dim:    #64748b;
  --white:       #f8fafc;
  --emerald:     #34d399;
  --emerald-dim: #059669;
  --amber:       #fbbf24;
  --blue:        #60a5fa;
  --violet:      #a78bfa;
  --rose:        #fb7185;
  --cyan:        #22d3ee;
  --orange:      #fb923c;
  --teal:        #2dd4bf;
  --indigo:      #818cf8;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   16px;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
  --nav-h:       64px;
  --sidebar-w:   260px;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--emerald); text-decoration: none; transition: color .2s; }
a:hover { color: var(--white); }

img { max-width: 100%; }
code { font-family: var(--font-mono); font-size: .9em; background: var(--bg-code); padding: 2px 6px; border-radius: 4px; }
pre code { background: none; padding: 0; }

h1, h2, h3, h4 { color: var(--white); line-height: 1.3; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: .35rem; }

/* --- Utility --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.icon { width: 18px; height: 18px; vertical-align: middle; flex-shrink: 0; }

/* ===================================================================
   Navigation
   =================================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: transparent;
  transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.nav-scrolled {
  background: rgba(10, 15, 26, .85);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h);
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.25rem; font-weight: 700; color: var(--white);
}
.nav-logo:hover { color: var(--white); }
.nav-logo-icon { font-size: 1.5rem; }
.nav-logo-text { letter-spacing: -.5px; }

.nav-links {
  display: flex; align-items: center; gap: 28px;
}
.nav-links a {
  color: var(--text-muted); font-size: .875rem; font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--white); }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 28px; height: 24px; position: relative;
}
.nav-toggle span {
  display: block; position: absolute; left: 0; width: 100%; height: 2px;
  background: var(--text-muted); border-radius: 2px; transition: .3s;
}
.nav-toggle span:nth-child(1) { top: 2px; }
.nav-toggle span:nth-child(2) { top: 11px; }
.nav-toggle span:nth-child(3) { top: 20px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .875rem;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all .2s; border: none; text-decoration: none;
}
.btn-sm { padding: 6px 14px; font-size: .8125rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-primary {
  background: var(--emerald); color: var(--bg);
}
.btn-primary:hover { background: #6ee7b7; color: var(--bg); box-shadow: 0 0 24px rgba(52,211,153,.35); }
.btn-outline {
  border: 1px solid var(--border-light); color: var(--text-muted); background: transparent;
}
.btn-outline:hover { border-color: var(--text-muted); color: var(--white); background: rgba(255,255,255,.05); }
.btn-ghost {
  border: 1px solid var(--border-light); color: var(--text);
  background: transparent; padding: 14px 28px;
}
.btn-ghost:hover { border-color: var(--text-muted); color: var(--white); background: rgba(255,255,255,.05); }

/* ===================================================================
   Hero
   =================================================================== */
.hero {
  position: relative; overflow: hidden;
  padding: calc(var(--nav-h) + 80px) 0 80px;
  text-align: center;
}
.hero-glow {
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(ellipse, rgba(52,211,153,.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; }

.badge {
  display: inline-block; font-size: .75rem; font-weight: 600;
  color: var(--emerald); background: rgba(52,211,153,.1);
  border: 1px solid rgba(52,211,153,.2);
  padding: 6px 16px; border-radius: 999px;
  margin-bottom: 24px; letter-spacing: .5px; text-transform: uppercase;
}

.gradient-text {
  background: linear-gradient(135deg, var(--emerald), var(--amber));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  max-width: 640px; margin: 20px auto 36px; font-size: 1.125rem;
  color: var(--text-muted); line-height: 1.7;
}
.hero-actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 60px;
}

/* Terminal */
.hero-screenshot {
  max-width: 900px; margin: 0 auto;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow), 0 0 80px rgba(52,211,153,.06);
}
.hero-screenshot img {
  display: block; width: 100%; height: auto;
}
.hero-terminal {
  max-width: 640px; margin: 0 auto;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow), 0 0 80px rgba(52,211,153,.06);
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}
.terminal-dot {
  width: 12px; height: 12px; border-radius: 50%;
}
.terminal-dot.red    { background: #ef4444; }
.terminal-dot.yellow { background: #eab308; }
.terminal-dot.green  { background: #22c55e; }
.terminal-title {
  margin-left: auto; font-size: .75rem; color: var(--text-dim);
}
.terminal-body {
  background: var(--bg-code); padding: 20px 24px;
}
.terminal-body pre {
  font-family: var(--font-mono); font-size: .85rem;
  line-height: 1.9; color: var(--text-muted);
  text-align: left; overflow-x: auto;
}
.t-comment { color: var(--text-dim); }
.t-prompt  { color: var(--emerald); }
.t-success { color: #22c55e; }
.t-link    { color: var(--blue); text-decoration: underline; }

/* ===================================================================
   Sections
   =================================================================== */
.section { padding: 100px 0; }
.section-dark { background: var(--bg-raised); }
.section-header {
  text-align: center; max-width: 640px; margin: 0 auto 56px;
}
.section-badge {
  display: inline-block; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--emerald); margin-bottom: 12px;
}
.section-header p { color: var(--text-muted); margin-top: 12px; font-size: 1.05rem; }

/* ===================================================================
   Feature Cards
   =================================================================== */
.grid {
  display: grid; gap: 24px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  border-color: var(--border-light);
}
.card h3 { margin: 16px 0 8px; }
.card p { color: var(--text-muted); font-size: .9rem; }

.card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.card-icon svg { width: 22px; height: 22px; }
.card-icon-emerald { background: rgba(52,211,153,.12); color: var(--emerald); }
.card-icon-blue    { background: rgba(96,165,250,.12); color: var(--blue); }
.card-icon-amber   { background: rgba(251,191,36,.12); color: var(--amber); }
.card-icon-violet  { background: rgba(167,139,250,.12); color: var(--violet); }
.card-icon-rose    { background: rgba(251,113,133,.12); color: var(--rose); }
.card-icon-cyan    { background: rgba(34,211,238,.12); color: var(--cyan); }
.card-icon-orange  { background: rgba(251,146,60,.12); color: var(--orange); }
.card-icon-teal    { background: rgba(45,212,191,.12); color: var(--teal); }
.card-icon-indigo  { background: rgba(129,140,248,.12); color: var(--indigo); }

/* ===================================================================
   Architecture
   =================================================================== */
.arch-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin-bottom: 48px;
}
.arch-card {
  text-align: center; padding: 32px 20px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s;
}
.arch-card:hover { border-color: var(--border-light); }
.arch-icon { font-size: 2rem; margin-bottom: 12px; }
.arch-card h3 { font-size: 1rem; margin-bottom: 6px; }
.arch-card p { color: var(--text-muted); font-size: .85rem; }

.arch-diagram {
  overflow-x: auto;
}
.diagram {
  font-family: var(--font-mono); font-size: .8rem; color: var(--text-dim);
  text-align: center; line-height: 1.5;
  background: var(--bg-code); padding: 28px;
  border-radius: var(--radius); border: 1px solid var(--border);
}

/* ===================================================================
   Providers Grid
   =================================================================== */
.providers-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px;
}
.provider-card {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px 16px;
  transition: border-color .2s, transform .2s;
}
.provider-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.provider-name { font-weight: 600; font-size: .9rem; color: var(--text); }

/* ===================================================================
   CTA
   =================================================================== */
.section-cta {
  background: linear-gradient(135deg, rgba(52,211,153,.06), rgba(251,191,36,.06));
}
.cta-inner {
  text-align: center; max-width: 600px; margin: 0 auto;
}
.cta-inner h2 { margin-bottom: 12px; }
.cta-inner p { color: var(--text-muted); margin-bottom: 32px; font-size: 1.05rem; }

/* ===================================================================
   Footer
   =================================================================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-inner {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
}
.footer-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.1rem; font-weight: 700; color: var(--white);
}
.footer-copy { color: var(--text-dim); font-size: .85rem; }
.footer-copy a { color: var(--text-muted); }
.footer-links { display: flex; gap: 24px; font-size: .85rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--white); }

/* ===================================================================
   Documentation Layout
   =================================================================== */
.docs-body { padding-top: var(--nav-h); }

.docs-layout {
  display: flex; min-height: calc(100vh - var(--nav-h));
}

/* Sidebar */
.docs-sidebar {
  position: sticky; top: var(--nav-h); align-self: flex-start;
  width: var(--sidebar-w); flex-shrink: 0;
  height: calc(100vh - var(--nav-h)); overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 28px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.docs-sidebar h4 {
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-dim); margin: 24px 0 8px;
}
.docs-sidebar h4:first-child { margin-top: 0; }
.docs-sidebar ul { list-style: none; padding: 0; }
.docs-sidebar li { margin: 0; }
.docs-sidebar a {
  display: block; padding: 5px 12px; border-radius: 6px;
  font-size: .85rem; color: var(--text-muted);
  transition: background .15s, color .15s;
}
.docs-sidebar a:hover { background: rgba(255,255,255,.05); color: var(--white); }
.docs-sidebar a.active {
  background: rgba(52,211,153,.1); color: var(--emerald);
}

/* Main docs content */
.docs-main {
  flex: 1; min-width: 0;
  padding: 48px 56px 80px;
}
.docs-content {
  max-width: 820px;
}
.docs-lead {
  font-size: 1.15rem; color: var(--text-muted); margin-bottom: 48px;
}
.docs-content h1 { margin-bottom: 8px; }
.docs-content h2 {
  margin-top: 56px; margin-bottom: 16px;
  padding-top: 24px; border-top: 1px solid var(--border);
}
.docs-content h2:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.docs-content h3 { margin-top: 32px; margin-bottom: 12px; }
.docs-content p { margin-bottom: 16px; }
.docs-content ul, .docs-content ol { margin-bottom: 16px; }
.docs-content section { scroll-margin-top: calc(var(--nav-h) + 24px); }

/* Code blocks */
.code-block {
  margin: 16px 0 24px;
  border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--border);
}
.code-header {
  background: var(--bg-raised);
  padding: 8px 16px; font-size: .75rem;
  color: var(--text-dim); font-weight: 600;
  border-bottom: 1px solid var(--border);
  letter-spacing: .3px;
}
.code-block pre {
  background: var(--bg-code);
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .83rem;
  line-height: 1.8;
  color: var(--text-muted);
}

/* Tables */
.table-wrapper {
  overflow-x: auto; margin: 16px 0 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
table {
  width: 100%; border-collapse: collapse;
  font-size: .875rem;
}
thead { background: var(--bg-raised); }
th {
  text-align: left; padding: 12px 16px;
  color: var(--text-dim); font-weight: 600;
  font-size: .75rem; text-transform: uppercase;
  letter-spacing: .5px;
}
td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}
td code { font-size: .8rem; }

/* Callout */
.callout {
  background: rgba(251,191,36,.06);
  border: 1px solid rgba(251,191,36,.2);
  border-radius: var(--radius-sm);
  padding: 16px 20px; margin: 24px 0;
  font-size: .9rem; color: var(--text-muted);
}
.callout strong { color: var(--amber); }

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .arch-grid { grid-template-columns: repeat(2, 1fr); }
  .docs-main { padding: 40px 32px 80px; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none; flex-direction: column;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: rgba(10,15,26,.97); backdrop-filter: blur(12px);
    padding: 16px 24px; gap: 12px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.active { display: flex; }
  .nav-toggle { display: block; }

  .hero { padding: calc(var(--nav-h) + 48px) 0 48px; }
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: 1rem; }

  .grid-3 { grid-template-columns: 1fr; }
  .arch-grid { grid-template-columns: 1fr; }
  .providers-grid { grid-template-columns: repeat(2, 1fr); }

  .section { padding: 64px 0; }

  /* Docs: sidebar becomes top-bar */
  .docs-layout { flex-direction: column; }
  .docs-sidebar {
    position: relative; top: 0;
    width: 100%; height: auto;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex; flex-wrap: wrap; gap: 0 24px;
    overflow-y: visible;
  }
  .docs-sidebar h4 { margin: 12px 0 4px; width: 100%; }
  .docs-sidebar ul { display: flex; flex-wrap: wrap; gap: 4px 8px; }
  .docs-main { padding: 32px 20px 64px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn-lg { width: 100%; justify-content: center; }
  .providers-grid { grid-template-columns: 1fr; }
  .docs-sidebar ul { flex-direction: column; }
}
