/* BePal landing page. Tokens come from the app's design system (DesignSystem.swift). */
:root {
  --accent: #7aa687;
  --accent-2: #9ebf8f;
  --accent-3: #c4dbbf;
  --midnight: #0d0f17;
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #ececf1;
  --text: #1f1a17;
  --text-2: #5c4f45;
  --text-3: #756a60; /* the app's #94877D darkened slightly to pass AA contrast on the web */
  --hairline: rgba(0, 0, 0, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --radius: 16px;
  --t-sage: rgba(122, 166, 135, 0.20);
  --t-blue: rgba(107, 153, 191, 0.18);
  --t-gold: rgba(194, 174, 121, 0.24);
  --t-cta: rgba(122, 166, 135, 0.30);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f17;
    --surface: #1c1f24;
    --surface-2: #262930;
    --text: rgba(255, 255, 255, 0.96);
    --text-2: rgba(255, 255, 255, 0.7);
    --text-3: rgba(255, 255, 255, 0.55);
    --hairline: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding-block: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 20px; letter-spacing: 0.01em; }
.brand img { display: block; width: 28px; height: 28px; border-radius: 7px; }
.lang { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; font-size: 14px; }
.lang a { text-decoration: none; padding: 6px 14px; border-radius: 999px; color: var(--text-2); }
.lang a[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--hairline); }

/* type */
h1, h2, h3 { font-weight: 400; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(36px, 6.4vw, 58px); line-height: 1.07; }
h2 { font-size: clamp(28px, 4.2vw, 38px); line-height: 1.15; }
h3 { font-size: 22px; line-height: 1.25; }
p { margin: 0; }
.label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-3); }
.lead { font-size: 19px; color: var(--text-2); max-width: 34em; }
.fine { font-size: 13px; color: var(--text-3); }
.fine a { color: var(--text-2); }

/* hero */
.hero { display: grid; gap: 40px; padding-block: 24px 72px; align-items: center; }
.hero-copy { display: grid; gap: 22px; }
.eta { font-size: 15px; color: var(--text-2); }

/* waitlist form */
.wl { display: grid; gap: 10px; max-width: 460px; }
.wl-row { display: grid; gap: 10px; }
.wl input[type="email"] {
  height: 52px; width: 100%; border-radius: 14px; border: 1px solid var(--hairline);
  background: var(--surface); color: var(--text); font: inherit; padding: 0 16px;
}
.wl input[type="email"]:focus-visible, .btn:focus-visible, .lang a:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px;
}
.btn {
  height: 52px; border: 0; border-radius: 14px; background: var(--accent); color: var(--midnight);
  font: 600 17px var(--font); padding: 0 22px; cursor: pointer; width: 100%;
}
.btn:active { opacity: 0.82; }
.btn[disabled] { opacity: 0.6; cursor: default; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.msg { font-size: 15px; min-height: 1.4em; color: var(--text-2); }
.msg.ok { color: #3f6b4d; }
.msg.err { color: #9a4a3a; }
@media (prefers-color-scheme: dark) { .msg.ok { color: var(--accent-2); } .msg.err { color: #e0a090; } }
.wl.done .wl-row { display: none; }

/* screenshots */
.shot { border-radius: 26px; overflow: hidden; background: var(--bg); box-shadow: var(--shadow), 0 0 0 1px var(--hairline); }
.shot img { width: 100%; }
.stage { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1 / 1.08; justify-self: center; }
.stage .shot { position: absolute; width: 56%; }
.stage .back { right: 0; top: 0; }
.stage .front { left: 0; top: 56px; z-index: 2; }

/* feature blocks */
.feature { display: grid; gap: 28px; padding-block: 40px; align-items: center; }
.feature .copy { display: grid; gap: 14px; max-width: 30em; }
.feature .copy p { color: var(--text-2); }
.feature .holder { position: relative; max-width: 460px; width: 100%; }
.feature.wide .holder { max-width: 420px; }
.feature .shot { position: relative; z-index: 1; }

/* calm line + video + about + bottom CTA */
.calm { text-align: center; padding-block: 40px 24px; color: var(--text-2); font-size: 19px; }
.video { padding-block: 40px; display: grid; gap: 16px; justify-items: center; text-align: center; }
.video .frame { width: 100%; max-width: 860px; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); box-shadow: 0 0 0 1px var(--hairline); }
.video iframe { width: 100%; height: 100%; border: 0; }
.about { padding-block: 56px; display: grid; gap: 14px; max-width: 36em; }
.about p { color: var(--text-2); }
.cta { display: grid; gap: 18px; justify-items: start; padding-top: 24px; padding-bottom: 24px; }
.cta p { color: var(--text-2); }

/* footer */
footer { border-top: 1px solid var(--hairline); padding-block: 28px 56px; display: grid; gap: 10px; }
footer p { color: var(--text-2); font-size: 14px; max-width: 46em; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--text-2); }

/* message pages (confirmed, unsubscribed, check email) */
.note { padding-block: 72px; display: grid; gap: 18px; max-width: 34em; }
.note p { color: var(--text-2); }
.note .btn { width: auto; display: inline-flex; align-items: center; text-decoration: none; }

@media (min-width: 640px) {
  .wl-row { grid-template-columns: 1fr auto; }
  .btn { width: auto; }
}
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.05fr 0.95fr; padding-block: 40px 96px; gap: 64px; }
  .feature { grid-template-columns: 1fr 1fr; gap: 72px; padding-block: 64px; }
  .feature.flip .copy { order: 2; }
  .feature.flip .holder { justify-self: start; }
  .feature .holder { justify-self: end; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- curves and colour ---------------------------------------------------------------- */
.hero-wrap { position: relative; overflow: hidden; }
.hero-wrap .hero { position: relative; z-index: 1; padding-bottom: 120px; }
.blob { position: absolute; z-index: 0; pointer-events: none; }
.blob-a { width: min(620px, 90vw); aspect-ratio: 1.1 / 1; right: -8%; top: 4%; background: var(--t-sage);
  border-radius: 58% 42% 47% 53% / 46% 56% 44% 54%; transform: rotate(-8deg); }
.blob-b { width: min(300px, 55vw); aspect-ratio: 1; left: -6%; bottom: 8%; background: var(--t-blue);
  border-radius: 46% 54% 38% 62% / 55% 40% 60% 45%; transform: rotate(14deg); }

.stage .back { transform: rotate(4deg); }
.stage .front { transform: rotate(-3deg); }

/* the chart motif: three smooth curves with dotted points, drifting slowly */
.lines { position: absolute; left: 0; right: 0; bottom: 0; height: 110px; overflow: hidden; pointer-events: none; z-index: 0; }
.lines svg { display: block; width: 200%; height: 100%; animation: drift 70s linear infinite; }
.lines path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.lines .line { stroke-width: 2.5; opacity: 0.55; }
.lines .dots { stroke-width: 6; stroke-dasharray: 0 20; opacity: 0.8; }
.l1 { stroke: #7aa687; } .l2 { stroke: #739fa3; } .l3 { stroke: #6b99bf; }
.lines-calm { position: relative; height: 96px; }
.lines-calm svg { animation-duration: 90s; }
@keyframes drift { to { transform: translateX(-50%); } }

/* colour bands: each feature takes one of the app's chart colours; edges are cut by waves */
.band { position: relative; background: var(--band); padding-block: 64px; overflow-x: clip; }
.band + .band { margin-top: -1px; }
.band .wave { position: absolute; left: 0; width: 100%; height: 56px; display: block; fill: var(--bg); pointer-events: none; z-index: 0; }
.band .wave-top { top: -1px; }
.band .wave-bot { bottom: -1px; transform: scaleY(-1); }
.band > .wrap { position: relative; z-index: 1; }
.band .feature { padding-block: 24px; }
.band-sage { --band: var(--t-sage); --dot: #7aa687; }
.band-blue { --band: var(--t-blue); --dot: #6b99bf; }
.band-gold { --band: var(--t-gold); --dot: #c2ae79; }
.band-cta { --band: var(--t-cta); margin-top: 24px; }

/* soft organic shape behind each screenshot */
.holder::before { content: ""; position: absolute; inset: -5% -9% -4% -7%; z-index: 0; background: var(--band); filter: saturate(1.2);
  border-radius: 46% 54% 52% 48% / 38% 44% 56% 62%; transform: rotate(-5deg); }
.band-blue .holder::before { border-radius: 54% 46% 40% 60% / 50% 36% 64% 50%; transform: rotate(4deg); }
.band-gold .holder::before { border-radius: 42% 58% 55% 45% / 44% 52% 48% 56%; transform: rotate(-3deg); }

/* section labels as small tinted pills with the series colour */
.label { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 5px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent); }
.label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--accent)); }

.calm-wrap { position: relative; padding-bottom: 24px; overflow-x: clip; }
.calm { padding-top: 24px; }

@media (prefers-reduced-motion: reduce) { .lines svg { animation: none; } }
@media (max-width: 899px) {
  .hero-wrap .hero { padding-bottom: 96px; }
  .band { padding-block: 48px; }
  .stage .back { transform: rotate(3deg); }
  .stage .front { transform: rotate(-2deg); }
}
