/* Stackflight — the app's own palette (app/lib/theme/stacklight_palette.dart,
   `classic`), so the site and the product are visibly one thing. */
:root {
  --bg: #080b10;
  --surface: #11161d;
  --raised: #18202a;
  --line: #293442;
  --text: #f4f7fa;
  --muted: #9aa8b7;
  --green: #79f28b;
  --cyan: #5ad9f5;
  --amber: #ffc857;
  --measure: 62ch;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 400 clamp(1rem, 0.96rem + 0.2vw, 1.0625rem)/1.65
        ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }
img { max-width: 100%; height: auto; display: block; }

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

.skip {
  position: absolute; left: 0.75rem; top: -4rem; z-index: 50;
  background: var(--green); color: #05210c; font-weight: 700;
  padding: 0.6rem 1rem; border-radius: 999px; text-decoration: none;
  transition: top 0.15s ease;
}
.skip:focus { top: 0.75rem; }

.wrap { width: min(72rem, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { width: min(46rem, 100%); margin-inline: auto; padding-inline: var(--gutter); }

/* ── header ───────────────────────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
header .wrap { display: flex; align-items: center; gap: 0.85rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: inherit; }
.brand img { width: 2rem; height: 2rem; border-radius: 0.5rem; }
.brand b { font-size: 1.05rem; letter-spacing: 0.02em; }
header nav { margin-left: auto; display: flex; gap: clamp(0.75rem, 3vw, 1.5rem); font-size: 0.925rem; }
header nav a, header .lang { color: var(--muted); text-decoration: none; white-space: nowrap; }
header nav a:hover, header nav a[aria-current="page"], header .lang:hover { color: var(--text); }

/* The language switcher is a sibling of the nav, not one of its links: it
   changes the language of the page you are on rather than taking you to
   another page, and on a phone it needs to move independently of them. */
header .lang {
  font-size: 0.925rem;
  margin-left: clamp(0.75rem, 3vw, 1.5rem);
  padding-left: clamp(0.75rem, 3vw, 1.5rem);
  border-left: 1px solid var(--line);
}

/* The bar fit four links beside the wordmark. A fifth — the language
   switcher — is one too many, and German labels are longer than English
   ones, so it breaks on a phone before it breaks in review.
   Below this the nav takes its own row and the two in-page jumps drop:
   they only shortcut a scroll, where every other link is the sole way to
   reach its page. `overflow-x` is the backstop for a 320px screen in
   German, so a long bar scrolls instead of widening the page. */
@media (max-width: 44rem) {
  header .wrap { flex-wrap: wrap; row-gap: 0.45rem; padding-block: 0.55rem; min-height: 0; }
  /* The switcher keeps the wordmark company on the first row and the links
     take the second to themselves. German is what forces this: "Datenschutz"
     and "Bedingungen" are half again as long as "Privacy" and "Terms", so a
     single row that holds the English bar still overflows the German one.
     A pill rather than the desktop divider, because a border-left with the
     wordmark on the far side of the row divides nothing. */
  header .lang {
    order: 1; margin-left: auto;
    padding: 0.1rem 0.6rem;
    border: 1px solid var(--line); border-radius: 999px;
    font-size: 0.8125rem;
  }
  header nav {
    order: 2; width: 100%; margin-left: 0;
    gap: 1rem; font-size: 0.875rem;
    overflow-x: auto; scrollbar-width: none;
  }
  header nav::-webkit-scrollbar { display: none; }
}

/* The smallest phones still in use, where the German legal pages —
   "Datenschutz" and "Bedingungen" beside a language switcher — are the
   longest bar the site has. */
@media (max-width: 22rem) {
  header nav { gap: 0.75rem; font-size: 0.8125rem; }
  /* Only here do the in-page jumps go. They shortcut a scroll, where every
     other link is the sole way to reach its page — so they are what a 320px
     screen gives up, and nothing above it has to. */
  header nav .jump { display: none; }
}

/* ── hero ─────────────────────────────────────────────────────────────── */
/* Block padding only: `.hero` sits on a `.wrap`, and a `padding` shorthand
   here zeroed the wrap's side gutter, so the hero ran to the screen edge. */
.hero { padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2rem, 5vw, 3.5rem); }
.eyebrow {
  color: var(--green); font-size: 0.8rem; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 1rem;
}
h1 {
  font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.9rem);
  line-height: 1.08; letter-spacing: -0.02em; font-weight: 800;
  max-width: 18ch;
}
.lede { margin-top: 1.25rem; max-width: var(--measure); color: var(--muted); font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem); }
.lede strong { color: var(--text); font-weight: 600; }

.facts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.75rem; list-style: none; padding: 0; }
.facts li {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.4rem 0.9rem; font-size: 0.85rem; color: var(--muted);
  background: var(--surface);
}
.facts li b { color: var(--text); font-weight: 600; }

/* ── store buttons ────────────────────────────────────────────────────── */
/* The geborgen pattern: a live store is a solid button, a store we are not
   on yet is the same button greyed out and not a link, with a "coming soon"
   line under the row. When Android ships, the Play button becomes an <a>
   like the App Store one and the line goes. */
.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.store-btn {
  display: inline-flex; align-items: center; gap: 0.7rem;
  padding: 0.65rem 1.3rem 0.65rem 1.05rem; border-radius: 0.9rem;
  background: var(--text); color: var(--bg);
  border: 1px solid var(--text); text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.store-btn:hover { background: var(--green); border-color: var(--green); color: #05210c; transform: translateY(-1px); }
.store-btn svg { width: 1.45rem; height: 1.45rem; fill: currentColor; flex-shrink: 0; }
.store-btn .st-text { display: block; font-size: 0.68rem; line-height: 1; opacity: 0.75; }
.store-btn .st-name { display: block; font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.store-btn.disabled,
.store-btn.disabled:hover {
  background: var(--surface); border-color: var(--line); color: var(--muted);
  cursor: default; transform: none;
}
.soon {
  display: flex; align-items: center; gap: 0.5rem; margin-top: 0.9rem;
  color: var(--amber); font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.soon::before {
  content: ''; width: 0.45rem; height: 0.45rem; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}

/* ── screenshot rail ──────────────────────────────────────────────────── */
/* Two modes, both centred.

   A carousel wherever six shots cannot sit side by side: every shot snaps to
   the middle of the screen, the first and last included. That needs the
   inline padding to be half the rail less half a shot — with a plain gutter
   there is no room to scroll the first shot to the centre, so it sat hard
   against the left edge and only the middle four ever centred.

   A single centred row once all six fit at no less than 10.5rem each
   (74.25rem = six at 10.5rem + five gaps + two gutters). Below that the shots
   get too small to read, so the carousel is kept rather than squeezed.

   The iPad gallery (`.tablet`) is the same carousel, sized to the phone
   shots' height rather than their width, so an iPad frame is 24rem wide.
   Six of those never fit a row, so from 74.25rem it is a 3×2 grid rather
   than the single row. */
.rail { padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.rail-scroll[hidden] { display: none; }
.rail-scroll {
  --shot: min(15rem, 62vw);
  display: flex; gap: 1.25rem; overflow-x: auto;
  padding: 0.5rem calc(50% - var(--shot) / 2) 1.5rem;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.rail-scroll figure { flex: 0 0 var(--shot); scroll-snap-align: center; margin: 0; }
.rail-scroll.tablet { --shot: min(24rem, 78vw); }
@media (min-width: 74.25rem) {
  .rail-scroll:not(.tablet) {
    justify-content: center;
    padding-inline: var(--gutter);
    scroll-snap-type: none;
  }
  /* Start at 15rem and give way equally, so the row always fits and never
     scrolls; the media query guarantees none shrinks below 10.5rem. */
  .rail-scroll:not(.tablet) figure { flex: 0 1 15rem; min-width: 0; }
  /* The iPad carousel would open on one frame centred and half the rail
     empty, so here it becomes two centred rows of three instead. */
  .rail-scroll.tablet {
    display: grid; grid-template-columns: repeat(3, minmax(0, 22rem));
    justify-content: center; gap: 2rem 1.25rem;
    overflow: visible; padding-inline: var(--gutter); scroll-snap-type: none;
  }
}

/* iPhone / iPad switch above the rail: a segmented control, centred. It
   ships `hidden` and `shots.js` reveals it, so a page without script shows
   both galleries and no dead buttons. */
.shot-tabs {
  display: flex; width: fit-content; margin: 0 auto 1.25rem;
  padding: 0.25rem; gap: 0.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.shot-tabs[hidden] { display: none; }
.shot-tabs button {
  font: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 0.4rem 1.1rem; border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.shot-tabs button:hover { color: var(--text); }
.shot-tabs button[aria-selected="true"] { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.rail-scroll img {
  width: 100%;
  border-radius: 1.4rem; border: 1px solid var(--line);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.55);
}
.rail-scroll figcaption { margin-top: 0.85rem; font-size: 0.85rem; color: var(--muted); }

/* ── sections ─────────────────────────────────────────────────────────── */
section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
section + section { border-top: 1px solid var(--line); }
h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); line-height: 1.2;
  letter-spacing: -0.01em; font-weight: 700; max-width: 24ch;
}
h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.35rem; }
section > .wrap > p, section > .narrow > p { max-width: var(--measure); color: var(--muted); margin-top: 1rem; }

.grid { display: grid; gap: 1.25rem; margin-top: 2rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; padding: 1.4rem; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .num { color: var(--cyan); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; display: block; margin-bottom: 0.6rem; }

.price { background: var(--raised); border: 1px solid var(--line); border-radius: 1.2rem; padding: clamp(1.5rem, 4vw, 2.5rem); margin-top: 2rem; }
.price .amount { font-size: clamp(2rem, 1.5rem + 2.4vw, 3rem); font-weight: 800; letter-spacing: -0.02em; }
.price .amount span { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price ul { margin: 1.25rem 0 0; padding-left: 1.1rem; color: var(--muted); display: grid; gap: 0.5rem; }

/* ── long-form legal ──────────────────────────────────────────────────── */
.legal { padding-block: clamp(2.5rem, 6vw, 4rem); }
.legal h1 { max-width: none; font-size: clamp(1.9rem, 1.5rem + 1.8vw, 2.6rem); }
.legal .updated { color: var(--muted); font-size: 0.9rem; margin-top: 0.75rem; }
.legal h2 { font-size: 1.3rem; margin-top: 2.5rem; max-width: none; }
.legal h3 { margin-top: 1.5rem; }
.legal p, .legal li { color: var(--muted); }
.legal p { margin-top: 0.9rem; max-width: var(--measure); }
.legal ul { margin-top: 0.9rem; padding-left: 1.2rem; display: grid; gap: 0.5rem; max-width: var(--measure); }
.legal strong { color: var(--text); font-weight: 600; }
.legal table { width: 100%; margin-top: 1.25rem; border-collapse: collapse; font-size: 0.925rem; }
.legal th, .legal td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { color: var(--text); font-weight: 600; }
.legal td { color: var(--muted); }

.callout {
  margin-top: 1.5rem; padding: 1.1rem 1.25rem;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--green); border-radius: 0.6rem;
}
.callout p { margin: 0; }

/* ── footer ───────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--line); padding-block: 2.5rem 3.5rem; margin-top: 2rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: baseline; }
footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: 0.925rem; }
footer nav a { color: var(--muted); text-decoration: none; }
footer nav a:hover { color: var(--text); }
footer small { color: var(--muted); margin-left: auto; font-size: 0.85rem; }

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

/* ── language switcher ────────────────────────────────────────────────────
   Set apart from the section links beside it: it changes the language of the
   page you are on, not the page. */

/* A quiet aside: true, worth saying, not the point of the paragraph above. */
.note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}
