/* ==========================================================================
   Countly Marketing — Zinc Mono design system (matches the app)
   Monochrome ShadZincColorScheme + Inter. Light & dark. No colored accent.
   ========================================================================== */

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

/* --- Design tokens ------------------------------------------------------- */
:root {
  /* Zinc — light (mirrors ShadZincColorScheme.light) */
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --surface: #ffffff;
  --fg: #18181b;
  --fg-muted: #71717a;
  --primary: #18181b;
  --primary-hover: #27272a;
  --primary-fg: #fafafa;
  --muted: #f4f4f5;
  --border: #e4e4e7;
  --ring: #18181b;
  --wash: rgba(24, 24, 27, 0.06);

  /* Radius — app_radius.dart */
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 999px;

  /* Motion — app_anim.dart */
  --t-fast: 150ms;
  --t-normal: 250ms;
  --t-slow: 400ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --container: 1080px;
}

[data-theme='dark'] {
  /* Zinc — dark (mirrors ShadZincColorScheme.dark) */
  --bg: #09090b;
  --bg-subtle: #0c0c0e;
  --surface: #111113;
  --fg: #fafafa;
  --fg-muted: #a1a1aa;
  --primary: #fafafa;
  --primary-hover: #e4e4e7;
  --primary-fg: #18181b;
  --muted: #27272a;
  --border: #27272a;
  --ring: #fafafa;
  --wash: rgba(250, 250, 250, 0.08);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  transition: background var(--t-normal) ease, color var(--t-normal) ease;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 16px;
}

h1, h2, h3 {
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-weight: 700;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) ease, border-color var(--t-fast) ease,
    color var(--t-fast) ease, transform var(--t-fast) ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--muted);
}

.btn-lg {
  min-height: 52px;
  padding: 0 28px;
  font-size: 1rem;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

/* --- Icon buttons (theme toggle) ---------------------------------------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background var(--t-fast) ease;
}

.icon-btn:hover {
  background: var(--muted);
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

.icon-btn .icon-moon {
  display: none;
}

[data-theme='dark'] .icon-btn .icon-sun {
  display: none;
}

[data-theme='dark'] .icon-btn .icon-moon {
  display: block;
}

/* --- Header -------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.brand .icon {
  width: 24px;
  height: 24px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Hero ---------------------------------------------------------------- */
.hero {
  padding: 88px 0 64px;
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 3.75rem);
  margin-bottom: 20px;
}

.hero .subtitle {
  font-size: 1.1875rem;
  color: var(--fg-muted);
  max-width: 30ch;
  margin-bottom: 32px;
}

.hero .cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero .note {
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--fg-muted);
}

/* --- Phone mockup -------------------------------------------------------- */
.mockup {
  justify-self: center;
  width: 270px;
  max-width: 100%;
  aspect-ratio: 9 / 18;
  border-radius: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.35);
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.mockup-screen {
  flex: 1;
  border-radius: 24px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.mockup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mockup-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.mockup-pill {
  font-size: 0.7rem;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 3px 10px;
}

.mockup-count {
  text-align: center;
  font-size: 3.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 8px 0 2px;
}

.mockup-sub {
  text-align: center;
  font-size: 0.72rem;
  color: var(--fg-muted);
}

.mockup-controls {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

.mockup-btn {
  flex: 1;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--fg);
}

.mockup-btn.primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}

.mockup-spark {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 40px;
}

.mockup-spark span {
  flex: 1;
  background: var(--wash);
  border-radius: 3px;
}

/* --- Section heading ----------------------------------------------------- */
.section-head {
  max-width: 36rem;
  margin: 0 auto 48px;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  margin-bottom: 12px;
}

.section-head p {
  color: var(--fg-muted);
  font-size: 1.0625rem;
}

/* --- Cards / grids ------------------------------------------------------- */
.grid {
  display: grid;
  gap: 20px;
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  transition: transform var(--t-normal) var(--ease),
    border-color var(--t-normal) ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--fg) 24%, var(--border));
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--wash);
  color: var(--fg);
  margin-bottom: 18px;
}

.card-icon .icon {
  width: 22px;
  height: 22px;
}

.card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  line-height: 1.55;
}

/* --- Steps --------------------------------------------------------------- */
.steps {
  counter-reset: step;
}

.step .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

/* --- Features band ------------------------------------------------------- */
.band {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.feature .check {
  flex: none;
  width: 24px;
  height: 24px;
  color: var(--fg);
  margin-top: 2px;
}

.feature h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature p {
  font-size: 0.9375rem;
  color: var(--fg-muted);
}

/* --- FAQ ----------------------------------------------------------------- */
.faq {
  max-width: 44rem;
  margin: 0 auto;
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.0625rem;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary .chev {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--fg-muted);
  transition: transform var(--t-fast) ease;
}

.faq details[open] summary .chev {
  transform: rotate(180deg);
}

.faq .answer {
  padding: 0 4px 20px;
  color: var(--fg-muted);
  font-size: 0.9688rem;
  animation: revealUp var(--t-normal) var(--ease);
}

/* --- CTA band ------------------------------------------------------------ */
.cta {
  text-align: center;
}

.cta-box {
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: var(--r-xl);
  padding: 64px 32px;
}

.cta-box h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 16px;
}

.cta-box p {
  opacity: 0.8;
  font-size: 1.0625rem;
  margin-bottom: 32px;
}

.cta-box .btn-primary {
  background: var(--primary-fg);
  color: var(--primary);
}

.cta-box .btn-primary:hover {
  opacity: 0.9;
  background: var(--primary-fg);
}

/* --- Footer -------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}

.footer .brand {
  margin-bottom: 14px;
}

.footer-tagline {
  color: var(--fg-muted);
  font-size: 0.9375rem;
  max-width: 28ch;
}

.footer h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 16px;
}

.footer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer ul a {
  color: var(--fg-muted);
  font-size: 0.9375rem;
  transition: color var(--t-fast) ease;
}

.footer ul a:hover {
  color: var(--fg);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.footer-copy {
  color: var(--fg-muted);
  font-size: 0.875rem;
}

.footer-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Language switcher --------------------------------------------------- */
.lang {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.lang a {
  padding: 7px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg-muted);
  transition: background var(--t-fast) ease, color var(--t-fast) ease;
}

.lang a + a {
  border-left: 1px solid var(--border);
}

.lang a:hover {
  background: var(--muted);
  color: var(--fg);
}

.lang a.active {
  background: var(--primary);
  color: var(--primary-fg);
}

/* --- Legal pages --------------------------------------------------------- */
.legal {
  max-width: 46rem;
  margin: 0 auto;
  padding: 72px 0 96px;
}

.legal h1 {
  font-size: 2.25rem;
  margin-bottom: 8px;
}

.legal .updated {
  color: var(--fg-muted);
  font-size: 0.875rem;
  margin-bottom: 40px;
}

.legal h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 36px 0 12px;
}

.legal p,
.legal li {
  color: var(--fg-muted);
  font-size: 0.9688rem;
}

.legal p {
  margin-bottom: 12px;
}

.legal ul {
  margin: 0 0 16px 22px;
}

.legal li {
  margin-bottom: 6px;
}

.legal a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal .todo {
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--muted);
  padding: 14px 16px;
  color: var(--fg-muted);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

/* --- Scroll reveal ------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  .hero .subtitle {
    max-width: none;
  }
  .hero .cta-group {
    justify-content: center;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 64px 0;
  }
  .grid-4,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .cta-box {
    padding: 48px 24px;
  }
}

/* --- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
