/* ============================================================
   nStant marketing site — shared styles
   Single source of truth for all pages. Edit here, applies everywhere.
   ============================================================ */

:root[data-theme="dark"] {
  --bg: #0C0A09;
  --bg-elev: #161310;
  --surface: #1C1917;
  --surface-2: #221E1B;
  --border: #292524;
  --border-strong: #3A3633;
  --text: #FAFAF9;
  --text-secondary: #A8A29E;
  --text-tertiary: #78716C;
  --action: #3B82F6;
  --action-strong: #1E40AF;
  --action-glow: rgba(59, 130, 246, 0.15);
  --alert: #F87171;
  --alert-bg: rgba(153, 27, 27, 0.18);
  --confirm: #4ADE80;
  --confirm-bg: rgba(21, 128, 61, 0.18);
  --neutral: #78716C;
  --grid: rgba(255, 255, 255, 0.03);
}

:root[data-theme="light"] {
  --bg: #FAFAF9;
  --bg-elev: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F5F5F4;
  --border: #E7E5E4;
  --border-strong: #D6D3D1;
  --text: #1C1917;
  --text-secondary: #57534E;
  --text-tertiary: #78716C;
  --action: #1E40AF;
  --action-strong: #1E3A8A;
  --action-glow: rgba(30, 64, 175, 0.08);
  --alert: #991B1B;
  --alert-bg: #FEE2E2;
  --confirm: #15803D;
  --confirm-bg: #DCFCE7;
  --neutral: #78716C;
  --grid: rgba(0, 0, 0, 0.04);
}

:root {
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --max: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background 220ms ease, color 220ms ease;
}

::selection { background: var(--action-strong); color: #FAFAF9; }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wordmark-mark {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--action-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FAFAF9;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.04em;
}

.wordmark {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 120ms;
}

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

.nav-link.active { color: var(--text); }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 120ms;
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle:hover { color: var(--text); border-color: var(--text-secondary); }

/* ============================================================
   CONTAINER & GENERIC LAYOUT
   ============================================================ */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 1;
}

/* ============================================================
   PAGE HEADER (used on non-home pages)
   ============================================================ */
.page-header {
  padding: clamp(72px, 10vw, 128px) 0 clamp(48px, 6vw, 80px);
  border-bottom: 1px solid var(--border);
}

.page-header-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
}

.page-header-meta .num {
  color: var(--action);
  font-weight: 600;
}

.page-header-meta .divider {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 8px;
  transform: translateY(-3px);
}

h1.page-title {
  font-size: clamp(36px, 5.5vw, 60px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 24px;
  max-width: 880px;
}

h1.page-title .accent {
  color: var(--action);
  font-style: italic;
  font-weight: 500;
}

.page-lead {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 640px;
}

/* ============================================================
   SECTION PRIMITIVES
   ============================================================ */
section.block {
  padding: clamp(72px, 10vw, 128px) 0;
  border-top: 1px solid var(--border);
  position: relative;
}

section.block:first-of-type { border-top: none; }

.section-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
}

.section-meta .num {
  color: var(--action);
  font-weight: 600;
}

.section-meta .divider {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 8px;
  transform: translateY(-3px);
}

h2.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 20px;
  max-width: 740px;
}

h3.subsection-title {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 16px;
}

.section-lead {
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 640px;
}

p.body-prose {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 680px;
}

p.body-prose + p.body-prose { margin-top: 16px; }

p.body-prose strong { color: var(--text); font-weight: 600; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 150ms;
  line-height: 1;
}

.btn-primary {
  background: var(--action);
  color: #FAFAF9;
  border-color: var(--action);
  box-shadow: 0 0 0 0 var(--action-glow);
}

.btn-primary:hover {
  background: var(--action-strong);
  border-color: var(--action-strong);
  box-shadow: 0 0 0 4px var(--action-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:hover { border-color: var(--text-secondary); }

.btn .arrow { transition: transform 150ms; }
.btn:hover .arrow { transform: translateX(2px); }

/* ============================================================
   CARDS, LISTS, BADGES
   ============================================================ */
.bordered-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 32px;
}

.bordered-list-item {
  background: var(--bg-elev);
  padding: 24px 28px;
  transition: background 180ms;
}

.bordered-list-item:hover { background: var(--surface); }

.numbered-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  margin-top: 32px;
}

.numbered-list li {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  align-items: baseline;
  font-size: 15px;
  color: var(--text);
  line-height: 1.55;
}

.numbered-list li:last-child { border-bottom: none; }
.numbered-list li:first-child { padding-top: 0; }

.numbered-list li::before {
  content: attr(data-num);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--action);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  margin-bottom: 32px;
  background: var(--surface);
}

.live-pill .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--confirm);
  box-shadow: 0 0 0 0 var(--confirm);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--confirm) 50%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ============================================================
   CTA STRIP (used at bottom of internal pages)
   ============================================================ */
.cta-strip {
  margin-top: 64px;
  padding: 48px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  position: relative;
  overflow: hidden;
}

.cta-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, var(--action-glow) 0%, transparent 50%);
  pointer-events: none;
}

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

.cta-strip h3 {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.cta-strip p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 460px;
}

.cta-strip-action {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 60px;
  margin-top: 80px;
}

.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .nav-link { display: none; }
  .cta-strip { flex-direction: column; align-items: flex-start; padding: 32px 24px; }
}

/* ============================================================
   MOTION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: reveal 800ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal-1 { animation-delay: 80ms; }
.reveal-2 { animation-delay: 180ms; }
.reveal-3 { animation-delay: 280ms; }
.reveal-4 { animation-delay: 380ms; }
.reveal-5 { animation-delay: 480ms; }

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
}
