/*
 * Swaff site. Colours, radii and type come from the app's design tokens
 * (packages/ui/src/theme/tokens.ts): strict black and white, neutral greys, hairline rows,
 * 8pt grey section gaps, system sans, black pill buttons.
 */
:root {
  --background: #FFFFFF;
  --surface: #FFFFFF;
  --surface-muted: #F2F2F2;
  --primary: #000000;
  --primary-pressed: #262626;
  --on-primary: #FFFFFF;
  --text: #000000;
  --text-secondary: #6E6E73;
  --text-tertiary: #6E6E73;
  --divider: #E8E8E8;
  --border: #8E8E93;
  --border-strong: #000000;
  --success: #1E7A43;
  --danger: #C62F34;
  --focus: #3B6FD8;
  --glass: rgba(255, 255, 255, 0.82);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --pill: 999px;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #000000;
    --surface: #121212;
    --surface-muted: #1F1F1F;
    --primary: #FFFFFF;
    --primary-pressed: #D9D9D9;
    --on-primary: #000000;
    --text: #FFFFFF;
    --text-secondary: #A1A1A6;
    --text-tertiary: #8E8E93;
    --divider: #262626;
    --border: #3A3A3A;
    --border-strong: #FFFFFF;
    --success: #3FBF73;
    --danger: #FF6369;
    --focus: #6E9BFF;
    --glass: rgba(0, 0, 0, 0.78);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 680px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Wordmark: same as the app's Welcome screen (800 weight, tight tracking, lower case). */
.wordmark { font-size: 26px; line-height: 32px; font-weight: 800; letter-spacing: -0.5px; text-decoration: none; }

.overline { font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-secondary); }
.lede { font-size: 17px; line-height: 1.45; color: var(--text-secondary); }
.fine { font-size: 13px; line-height: 18px; color: var(--text-tertiary); }
.fine a { color: var(--text-secondary); }

/* Buttons: 52pt pills, like the app's sign-in buttons. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border-radius: var(--pill);
  font: 600 16px/20px var(--sans); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s ease;
}
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-pressed); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-muted); }
.btn[disabled] { opacity: .5; cursor: default; }
.apple { width: 16px; height: 19px; margin-top: -3px; }

/* Nav: translucent bar with a hairline, like the app's floating chrome. */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--divider);
}
.nav-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.nav-links { display: flex; gap: 24px; margin-left: auto; }
.nav-links a { font-size: 15px; color: var(--text-secondary); text-decoration: none; }
.nav-links a:hover { color: var(--text); }

/* Hero */
.hero { padding: 56px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.hero h1 { margin-top: 14px; font-size: clamp(38px, 5.4vw, 60px); line-height: 1.05; font-weight: 700; letter-spacing: -1.5px; }
.hero .lede { margin-top: 18px; max-width: 30em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.hero .fine { margin-top: 14px; }

/* Mosaic: the Welcome screen's 2x2 photo grid (tall row, then short row). */
.mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mosaic img { width: 100%; object-fit: cover; border-radius: var(--r-lg); background: var(--surface-muted); }
.mosaic .tall { aspect-ratio: 1 / 1.08; }
.mosaic .short { aspect-ratio: 1 / 0.68; }

/* The app's thick grey band between sections. */
.gap { height: 8px; background: var(--surface-muted); }

.section { padding: 72px 0; }
.section-title { font-size: clamp(28px, 3.6vw, 36px); line-height: 1.15; font-weight: 700; letter-spacing: -0.6px; }

/* How it works */
.feature { display: grid; grid-template-columns: 300px 1fr; gap: 64px; align-items: center; margin-top: 64px; }
.feature.reverse { grid-template-columns: 1fr 300px; }
.feature.reverse .phone { order: 2; }
.feature-copy { max-width: 30em; }
.feature h3 { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.3px; margin-top: 12px; }
.feature p:not(.step) { margin-top: 10px; font-size: 17px; color: var(--text-secondary); }
.step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--pill);
  background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 15px;
}

/* iPhone frame around a real app screenshot (1206x2622, i.e. 9:19.5). */
.phone {
  width: 100%; max-width: 300px; margin: 0 auto;
  padding: 11px; border-radius: 52px;
  background: #0B0B0C;
  box-shadow: 0 0 0 1.5px #3A3A3C inset, 0 24px 60px rgba(0, 0, 0, .14);
}
.screen {
  position: relative; aspect-ratio: 1206 / 2622; border-radius: 42px; overflow: hidden;
  background: var(--surface-muted);
}
.screen img { width: 100%; height: 100%; object-fit: cover; }
.screen .ph { display: none; }
.screen.empty img { display: none; }
.screen.empty .ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 24px; text-align: center; font-size: 14px; color: var(--text-tertiary);
}

/* Safety: full-width rows split by hairlines, like the app's settings lists. */
.rows { list-style: none; margin: 32px 0 0; padding: 0; }
.rows li { display: flex; gap: 16px; padding: 20px 0; border-bottom: 0.5px solid var(--divider); }
.rows li:first-child { border-top: 0.5px solid var(--divider); }
.rows svg { flex: none; width: 22px; height: 22px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.rows h3 { font-size: 16px; line-height: 21px; font-weight: 600; }
.rows p { margin-top: 4px; font-size: 15px; line-height: 20px; color: var(--text-secondary); }
.more { margin-top: 24px; font-size: 15px; }
.more a { font-weight: 600; }

/* Waitlist */
.app-icon { margin: 0 auto 20px; border-radius: 16px; box-shadow: 0 0 0 0.5px var(--divider); }
#waitlist .lede { margin: 12px auto 0; max-width: 28em; }
.waitlist { display: grid; gap: 10px; max-width: 420px; margin: 28px auto 16px; text-align: left; }
.waitlist input[type="email"] {
  width: 100%; min-height: 52px; padding: 0 18px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 400 16px var(--sans);
}
.waitlist input[type="email"]::placeholder { color: var(--text-tertiary); }
.waitlist input[type="email"]:focus { outline: none; border-color: var(--border-strong); }
.waitlist .invalid { border-color: var(--danger) !important; }
/* Segmented control: like the app's Cash | Swap switch. */
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border-strong); border-radius: var(--r-md); overflow: hidden; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 46px; font-weight: 500; }
.seg input:checked + span { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -4px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.form-msg { min-height: 20px; font-size: 14px; text-align: center; color: var(--text-secondary); }
.form-msg.ok { color: var(--success); }
.form-msg.err { color: var(--danger); }

/* Footer */
.footer { border-top: 0.5px solid var(--divider); padding: 32px 0 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer nav a { display: inline-block; padding: 10px 0; font-size: 14px; color: var(--text-secondary); text-decoration: none; }
.footer nav a:hover { color: var(--text); }
.footer .fine { width: 100%; }

/* Phone widths */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-inner { justify-content: space-between; }
  .hero { padding: 28px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .mosaic { order: -1; }
  .hero h1 { letter-spacing: -1px; }
  .hero-actions .btn { width: 100%; }
  .section { padding: 48px 0; }
  .feature, .feature.reverse { grid-template-columns: 1fr; gap: 28px; margin-top: 48px; }
  .feature.reverse .phone { order: 0; }
  .phone { max-width: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
