/* ==========================================================================
   Nyquist landing page — vanilla CSS, no build step, no framework.
   Dark-first, accessible, performance-minded.
   ========================================================================== */

/* ---- Design tokens ---- */
:root {
  --brand-orange: #ffb36a;
  --brand-purple: #7b68ff;

  --bg: #0e0b16;
  --bg-elev: #161127;
  --bg-elev-2: #1d1733;
  --surface-border: #2c2542;
  --text: #f1edf8;
  --text-dim: #a79fc2;
  --text-faint: #756d93;

  --accent: #7b68ff; /* brand purple */
  --accent-strong: #6a55f5;
  --accent-ink: #ffffff; /* text on accent fills */
  --accent-text: #ffb36a; /* orange accent for links/labels on dark */
  --accent-soft: rgba(123, 104, 255, 0.14);

  --good: #34d399; /* semantic green (matches in-app bit-perfect status) */
  --good-soft: rgba(52, 211, 153, 0.14);
  --good-border: rgba(52, 211, 153, 0.4);
  --accent-blue: #38bdf8;
  --accent-amber: #fbbf24;

  --ring: rgba(123, 104, 255, 0.6);

  --header-bg: rgba(14, 11, 22, 0.72);
  --menu-bg: rgba(14, 11, 22, 0.97);
  --alt-bg: rgba(255, 255, 255, 0.022);

  --maxw: 1120px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);

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

  --step-1: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  --h1: clamp(2.3rem, 1.6rem + 3.2vw, 4.1rem);
  --h2: clamp(1.7rem, 1.3rem + 1.8vw, 2.6rem);
  --h3: clamp(1.1rem, 1rem + 0.4vw, 1.25rem);
}

/* ---- Light theme ---- */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf7f2;
    --bg-elev: #ffffff;
    --bg-elev-2: #fbf9f6;
    --surface-border: #ece5dc;
    --text: #1b1630;
    --text-dim: #5a5470;
    --text-faint: #8b849c;

    --accent: #6a55f5;
    --accent-strong: #5a45e6;
    --accent-ink: #ffffff;
    --accent-text: #6a4fe6; /* deeper purple — orange fails on white */
    --accent-soft: rgba(106, 85, 245, 0.1);

    --ring: rgba(106, 79, 230, 0.6);

    --header-bg: rgba(250, 247, 242, 0.8);
    --menu-bg: rgba(250, 247, 242, 0.98);
    --alt-bg: #f3eee7;
    --shadow: 0 18px 50px rgba(80, 60, 120, 0.14);
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-1);
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(
      1100px 600px at 80% -10%,
      rgba(255, 179, 106, 0.12),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at 0% 0%,
      rgba(123, 104, 255, 0.12),
      transparent 55%
    ),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 700;
}
h1 {
  font-size: var(--h1);
}
h2 {
  font-size: var(--h2);
}
h3 {
  font-size: var(--h3);
}
p {
  margin: 0 0 1rem;
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
}
.narrow {
  max-width: 760px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

/* ---- Buttons & CTAs ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-small:hover {
  background: var(--accent-strong);
}
.btn-ghost {
  background: transparent;
  border-color: var(--surface-border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px;
  border-radius: 14px;
  background: #0a0a0f;
  color: #ffffff;
  font-weight: 500;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.appstore-badge:hover {
  text-decoration: none;
  transform: translateY(-2px);
}
.appstore-badge svg {
  color: #ffffff;
}
.appstore-badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  text-align: left;
}
.appstore-badge-small {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
}
.appstore-badge-large {
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.appstore-badge-lg {
  padding: 14px 26px;
}

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--surface-border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 700;
}
.brand:hover {
  text-decoration: none;
}
.brand-logo {
  border-radius: 7px;
}
.brand-name {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-menu a {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-menu a:hover {
  color: var(--text);
  text-decoration: none;
}
.nav-menu a.btn-small {
  color: var(--accent-ink);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  background: var(--bg-elev);
  cursor: pointer;
  position: relative;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  background: var(--text);
  transform: translate(-50%, -50%);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.nav-toggle-bar::before {
  transform: translate(-50%, -7px);
}
.nav-toggle-bar::after {
  transform: translate(-50%, 5px);
}

/* ---- Hero ---- */
.hero {
  padding: clamp(46px, 7vw, 96px) 0 clamp(40px, 5vw, 72px);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 14px;
}
.lede {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.22rem);
  color: var(--text-dim);
  max-width: 38ch;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 26px 0 22px;
  align-items: center;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--text-dim);
  font-size: 0.92rem;
}
.hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}
.dot-green {
  background: var(--good);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
}
.dot-blue {
  background: var(--accent-blue);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}
.dot-amber {
  background: var(--accent-amber);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}
.dot-purple {
  background: var(--brand-purple);
  box-shadow: 0 0 10px rgba(123, 104, 255, 0.6);
}
.dot-orange {
  background: var(--brand-orange);
  box-shadow: 0 0 10px rgba(255, 179, 106, 0.55);
}

/* ---- Hero screenshot + app icon ---- */
.hero-art {
  position: relative;
}
.hero-shot {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  background: var(--bg-elev);
  aspect-ratio: 16 / 10;
}
.hero-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}
.app-icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.app-icon-badge {
  position: absolute;
  left: -18px;
  bottom: -20px;
}

/* ---- Screenshot gallery ---- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.gallery-item {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev));
  transition:
    transform 0.18s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.gallery-figure {
  margin: 0;
}
.gallery-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  border-bottom: 1px solid var(--surface-border);
}
.gallery-cap {
  padding: 14px 18px 18px;
  color: var(--text-dim);
  font-size: 0.92rem;
}
.gallery-cap strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-green {
  background: var(--good-soft);
  color: var(--good);
  border: 1px solid var(--good-border);
}

/* ---- Format strip ---- */
.strip {
  border-block: 1px solid var(--surface-border);
  background: var(--alt-bg);
}
.strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  padding: 20px 22px;
}
.strip-label {
  color: var(--text-faint);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.format-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.format-list li {
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.format-list .muted {
  color: var(--text-faint);
  font-weight: 500;
}

/* ---- Sections ---- */
.section {
  padding: clamp(56px, 8vw, 104px) 0;
}
.section-alt {
  background: var(--alt-bg);
  border-block: 1px solid var(--surface-border);
}
.section-head {
  max-width: 640px;
  margin-bottom: clamp(34px, 4vw, 52px);
}
.section-sub {
  color: var(--text-dim);
  font-size: 1.08rem;
}

/* ---- Cards / feature grid ---- */
.feature-grid,
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.card {
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition:
    transform 0.18s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.card h3 {
  margin-bottom: 0.4em;
}
.card p {
  color: var(--text-dim);
  margin: 0;
}
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 1.3rem;
  margin-bottom: 16px;
}

/* ---- Split (bit-perfect) ---- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 5vw, 64px);
  align-items: center;
}
.split-copy p {
  color: var(--text-dim);
}
.check-list {
  list-style: none;
  margin: 18px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.check-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.fine {
  font-size: 0.92rem;
  color: var(--text-faint);
}

.signal-card {
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
}
.signal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  color: var(--text-dim);
}
.signal-val {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.signal-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.flow-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--good), rgba(52, 211, 153, 0.2));
  border-radius: 2px;
}
.signal-status {
  margin-top: 14px;
}

/* ---- Privacy ---- */
.privacy {
  max-width: 720px;
}
.privacy p {
  color: var(--text-dim);
  font-size: 1.08rem;
}

/* ---- FAQ ---- */
.faq {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq details {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 4px 20px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 16px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq details p {
  color: var(--text-dim);
  margin: 0 0 16px;
}

/* ---- Final CTA ---- */
.cta-final {
  text-align: center;
}
.cta-box {
  background:
    linear-gradient(
      160deg,
      rgba(123, 104, 255, 0.16),
      rgba(255, 179, 106, 0.16)
    ),
    var(--bg-elev);
  border: 1px solid rgba(123, 104, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 72px) 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.cta-box p {
  color: var(--text-dim);
  max-width: 46ch;
}
.cta-box .appstore-badge {
  margin-top: 16px;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--surface-border);
  padding: 48px 0 32px;
  background: var(--bg-elev);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
}
.footer-brand {
  max-width: 420px;
}
.footer-tagline {
  color: var(--text-faint);
  font-size: 0.92rem;
  margin-top: 10px;
}
.footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  color: var(--text-dim);
}
.footer-links a:hover {
  color: var(--accent-text);
}
.footer-bottom {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--surface-border);
  color: var(--text-faint);
  font-size: 0.85rem;
}
.footer-bottom p {
  margin: 0;
}

/* ---- Reveal on scroll ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .hero-grid,
  .split {
    grid-template-columns: 1fr;
  }
  .hero-art {
    order: -1;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .nav-menu {
    position: absolute;
    top: 64px;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 22px 22px;
    background: var(--menu-bg);
    border-bottom: 1px solid var(--surface-border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 0.2s ease,
      transform 0.2s ease;
  }
  .nav-menu.open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  .nav-menu li {
    padding: 6px 0;
  }
  .nav-menu a.btn-small {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 6px;
  }
}

/* ---- Document / legal pages (Support, Privacy) ---- */
.doc-header {
  padding: clamp(48px, 7vw, 88px) 0 clamp(20px, 3vw, 32px);
  border-bottom: 1px solid var(--surface-border);
  background: var(--alt-bg);
}
.doc-header .eyebrow {
  margin-bottom: 8px;
}
.doc-lede {
  color: var(--text-dim);
  font-size: 1.08rem;
  max-width: 680px;
  margin-top: 4px;
}
.doc-meta {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--text-faint);
}

.doc {
  padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px);
}
.doc h2 {
  margin-top: 1.6em;
  scroll-margin-top: 84px;
}
.doc h2:first-of-type {
  margin-top: 0;
}
.doc h3 {
  margin-top: 1.4em;
}
.doc p,
.doc li {
  color: var(--text-dim);
}
.doc ul {
  margin: 0 0 1rem;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc strong {
  color: var(--text);
}
.doc a {
  text-decoration: underline;
}

.doc-toc {
  margin: 0 0 2.2rem;
  padding: 18px 20px;
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
}
.doc-toc p {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--text);
}
.doc-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 6px;
}
.doc-toc a {
  color: var(--text-dim);
  text-decoration: none;
}
.doc-toc a:hover {
  color: var(--accent-text);
}

.doc-callout {
  margin: 0 0 1.6rem;
  padding: 18px 20px;
  border: 1px solid var(--good-border);
  background: var(--good-soft);
  border-radius: var(--radius);
  color: var(--text);
}
.doc-callout p {
  margin: 0;
  color: var(--text);
}

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin: 0 0 1.6rem;
  padding: 22px 24px;
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
}
.contact-card .feature-icon {
  margin-bottom: 0;
  flex: none;
}
.contact-card-body {
  flex: 1 1 240px;
}
.contact-card-body p {
  margin: 0;
  color: var(--text-dim);
}
.contact-card-body a {
  font-weight: 600;
  font-size: 1.12rem;
  color: var(--accent-text);
}
