/* ============================================================
   Longtom — the public site.

   Layout only. Every colour, font and radius comes from
   tokens.css, which is the app's own stylesheet copied in at
   build time rather than reimplemented — the site and the
   product are the same object and should not drift apart.

   The app is a dense console at 14px. A page somebody reads
   once, on a phone, in a browser tab, is not, so the reading
   scale is larger here and nothing else changes.
   ============================================================ */

body {
  font-size: 17px;
  line-height: 1.62;
}

/* Larger than the console's 12.5px for the same reason as the body: this is
   prose to be read, not a label beside a number. */
.topic {
  font-size: 15px;
  line-height: 1.6;
}

a:focus-visible,
.mark:focus-visible {
  outline: 2px solid var(--lt-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Bar ------------------------------------------------------------------ */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.mark:hover { text-decoration: none; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 17px;
}
.bar nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 15px;
}
.bar nav a { color: var(--ink-2); }
.bar nav a:hover { color: var(--lt-blue-ink); }

/* ---- Shell ---------------------------------------------------------------- */

main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 28px 72px;
}
section { padding: 56px 0; }
section + section { border-top: 1px solid var(--line); }

h1 {
  font-size: clamp(30px, 5.2vw, 46px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
}
h2 {
  font-size: clamp(22px, 3.2vw, 28px);
  line-height: 1.25;
  margin: 0 0 18px;
  max-width: 24ch;
}
h3 {
  font-size: 18px;
  margin: 0 0 10px;
}

/* Measure, not width. Long lines are the commonest way a page of real prose
   becomes a page nobody finishes. */
p { max-width: 68ch; }
.lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 66ch;
  margin: 0 0 20px;
}

.hero { padding-top: 64px; }
.hero h1 { max-width: 18ch; }

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 15px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  padding: 12px 16px;
  max-width: 72ch;
}

/* ---- Cards ---------------------------------------------------------------- */

.cards {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 28px;
}
.cards.two { grid-template-columns: repeat(2, 1fr); }
.cards .card > p { max-width: none; }
.cards .card > p:last-child { margin-bottom: 0; }

/* A section whose cards want the full measure rather than the prose one. */
.wide h2 { max-width: 28ch; }

/* ---- Countries ------------------------------------------------------------ */

.countries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 2px 18px;
  margin: 24px 0 22px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 16px);
}
.countries span {
  font-size: 14.5px;
  padding: 3px 0;
  border-bottom: 1px solid transparent;
}
.countries b {
  font-weight: 600;
  color: var(--ink);
}
.countries i {
  font-style: normal;
  color: var(--ink-3);
  font-size: 13px;
}

/* ---- Closing and footer --------------------------------------------------- */

.closing { text-align: left; }
.closing h2 { max-width: 30ch; }

footer {
  border-top: 1px solid var(--line);
  padding: 26px 28px 48px;
  max-width: 1060px;
  margin: 0 auto;
  color: var(--ink-2);
  font-size: 15px;
}
footer p { max-width: 72ch; margin: 0 0 8px; }
footer a { margin-left: 14px; }

/* ---- Prose pages (privacy) ------------------------------------------------ */

.prose { padding-top: 48px; }
.prose h2 { margin-top: 38px; }
.prose h2:first-of-type { margin-top: 0; }
.prose ul { max-width: 68ch; padding-left: 22px; }
.prose li { margin-bottom: 8px; }

/* ---- Narrow --------------------------------------------------------------- */

@media (max-width: 900px) {
  .cards, .cards.two { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .bar { padding: 12px 18px; gap: 14px; }
  /* The wordmark and the logo are the identity; four section links are not,
     and wrapping them onto a second sticky row costs more than they return.
     Support survives, because it is the one link somebody on a phone is
     actively looking for rather than browsing past — and unlike the others it
     is a page, not a jump down the one they are already on. */
  .bar nav a { display: none; }
  .bar nav a[href="/support"] { display: inline; }
  main { padding: 0 18px 56px; }
  section { padding: 40px 0; }
  .hero { padding-top: 40px; }
  footer { padding: 24px 18px 40px; }
}

/* ---- Support: the form and the questions ---------------------------------- */

/* The only form on the site. It posts same-origin to a Worker that turns it
   into an email and keeps nothing — see support-worker/ — so the CSP allows
   `form-action 'self'` and still nothing third-party. */

.formcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin: 22px 0 8px;
  box-shadow: var(--shadow-card);
}

form { display: grid; gap: 14px; }

form label {
  display: grid;
  gap: 5px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
/* The hint inside the label rather than beside it: a field whose explanation
   is somewhere else is a field people fill in wrong. */
form label span {
  font-weight: 400;
  font-size: 14px;
  color: var(--ink-2);
}

form input,
form textarea,
form select {
  font: inherit;
  font-size: 16px; /* 16 stops iOS zooming the page on focus. */
  width: 100%;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
form textarea { min-height: 10em; resize: vertical; }
form input:focus-visible,
form textarea:focus-visible,
form select:focus-visible {
  outline: 2px solid var(--lt-blue);
  outline-offset: 1px;
}

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

form button {
  font: inherit;
  font-weight: 600;
  justify-self: start;
  padding: 10px 20px;
  color: #fff;
  background: var(--lt-blue-deep);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
form button:hover { background: var(--lt-blue-ink); }

/* A field no person can see and every crude bot fills in. Off-screen rather
   than display:none, which some bots check for. */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.qa { margin: 0; max-width: 72ch; }
.qa dt { font-weight: 600; margin-top: 26px; color: var(--ink); }
.qa dd { margin: 6px 0 0; color: var(--ink-2); }
.qa code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
}

@media (max-width: 620px) {
  .pair { grid-template-columns: 1fr; }
  .formcard { padding: 18px; }
}
