/* Unmissably — marketing site stylesheet.
   Dark theme anchored on the Unmissably brand palette (BrandPalette in
   Sources/Unmissably/Core/DesignTokens.swift). Hex values mirror the app. */

:root {
  /* Surfaces — dark theme from BrandPalette */
  --bg:            #0A100D; /* nearBlack: deepest ground */
  --bg-alt:        #131A17; /* alternating section bg, slightly lifted */
  --panel:         #2D3A34; /* darkPanel: cards, elevated surfaces */
  --panel-hov:     #354540;
  --surface:       #29323A; /* darkSurface: top elevation, modals */
  --border:        rgba(103, 113, 122, 0.20); /* mediumGray @ 20% */
  --border-strong: rgba(103, 113, 122, 0.40);

  /* Text */
  --text:          #FEFEFE;
  --text-muted:    rgba(254, 254, 254, 0.76);
  --text-dim:      rgba(254, 254, 254, 0.54);
  --gray:          #67717A;

  /* Accent — green is the default brand accent */
  --accent:        #598F74;
  --accent-hov:    #719F88;
  --accent-press:  #48755F;
  --accent-soft:   rgba(89, 143, 116, 0.18);

  /* Status colors mirror the brand palette */
  --success:       #598F74;
  --warning:       #E6B260;
  --error:         #A22C29;

  /* Spacing — 4px scale (matches DesignSpacing) */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  12px;
  --sp-lg:  16px;
  --sp-xl:  20px;
  --sp-xxl: 24px;
  --sp-3xl: 32px;
  --sp-4xl: 48px;
  --sp-5xl: 64px;
  --sp-6xl: 96px;

  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-pill: 999px;

  --shadow-soft: 0 1px 2px rgba(0,0,0,0.40), 0 8px 22px rgba(0,0,0,0.42);
  --shadow-hard: 0 2px 8px rgba(0,0,0,0.45), 0 24px 60px rgba(0,0,0,0.55);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --w-narrow:  680px;
  --w-default: 920px;
  --w-wide:    1120px;
}

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

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hov); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::selection { background: var(--accent-soft); color: var(--text); }

/* Layout */
.container {
  width: 100%;
  max-width: var(--w-default);
  margin-inline: auto;
  padding-inline: var(--sp-xxl);
}
.container--narrow { max-width: var(--w-narrow); }
.container--wide   { max-width: var(--w-wide); }

/* Top nav */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 16, 13, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-lg);
  padding-block: var(--sp-md);
}
.site-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.site-nav__brand:hover { color: var(--text); }
.site-nav__mark {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
  border-radius: 7px;
}
.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
}
.site-nav__links a {
  color: var(--text-muted);
  font-size: 14px;
}
.site-nav__links a:hover { color: var(--text); }
@media (max-width: 640px) {
  .site-nav__links a:not(.btn) { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn--primary {
  background: var(--accent);
  color: #FEFEFE;
}
.btn--primary:hover { background: var(--accent-hov); color: #FEFEFE; }

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

/* Mac App Store badge — placeholder until we have the official one */
.btn--appstore {
  background: #FEFEFE;
  color: var(--bg);
  border: 1px solid #FEFEFE;
  padding: 10px 18px;
  border-radius: 10px;
  gap: var(--sp-md);
  font-weight: 500;
  font-size: 13px;
}
.btn--appstore:hover { background: #E5E5E5; border-color: #E5E5E5; color: var(--bg); }
.btn--appstore svg { width: 22px; height: 22px; fill: var(--bg); }
.btn--appstore .btn__eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 0.75;
  text-align: left;
  line-height: 1;
  margin-bottom: 3px;
}
.btn--appstore .btn__label {
  display: block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

/* Marketing layout */
.marketing main { display: block; }

/* Hero */
.hero {
  padding-block: var(--sp-6xl) var(--sp-5xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: var(--sp-xxl);
}
.hero__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.hero h1 {
  font-size: clamp(36px, 5.4vw, 60px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-xl);
  max-width: 19ch;
  margin-inline: auto;
  color: var(--text);
}
.hero__sub {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-muted);
  max-width: 54ch;
  margin-inline: auto;
  margin-bottom: var(--sp-3xl);
}
.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-md);
}
.hero__note {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: var(--sp-5xl);
}
.hero__visual {
  max-width: var(--w-wide);
  margin-inline: auto;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-hard);
  background: var(--panel);
}
.hero__visual img { display: block; width: 100%; height: auto; }

/* Sections */
.section { padding-block: var(--sp-6xl); }
.section--tight { padding-block: var(--sp-5xl); }
.section--alt { background: var(--bg-alt); }
.section__head {
  text-align: center;
  max-width: 48ch;
  margin-inline: auto;
  margin-bottom: var(--sp-5xl);
}
.section__eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-md);
}
.section__head h2 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: var(--sp-md);
}
.section__head p {
  color: var(--text-muted);
  font-size: 16px;
}

/* Loss-framed problem section */
.problem {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--sp-5xl);
  align-items: center;
}
@media (max-width: 880px) { .problem { grid-template-columns: 1fr; gap: var(--sp-3xl); } }
.problem h2 {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--sp-lg);
}
.problem p { color: var(--text-muted); margin-bottom: var(--sp-md); font-size: 16px; }
.problem strong { color: var(--text); font-weight: 600; }
.problem__fact {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-3xl);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}
.problem__fact code {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: var(--sp-sm);
}
.problem__fact code .cal { color: var(--accent); }
.problem__fact code .eta { color: var(--warning); }

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-xxl);
}
@media (max-width: 880px) { .features { grid-template-columns: 1fr; } }

.feature {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-3xl);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.feature:hover {
  background: var(--panel-hov);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.feature__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-xl);
  font-size: 16px;
  font-weight: 700;
}
.feature h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: var(--sp-sm);
  color: var(--text);
}
.feature p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.65;
}

/* Showcase */
.showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5xl);
  align-items: center;
}
@media (max-width: 880px) { .showcase { grid-template-columns: 1fr; gap: var(--sp-3xl); } }
.showcase__copy h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-md);
}
.showcase__copy p {
  color: var(--text-muted);
  margin-bottom: var(--sp-lg);
}
.showcase__copy ul { list-style: none; padding: 0; margin: 0; }
.showcase__copy li {
  padding-left: var(--sp-xl);
  position: relative;
  margin-bottom: var(--sp-sm);
  color: var(--text-muted);
  font-size: 14px;
}
.showcase__copy li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.showcase__media {
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  background: var(--panel);
}
.showcase__media img { display: block; width: 100%; height: auto; }

/* Gallery — grid of overlay screenshots */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-xxl);
}
@media (max-width: 880px) { .gallery { grid-template-columns: 1fr; } }
.gallery__item { margin: 0; }
.gallery__item img {
  width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  background: var(--panel);
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.gallery__item figcaption {
  margin-top: var(--sp-sm);
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

/* Integrations strip */
.integrations {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-md) var(--sp-lg);
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}
.integrations span {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-lg);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}

/* Inline objection cards (distributed FAQ pattern) */
.objections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-lg);
  margin-top: var(--sp-xxl);
}
@media (max-width: 720px) { .objections { grid-template-columns: 1fr; } }
.objection {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl) var(--sp-xxl);
}
.objection h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-xs);
}
.objection p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

/* Trust row */
.trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3xl);
  color: var(--text-muted);
  font-size: 14px;
}
.trust span { display: inline-flex; align-items: center; gap: var(--sp-sm); }
.trust strong { color: var(--text); font-weight: 600; }

/* Closing CTA */
.cta-band {
  margin-inline: auto;
  max-width: var(--w-wide);
  padding: var(--sp-5xl) var(--sp-3xl);
  border-radius: var(--r-xl);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  color: var(--text);
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.cta-band h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-md);
  color: var(--text);
}
.cta-band p {
  color: var(--text-muted);
  max-width: 48ch;
  margin-inline: auto;
  margin-bottom: var(--sp-xxl);
}
.cta-band__micro {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: var(--sp-md);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--sp-3xl);
  color: var(--text-dim);
  font-size: 13px;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-lg);
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: var(--sp-lg); }
.site-footer__links a { color: var(--text-muted); }
.site-footer__links a:hover { color: var(--text); }

/* Document pages (privacy, terms, faq, support) */
.doc-page main { padding-block: var(--sp-5xl) var(--sp-6xl); }
.doc-page__header {
  padding-top: var(--sp-5xl);
  padding-bottom: var(--sp-3xl);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-5xl);
}
.doc-page__header h1 {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: var(--sp-md);
}
.doc-page__meta { color: var(--text-muted); font-size: 13px; margin-top: var(--sp-xs); }
.doc-page__back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  color: var(--text-muted);
  font-size: 13px;
}
.doc-page__back:hover { color: var(--accent); }

.doc-page article { font-size: 15px; line-height: 1.75; }
.doc-page article h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: var(--sp-5xl);
  margin-bottom: var(--sp-md);
}
.doc-page article h2:first-child { margin-top: 0; }
.doc-page article h3 {
  font-size: 16px;
  font-weight: 600;
  margin-top: var(--sp-3xl);
  margin-bottom: var(--sp-sm);
}
.doc-page article p { color: var(--text); margin-bottom: var(--sp-md); }
.doc-page article ul, .doc-page article ol {
  padding-left: var(--sp-xxl);
  margin-bottom: var(--sp-lg);
  color: var(--text);
}
.doc-page article li { margin-bottom: var(--sp-xs); }
.doc-page article strong { color: var(--text); font-weight: 600; }

.highlight {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: var(--sp-lg) var(--sp-xl);
  margin: var(--sp-xl) 0;
}

/* FAQ */
.faq-list { margin-top: var(--sp-3xl); }
.faq-list details {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl) var(--sp-xxl);
  margin-bottom: var(--sp-md);
  transition: border-color 0.2s ease;
}
.faq-list details[open] { border-color: var(--border-strong); }
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-lg);
  color: var(--text);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 300;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-list details[open] summary::after { content: "−"; }
.faq-list details > *:not(summary) {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
  margin-top: var(--sp-md);
}

/* Support */
.support-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-lg);
  margin-top: var(--sp-3xl);
  max-width: 36rem;
}
.support-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-xxl);
}
.support-card h3 { font-size: 16px; font-weight: 600; margin-bottom: var(--sp-sm); }
.support-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: var(--sp-lg);
}

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

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
