/* ──────────────────────────────────────────────────────────────────
   Snipetic shared web styles — used by landing.html, privacy.html, terms.html
   Single source of truth for tokens, nav, footer, buttons, base type.
   Page-specific styles still live in each page's <style> block.
   ────────────────────────────────────────────────────────────────── */

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

/* ── Tokens ───────────────────────────────────────────────────────── */
:root {
  --bg:          #0d0e17;
  --surface:     #0f0f18;
  --surface2:    #16162a;
  --border:      #1c1c2e;
  --border2:     #28283c;
  --text:        #eeeef5;
  --muted:       #a8a8cc;
  --dimmer:      #7878a0;
  --accent:      #60a5fa;
  --accent-dim:  rgba(96,165,250,0.1);
  --accent-glow: rgba(96,165,250,0.2);
  --pro:         #93c5fd;
  --pro-dim:     rgba(147,197,253,0.08);
  --success:     #22c55e;
  --warn:        #f59e0b;
}

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* Particle background canvas */
body > canvas { opacity: 0.22; }

/* Subtle grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
}

/* ── Type ─────────────────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: 'Exo 2', sans-serif;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.logo-word {
  font-family: 'Exo 2', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
}
.logo-word .logo-labs { color: var(--accent); }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Layout ───────────────────────────────────────────────────────── */
nav, section, footer { position: relative; z-index: 1; }

.container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ── Nav ──────────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
  background: rgba(8,8,13,0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
nav.nav-hidden { transform: translateY(-110%); }
/* Keep nav visible while the mobile menu is open, even after scroll */
nav.nav-open.nav-hidden { transform: translateY(0); }

/* Floating hamburger pill — appears when nav slides away */
.nav-pill {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 99;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(8,8,13,0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(0.92);
  transition: opacity 0.22s, transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.18s, border-color 0.18s;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}
.nav-pill.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.nav-pill:hover { background: rgba(8,8,13,0.95); border-color: var(--dimmer); }
.nav-pill:active { transform: translateY(0) scale(0.95); }
.nav-pill-bar,
.nav-pill-bar::before,
.nav-pill-bar::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}
.nav-pill-bar { position: relative; }
.nav-pill-bar::before,
.nav-pill-bar::after {
  content: '';
  position: absolute;
  left: 0;
}
.nav-pill-bar::before { top: -6px; }
.nav-pill-bar::after  { top:  6px; }

/* Desktop: keep nav fully visible, no scroll-collapse */
@media (min-width: 961px) {
  nav.nav-hidden { transform: none; }
  .nav-pill { display: none !important; }
}

/* Back-to-top button — bottom-right, aligned with content edge on desktop */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: max(20px, calc((100vw - 1260px) / 2 + 40px));
  z-index: 99;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(8,8,13,0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.92);
  transition: opacity 0.22s, transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.18s, border-color 0.18s;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}
.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.back-to-top:hover {
  background: rgba(8,8,13,0.95);
  border-color: var(--dimmer);
}
.back-to-top:active { transform: translateY(0) scale(0.95); }
.back-to-top svg { width: 18px; height: 18px; display: block; stroke-width: 2; }
@media (max-width: 680px) {
  .back-to-top { right: 18px; bottom: 18px; }
}

.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 40px;
}
.nav-inner > .logo-word { grid-column: 1; justify-self: start; }
.nav-inner > .nav-links { grid-column: 2; }
.nav-inner > .nav-right { grid-column: 3; justify-self: end; }

/* Aurora divider — anchored to the bottom of the sticky nav, scrolls with it */
nav::before,
nav::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, #1a2aff, #4a7fff 18%, #00cfff 35%, #00ffcc 50%, #4a7fff 65%, #9a5aff 82%, #1a2aff);
  mask-image: linear-gradient(90deg, transparent 0%, black 22%, black 78%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 22%, black 78%, transparent 100%);
  pointer-events: none;
}
nav::before {
  bottom: -2px;
  height: 2px;
  z-index: 2;
}
nav::after {
  bottom: -4px;
  height: 4px;
  filter: blur(6px);
  opacity: 0.9;
  z-index: 1;
  animation: prismatic-pulse 2s ease-in-out infinite;
}

/* Legacy divider div — now redundant since the gradient lives on nav itself */
.nav-divider { display: none; }

/* Reusable aurora divider — same gradient as nav, usable anywhere */
.aurora-divider {
  position: relative;
  height: 2px;
  border: none;
  z-index: 1;
}
.aurora-divider::before,
.aurora-divider::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #1a2aff, #4a7fff 18%, #00cfff 35%, #00ffcc 50%, #4a7fff 65%, #9a5aff 82%, #1a2aff);
  mask-image: linear-gradient(90deg, transparent 0%, black 22%, black 78%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 22%, black 78%, transparent 100%);
}
.aurora-divider::before { opacity: 1; }
.aurora-divider::after  { filter: blur(6px); opacity: 0.9; animation: prismatic-pulse 2s ease-in-out infinite; }

@keyframes prismatic-pulse {
  0%, 100% { opacity: 0.65; }
  50%       { opacity: 0.95; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0 auto;
}

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

/* ── Products dropdown ──────────────────────────────── */
.nav-has-dd { position: relative; }

.nav-dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s;
}
.nav-dd-btn:hover { color: var(--text); }
.nav-dd-btn::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -2px);
  transition: transform 0.18s;
}
.nav-has-dd.dd-open .nav-dd-btn::after {
  transform: rotate(-135deg) translate(-1px, 2px);
}

.nav-dd::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}
.nav-dd {
  position: absolute;
  top: calc(100% + 14px);
  left: -12px;
  min-width: 148px;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: #0f0f1c;
  border: 1px solid var(--border);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 200;
}
@media (hover: hover) {
  .nav-has-dd:hover .nav-dd {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
}
.nav-has-dd.dd-open .nav-dd {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-dd a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dimmer);
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.nav-dd a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.nav-right { display: flex; align-items: center; gap: 10px; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  width: 22px;
  background: var(--text);
  border-radius: 2px;
  transition: opacity 0.15s, transform 0.2s;
}
nav.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
nav.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; }
nav.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
  border: none;
  white-space: nowrap;
}

.btn-primary { background: var(--accent); color: #f4f7ff; }
.btn-primary:hover { background: #3b82f6; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(96,165,250,0.25); }

.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border2); }
.btn-ghost:hover { color: var(--text); border-color: var(--dimmer); background: var(--surface); }

/* ── Footer ───────────────────────────────────────────────────────── */
footer {
  padding: 64px 0 48px;
  background: #08090f;
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, 0.32),
    inset 0 -4px 12px rgba(0, 0, 0, 0.32);
}

.foot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
  gap: 20px;
}

.foot-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.foot-social { display: flex; gap: 10px; list-style: none; }

.foot-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.18s;
  text-decoration: none;
}
.foot-social a:hover {
  color: var(--text);
  background: var(--surface2);
  border-color: var(--dimmer);
  transform: translateY(-1px);
}
.foot-social svg { width: 16px; height: 16px; display: block; }

.foot-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.foot-copy p,
.foot-copy { font-size: 13px; color: var(--dimmer); margin: 0; }

.foot-link-groups {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.foot-links {
  display: flex;
  gap: 22px;
  list-style: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

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

.foot-links-secondary a {
  color: var(--dimmer);
  font-size: 13px;
}
.foot-links-secondary a:hover { color: var(--muted); }

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav-hamburger { display: flex; }
  .nav-links { display: none; }

  nav.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #08080d;
    padding: 4px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    list-style: none;
  }
  nav.nav-open .nav-links li,
  nav.nav-open .nav-dd li {
    width: 100%;
    list-style: none;
  }
  nav.nav-open .nav-links > li > a {
    display: block;
    padding: 16px 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    text-decoration: none;
  }
  nav.nav-open .nav-links > li:last-child > a { border-bottom: none; }

  /* Products — collapsible toggle on mobile */
  nav.nav-open .nav-dd-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    color: var(--muted);
    padding: 16px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    pointer-events: auto;
  }
  nav.nav-open .nav-dd-btn::after {
    display: inline-block;
    margin-left: 8px;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.18s;
  }
  nav.nav-open .nav-has-dd.dd-open .nav-dd-btn { border-bottom-color: transparent; }
  nav.nav-open .nav-has-dd.dd-open .nav-dd-btn::after {
    transform: rotate(-135deg) translate(-2px, 2px);
  }

  /* Dropdown panel — collapsed by default, shown when dd-open */
  nav.nav-open .nav-dd {
    position: static;
    transform: none;
    transition: none;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    min-width: auto;
    list-style: none;
    display: none;
    opacity: 1;
    pointer-events: auto;
  }
  nav.nav-open .nav-has-dd.dd-open .nav-dd {
    display: block;
    border-bottom: 1px solid var(--border);
    padding: 4px 0 8px;
  }
  nav.nav-open .nav-dd a {
    display: block;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 0 12px 14px;
    color: var(--dimmer);
    border-radius: 0;
    background: none;
    text-decoration: none;
  }
  nav.nav-open .nav-dd a:hover,
  nav.nav-open .nav-dd a:active { color: var(--text); }

  .nav-right .btn-primary { display: none; }
}

@media (max-width: 720px) {
  footer { padding: 48px 0 36px; }
  .foot-top { margin-bottom: 28px; }
  .foot-bottom { gap: 16px; }
  .foot-link-groups { gap: 6px; }
  .foot-links { gap: 14px; }
}

@media (max-width: 680px) {
  .container { padding: 0 24px; }
}

/* ── Doc pages (privacy / terms / support) ───────────────────────── */
.doc-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 32px 120px;
  position: relative;
  z-index: 1;
}

.doc-header h1 {
  font-family: 'Exo 2', sans-serif;
  font-weight: 800;
  font-size: 40px;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 12px;
}

.doc-meta {
  font-size: 15px;
  color: var(--muted);
}

.section {
  padding: 32px 36px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  margin-bottom: 20px;
}

.section p {
  font-size: 16px;
  color: #c8c8e6;
  line-height: 1.85;
  margin-bottom: 14px;
}
.section p:last-child { margin-bottom: 0; }

.section a { color: var(--accent); text-decoration: none; }
.section a:hover { text-decoration: underline; }

code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--text);
}

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

@media (max-width: 768px) {
  .doc-wrap { padding: 48px 20px 80px; }
}

@media (max-width: 480px) {
  .doc-wrap { padding: 36px 16px 64px; }
}
