/* XToGo — promotional site.
   Colours are the app's own Palette (XToGoKit/Sources/XToGoDesign/Palette.swift),
   so the site and the app stay one thing. */

:root {
  color-scheme: light dark;

  --canvas: #f4f5f8;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --hairline: #e1e4ea;

  --label: #11131a;
  --secondary-label: #646b7c;
  --tertiary-label: #9198a8;

  --accent: #2f6bff;
  --accent-soft: #e6edff;
  --accent-ink: #ffffff;

  --success: #1b8a4b;
  --success-soft: #e1f5e9;
  --failure: #d03636;
  --failure-soft: #fde8e8;
  --caution: #b2650a;
  --caution-soft: #fdf1de;

  --shadow-card: 0 1px 2px rgb(17 19 26 / 0.05), 0 8px 24px rgb(17 19 26 / 0.06);
  --shadow-phone: 0 4px 12px rgb(17 19 26 / 0.10), 0 32px 64px rgb(17 19 26 / 0.16);

  --radius-card: 16px;
  --radius-chip: 8px;
  --gutter: 16px;
  --measure: 1120px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0c0d10;
    --surface: #17191e;
    --surface-elevated: #1f222a;
    --hairline: #2c2f38;

    --label: #f2f4f8;
    --secondary-label: #9aa1b1;
    --tertiary-label: #6c7488;

    --accent: #5b8cff;
    --accent-soft: #1b2440;
    --accent-ink: #0c0d10;

    --success: #41c97a;
    --success-soft: #11301f;
    --failure: #ff6b6b;
    --failure-soft: #351616;
    --caution: #f0a83a;
    --caution-soft: #33260e;

    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.36);
    --shadow-phone: 0 4px 12px rgb(0 0 0 / 0.5), 0 32px 64px rgb(0 0 0 / 0.55);
  }
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--label);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

img, svg { max-width: 100%; height: auto; display: block; }

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--surface);
  color: var(--label);
  padding: 10px 16px;
  border-radius: var(--radius-chip);
  box-shadow: var(--shadow-card);
  z-index: 100;
}
.skip-link:focus { left: 24px; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--hairline); }

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 62px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 640;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--label);
  margin-right: auto;
}
.wordmark:hover { text-decoration: none; }
.wordmark img { width: 28px; height: 28px; border-radius: 7px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
}
.site-nav a { color: var(--secondary-label); }
.site-nav a:hover { color: var(--label); text-decoration: none; }

.wordmark { flex: none; }
.site-nav { flex: 0 1 auto; min-width: 0; }
.site-header .badge-appstore { flex: none; }

@media (max-width: 760px) {
  .site-nav .optional { display: none; }
}

/* Below this the wordmark, two links and a button stop fitting on one line.
   The download button is the reason the header exists, so the links go. */
@media (max-width: 560px) {
  .site-header .wrap { gap: 12px; }
  .site-nav { display: none; }
}

/* ------------------------------------------------------------------- CTA */

.badge-appstore {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px 11px 17px;
  border-radius: 12px;
  background: var(--label);
  color: var(--canvas);
  font-weight: 500;
  line-height: 1.15;
  white-space: nowrap;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.badge-appstore:hover { text-decoration: none; opacity: 0.88; transform: translateY(-1px); }
.badge-appstore svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.badge-appstore .lede { display: block; font-size: 11px; opacity: 0.75; letter-spacing: 0.01em; }
.badge-appstore .name { display: block; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }

.badge-appstore.compact { padding: 8px 15px 8px 12px; border-radius: 10px; }
.badge-appstore.compact svg { width: 19px; height: 19px; }
.badge-appstore.compact .lede { display: none; }
.badge-appstore.compact .name { font-size: 14px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--label);
  font-weight: 550;
  font-size: 16px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.btn-ghost:hover { text-decoration: none; border-color: var(--tertiary-label); transform: translateY(-1px); }

/* ------------------------------------------------------------------ hero */

.hero { padding: clamp(48px, 9vw, 104px) 0 clamp(56px, 8vw, 88px); }

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.005em;
  margin-bottom: 22px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(38px, 6.2vw, 62px);
  line-height: 1.03;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.hero .standfirst {
  margin: 0 0 32px;
  font-size: clamp(18px, 2.1vw, 21px);
  line-height: 1.5;
  color: var(--secondary-label);
  max-width: 34ch;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.hero .fineprint {
  margin: 0;
  font-size: 14px;
  color: var(--tertiary-label);
}

.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 460px;
}

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero .standfirst { max-width: 48ch; }
  .hero-art { min-height: 0; margin-top: 12px; }
}

/* ---------------------------------------------------------------- phones */

.phone {
  position: relative;
  border-radius: 40px;
  padding: 9px;
  background: linear-gradient(160deg, #3c414d, #15171c 55%, #2a2e37);
  box-shadow: var(--shadow-phone);
  flex: none;
}
.phone img {
  border-radius: 32px;
  display: block;
  background: var(--canvas);
}
.phone::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 32px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.10);
  pointer-events: none;
}

.hero-art .phone { width: 274px; }
.hero-art .phone.back {
  position: absolute;
  width: 232px;
  right: -34px;
  bottom: 52px;
  transform: rotate(6deg);
  z-index: -1;
  opacity: 0.94;
}

@media (max-width: 560px) {
  .hero-art .phone { width: 232px; }
  .hero-art .phone.back { display: none; }
}

/* --------------------------------------------------------------- section */

section { padding: clamp(52px, 8vw, 92px) 0; }

.section-head { max-width: 40rem; margin-bottom: clamp(32px, 5vw, 52px); }
.section-head.centred { margin-inline: auto; text-align: center; }

.kicker {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}

h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.028em;
  font-weight: 680;
}

.section-head p {
  margin: 0;
  font-size: 18px;
  color: var(--secondary-label);
}

/* ------------------------------------------------------------- feature grid */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(288px, 1fr));
  gap: var(--gutter);
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 26px 24px 28px;
  box-shadow: var(--shadow-card);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.012em;
  font-weight: 640;
}
.card p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--secondary-label);
}

.card .glyph {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}
.card .glyph svg { width: 21px; height: 21px; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.card.tone-success .glyph { background: var(--success-soft); color: var(--success); }
.card.tone-caution .glyph { background: var(--caution-soft); color: var(--caution); }
.card.tone-failure .glyph { background: var(--failure-soft); color: var(--failure); }

/* ------------------------------------------------------------------ tour */

.tour { background: var(--surface); border-block: 1px solid var(--hairline); }

.tour-rail {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 4px 24px 28px;
  margin-inline: -24px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.tour-rail > figure {
  margin: 0;
  flex: none;
  width: 244px;
  scroll-snap-align: center;
}
.tour-rail .phone { width: 100%; }

/* Wide enough for the whole walk-through at once: drop the scroll, lay the
   five screens out as a row that fits inside the measure. */
@media (min-width: 980px) {
  .tour-rail {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
    overflow: visible;
    padding-inline: 0;
    margin-inline: 0;
  }
  .tour-rail > figure { width: auto; }
  .tour-rail figcaption { font-size: 13.5px; }
  .tour-rail figcaption b { font-size: 14.5px; }
}
.tour-rail figcaption {
  margin-top: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--secondary-label);
}
.tour-rail figcaption b {
  display: block;
  color: var(--label);
  font-weight: 620;
  font-size: 15.5px;
  margin-bottom: 2px;
}

/* ------------------------------------------------------------------- faq */

.faq { display: grid; gap: 12px; max-width: 46rem; margin-inline: auto; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 4px 22px;
  box-shadow: var(--shadow-card);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 32px 18px 0;
  font-weight: 600;
  font-size: 16.5px;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 9px; height: 9px;
  border-right: 2px solid var(--tertiary-label);
  border-bottom: 2px solid var(--tertiary-label);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.18s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq details p {
  margin: 0 0 20px;
  font-size: 15.5px;
  color: var(--secondary-label);
}
.faq details p:first-of-type { margin-top: -2px; }

/* ------------------------------------------------------------------ close */

.closer { text-align: center; }
.closer .icon-large { width: 92px; height: 92px; border-radius: 22px; margin: 0 auto 26px;
  box-shadow: var(--shadow-card); }
.closer h2 { margin-bottom: 12px; }
.closer p { margin: 0 auto 30px; max-width: 34rem; font-size: 18px; color: var(--secondary-label); }
.closer .actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 34px 0 46px;
  font-size: 14.5px;
  color: var(--tertiary-label);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  align-items: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-left: auto; }
.site-footer a { color: var(--secondary-label); }
.site-footer .disclaimer {
  flex-basis: 100%;
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--tertiary-label);
}

/* ------------------------------------------------------------ prose pages */

.prose { max-width: 44rem; margin-inline: auto; padding-block: clamp(44px, 7vw, 76px); }
.prose h1 { font-size: clamp(32px, 5vw, 44px); margin-bottom: 8px; }
.prose .updated { margin: 0 0 40px; color: var(--tertiary-label); font-size: 15px; }
.prose h2 { font-size: 22px; margin: 40px 0 12px; letter-spacing: -0.015em; }
.prose h3 { font-size: 17px; margin: 26px 0 8px; font-weight: 640; }
.prose p, .prose li { color: var(--secondary-label); font-size: 16.5px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--label); font-weight: 620; }
.prose .lead { font-size: 19px; color: var(--label); }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 1px 5px;
}
