/* catchmytrain.uk — the Coral Pop palette of the App Store screenshots, with the app's Tanker type.
   Display: Tanker (self-hosted, Fontshare ITF FFL). Text: the system face (SF on Apple devices).
   Motion follows Emil Kowalski's rules: ease-out, short, interruptible; nothing scales from 0;
   hover only on real pointers; everything collapses under prefers-reduced-motion. */

@font-face { font-family: "Tanker"; src: url("/fonts/Tanker-Regular.woff2") format("woff2"); font-display: swap; }

:root {
  color-scheme: light;
  /* Coral Pop: the App Store screenshot palette */
  --ink: #2B1230;                      /* deep plum text */
  --sub: rgba(43, 18, 48, .74);
  --faint: rgba(43, 18, 48, .55);
  --line: rgba(43, 18, 48, .12);
  --coral: #FF7E6B;
  --peach: #FF9E85;
  --blush: #FFD0B8;
  --cream: #FFF3EA;
  --sun: #FFD66B;                      /* highlighter + sun */
  --mint: #D6FBEA;                     /* widget cards */
  --mint-ink: #12382B;
  --go: #0B8A57;                       /* the "leave by" green */
  --bg: var(--cream);
  --card: rgba(255, 255, 255, .72);
  --ease-out: cubic-bezier(.23, 1, .32, 1);       /* strong ease-out for entrances */
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);   /* for things already on screen */
  --r: 22px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;
  interpolate-size: allow-keywords;
  /* doodles, drawn like the screenshots' (data: URIs are allowed by the CSP) */
  --heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 84C20 62 8 46 14 30 20 14 42 12 50 30 58 12 80 14 86 30 92 46 80 62 50 84Z' fill='%23fff'/%3E%3C/svg%3E");
  --spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 6C54 36 64 46 94 50 64 54 54 64 50 94 46 64 36 54 6 50 36 46 46 36 50 6Z' fill='%23FFD66B'/%3E%3C/svg%3E");
  --spark-plum: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 6C54 36 64 46 94 50 64 54 54 64 50 94 46 64 36 54 6 50 36 46 46 36 50 6Z' fill='%232B1230'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { /* coral at the top, easing into warm cream, like the screenshots */
  content: ""; position: absolute; inset: 0 0 auto; height: min(1500px, 100%); z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
  background:
    radial-gradient(38% 30% at 92% 12%, rgba(255, 214, 107, .55), transparent 70%),
    radial-gradient(40% 32% at 0% 62%, rgba(255, 255, 255, .28), transparent 70%),
    linear-gradient(180deg, var(--coral) 0%, var(--peach) 38%, var(--blush) 68%, var(--cream) 100%);
}
body::after { /* warm glows further down so the page never goes flat */
  content: ""; position: absolute; left: 0; right: 0; top: 2200px; bottom: 0; z-index: -1; pointer-events: none;
  /* bounded by the page: on short pages (support) it collapses to nothing instead of adding scroll */
  background:
    radial-gradient(45% 22% at 100% 20%, rgba(255, 158, 133, .45), transparent 70%),
    radial-gradient(40% 20% at 0% 72%, rgba(255, 214, 107, .35), transparent 70%);
}
body { position: relative; min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 10px; }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 12px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 10; }

.display {
  font-family: "Tanker", "Impact", sans-serif; font-weight: 400;
  text-transform: uppercase; letter-spacing: .012em; line-height: .92;
  text-wrap: balance;
}
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 5; backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  background: rgba(255, 126, 107, .72); border-bottom: 1px solid rgba(43, 18, 48, .08); }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand span { font-size: 24px; }
.nav { margin-left: auto; display: flex; gap: 6px; }
.nav a { text-decoration: none; color: var(--sub); font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 999px; transition: color .2s ease, background-color .2s ease; }
.nav a[aria-current="page"] { color: var(--ink); background: rgba(255, 255, 255, .55); }
@media (max-width: 560px) { .nav a.hide-sm { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 16px; border: 0; cursor: pointer;
  font: 700 17px/1 inherit; text-decoration: none; color: #fff; background: var(--ink);
  transition: transform .16s var(--ease-out), background-color .2s ease, box-shadow .2s ease;
  box-shadow: 0 12px 28px rgba(43, 18, 48, .22);
}
.btn.ghost { color: var(--ink); background: rgba(255, 255, 255, .62); box-shadow: none; }
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #45213F; }
  .btn.ghost:hover { background: rgba(255, 255, 255, .85); }
  .nav a:hover { color: var(--ink); }
}

.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 700; color: var(--ink); background: rgba(255, 255, 255, .7); }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--go); }

/* ---------- hero ---------- */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(48px, 8vw, 110px); }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(64px, 11vw, 132px); margin: 22px 0 22px; }
.hero h1 em { font-style: normal; }
.hero p.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--sub); max-width: 32em; margin: 0 0 30px; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
/* QR to the TestFlight link: only useful on a computer, so hidden on touch screens */
.qr-join { display: none; align-items: center; justify-content: center; gap: 18px; margin: 0 auto 22px; color: var(--mint-ink); font-size: 15px; max-width: 420px; text-align: left; }
.qr-join img { width: 132px; height: 132px; padding: 10px; background: #fff; border-radius: 16px; flex: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 761px) { .qr-join { display: flex; } }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 26px; color: var(--faint); font-size: 14px; font-weight: 600; }
.trust span { background: rgba(255, 255, 255, .62); color: var(--ink); padding: 6px 12px; border-radius: 999px; }
.trust span::before { content: "✓"; color: var(--go); margin-right: 6px; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } .hero .phone { justify-self: center; } }

/* ---------- phone frame ---------- */
.phone { width: min(330px, 78vw); aspect-ratio: 421 / 880; padding: 3.3%; border-radius: 15.5% / 7.4%;
  background: #16121F; box-shadow: 0 40px 80px rgba(43, 18, 48, .32); rotate: -4deg; }
.feature.flip .phone, .hero .phone { rotate: 4deg; }
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 12.6% / 5.8%; }

/* ---------- sections ---------- */
section { padding: clamp(56px, 9vw, 110px) 0; }
.kicker { color: var(--ink); opacity: .78; font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
h2.display { font-size: clamp(48px, 7.5vw, 92px); margin: 12px 0 18px; }
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.feature + .feature { margin-top: clamp(72px, 10vw, 130px); }
.feature.flip .copy { order: 2; }
.feature p { color: var(--sub); font-size: 19px; max-width: 30em; margin: 0; }
.feature .phone { justify-self: center; }
/* one highlighter swipe on the key words, as in the screenshots */
.hero h1 em, .accent-good, .accent-warn, .accent-lilac { background: linear-gradient(transparent 50%, var(--sun) 50%, var(--sun) 92%, transparent 92%); padding: 0 .06em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
@media (max-width: 760px) { .feature { grid-template-columns: 1fr; } .feature.flip .copy { order: 0; } }

.sum { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 18px; font-weight: 650; color: var(--sub); }
.sum b { color: var(--mint-ink); background: var(--mint); box-shadow: 0 8px 20px rgba(18, 56, 43, .12); border-radius: 12px; padding: 7px 11px; font-weight: 650; white-space: nowrap; }
.sum b.res { color: var(--go); background: var(--mint); font-family: "Tanker", sans-serif; font-weight: 400; font-size: 24px; letter-spacing: .03em; padding: 4px 12px; }

/* ---------- beta band ---------- */
.band { border-radius: 30px; padding: clamp(32px, 6vw, 64px); background: var(--mint); color: var(--mint-ink); box-shadow: 0 40px 80px rgba(18, 56, 43, .16); position: relative; rotate: -1deg;
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; }
.band ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; color: rgba(18, 56, 43, .82); }
.band li { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; }
.band li b { color: var(--go); }
@media (max-width: 760px) { .band { grid-template-columns: 1fr; } }

/* ---------- support page ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.card { background: var(--card); box-shadow: 0 18px 40px rgba(43, 18, 48, .10); border-radius: var(--r); padding: 24px; text-decoration: none; display: flex; flex-direction: column; gap: 10px;
  transition: transform .16s var(--ease-out), background-color .2s ease, border-color .2s ease; }
.card:active { transform: scale(.98); }
.card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--mint); color: var(--go); }
.card h3 { margin: 4px 0 0; font-size: 19px; }
.card p { margin: 0; color: var(--sub); font-size: 15.5px; }
@media (hover: hover) and (pointer: fine) { a.card:hover { background: #fff; } }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }

.faq { margin-top: 28px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 16px; padding: 22px 4px; font-weight: 650; font-size: 18px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; margin-left: auto; width: 11px; height: 11px; border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink);
  transform: rotate(45deg) translateY(-3px); transition: transform .25s var(--ease-out); flex: none; }
.faq details[open] summary::after { transform: rotate(225deg) translateY(-1px); }
.faq details::details-content { block-size: 0; overflow: clip; transition: block-size .32s var(--ease-out), content-visibility .32s allow-discrete; }
.faq details[open]::details-content { block-size: auto; }
.faq .a { padding: 0 4px 22px; color: var(--sub); max-width: 46em; }
.faq .a p { margin: 0 0 10px; }

.note { margin-top: 28px; padding: 18px 20px; border-radius: 16px; background: rgba(255, 214, 107, .38); color: var(--ink); }
.note b { color: var(--ink); }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 36px 0 56px; color: var(--faint); font-size: 14.5px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
footer nav { display: flex; gap: 18px; margin-left: auto; }
footer a { text-decoration: none; color: var(--sub); }
@media (hover: hover) and (pointer: fine) { footer a:hover { color: var(--ink); } }

/* ---------- motion ---------- */
/* Entrances: opacity + a short rise, strong ease-out, staggered by --i. Nothing scales from 0. */
.reveal { opacity: 0; transform: translateY(14px); filter: blur(4px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out), filter .7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; filter: none; }
.phone.reveal { transform: translateY(24px) scale(.96); }

/* ---------- doodles: hearts and sparkles around the phones ---------- */
.hero .wrap > .phone, .feature .phone { position: relative; overflow: visible; }
.doodle { position: absolute; width: 46px; height: 46px; background: var(--heart) center / contain no-repeat; pointer-events: none; }
.doodle.spark { background-image: var(--spark); width: 38px; height: 38px; }
.doodle.spark.plum { background-image: var(--spark-plum); width: 30px; height: 30px; }
.band .doodle { top: -18px; right: 34px; rotate: 12deg; }
.phone.reveal.in { transform: none; }
.no-js .reveal { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .phone.reveal { transform: none; filter: none; transition: opacity .2s ease; transition-delay: 0s; }
  .btn, .card { transition: background-color .2s ease; }
  .btn:active, .card:active { transform: none; }
  .faq details::details-content { transition: none; }
}
