/* cargo.supply: the policy pages (/privacy, /terms, /security, /support, 404).
   Light colours come from tokens.css, which mirrors cargo/AppTheme.swift; change them
   there. The app-look pages (/, /c, /i) use app.css instead. No webfonts: the system
   stack is what the iOS app uses. */

@import url("/tokens.css");

:root {
  /* Light only, like the app (#196) and the app-look pages: one theme site-wide (#287). */
  color-scheme: light;

  --bg: var(--app-background);
  --surface: var(--app-card);
  --brand: var(--app-brown);
  --text: var(--app-text);
  --text-2: var(--app-text-2);
  --muted: var(--app-placeholder);
  --hairline: var(--app-hairline);
  --subtle: var(--app-subtle);
  --shadow: 0 2px 5px rgba(0, 0, 0, 0.05);  /* cardShadow 2 / radius 5 / 5% */
  --glass: rgba(251, 251, 251, 0.82);

  /* Draft placeholders in the legal text. Not a brand colour: a highlighter. */
  --mark-bg: #fbf3db;
  --mark-text: #956400;

  --radius: 18px;           /* the app's card radius */
  --gutter: 16px;           /* the app's side gutter */
  --measure: 66ch;

  --font: var(--app-font);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-decoration: none;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration: underline;
}

/* Links inside policy text are underlined: brown on near-black body text is 1.38:1, so colour
   alone does not mark them (WCAG 1.4.1, #671). The header nav and footer keep plain links. */
main a {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.skip:focus {
  top: 8px;
  z-index: 10;
}

/* ---- Header: the app's sticky glass header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.site-header .row {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.wordmark:hover {
  text-decoration: none;
}

.wordmark svg {
  width: 20px;
  height: 20px;
  fill: var(--text);
  flex: none;
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  color: var(--text-2);
  font-size: 0.9375rem;
  padding: 6px 10px;
  border-radius: 999px;
}

.site-nav a:hover {
  text-decoration: none;
  background: var(--subtle);
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* ---- Landing ---- */

main {
  flex: 1;
}

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(40px, 9vh, 96px) var(--gutter) 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

.hero-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 6.5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-wrap: balance;
}

.hero-copy p {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(1.0625rem, 2.2vw, 1.375rem);
  line-height: 1.45;
  color: var(--text-2);
  text-wrap: pretty;
}

.hero-copy .platform {
  margin-top: 28px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.store-badge {
  margin-top: 24px;
}

/* The mark, drawn large on the app's white card. */
.hero-art {
  justify-self: center;
  width: min(100%, 300px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--surface);
  border-radius: 22.37%; /* iOS icon curvature */
  box-shadow: var(--shadow), 0 0 0 1px var(--hairline);
  padding: 22%;
}

.hero-art svg {
  width: 100%;
  height: 100%;
  fill: var(--brand);
}

@media (min-width: 760px) {
  .hero {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 64px;
    min-height: calc(100dvh - 56px - 72px);
  }

  .hero-art {
    width: min(100%, 360px);
    justify-self: end;
  }
}

/* ---- Document pages (privacy, terms, support) ---- */

.doc {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 40px var(--gutter) 72px;
}

.doc header {
  margin-bottom: 36px;
}

.doc h1 {
  margin: 0 0 12px;
  font-size: clamp(1.875rem, 5vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.doc .lede {
  color: var(--text-2);
  font-size: 1.125rem;
  margin: 0;
}

.doc h2 {
  margin: 44px 0 12px;
  font-size: 1.3125rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.doc h3 {
  margin: 28px 0 8px;
  font-size: 1.0625rem;
  font-weight: 600;
}

.doc p,
.doc li {
  color: var(--text-2);
}

.doc p {
  margin: 0 0 16px;
}

.doc ul,
.doc ol {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

.doc li {
  margin-bottom: 6px;
}

.doc strong {
  color: var(--text);
  font-weight: 600;
}

.doc hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 40px 0;
}

/* Definition-style meta block (effective date, provider, contact) */
.meta {
  margin: 0 0 8px;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 20px;
  row-gap: 8px;
  font-size: 0.9375rem;
}

.meta dt {
  color: var(--muted);
}

.meta dd {
  margin: 0;
  color: var(--text);
}

@media (max-width: 420px) {
  .meta {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }

  .meta dd {
    margin-bottom: 8px;
  }
}

/* The draft banner carried over from the source document */
.notice {
  margin: 0 0 32px;
  padding: 14px 18px;
  border-left: 3px solid var(--brand);
  background: var(--subtle);
  border-radius: 0 12px 12px 0;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.notice p {
  margin: 0;
}

/* Placeholders waiting on legal / the owner. Visibly marked on purpose. */
mark {
  background: var(--mark-bg);
  color: var(--mark-text);
  padding: 0 0.3em;
  border-radius: 4px;
  font-weight: 500;
}

/* Steps on the support page */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 18px 14px 60px;
  margin: 0 0 8px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--subtle);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

/* ---- Footer ---- */

.site-footer {
  border-top: 1px solid var(--hairline);
}

.site-footer .row {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.site-footer a {
  color: var(--text-2);
}

@media (prefers-reduced-motion: no-preference) {
  .site-nav a,
  .site-footer a {
    transition: background-color 160ms ease, color 160ms ease;
  }
}

/* 320px: the header row must stay on one line. The mark alone carries the brand. */
@media (max-width: 399px) {
  .site-nav a {
    padding: 6px 8px;
    font-size: 0.875rem;
  }
}

@media (max-width: 339px) {
  .wordmark span {
    display: none;
  }
}
