/* Certis public site — the landing (`/`) and install (`/download`) pages the gateway serves to someone
   who has neither an account nor the app.

   Deliberately standalone: no build step, no framework, no external font. These are the two pages that
   must render for a first-time visitor on a phone with a bad connection, so they carry their own tokens
   instead of pulling the client bundle. The token NAMES and VALUES mirror client/src/styles.css — the
   site and the app are one product and must not drift into two palettes; changing a brand colour there
   means changing it here. */

:root {
  color-scheme: light;
  --page: #e7ebf0;
  --card: #ffffff;
  --ink: #17222d;
  --muted: #6b7885;
  --line: #e3e7ec;
  --brand: #12395b;
  --brand-2: #1c4f79;
  --brand-ink: #12395b;
  --accent: #0f7e74;
  --accent-ink: #0c6b62;
  --accent-soft: #e6f2f0;
  --sh-1: 0 1px 2px rgba(12, 30, 45, 0.06);
  --sh-2: 0 10px 30px rgba(10, 30, 40, 0.14);
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
}

/* The OS preference decides; the site has no theme toggle of its own (the app owns that). */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #080d13;
    --card: #16212e;
    --ink: #e8eef4;
    --muted: #93a3b3;
    --line: #26333f;
    --brand: #16406a;
    --brand-2: #205081;
    --brand-ink: #22b7a9;
    --accent: #19a89b;
    --accent-ink: #22b7a9;
    --accent-soft: #103733;
    --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --sh-2: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 20px 64px;
}

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand .mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: linear-gradient(160deg, var(--brand-2), var(--brand));
  box-shadow: var(--sh-1);
}

.top-link {
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.top-link:hover {
  text-decoration: underline;
}

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

.hero {
  padding: 40px 0 8px;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lead {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.06rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 0;
}

.btn {
  display: inline-block;
  padding: 13px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--sh-1);
}

.btn:hover {
  border-color: var(--accent);
}

.btn.primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-ink);
}

/* --- what it does ---------------------------------------------------------------------------- */

.points {
  display: grid;
  gap: 2px;
  margin: 48px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--line);
  box-shadow: var(--sh-1);
}

.point {
  padding: 20px 22px;
  background: var(--card);
}

.point h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 650;
}

.point p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* --- access / cards -------------------------------------------------------------------------- */

.card {
  margin: 20px 0 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-1);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.card p:last-child {
  margin-bottom: 0;
}

.card .btn {
  margin-top: 2px;
}

/* The platform the visitor is actually on (site.js stamps <html>) leads: it moves to the top of the
   stack and gains the accent edge, so the phone in their hand is the card they read first. */
.cards {
  display: flex;
  flex-direction: column;
}

.is-android .cards [data-platform="android"],
.is-ios .cards [data-platform="ios"],
.is-desktop .cards [data-platform="desktop"] {
  order: -1;
  border-color: var(--accent);
  box-shadow: var(--sh-2);
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.steps {
  margin: 18px 0 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.steps li {
  margin: 0 0 8px;
}

.steps li:last-child {
  margin-bottom: 0;
}

.steps strong,
.card p strong {
  color: var(--ink);
  font-weight: 620;
}

.fine {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.88rem;
}

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

footer {
  margin: 56px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

footer a {
  color: var(--accent-ink);
}

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