/* Touch Tracker Pro — marketing landing page.
   Standalone: no dependency on the Expo app. Colours are the app's own
   `green` theme (src/constants THEMES.green) so the site and the app match. */

:root {
  --green-900: #1a4a2a;   /* THEMES.green.primary — hero */
  --green-700: #1a7a4a;   /* THEMES.green.accent */
  --green-500: #2f9e5f;
  --green-100: #e6f3ec;
  --green-50:  #f3f9f5;
  --lime:      #7ddf8f;

  --ink:       #16211b;
  --ink-2:     #4a5a50;
  --line:      #d7e2db;
  --paper:     #ffffff;
  --page:      #f6f8f7;
  --error:     #b3261e;
  --error-bg:  #fdecea;

  --radius:    14px;
  --shadow:    0 1px 2px rgba(16, 40, 26, .06), 0 8px 24px rgba(16, 40, 26, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
}

img { max-width: 100%; }
a { color: var(--green-700); }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(125, 223, 143, .18), transparent 60%),
    var(--green-900);
  color: #fff;
  padding: 20px 0 72px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { border-radius: 10px; display: block; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: .2px; }

.hero-body { max-width: 720px; padding-top: 56px; }

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(32px, 5.4vw, 54px);
  line-height: 1.08;
  font-weight: 850;
  letter-spacing: -.02em;
}

.lede {
  margin: 0 0 32px;
  font-size: clamp(17px, 2.1vw, 20px);
  color: rgba(255, 255, 255, .86);
  max-width: 620px;
}

/* Official store badges. Both companies forbid altering the artwork, so the
   images are shown exactly as supplied: same HEIGHT (Google's must be the
   same size or larger; neither file has hidden padding, so equal height is
   equal visible size), App Store first, gap >= 1/4 badge height (48/4 = 12),
   and NO hover movement or opacity change — Apple: "Don't modify, angle, or
   animate the App Store badge." The focus ring sits outside the artwork. */
.stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.store { display: inline-block; line-height: 0; border-radius: 8px; }
.store img { display: block; height: 48px; width: auto; max-width: none; } /* never squeeze: that would distort the artwork */
.store:focus-visible { outline: 3px solid var(--lime); outline-offset: 4px; }

.hero-cta {
  display: inline-block;
  color: var(--lime);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid rgba(125, 223, 143, .4);
  padding-bottom: 2px;
}
.hero-cta:hover { border-color: var(--lime); }

/* ── Features ─────────────────────────────────────────── */
.features { margin-top: -40px; position: relative; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.feature {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px 22px;
}
.feature-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  font-size: 24px;
  border-radius: 12px;
  background: var(--green-100);
  margin-bottom: 14px;
}
.feature h2 { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.feature p { margin: 0; color: var(--ink-2); font-size: 16px; }

/* ── Join-code callout ────────────────────────────────── */
.join-band { padding: 56px 0 8px; }

.join-inner {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: var(--green-50);
  border: 1px solid #cfe6d8;
  border-radius: var(--radius);
  padding: 24px;
}
.join-badge {
  flex: none;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  font-size: 26px;
  background: var(--paper);
  border-radius: 12px;
  border: 1px solid #cfe6d8;
}
.join-band h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.join-band p { margin: 0; color: var(--ink-2); }
.join-band strong { color: var(--ink); white-space: nowrap; }

/* ── Signup ───────────────────────────────────────────── */
.signup { padding: 56px 0 72px; }
.signup h2 { margin: 0 0 8px; font-size: clamp(26px, 3.4vw, 34px); font-weight: 850; letter-spacing: -.01em; }
.signup-sub { margin: 0 0 28px; color: var(--ink-2); }

form, .thanks {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

fieldset { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
legend {
  padding: 0;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green-700);
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 14px; min-width: 0; }

label { display: block; font-weight: 650; font-size: 15px; margin-bottom: 6px; }
.req { color: var(--error); }
.opt { color: var(--ink-2); font-weight: 400; }

input, select {
  width: 100%;
  font: inherit;
  font-size: 16px;               /* 16px stops iOS zooming on focus */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  min-height: 46px;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(26, 122, 74, .18);
}
input[aria-invalid="true"] { border-color: var(--error); }
input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(179, 38, 30, .16); }

.help { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.err { margin: 6px 0 0; font-size: 14px; color: var(--error); font-weight: 600; }
.err:empty { display: none; }

.color-select { position: relative; }
.color-select select { padding-left: 40px; appearance: auto; }
.swatch {
  position: absolute; left: 12px; top: 50%;
  width: 18px; height: 18px; margin-top: -9px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
  pointer-events: none;
}
/* Mirrors THEMES.*.primary in the app. */
.swatch-green  { background: #1a4a2a; }
.swatch-blue   { background: #1a3a5c; }
.swatch-red    { background: #5c1a1a; }
.swatch-purple { background: #3a1a5c; }
.swatch-orange { background: #5c3a1a; }
.swatch-black  { background: #1a1a1a; }

.form-error {
  background: var(--error-bg);
  color: var(--error);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-weight: 600;
  font-size: 15px;
}

/* Off-screen rather than display:none — some bots skip hidden fields. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.submit {
  width: 100%;
  min-height: 52px;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  background: var(--green-900);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: background .12s ease;
}
.submit:hover { background: #235e36; }
.submit:focus-visible { outline: 3px solid rgba(26, 122, 74, .45); outline-offset: 2px; }
.submit[disabled] { opacity: .65; cursor: progress; }

.after-submit { margin: 12px 0 0; text-align: center; font-size: 14px; color: var(--ink-2); }

.thanks { text-align: center; padding: 44px 28px; }
.thanks:focus { outline: none; }
.thanks-icon { font-size: 40px; margin-bottom: 10px; }
.thanks h3 { margin: 0 0 8px; font-size: 24px; font-weight: 850; }
.thanks p { margin: 0; color: var(--ink-2); }

/* ── Footer ───────────────────────────────────────────── */
.footer { background: var(--green-900); color: rgba(255, 255, 255, .85); padding: 28px 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer p { margin: 0; font-size: 15px; }
.footer a { color: var(--lime); }
.footer-meta { color: rgba(255, 255, 255, .65); }

/* ── Responsive ───────────────────────────────────────── */
/* Four features: 4-up on desktop, 2x2 on tablets, one column on phones. */
@media (max-width: 980px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .features { margin-top: -32px; }
}

@media (max-width: 600px) {
  .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding-bottom: 60px; }
  .hero-body { padding-top: 36px; }
  .row { grid-template-columns: 1fr; gap: 0; }
  form, .thanks { padding: 20px; }
  .join-inner { flex-direction: column; gap: 12px; padding: 20px; }
  .footer-inner { flex-direction: column; }
}
