/* ==========================================================================
   Mondary — styles.css
   A single, dependency-free stylesheet.
   Structure:
     1. Design tokens
     2. Reset & base
     3. Layout primitives
     4. Typography
     5. Buttons & pills
     6. Header / navigation
     7. Hero
     8. Sections (features, steps, screenshots, FAQ, CTA, legal)
     9. Footer
    10. Motion & reveal
    11. Utilities
   ========================================================================== */

/* 1. DESIGN TOKENS ========================================================= */

:root {
  /* Colour — monochrome, taken from the app icon */
  --bg:            #08080a;
  --bg-elevated:   #101014;
  --surface:       #131317;
  --surface-hover: #1a1a20;
  --border:        rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text:          #f4f4f5;
  --text-muted:    #a1a1aa;
  --text-faint:    #71717a;

  --accent:        #ffffff;
  --accent-ink:    #08080a;

  /* Glow used behind the hero + CTA */
  --glow: radial-gradient(60% 60% at 50% 0%, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 70%);

  /* Type — fluid, clamps between mobile and desktop */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1:  clamp(1.2rem, 1.12rem + 0.4vw, 1.45rem);
  --step-2:  clamp(1.45rem, 1.3rem + 0.75vw, 1.95rem);
  --step-3:  clamp(1.8rem, 1.5rem + 1.5vw, 2.6rem);
  --step-4:  clamp(2.3rem, 1.7rem + 3vw, 4.2rem);

  /* Spacing scale */
  --space-2xs: 0.375rem;
  --space-xs:  0.625rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;
  --space-2xl: clamp(4rem, 2rem + 8vw, 8rem);

  /* Shape */
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Depth */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow:    0 12px 32px -12px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 80px -32px rgba(0, 0, 0, 0.85);

  /* Layout */
  --container: 1140px;
  --container-narrow: 760px;
  --header-h: 68px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Optional light theme. Flip <html data-theme="light"> to preview it.
   The site ships dark by default to match the icon. */
[data-theme="light"] {
  --bg:            #ffffff;
  --bg-elevated:   #fafafa;
  --surface:       #f4f4f5;
  --surface-hover: #ececee;
  --border:        rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.18);
  --text:          #09090b;
  --text-muted:    #52525b;
  --text-faint:    #71717a;
  --accent:        #09090b;
  --accent-ink:    #ffffff;
  --glow: radial-gradient(60% 60% at 50% 0%, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
}

/* 2. RESET & BASE ========================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

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

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

button, input, textarea, select { font: inherit; color: inherit; }

ul, ol { list-style: none; padding: 0; }

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

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

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -150%);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1.1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  z-index: 200;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* 3. LAYOUT PRIMITIVES ===================================================== */

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

.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--space-2xl); position: relative; }

.section + .section { padding-top: 0; }

.section--bordered { border-top: 1px solid var(--border); padding-top: var(--space-2xl); }

.section__head {
  max-width: 46ch;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.grid { display: grid; gap: var(--space-md); }

/* 4. TYPOGRAPHY ============================================================ */

h1, h2, h3, h4 {
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); letter-spacing: -0.04em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { text-wrap: pretty; }

.lead {
  font-size: var(--step-1);
  color: var(--text-muted);
  line-height: 1.5;
  font-weight: 400;
}

.eyebrow {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--space-sm);
}

.muted { color: var(--text-muted); }

/* 5. BUTTONS & PILLS ======================================================= */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: 0.8em 1.5em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius-pill);
  font-size: var(--step-0);
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease),
              border-color 0.18s var(--ease), opacity 0.18s var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  --btn-bg: var(--accent);
  --btn-fg: var(--accent-ink);
  --btn-bd: var(--accent);
  font-weight: 600;
}
.btn--primary:hover { opacity: 0.9; }

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

.btn--lg { padding: 1em 1.9em; font-size: var(--step-0); }

.btn--block { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
}

.btn-row--center { justify-content: center; }

/* Small status pill, e.g. "Now in beta" */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.4em 0.9em;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--step--1);
  color: var(--text-muted);
  font-weight: 500;
}

.pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

/* 6. HEADER / NAVIGATION =================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.header.is-scrolled { border-bottom-color: var(--border); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.0625rem;
}

.brand__mark { width: 30px; height: 30px; border-radius: 8px; }

.nav { display: none; }

.nav__list { display: flex; align-items: center; gap: var(--space-md); }

.nav__link {
  font-size: var(--step--1);
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.18s var(--ease);
}
.nav__link:hover { color: var(--text); }

.header__actions { display: none; }

/* Mobile menu toggle */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 99;
  background: var(--bg);
  padding: var(--space-lg) clamp(1.15rem, 4vw, 2rem) var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
}

.mobile-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

.mobile-nav__link {
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.03em;
  padding-block: 0.35em;
  border-bottom: 1px solid var(--border);
}

.mobile-nav .btn { margin-top: var(--space-md); }

body.nav-open { overflow: hidden; }

/* 7. HERO ================================================================== */

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 3rem + 6vw, 7.5rem) var(--space-2xl);
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 70vh;
  background: var(--glow);
  pointer-events: none;
  z-index: -1;
}

.hero__inner {
  max-width: 44rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.hero__title { margin-top: var(--space-2xs); }

.hero__lead { max-width: 34rem; }

.hero__note {
  font-size: var(--step--1);
  color: var(--text-faint);
}

/* Device mock-up */
.hero__media {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  display: flex;
  justify-content: center;
  perspective: 1600px;
}

/* The bezel wraps the screen; the 9/19.5 ratio belongs to the screen itself.
   Putting it on the frame instead would leave the padding to come out of the
   screen, squashing it to 0.444 and cropping the sides off the screenshot. */
.device {
  position: relative;
  width: min(280px, 72vw);
  border-radius: 44px;
  padding: 10px;
  background: linear-gradient(160deg, #2a2a30 0%, #0e0e11 50%, #26262c 100%);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.07);
}

/* Matched to the screenshots themselves (700×1522, from a 1206×2622 iPhone
   capture) rather than a nominal 9/19.5, so `cover` has nothing to crop in any
   engine. It differs from 9/19.5 by 0.35% — invisible, but it is the difference
   between "fits exactly" and "trims a little off whichever edge". */
.device__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 700 / 1522;
  border-radius: 35px;
  overflow: hidden;
  background: var(--bg-elevated);
}

/* Pinned to the four edges rather than sized with height:100%. Safari does not
   always treat a height derived from aspect-ratio as definite, so a percentage
   height can collapse to auto there and leave the screenshot mis-scaled. */
.device__screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}



/* 8. SECTIONS ============================================================== */

/* --- Trust / stats strip --- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}

.stat__value {
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.03em;
  display: block;
}

.stat__label {
  font-size: var(--step--1);
  color: var(--text-muted);
}

/* --- Feature cards --- */
.features { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
              background-color 0.25s var(--ease);
}

.card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-3px);
}

.card__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  margin-bottom: var(--space-2xs);
  flex: none;
}

.card__icon svg { width: 20px; height: 20px; stroke: var(--text); fill: none;
                  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.card p { color: var(--text-muted); font-size: var(--step-0); }

/* Wide feature card that spans the row on desktop */
.card--wide { grid-column: 1 / -1; }

/* --- Steps --- */
.steps {
  counter-reset: step;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-lg);
}

.step { position: relative; padding-top: var(--space-sm); border-top: 1px solid var(--border); }

.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-faint);
  margin-bottom: var(--space-xs);
}

.step h3 { margin-bottom: 0.35rem; }
.step p { color: var(--text-muted); }

/* --- Screenshot gallery --- */
.shots {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-block: var(--space-xs) var(--space-md);
  padding-inline: clamp(1.15rem, 4vw, 2rem);
  margin-inline: calc(clamp(1.15rem, 4vw, 2rem) * -1);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.shots::-webkit-scrollbar { height: 6px; }
.shots::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

.shot {
  flex: 0 0 auto;
  width: min(230px, 62vw);
  scroll-snap-align: center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 9 / 19.5;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-size: var(--step--1);
  overflow: hidden;
}

.shot img { width: 100%; height: 100%; object-fit: cover; }

/* --- FAQ accordion --- */
.faq { max-width: var(--container-narrow); margin-inline: auto; }

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

.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 1.25rem 0;
  background: none;
  border: 0;
  text-align: left;
  font-size: var(--step-0);
  font-weight: 550;
  cursor: pointer;
}

.faq__icon {
  flex: none;
  width: 18px;
  height: 18px;
  position: relative;
}
.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1.5px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform 0.28s var(--ease);
}
.faq__icon::after { transform: rotate(90deg); }
.faq__q[aria-expanded="true"] .faq__icon::after { transform: rotate(0deg); }

.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s var(--ease);
}
.faq__a > div { overflow: hidden; }
.faq__item.is-open .faq__a { grid-template-rows: 1fr; }
.faq__a p { color: var(--text-muted); padding-bottom: 1.35rem; max-width: 62ch; }

/* --- CTA band --- */
.cta {
  position: relative;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
  overflow: hidden;
}

.cta::before {
  content: "";
  position: absolute;
  inset: -60% -20% auto -20%;
  height: 120%;
  background: var(--glow);
  pointer-events: none;
}

.cta > * { position: relative; }

.cta h2 { margin-bottom: var(--space-sm); }
.cta .lead { margin-inline: auto; max-width: 40ch; margin-bottom: var(--space-md); }

/* 9. FOOTER ================================================================ */

.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-xl) var(--space-lg);
  margin-top: var(--space-2xl);
}

.footer__grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
  margin-bottom: var(--space-xl);
}

.footer__about { max-width: 34ch; }
.footer__about p { color: var(--text-muted); font-size: var(--step--1); margin-top: var(--space-xs); }

.footer__col h4 {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.footer__col li + li { margin-top: 0.5rem; }

.footer__col a {
  color: var(--text-muted);
  font-size: var(--step--1);
  transition: color 0.18s var(--ease);
}
.footer__col a:hover { color: var(--text); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  font-size: var(--step--1);
  color: var(--text-faint);
}

.social { display: flex; gap: var(--space-xs); }

.social a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.social a:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.social svg { width: 17px; height: 17px; fill: var(--text-muted); }
.social a:hover svg { fill: var(--text); }

/* 10. MOTION & REVEAL ====================================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

@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;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* --- Legal pages (privacy, terms) --- */
.legal {
  max-width: var(--container-narrow);
  margin-inline: auto;
}

.legal__head { margin-bottom: var(--space-xl); }

.legal__date {
  display: block;
  margin-top: var(--space-sm);
  color: var(--text-faint);
  font-size: var(--step--1);
}

.legal h2 {
  font-size: var(--step-2);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.legal h2:first-of-type { border-top: 0; padding-top: 0; }

.legal p, .legal li { color: var(--text-muted); }

.legal p + p, .legal ul + p, .legal p + ul { margin-top: var(--space-sm); }

.legal ul {
  list-style: disc;
  padding-left: 1.4em;
  margin-top: var(--space-sm);
}

.legal li + li { margin-top: var(--space-2xs); }

.legal strong { color: var(--text); font-weight: 600; }

.legal a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
}

.legal a:hover { text-decoration-color: var(--text); }

/* 11. UTILITIES ============================================================ */

.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;
}

.text-center { text-align: center; }
.stack > * + * { margin-top: var(--space-sm); }

/* RESPONSIVE ============================================================== */

@media (min-width: 720px) {
  .footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

@media (min-width: 900px) {
  .nav { display: block; }
  .header__actions { display: flex; gap: var(--space-xs); }
  .nav-toggle { display: none; }
  .mobile-nav { display: none; }
  .hero { text-align: center; }
}

@media (min-width: 1024px) {
  .device { width: 300px; }
  .shot { width: 250px; }
}
