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

html { scroll-behavior: smooth; }

:root {
  color-scheme: light dark;

  --bg:       #f6f7f8;
  --surface-2: #ffffff;
  --border:   rgba(13, 19, 26, 0.10);
  --text:     #0d131a;
  --muted:    rgba(13, 19, 26, 0.62);
  --muted-2:  rgba(13, 19, 26, 0.42);

  --accent:   #19c37d;
  --accent-2: rgba(25, 195, 125, 0.16);

  --shadow-2: 0 10px 24px rgba(13, 19, 26, 0.08);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #0b0f14;
    --surface-2: #141a22;
    --border:   rgba(255, 255, 255, 0.10);
    --text:     rgba(255, 255, 255, 0.92);
    --muted:    rgba(255, 255, 255, 0.62);
    --muted-2:  rgba(255, 255, 255, 0.42);
    --shadow-2: 0 14px 30px rgba(0, 0, 0, 0.40);
  }
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

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

img { max-width: 100%; height: auto; }

::selection { background: var(--accent-2); }

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

/* Skip link */
.skip {
  position: absolute;
  left: -999px;
  top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  z-index: 60;
}
.skip:focus { left: 12px; }

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav {
  max-width: 960px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) 14px calc(20px + env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

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

.brand-mark {
  width: 20px;
  height: 20px;
  display: block;
  flex: none;
}
.brand-mark img {
  border-radius: 6px;
  width: 100%;
  height: 100%;
  display: block;
}
.brand-name { font-size: 20px; letter-spacing: -0.02em; line-height: 1; }

.nav-link,
.nav-back {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
}
.nav-link:hover,
.nav-back:hover { color: var(--text); background: rgba(0, 0, 0, 0.04); }
@media (prefers-color-scheme: dark) {
  .nav-link:hover,
  .nav-back:hover { background: rgba(255, 255, 255, 0.06); }
}

.nav-link[aria-current="page"] {
  color: var(--text);
  background: color-mix(in oklab, var(--text) 10%, transparent);
}

@media (max-width: 560px) {
  .nav-actions { gap: 8px; }
  .nav-link { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: transform .12s ease, background-color .12s ease;
  font-size: 14px;
  line-height: 1;
  user-select: none;
  letter-spacing: -0.01em;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--accent);
  color: #05120c;
  box-shadow: 0 10px 30px rgba(25, 195, 125, 0.22);
}
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 88%, #000 12%); }

/* Layout */
main { display: block; }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(28px, 6svh, 72px) calc(20px + env(safe-area-inset-right)) clamp(32px, 7svh, 80px) calc(20px + env(safe-area-inset-left));
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 44px;
  align-items: center;
}

.hero-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 7vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.lead {
  margin: 0;
  font-size: 17px;
  color: var(--muted);
  max-width: 52ch;
}

.hero-ctas {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.fineprint {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted-2);
}

.hero-media {
  display: flex;
  justify-content: flex-end;
}

.phone {
  width: auto;
  height: clamp(640px, 72vh, 760px);
  max-width: 360px;
  aspect-ratio: 1206 / 2622;
  border-radius: 36px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-2);
  position: relative;
  transform: translateZ(0); /* force GPU layer — prevents mask-image flicker on scroll */
}

.phone img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* Microcopy */
.micro {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted-2);
  max-width: 60ch;
}
.micro a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(25, 195, 125, 0.35);
  text-underline-offset: 3px;
}
.micro a:hover { text-decoration-color: var(--accent); }

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 40px;
  margin-top: clamp(32px, 5svh, 56px);
  padding-top: clamp(28px, 4svh, 48px);
  border-top: 1px solid var(--border);
}
.feat-icon {
  display: block;
  width: 24px;
  height: 24px;
  color: var(--accent);
  margin-bottom: 14px;
}
.feature h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.feature p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.feature code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: var(--accent-2);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text);
}

.help {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted-2);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px calc(20px + env(safe-area-inset-right)) 22px calc(20px + env(safe-area-inset-left));
}
.foot {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.foot-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.foot-copy { color: var(--muted-2); font-size: 13px; }

/* Legal pages */
.legal {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 20px 70px;
}
.legal h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 46px);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.legal .eff {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted-2);
}
.legal h2 {
  margin: 38px 0 10px;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.legal p,
.legal li {
  color: var(--muted);
  margin: 0 0 12px;
  font-size: 15px;
}
.legal a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(25, 195, 125, 0.35);
  text-underline-offset: 3px;
}
.legal a:hover { text-decoration-color: var(--accent); }
.legal ul { padding-left: 20px; }
.legal hr { border: none; border-top: 1px solid var(--border); margin: 26px 0; }

/* Responsive */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hero-media { justify-content: center; }
  .hero-ctas .btn { width: 100%; padding: 14px 16px; border-radius: 14px; }
  .phone {
    height: min(66svh, 720px);
    max-width: min(92vw, 420px);
  }
  /* Show top + bottom of screenshot blended, hiding the empty middle */
  @supports ((-webkit-mask-image: linear-gradient(#000, transparent)) or (mask-image: linear-gradient(#000, transparent))) {
    .phone img { opacity: 0; }
    .phone::before,
    .phone::after {
      content: '';
      position: absolute;
      inset: 0;
      background-image: url("assets/screenshot.png");
      background-repeat: no-repeat;
      background-size: 100% auto;
    }
    .phone::before {
      background-position: top center;
      -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 82%);
      mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 82%);
    }
    .phone::after {
      background-position: bottom center;
      -webkit-mask-image: linear-gradient(to top, #000 0%, #000 40%, transparent 70%);
      mask-image: linear-gradient(to top, #000 0%, #000 40%, transparent 70%);
    }
  }
}

@media (max-width: 600px) {
  .site-header .btn { display: none; }
  .features { grid-template-columns: 1fr; gap: 24px; }
}

/* Touch devices: disable sticky hover state triggered by tap */
@media (hover: none) {
  .btn:hover { transform: none; }
  .btn-primary:hover { background: var(--accent); }
}

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