/* Cambyo website. Tokens from docs/BRIEF.md ("Colour tokens"); light and dark follow the phone. */

@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/SpaceGrotesk-Variable.acad6de1fc.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --page: #F1F1F5;
  --card: #FFFFFF;
  --well: #F0F0F5;
  --hairline: #E6E6EC;
  --border: #D9D9E1;
  --text: #15161C;
  --text-2: #62646F;
  --accent: #1F4BF2;
  --accent-text: #1F4BF2;
  --tint: #E6EBFD;
  --on-accent: #FFFFFF;
  --pill: #23242C;
  --bezel: #15161C;
  --warn-bg: #FDF3DC;
  --warn-border: #EBCB8B;
  --warn: #6B4A0B;
  --ok-bg: #E6F4EA;
  --ok: #1B7A3D;
  --shadow: 0 1px 2px rgba(21, 22, 28, 0.04), 0 12px 32px rgba(21, 22, 28, 0.08);
  --body: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: 20px;
  --max: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0F1014;
    --card: #1B1C22;
    --well: #24252C;
    --hairline: #2A2B33;
    --border: #33343D;
    --text: #F2F2F5;
    --text-2: #A0A2AE;
    --accent: #3D63FF;
    --accent-text: #8FA6FF;
    --tint: #1E2440;
    --pill: #26272F;
    --bezel: #2A2B33;
    --warn-bg: #2A2208;
    --warn-border: #5C4A0E;
    --warn: #E9D9A6;
    --ok-bg: #10291A;
    --ok: #6EE7A0;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--accent-text); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p, ul, ol { margin: 0; }
strong { font-weight: 650; }
code {
  font: 0.9em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--well); border-radius: 6px; padding: 0.1em 0.35em;
}

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  padding: 10px 16px; border-radius: 12px; background: var(--accent); color: var(--on-accent);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* Header */
.site-head { padding: 18px 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
  font: 700 22px/1 var(--display); letter-spacing: -0.02em; min-height: 44px;
}
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.site-nav ul { display: flex; gap: 4px; list-style: none; padding: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 12px;
  color: var(--text); font-weight: 550; font-size: 15px; text-decoration: none;
}
.site-nav a:hover { background: var(--card); }
.site-nav a[aria-current="page"] { color: var(--accent-text); }
@media (max-width: 560px) { .site-nav .wide { display: none; } }
@media (max-width: 400px) {
  .site-nav .narrow-hide { display: none; }
  .site-nav a { padding: 0 8px; }
}

/* Shared bits */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 14px/1.2 var(--body); color: var(--accent-text); letter-spacing: 0;
}
.tile {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: inline-grid; place-items: center; background: var(--tint); color: var(--accent-text);
}
.tile svg { width: 22px; height: 22px; }
.card { background: var(--card); border: 1px solid var(--hairline); border-radius: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--hairline); font-size: 14px; font-weight: 550; color: var(--text);
}
.chip svg { width: 18px; height: 18px; color: var(--accent-text); }
.ticks { list-style: none; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 0.3em; width: 18px; height: 18px; border-radius: 6px;
  background: var(--tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F4BF2' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}
@media (prefers-color-scheme: dark) {
  .ticks li::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238FA6FF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E");
  }
}

/* Phone frames around the app's screenshots */
.phone {
  margin: 0; flex: 0 0 auto; width: 100%; max-width: 280px;
  padding: 8px; border-radius: 36px; background: var(--bezel); box-shadow: var(--shadow);
}
.phone img { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 28px; background: var(--page); }
.phones {
  display: flex; gap: 20px; overflow-x: auto; padding: 8px 2px 18px; margin: 0 -2px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.phones .phone { width: 72%; max-width: 250px; scroll-snap-align: center; }
.phones figcaption, .phone figcaption { margin-top: 10px; text-align: center; font-size: 14px; color: var(--text-2); }
.phones figure { margin: 0; flex: 0 0 auto; width: 70%; max-width: 250px; scroll-snap-align: center; }
.phones figure .phone { width: 100%; max-width: none; }
@media (min-width: 900px) {
  .phones { overflow: visible; justify-content: center; }
  .phones figure { width: auto; flex: 1 1 0; }
}

/* Homepage hero */
.hero { padding: 24px 0 56px; }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
.hero-icon { width: 76px; height: 76px; border-radius: 18px; box-shadow: var(--shadow); }
.hero h1 { margin-top: 22px; font-size: clamp(40px, 9vw, 64px); font-weight: 700; }
.hero .lead { margin-top: 18px; font-size: clamp(18px, 2.4vw, 20px); color: var(--text-2); max-width: 36em; }
.soon {
  margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  font-weight: 600;
}
.soon .label { width: 100%; font-size: 15px; color: var(--text); }
.store {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 16px 6px 12px;
  border-radius: 14px; background: var(--pill); color: #FFFFFF; font-size: 15px; line-height: 1.15;
}
.store svg { width: 24px; height: 24px; flex-shrink: 0; }
.store small { display: block; font-size: 12px; font-weight: 500; color: #C9CAD3; }
.hero-chips { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-media { display: flex; justify-content: center; }
.hero-media .phone { max-width: 300px; }
@media (min-width: 900px) {
  .hero { padding: 40px 0 88px; }
  .hero .wrap { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
}

/* Feature sections */
.features { display: grid; gap: 20px; padding-bottom: 20px; }
.feature { padding: 40px 0; }
.feature .wrap { display: grid; gap: 32px; align-items: center; }
.feature h2 { margin-top: 14px; font-size: clamp(30px, 5.4vw, 44px); font-weight: 700; }
.feature .intro { margin-top: 14px; font-size: 18px; color: var(--text-2); max-width: 34em; }
.feature .ticks { margin-top: 22px; }
.feature-media { min-width: 0; }
@media (min-width: 900px) {
  .feature .wrap { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; }
  .feature.flip .feature-text { order: 2; }
  .feature.stack .wrap { grid-template-columns: minmax(0, 1fr); }
  .feature.stack .feature-text { max-width: 760px; }
}
.illustration { display: block; width: 100%; height: auto; border-radius: 24px; box-shadow: var(--shadow); }
.ill-card { background: var(--card); }
.ill-well { fill: var(--well); }
.ill-card-fill { fill: var(--card); }
.ill-road { stroke: var(--border); }
.ill-road-minor { stroke: var(--hairline); }
.ill-water { fill: var(--tint); }
.ill-route { stroke: var(--accent); }
.ill-text { font-family: var(--display); font-weight: 700; }
.ill-ink { fill: var(--text); }
.ill-ink-2 { fill: var(--text-2); }
.ill-chip { fill: var(--card); stroke: var(--hairline); }
.ill-warn-bg { fill: var(--warn-bg); stroke: var(--warn-border); }
.ill-warn { fill: var(--warn); }
.ill-accent { fill: var(--accent); }

.duo { display: grid; gap: 16px; }
@media (min-width: 640px) { .duo { grid-template-columns: 1fr 1fr; } }
.duo .card { padding: 24px; }
.duo h3 { display: flex; align-items: center; gap: 12px; font-size: 22px; }
.duo p { margin-top: 12px; color: var(--text-2); }
.duo .ticks { margin-top: 16px; font-size: 15px; }

/* Values band */
.values { padding: 40px 0 56px; }
.values h2 { font-size: clamp(28px, 4.6vw, 36px); }
.values .grid { margin-top: 24px; display: grid; gap: 16px; }
@media (min-width: 720px) { .values .grid { grid-template-columns: repeat(3, 1fr); } }
.values .card { padding: 22px; }
.values h3 { margin-top: 14px; font-size: 19px; }
.values p { margin-top: 8px; color: var(--text-2); font-size: 15px; }

.cta { padding: 8px 0 56px; }
.cta .card { padding: 32px 24px; text-align: center; display: grid; justify-items: center; gap: 14px; }
.cta img { width: 64px; height: 64px; border-radius: 15px; }
.cta h2 { font-size: clamp(26px, 4.4vw, 34px); }
.cta p { color: var(--text-2); max-width: 36em; }

/* Text pages */
.page { padding: 12px 0 64px; }
.page .wrap { max-width: 880px; }
.page-head { padding: 12px 0 8px; }
.page-head h1 { font-size: clamp(34px, 7vw, 48px); font-weight: 700; }
.page-head .lead { margin-top: 12px; font-size: 18px; color: var(--text-2); }
.prose { font-size: 16px; }
.notice + .prose, .toc + .prose, .page-head + .prose { margin-top: 28px; }
.prose > * + * { margin-top: 16px; }
.prose h2 { margin-top: 44px; font-size: 26px; scroll-margin-top: 16px; }
.prose h3 { margin-top: 32px; font-size: 20px; scroll-margin-top: 16px; }
.prose h2 + *, .prose h3 + * { margin-top: 12px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--text-2); }
.prose .meta-lines { color: var(--text-2); }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 40px 0; }

.notice {
  margin-top: 20px; padding: 14px 16px; border-radius: 16px;
  background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn); font-size: 15px;
}
.notice strong { color: inherit; }
.notice p + p { margin-top: 6px; }
.notice.beta { background: var(--well); border-color: var(--hairline); color: var(--text-2); }
.notice.beta strong { color: var(--text); }

mark.ph {
  background: var(--warn-bg); color: var(--warn); border: 1px dashed var(--warn-border);
  border-radius: 6px; padding: 0 4px; font-weight: 600;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.ph-block { padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); border: 1px dashed var(--warn-border); }
.ph-block mark.ph { border: 0; padding: 0; background: none; }

.toc { margin-top: 24px; padding: 18px 20px; }
.toc h2 { font-size: 17px; margin: 0; }
.toc ol { margin-top: 10px; padding-left: 1.3em; columns: 2 240px; column-gap: 28px; font-size: 15px; }
.toc li { break-inside: avoid; padding: 3px 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Tables become stacked cards on small screens */
.table-wrap { margin-top: 16px; }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 14px; }
@media (min-width: 760px) {
  .table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: 16px; background: var(--card); }
  .prose thead th { background: var(--well); font-weight: 650; font-size: 14px; }
  .prose tbody td { border-top: 1px solid var(--hairline); }
  .prose th + th, .prose td + td { border-left: 1px solid var(--hairline); }
}
@media (max-width: 759.98px) {
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose table, .prose tbody, .prose tr, .prose td { display: block; }
  .prose tr { background: var(--card); border: 1px solid var(--hairline); border-radius: 16px; padding: 6px 0; }
  .prose tr + tr { margin-top: 12px; }
  .prose td { padding: 8px 16px; }
  .prose td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-size: 13px; font-weight: 600; color: var(--text-2);
  }
}

/* FAQ */
.faq { display: grid; gap: 10px; margin-top: 16px; }
.faq details { background: var(--card); border: 1px solid var(--hairline); border-radius: 16px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 48px 16px 18px; position: relative;
  font-weight: 600; min-height: 48px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg);
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq .answer { padding: 0 18px 18px; color: var(--text); }
.faq .answer > * + * { margin-top: 10px; }

.steps { counter-reset: step; list-style: none; padding: 0 !important; display: grid; gap: 10px; }
.steps li { counter-increment: step; position: relative; padding: 14px 16px 14px 56px; background: var(--card); border: 1px solid var(--hairline); border-radius: 16px; }
.steps li + li { margin-top: 0 !important; }
.steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 13px; width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center; background: var(--tint); color: var(--accent-text);
  font: 700 15px/1 var(--display);
}
.box { padding: 18px 20px; }
.box > * + * { margin-top: 10px; }
.mail {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px;
  border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 650; text-decoration: none;
}
.mail:hover { filter: brightness(1.06); }
.mail svg { width: 20px; height: 20px; }

details.licence { background: var(--card); border: 1px solid var(--hairline); border-radius: 14px; }
details.licence summary { cursor: pointer; padding: 12px 16px; font-weight: 600; min-height: 44px; }
details.licence pre {
  margin: 0; padding: 0 16px 16px; white-space: pre-wrap; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-2); max-height: 480px; overflow: auto;
}

/* 404 */
.lost { padding: 48px 0 96px; text-align: center; }
.lost .wrap { display: grid; justify-items: center; gap: 16px; }
.lost h1 { font-size: clamp(32px, 7vw, 44px); }
.lost p { color: var(--text-2); max-width: 30em; }

/* Footer */
.site-foot { border-top: 1px solid var(--hairline); padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); font-size: 15px; }
.site-foot .wrap { display: grid; gap: 20px; }
.site-foot nav ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 4px; margin-left: -10px; }
.site-foot nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--text); text-decoration: none; border-radius: 10px; }
.site-foot nav a:hover { background: var(--card); }
.site-foot .small { font-size: 14px; color: var(--text-2); }
.site-foot .brand { font-size: 19px; }
.site-foot .brand img { width: 28px; height: 28px; border-radius: 7px; }

@media print {
  .site-head nav, .site-foot nav, .skip, .toc { display: none; }
  body { background: #FFFFFF; color: #000000; }
  .card, .table-wrap, .prose tr { border-color: #CCCCCC; }
}

/* A shared Live convoy (/c) */
.convoy-code { background: var(--card); border: 1px solid var(--hairline); border-radius: 18px; padding: 20px; margin: 8px 0 24px; box-shadow: var(--shadow); }
.convoy-code-label { margin: 0; color: var(--text-2); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.convoy-code-text { margin: 4px 0 16px; font-family: var(--display); font-size: 40px; font-weight: 700; letter-spacing: 0.08em; color: var(--text); user-select: all; }
.convoy-code-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.convoy-copy { min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--well); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.convoy-code-note { margin: 10px 0 0; color: var(--ok); font-size: 14px; }
