:root {
  --ink: #0f172a;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #f8fafc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); }

/* header and footer */

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.site .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}

header.site nav { display: flex; align-items: center; gap: 6px; }

header.site nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
}

header.site nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

header.site nav a.cta {
  background: var(--accent);
  color: #fff;
}

header.site nav a.cta:hover { background: var(--accent-dark); }

footer.site {
  background: var(--ink);
  color: #94a3b8;
  padding: 44px 24px 32px;
  font-size: 14px;
}

footer.site .cols {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
  grid-template-columns: 2fr 1fr 1fr;
}

footer.site strong { color: #fff; display: block; margin-bottom: 6px; }
footer.site p { margin: 0; }
footer.site a { display: block; color: #cbd5e1; text-decoration: none; margin-bottom: 6px; }
footer.site a:hover { color: #fff; }

footer.site .small {
  max-width: 1040px;
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
}

footer.site .small a { display: inline; }

/* hero */

.hero {
  max-width: 1040px;
  margin: 0 auto;
  padding: 72px 24px 56px;
  display: grid;
  gap: 40px;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
}

.hero h1 {
  font-size: 46px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.lead { font-size: 18px; color: #334155; margin: 0 0 24px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--paper); }

.note { font-size: 14px; color: var(--muted); margin-top: 16px; }
.centre { text-align: center; }

/* bands */

.band { max-width: 1040px; margin: 0 auto; padding: 56px 24px; }
.band.alt { max-width: none; background: var(--paper); }
.band.alt > * { max-width: 1040px; margin-left: auto; margin-right: auto; }
.band.narrow { max-width: 720px; }

.band h2 {
  font-size: 30px;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
}

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

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

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}

.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0; font-size: 15px; color: #475569; }

a.card { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: #94a3b8; transform: translateY(-2px); }

.meta { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.cta-band { text-align: center; }
.cta-band p { color: #475569; margin: 0 0 22px; }

/* article list and body */

.stack { display: flex; flex-direction: column; gap: 4px; }

.row {
  display: block;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.row:hover h2 { color: var(--accent); }
.row h2 { font-size: 21px; margin: 0 0 6px; }
.row p { margin: 0; color: #475569; font-size: 15px; }

.prose h1 { font-size: 36px; line-height: 1.15; letter-spacing: -0.02em; margin: 6px 0 12px; }
.prose h2 { font-size: 23px; margin: 38px 0 10px; }
.prose h3 { font-size: 18px; margin: 28px 0 8px; }
.prose p, .prose li { font-size: 16.5px; color: #1e293b; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-left: 3px solid var(--accent);
  color: #475569;
}
.prose code { background: var(--paper); padding: 2px 6px; border-radius: 5px; font-size: 14px; }
.prose pre { background: var(--ink); color: #e2e8f0; padding: 16px; border-radius: 10px; overflow-x: auto; }
.prose pre code { background: none; color: inherit; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--paper); }
.hero-image { border-radius: 14px; margin: 24px 0; }

.endnote {
  margin-top: 48px;
  padding: 24px;
  background: var(--paper);
  border-radius: 14px;
}

.endnote h3 { margin: 0 0 8px; }
.endnote p { margin: 0 0 16px; color: #475569; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; }
  .hero-art { order: -1; max-width: 320px; margin: 0 auto; }
  .hero h1 { font-size: 34px; }
  .grid, .grid.four, .grid.three { grid-template-columns: 1fr; }
  footer.site .cols { grid-template-columns: 1fr; }
  header.site nav a { padding: 8px; }
}

/* ---- motion and the hand-made touches ---- */

/* Sections arrive as you reach them. Same safety rule as the app: nothing is
   hidden by a state only an animation can undo, so `backwards` not `forwards`,
   and anything not yet observed stays visible if the script never runs. */
/* Only hidden once the script has proved it is running, so a failed or blocked
   script leaves a perfectly readable page rather than a blank one. */
.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.2,.8,.3,1), transform .6s cubic-bezier(.2,.8,.3,1); }
.js-reveal .reveal.shown { opacity: 1; transform: none; }

.grid .card { transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.grid .card:hover { transform: translateY(-3px); border-color: #94a3b8; box-shadow: 0 10px 30px -12px rgba(15, 23, 42, .18); }

/* A drawn underline rather than a border, so the emphasis looks put there by
   a person. The squiggle is an inline SVG so it scales with the text. */
.scribble { position: relative; white-space: nowrap; }
.scribble::after {
  content: '';
  position: absolute; left: -2%; right: -2%; bottom: -.32em; height: .38em;
  background: no-repeat center/100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9c28-5 62-7 96-6 30 1 62 4 98 2' stroke='%232563eb' stroke-width='4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  opacity: .55;
}

/* Stuck on at a slight angle, like a real one would be. */
.sticky-note {
  position: relative;
  margin: 28px auto 0;
  max-width: 420px;
  padding: 18px 22px;
  background: #fef9c3;
  border-radius: 3px;
  transform: rotate(-1.4deg);
  box-shadow: 0 10px 24px -14px rgba(15, 23, 42, .5);
  font-size: 15px;
  color: #422006;
}
.sticky-note strong { display: block; margin-bottom: 4px; }

/* The scan demo. Tapping the label runs the sequence the product runs. */
.demo { display: grid; gap: 22px; grid-template-columns: 220px 1fr; align-items: center; }
.demo-label {
  cursor: pointer; border: 0; padding: 22px; border-radius: 16px;
  background: #fff; box-shadow: inset 0 0 0 2px var(--line);
  display: grid; gap: 10px; justify-items: center; transition: box-shadow .2s ease, transform .2s ease;
}
.demo-label:hover { box-shadow: inset 0 0 0 2px var(--accent); transform: translateY(-2px); }
.demo-label svg { width: 108px; height: 108px; }
.demo-label .ref { font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.demo-label .hint { font-size: 12px; font-weight: 700; color: var(--accent); }

.demo-steps { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.demo-steps li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  opacity: .35; transform: translateX(-6px);
  transition: opacity .35s ease, transform .35s ease, box-shadow .35s ease;
  font-size: 15px;
}
.demo-steps li.on { opacity: 1; transform: none; box-shadow: inset 0 0 0 1px var(--accent); }
.demo-steps .tick {
  display: grid; place-items: center; flex: 0 0 24px; height: 24px; width: 24px;
  border-radius: 999px; background: var(--line); color: #fff; font-size: 13px; font-weight: 700;
}
.demo-steps li.on .tick { background: var(--accent); }
.demo-steps li.done .tick { background: #16a34a; }

@media (max-width: 720px) {
  .demo { grid-template-columns: 1fr; }
  .demo-label { max-width: 240px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.shown { opacity: 1; transform: none; transition: none; }
  .grid .card:hover { transform: none; }
  .demo-steps li { transition: none; }
}

/* Store row.

   The Play badge keeps Google's own proportions and gets no filter, no border
   and no recolour, because their brand rules forbid all three. The lift on
   hover is a transform on the anchor, so the artwork moves without a pixel of
   it being altered. */
.stores {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 22px;
}

.store-badge {
  display: inline-flex;
  line-height: 0;
  border-radius: 8px;
  transition: transform .18s ease;
}
.store-badge:hover { transform: translateY(-2px); }
.store-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.store-badge img { display: block; width: 178px; height: auto; }

/* Deliberately not an Apple badge. See storeRow() in build-site.mjs. */
.store-soon {
  margin: 0;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.store-soon strong { display: block; color: var(--ink); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .store-badge, .store-badge:hover { transition: none; transform: none; }
}

/* FAQ. A <details> list is the accessible way to do this and, unlike a
   JavaScript accordion, the answers are in the HTML for a crawler to read. */
.faq details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 18px;
  margin-bottom: 10px;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  padding: 16px 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 20px; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: '\2212'; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq details p { margin: 14px 0 18px; color: #475569; font-size: 15.5px; }
