/* Presence — marketing landing
 * Hand-tuned, performance-first. Mirrors the app's design tokens
 * (src/design/tokens.ts) so the web identity matches the iOS one.
 *
 * Approach:
 *   - CSS custom properties for tokens.
 *   - Dark surface for the marketing page (the app is light; the marketing
 *     site leans dark + accent because attractors read better on dark).
 *   - Mobile-first; one media query for tablet+.
 *   - No frameworks. No build step. ~10kb gzipped.
 */

:root {
  /* Color */
  --bg:            #0a0a0c;
  --surface:       #15151a;
  --surface-2:     #1e1e26;
  --hairline:      rgba(255,255,255,0.08);
  --separator:     rgba(255,255,255,0.04);

  --text:          #f6f6f9;
  --text-2:        #b6b6c0;
  --text-3:        #8c8c95;

  --accent:        #007AFF;
  --accent-soft:   rgba(0,122,255,0.14);

  --success:       #34c759;
  --warning:       #fcd34d;

  /* Spacing — 8pt grid */
  --s-xs:  4px;
  --s-sm:  8px;
  --s-md:  12px;
  --s-lg:  16px;
  --s-xl:  24px;
  --s-2xl: 32px;
  --s-3xl: 48px;
  --s-4xl: 80px;
  --s-5xl: 120px;

  /* Radii */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-pill: 999px;

  /* Type ramp — mirrors the app */
  --f-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  --max-w: 1100px;
}

/* Reset (minimal — only what we need) */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv02", "cv11";
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; margin: 0; }

/* Accessibility helpers */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--accent); color: var(--text);
  padding: var(--s-sm) var(--s-lg);
  z-index: 100;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { top: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* Layout */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-xl);
}
.container-narrow { max-width: 720px; }

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,10,12,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--s-md) var(--s-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-mark { color: var(--accent); }
.nav-links {
  display: none;
  gap: var(--s-xl);
}
.nav-links a {
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  transition: color 120ms ease;
}
.nav-links a:hover { color: var(--text); }

/* HERO */
.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: var(--s-4xl) 0 var(--s-3xl);
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 var(--s-xl);
  max-width: 900px;
}
.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--text-3);
  margin: 0 0 var(--s-xl);
}
.hero-title {
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.96;
  margin: 0 0 var(--s-xl);
  color: var(--text);
  text-wrap: balance;
}
.hero-lede {
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-2);
  margin: 0 auto var(--s-2xl);
  max-width: 620px;
  text-wrap: pretty;
}
.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-lg);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  padding: var(--s-xs) var(--s-md);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
}
.hero-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.86); }
}
.hero-fade {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  z-index: 1;
  pointer-events: none;
}

/* BUTTON */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  padding: 14px 24px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  border: 0;
  transition: transform 120ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 120ms ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 20px rgba(0,122,255,0.25);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); opacity: 0.92; }

/* SECTIONS — shared */
.section {
  padding: var(--s-4xl) 0;
  border-top: 1px solid var(--hairline);
}
.section-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--accent);
  margin: 0 0 var(--s-md);
}
.section-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin: 0 0 var(--s-lg);
  color: var(--text);
  text-wrap: balance;
}
.section-lede {
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.55;
  color: var(--text-2);
  max-width: 680px;
  margin: 0 0 var(--s-2xl);
}

/* ENGINE — three-card grid */
.engine-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-lg);
  margin-top: var(--s-2xl);
}
.engine-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: var(--s-xl);
}
.engine-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent);
  margin: 0 0 var(--s-sm);
}
.engine-card-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-md);
  color: var(--text);
}
.engine-card-body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0;
}
.engine-card-body em {
  color: var(--text);
  font-style: italic;
  font-weight: 500;
}

/* LAYERS */
.layers-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-lg);
  margin-top: var(--s-2xl);
}
.layer-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: var(--s-2xl);
}
.layer-card-hero {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(0,122,255,0.18), transparent 50%),
    var(--surface);
  border-color: var(--accent-soft);
}
.layer-card-number {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--text-3);
  margin: 0 0 var(--s-md);
}
.layer-card-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-lg);
  color: var(--text);
}
.layer-card-body {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0;
}
.layer-card-body em {
  color: var(--text);
  font-style: italic;
  font-weight: 500;
}

/* WORKS WITH — chip grid */
.hubs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-md);
  margin-top: var(--s-2xl);
  margin-bottom: var(--s-xl);
}
.hub {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: var(--s-lg);
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.hubs-fineprint {
  font-size: 13px;
  color: var(--text-3);
  max-width: 620px;
  margin: 0;
  line-height: 1.6;
}

/* CTA */
.section-cta { text-align: center; }
.cta-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin: 0 0 var(--s-lg);
  color: var(--text);
}
.cta-body {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0 auto var(--s-2xl);
  max-width: 540px;
}
.cta-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-sm);
  max-width: 440px;
  margin: 0 auto;
}
.cta-form input[type=email] {
  font-family: var(--f-sans);
  font-size: 16px;
  padding: 14px 18px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  outline: none;
  transition: border-color 120ms ease;
}
.cta-form input[type=email]:focus {
  border-color: var(--accent);
}
.cta-status {
  margin-top: var(--s-md);
  font-size: 14px;
  color: var(--text-3);
  min-height: 1.2em;
}
.cta-status-success { color: var(--success); }

/* FOOTER */
.footer {
  border-top: 1px solid var(--hairline);
  padding: var(--s-2xl) 0;
  color: var(--text-3);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-md);
  text-align: center;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-weight: 600;
  color: var(--text-2);
}
.footer-brand svg { color: var(--accent); }
.footer-copy {
  font-size: 13px;
  margin: 0;
}
.footer-links {
  display: flex;
  gap: var(--s-xl);
  font-size: 13px;
}
.footer-links a { color: var(--text-3); transition: color 120ms ease; }
.footer-links a:hover { color: var(--text); }

/* TABLET+ */
@media (min-width: 768px) {
  .nav-links { display: flex; }
  .engine-grid { grid-template-columns: repeat(3, 1fr); }
  .layers-row { grid-template-columns: repeat(2, 1fr); }
  .hubs-grid { grid-template-columns: repeat(4, 1fr); }
  .cta-form { flex-direction: row; }
  .cta-form input[type=email] { flex: 1; }
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* DESKTOP */
@media (min-width: 1024px) {
  .section { padding: var(--s-5xl) 0; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-badge-dot { animation: none; opacity: 1; transform: none; }
}

/* Forced colors (Windows high-contrast etc.) */
@media (forced-colors: active) {
  .btn-primary { border: 1px solid ButtonText; }
  .engine-card, .layer-card, .hub { border-color: ButtonText; }
}
