/* Pipstep website — one small stylesheet, system fonts only (SF Pro Rounded on Apple devices), no external requests.
   Brand colours mirror CoachUI/Theme.swift: brand hues are the same in light and dark, only neutrals flip. */
:root {
  --trail: #FF7A1A; --trail-deep: #D9600B;
  --sun: #FFC800; --sun-deep: #E5A000;
  --sky: #1CB0F6; --sky-deep: #1899D6;
  --leaf: #58CC02; --leaf-deep: #46A302;
  --berry: #CE82FF; --ember: #FF4B4B;
  --ink: #131722;

  --bg: #FFF8F1;
  --surface: #FFFFFF;
  --surface-2: #FFF1E3;
  --stroke: #F0DFCF;
  --text: #131722;
  --muted: #5B6670;
  --link: #0B7FC0;
  --radius: 20px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131F24;          /* Theme.canvas */
    --surface: #1B2B33;     /* Theme.surface */
    --surface-2: #233640;   /* Theme.surfaceRaised */
    --stroke: #37464F;      /* Theme.stroke */
    --text: #E9EEF5;        /* Theme.mist */
    --muted: #8FA3AD;       /* Theme.subtle */
    --link: #1CB0F6;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 500 18px/1.55 var(--font);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3 { font-weight: 800; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 6vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 10px; }
.skip:focus { left: 8px; z-index: 10; }

/* Header */
.top { padding: 14px 0; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.3rem; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.top nav { display: flex; gap: 16px; align-items: center; font-weight: 700; font-size: .95rem; }
.top nav a { color: var(--text); text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.lang { border: 2px solid var(--stroke); border-radius: 999px; padding: 4px 12px; }
@media (max-width: 640px) { .top nav .hide-sm { display: none; } }

/* Hero */
.hero {
  background: linear-gradient(35deg, var(--trail), var(--sun));
  color: #fff; overflow: hidden;
}
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 24px; padding-top: 56px; padding-bottom: 56px; }
.hero h1 { color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.08); }
.hero .lead { font-size: 1.3rem; font-weight: 700; color: var(--ink); opacity: .86; max-width: 34em; }
.hero img.pip { width: min(360px, 80%); margin: 0 auto; filter: drop-shadow(0 18px 24px rgba(0,0,0,.15)); }
.badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; }
.pill { display: inline-block; background: rgba(255,255,255,.88); color: var(--ink); font-weight: 800; border-radius: 999px; padding: 6px 14px; font-size: .9rem; }
@media (max-width: 800px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; padding-top: 32px; }
  .hero .lead { margin: 0 auto 1em; }
  .badges { justify-content: center; }
  .hero img.pip { width: 220px; grid-row: 1; }
}

/* App Store badge placeholder (replace with Apple's official badge artwork once the app is live) */
.store {
  display: inline-flex; align-items: center; gap: 10px; background: #000; color: #fff; text-decoration: none;
  border-radius: 12px; padding: 10px 18px; font-weight: 700; line-height: 1.1; border: 1px solid #A6A6A6;
}
.store small { display: block; font-size: .7rem; font-weight: 600; opacity: .85; }
.store b { font-size: 1.2rem; }
.store[aria-disabled="true"] { cursor: default; }

/* Chunky button (ChunkyButtonStyle) */
.btn {
  display: inline-block; text-decoration: none; text-transform: uppercase; font-weight: 800; letter-spacing: .02em;
  background: var(--sky); color: #fff; padding: 14px 24px; border-radius: 16px; box-shadow: 0 4px 0 var(--sky-deep);
  border: 0; font-family: inherit; font-size: 1rem; cursor: pointer;
}
.btn:active { transform: translateY(4px); box-shadow: none; }
.btn.orange { background: var(--trail); box-shadow: 0 4px 0 var(--trail-deep); }

/* Sections */
section { padding: 64px 0; }
section.alt { background: var(--surface-2); }
.center { text-align: center; }
.sub { color: var(--muted); font-size: 1.1rem; max-width: 40em; }
.center .sub { margin-left: auto; margin-right: auto; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 28px; }
.card {
  background: var(--surface); border: 2px solid var(--stroke); border-radius: var(--radius);
  padding: 22px; box-shadow: 0 4px 0 var(--stroke);
}
.card img.icon { width: 88px; height: 88px; margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }

/* Steps */
.steps { counter-reset: s; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 28px; }
.steps li { list-style: none; position: relative; padding: 22px 22px 22px 76px; background: var(--surface); border: 2px solid var(--stroke); border-radius: var(--radius); }
.steps li::before {
  counter-increment: s; content: counter(s); position: absolute; left: 20px; top: 20px;
  width: 40px; height: 40px; border-radius: 50%; background: var(--leaf); color: #fff; font-weight: 800;
  display: grid; place-items: center; box-shadow: 0 3px 0 var(--leaf-deep);
}
.steps { padding: 0; margin-left: 0; }

/* Screens */
.shots { display: flex; gap: 18px; overflow-x: auto; padding: 12px 4px 24px; scroll-snap-type: x mandatory; margin-top: 18px; }
.shots figure { margin: 0; flex: 0 0 auto; width: 230px; scroll-snap-align: start; text-align: center; }
.shots img { border-radius: 28px; border: 2px solid var(--stroke); background: #131F24; }
.shots figcaption { font-weight: 700; font-size: .95rem; margin-top: 10px; color: var(--muted); }

/* Growth strip */
.growth { display: flex; justify-content: center; align-items: flex-end; gap: 6px; flex-wrap: wrap; margin-top: 24px; }
.growth img { width: 110px; }
.growth span { font-size: 1.6rem; color: var(--muted); font-weight: 800; padding-bottom: 40px; }

/* Free vs Plus */
.plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 28px; }
.plans ul { padding-left: 1.1em; margin: 0; }
.plans li { margin-bottom: .4em; }
.plan-free { border-color: var(--leaf); box-shadow: 0 4px 0 var(--leaf-deep); }
.plan-plus { border-color: var(--berry); box-shadow: 0 4px 0 #A55FD6; }
.tag { display: inline-block; font-size: .8rem; font-weight: 800; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; color: #fff; margin-bottom: 10px; }

/* FAQ */
details { background: var(--surface); border: 2px solid var(--stroke); border-radius: 16px; padding: 14px 18px; margin-bottom: 12px; }
summary { cursor: pointer; font-weight: 800; }
details p { margin: .8em 0 0; color: var(--text); }

/* Legal / text pages */
.doc { max-width: 760px; padding-top: 24px; padding-bottom: 64px; }
.doc h2 { font-size: 1.5rem; margin-top: 1.6em; }
.doc h3 { margin-top: 1.2em; }
.doc li { margin-bottom: .4em; }
.draft { background: #FFF4CC; color: #4A3A00; border: 2px solid var(--sun-deep); border-radius: 14px; padding: 14px 18px; font-weight: 700; }
.doc table { border-collapse: collapse; width: 100%; font-size: .95rem; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--stroke); padding: 8px 10px; text-align: left; vertical-align: top; }

/* Invite */
.invite { text-align: center; max-width: 560px; padding-top: 32px; padding-bottom: 64px; }
.invite img { width: 180px; margin: 0 auto 8px; }
.code { font: 800 2.4rem/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; background: var(--surface); border: 2px dashed var(--trail); border-radius: 18px; padding: 18px 22px; display: inline-block; margin: 10px 0 16px; }
.invite ol { text-align: left; display: inline-block; margin: 8px 0 24px; }

footer { padding: 36px 0 48px; color: var(--muted); font-size: .95rem; border-top: 2px solid var(--stroke); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn:active { transform: none; } }

/* Utilities (no inline styles: the CSP allows only this stylesheet) */
.leaf { background: var(--leaf); } .sky { background: var(--sky); } .trail { background: var(--trail); }
.berry { background: var(--berry); } .sun { background: var(--sun); } .ember { background: var(--ember); }
.steps li { text-align: left; }
img.mascot { width: 140px; margin: 0 auto 8px; }
.fine { margin-top: 1em; color: var(--muted); font-size: .95rem; }
.grid.middle { align-items: center; }
ul.plain { margin: 0; padding-left: 1.1em; }
ul.plain li { margin-bottom: .5em; }
p.after { margin: 1em 0 0; }
.wrap.narrow { max-width: 820px; }
