/* ============================================================
   CereVault - shared stylesheet
   Dark, privacy-first product-brand theme.
   No frameworks. Lightweight. Mobile-first. Accessible.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg:           #0a0c10;
  --bg-alt:       #0e1117;
  --surface:      #141a22;
  --surface-2:    #1a212c;
  --border:       rgba(255, 255, 255, 0.08);
  --border-strong:rgba(255, 255, 255, 0.16);

  --text:         #e6edf3;
  --text-muted:   #9aa6b2;
  --text-faint:   #707b87;

  --accent:       #58a6ff;
  --accent-hover: #8ecaff;
  --accent-soft:  rgba(88, 166, 255, 0.12);
  --accent-2:     #8b7cff;

  --radius:       16px;
  --radius-sm:    10px;
  --radius-pill:  999px;

  --maxw:         1140px;
  --gap:          clamp(1rem, 2.5vw, 1.75rem);

  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:    0 12px 32px rgba(0, 0, 0, 0.45);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto,
          Helvetica, Arial, sans-serif;

  color-scheme: dark;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Site scrolls normally, no scroll locking. */
  overflow-x: hidden;
  min-height: 100dvh;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

img, svg { max-width: 100%; }
img { height: auto; border: 0; }

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

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
p { margin: 0 0 1rem; }

/* ---------- Accessibility helpers ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--accent);
  color: #04101f;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; color: #04101f; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}

.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.section-head { max-width: 56ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}
.section-head h2 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); }
.section-head p { color: var(--text-muted); font-size: 1.075rem; margin-bottom: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 12, 16, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 12, 16, 0.92);
}
.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.brand:hover { color: var(--text); }
.brand-mark { display: inline-flex; flex: 0 0 auto; }
.brand-mark img { display: block; height: 30px; width: auto; }
.brand-name { white-space: nowrap; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.975rem;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle svg { display: block; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.975rem;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #04101f; }
.btn-primary:hover { background: var(--accent-hover); color: #04101f; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.btn-ghost { background: transparent; color: var(--accent); padding-inline: 0.2rem; }
.btn-ghost:hover { color: var(--accent-hover); }
.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-lg { padding: 0.95rem 1.6rem; font-size: 1.05rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.85rem; align-items: center; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(4rem, 10vw, 7.5rem);
  overflow: hidden;
}
/* Restrained, static glow replaces the old animated canvas. */
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 120%;
  z-index: -2;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(88, 166, 255, 0.18), transparent 70%),
    radial-gradient(42% 42% at 82% 8%, rgba(139, 124, 255, 0.14), transparent 70%);
  pointer-events: none;
}
/* Faint dot grid for subtle texture. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 25%, #000 30%, transparent 80%);
          mask-image: radial-gradient(70% 60% at 50% 25%, #000 30%, transparent 80%);
  pointer-events: none;
}
.hero-inner { max-width: 56rem; }
.hero h1 {
  font-size: clamp(2.2rem, 1.3rem + 3.8vw, 3.9rem);
  margin-bottom: 1rem;
  color: #f3f7fb; /* fallback if background-clip: text is unsupported */
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 {
    background: linear-gradient(180deg, #ffffff, #b9c6d3);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}
.hero .lead {
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.35rem);
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: 1.8rem;
}
.hero .cta-row { margin-bottom: 1.5rem; }
.trust-line {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  color: var(--text-faint);
  margin: 0;
}
.trust-line svg { color: var(--accent); flex: 0 0 auto; }

/* ---------- Product grid / cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--gap);
}
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 1rem + 1.2vw, 1.9rem);
  transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease;
}
.product-card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--surface-2); }
.product-card .card-icon {
  display: inline-flex;
  width: 46px; height: 46px;
  align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1.1rem;
}

/* App icons (recreated from the App Store artwork) */
.app-icon { display: inline-block; margin-bottom: 1.1rem; line-height: 0; }
.app-icon img { display: block; width: 56px; height: 56px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45)); }
.product-icon { display: block; width: 78px; height: 78px; margin-bottom: 1.25rem; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5)); }
.product-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.product-card .category {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.8rem;
}
.product-card p { color: var(--text-muted); margin-bottom: 1.4rem; }
.product-card .card-cta { margin-top: auto; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid var(--border-strong);
}
.badge--free { background: rgba(98, 210, 145, 0.14); color: #74e0a4; border-color: rgba(98, 210, 145, 0.3); }

/* ---------- Pillars (privacy) ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--gap);
  margin-top: 2.4rem;
}
.pillar { padding: 1.3rem 1.4rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.pillar .pillar-icon { color: var(--accent); margin-bottom: 0.8rem; display: inline-flex; }
.pillar h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.pillar p { color: var(--text-muted); font-size: 0.97rem; margin: 0; }

.callout {
  margin-top: 2.6rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  font-size: clamp(1.1rem, 1rem + 0.8vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Feature list (product pages) ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--gap);
}
.feature {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.feature .feature-icon { color: var(--accent); margin-bottom: 0.9rem; display: inline-flex; }
.feature h3 { font-size: 1.12rem; margin-bottom: 0.4rem; }
.feature p { color: var(--text-muted); font-size: 0.97rem; margin: 0; }

/* ---------- Product hero (two column) ---------- */
.product-hero { padding-block: clamp(3rem, 7vw, 5rem); position: relative; isolation: isolate; overflow: hidden; }
.product-hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 110%;
  z-index: -1;
  background: radial-gradient(50% 50% at 25% 0%, rgba(88, 166, 255, 0.14), transparent 70%);
  pointer-events: none;
}
.breadcrumb { margin-bottom: 1.25rem; font-size: 0.9rem; color: var(--text-faint); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.product-hero h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); }
.product-hero .tagline { font-size: 1.05rem; color: var(--accent); font-weight: 600; margin-bottom: 0.6rem; letter-spacing: 0.01em; }
.product-hero .lead { font-size: clamp(1.05rem, 1rem + 0.5vw, 1.25rem); color: var(--text-muted); max-width: 54ch; }
.product-meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem;
  color: var(--text-faint); font-size: 0.9rem; margin: 1.4rem 0 1.8rem;
  list-style: none; padding: 0;
}
.product-meta li { display: inline-flex; align-items: center; gap: 0.4rem; }
.product-meta svg { color: var(--accent); }

/* Requirements / notes box */
.note-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.4rem 1.6rem;
}
.note-box h3 { font-size: 1.05rem; margin-bottom: 0.7rem; }
.note-box ul { margin: 0; padding-left: 1.1rem; color: var(--text-muted); }
.note-box li { margin-bottom: 0.4rem; }
.note-box li:last-child { margin-bottom: 0; }

.split {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

/* ---------- Setup guide ---------- */
.guide-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--gap);
}
.guide-options .feature h3 { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}
.steps > li {
  position: relative;
  padding-left: 3.4rem;
  min-height: 2.4rem;
}
.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 700;
  border: 1px solid var(--border-strong);
}
.steps h3 { font-size: 1.08rem; margin: 0.25rem 0 0.4rem; }
.steps p { color: var(--text-muted); margin: 0 0 0.6rem; }
.steps p:last-child { margin-bottom: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.12em 0.42em;
  color: #e6edf3;
}
.cmd {
  display: block;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.5;
  background: #05070a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin: 0.6rem 0;
  overflow-x: auto;
  color: #e6edf3;
  white-space: pre;
}
.cmd .prompt { color: var(--text-faint); user-select: none; }

/* ---------- App Store badge ---------- */
.appstore-badge { display: inline-flex; align-items: center; }
.appstore-badge img { display: block; height: 52px; width: auto; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band .container { max-width: 60rem; }
.cta-band h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); margin-bottom: 0.6rem; }
.cta-band p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 1.6rem; }
.cta-band .cta-row { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(2, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
}
.footer-brand .brand { margin-right: 0; margin-bottom: 0.85rem; }
.footer-brand p { color: var(--text-muted); max-width: 34ch; margin: 0; }
.footer-col h4 {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 0.9rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.55rem; }
.footer-col a { color: var(--text-muted); font-weight: 500; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: clamp(2rem, 4vw, 2.75rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 0.875rem;
}
.footer-bottom p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }

  .nav-menu {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem clamp(1.1rem, 4vw, 2rem) 1.25rem;
    background: rgba(10, 12, 16, 0.98);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .nav-menu.is-open { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links a { display: block; padding: 0.95rem 0.2rem; font-size: 1.05rem; color: var(--text); }
  .nav-menu .nav-cta { margin-top: 1rem; }

  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 460px) {
  .footer-grid { grid-template-columns: 1fr; }
  .cta-row .btn { width: 100%; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .btn:hover, .product-card:hover { transform: none; }
}
