/* Glow Up — the identity from the icon (direction A, the identity boards):
   aubergine and paper grounds, headlines in two lines with the second in the
   accent, SF for headlines and text as on Apple's pages, Funnel Display for
   the wordmark only, and the brand device: two photos, the later one raised
   and lit. The glow is light only, never inside letters. */

@font-face {
  font-family: "Funnel Display";
  src: url("fonts/FunnelDisplay-VF.ttf") format("truetype");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --aubergine: #1F0E25;
  --plum: #34183A;
  --then: #7E6680;
  --coral: #FF9A8C;
  --apricot: #FFC07A;
  --gold: #FFF1A6;
  --ember: #D9573E;
  --paper: #FBF5F0;
  --ink: #1A1420;
  --ink-2: #625A68;
  --mist: #B8ADBC;

  /* Light: paper. Ember is for large text only; small accent text takes --link (5.6:1). */
  --bg: var(--paper);
  --bg-2: #F3EAE3;
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --accent: var(--ember);
  --link: #A8402B;
  --line: rgba(26, 20, 32, .12);
  --nav: rgba(251, 245, 240, .78);
  --pill-bg: var(--ink);
  --pill-fg: #fff;
  --field: #fff;
  --halo: rgba(255, 150, 100, .38);
  --ring: rgba(217, 87, 62, .28);
  --error: #B3261E;

  --brand: "Funnel Display", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", Roboto, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --gutter: 20px;
  color-scheme: light dark;
}

/* Dark: aubergine, apricot accent. Also the always-dark band (.dark). */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--aubergine);
    --bg-2: var(--plum);
    --fg: #fff;
    --fg-2: var(--mist);
    --accent: var(--apricot);
    --link: var(--apricot);
    --line: rgba(255, 255, 255, .13);
    --nav: rgba(31, 14, 37, .74);
    --pill-bg: var(--apricot);
    --pill-fg: var(--ink);
    --field: rgba(255, 255, 255, .06);
    --halo: rgba(255, 160, 100, .45);
    --ring: rgba(255, 210, 150, .55);
    --error: #FF9A8C;
  }
}
.dark {
  --bg: var(--aubergine);
  --bg-2: var(--plum);
  --fg: #fff;
  --fg-2: var(--mist);
  --accent: var(--apricot);
  --link: var(--apricot);
  --line: rgba(255, 255, 255, .13);
  --halo: rgba(255, 160, 100, .45);
  --ring: rgba(255, 210, 150, .55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }
section[id] { scroll-margin-top: 52px; }

/* The wordmark: lowercase, "up" raised like the later photo in the icon. */
.wm { font: 600 1em/1 var(--brand); letter-spacing: -0.035em; white-space: nowrap; color: var(--fg); }
.wm .up { display: inline-block; transform: translateY(-0.16em); color: var(--accent); }
.app-icon { border-radius: 22.5%; }

/* Navigation: thin, sticky, translucent. */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--nav);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  max-width: 1080px; margin: 0 auto; height: 52px; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 22px; margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { color: var(--fg-2); font-size: 14px; }
.nav-links a:hover { color: var(--fg); text-decoration: none; }
.pill {
  display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 999px;
  background: var(--pill-bg); color: var(--pill-fg); font: 600 13px/1 var(--text);
}
.pill:hover { text-decoration: none; filter: brightness(1.08); }
@media (max-width: 640px) { .nav-links { display: none; } }

/* Sections: one idea, one picture, a lot of air. */
.section { padding: clamp(96px, 13vw, 168px) var(--gutter); text-align: center; overflow: clip; }
.inner { max-width: 1080px; margin: 0 auto; }
.headline {
  margin: 0; font: 700 clamp(44px, 7vw, 84px)/1.03 var(--display); letter-spacing: -0.022em; color: var(--fg);
  text-wrap: balance;
}
.headline em, .tile h3 em { font-style: normal; color: var(--accent); }
.hero .headline { font-size: clamp(52px, 10vw, 120px); line-height: 1; }
.sub {
  max-width: 640px; margin: 24px auto 0; font-size: clamp(19px, 2.2vw, 24px); line-height: 1.4; color: var(--fg-2);
  text-wrap: pretty;
}
.fine { max-width: 560px; margin: 28px auto 0; font-size: 14px; line-height: 1.5; color: var(--fg-2); }

/* Hero */
.hero { padding-top: clamp(56px, 9vw, 104px); padding-bottom: clamp(88px, 11vw, 140px); }
.hero .sub { text-wrap: balance; }
.hero .app-icon { width: 88px; height: 88px; margin: 0 auto 28px; box-shadow: 0 12px 40px rgba(31, 14, 37, .22); }
.cta { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 36px; }
.badge img { height: 52px; width: auto; }
.cta .note { font-size: 15px; color: var(--fg-2); }

/* The brand device: two photos side by side, the later raised and lit. */
.pair { position: relative; isolation: isolate; display: flex; justify-content: center; align-items: flex-end; gap: clamp(10px, 2vw, 20px); }
.pair figure { margin: 0; flex: 0 1 auto; }
.pair img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: clamp(14px, 2vw, 24px); }
.pair figcaption { margin-top: 12px; font: 500 15px/1 var(--text); color: var(--fg-2); text-align: left; }
.pair .then img { filter: saturate(.55) brightness(.86); }
.pair .now { transform: translateY(-9%); }
.pair .now img { box-shadow: 0 0 0 1.5px var(--ring), 0 0 80px var(--halo); }
.pair .now figcaption { color: var(--link); }
/* The light behind the later photo: the glow, never in letters. */
.pair::before {
  content: ""; position: absolute; z-index: -1; width: 70%; aspect-ratio: 1; right: -8%; top: -18%;
  background: radial-gradient(closest-side, rgba(255, 192, 122, .38), rgba(255, 154, 140, .14), transparent);
  pointer-events: none;
}
.hero .pair { width: fit-content; margin: clamp(72px, 9vw, 112px) auto 0; }
.hero .pair figure { width: min(320px, 42vw); }
.pair-note { margin: 22px 0 0; font-size: 14px; color: var(--fg-2); }

@media (prefers-reduced-motion: no-preference) {
  .hero .pair .now { animation: rise 1.6s cubic-bezier(.2, .7, .2, 1) .35s both; }
  .hero .pair .now img { animation: light 1.6s ease .35s both; }
  .hero .pair::before { animation: dawn 2s ease .35s both; }
}
@keyframes rise { from { transform: none; } to { transform: translateY(-9%); } }
@keyframes light { from { box-shadow: 0 0 0 1.5px transparent, 0 0 80px transparent; } }
@keyframes dawn { from { opacity: 0; } }

/* Camera: an always-dark band, the phone rising out of its lower edge. */
.band { background: var(--bg); color: var(--fg); padding-bottom: 0; position: relative; }
.band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 78%, rgba(255, 170, 120, .16), transparent 70%),
              radial-gradient(55% 40% at 80% 42%, rgba(74, 33, 64, .85), transparent 75%);
}
.band > * { position: relative; }

/* The phone: a real frame (tools/phone-frame.swift) over the screen. Offsets are
   fractions of the width, so a shorter --cut only crops the phone's lower part. */
.phone { position: relative; width: min(380px, 80vw); aspect-ratio: var(--cut, 924 / 1484); margin: clamp(56px, 7vw, 80px) auto 0; overflow: hidden; }
.phone .screen { position: absolute; top: 0; left: 7.5%; width: 85%; height: auto; margin-top: 4.7%; border-radius: 5.4% / 2.9%; }
.phone .frame { position: absolute; top: 0; left: 0; width: 100%; height: auto; pointer-events: none; }

/* Short facts under a big picture. */
.facts {
  list-style: none; margin: 0 auto; padding: 0; max-width: 1080px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 48px; text-align: left;
}
.facts h3 { margin: 0 0 8px; font: 600 21px/1.2 var(--display); letter-spacing: -0.01em; color: var(--fg); }
.facts p { margin: 0; color: var(--fg-2); }
.facts-strip { padding-top: clamp(72px, 9vw, 112px); padding-bottom: 0; }
@media (max-width: 820px) { .facts { grid-template-columns: 1fr; gap: 28px; max-width: 520px; } }

/* Compare: a before/after slider that works like the app's. */
.compare {
  --pos: 50%;
  position: relative; width: min(560px, 100%); aspect-ratio: 3 / 4; margin: clamp(56px, 7vw, 80px) auto 0;
  border-radius: clamp(20px, 3vw, 32px); overflow: hidden; touch-action: pan-y; cursor: ew-resize;
  user-select: none; -webkit-user-select: none; background: var(--bg-2);
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare .divider { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.compare .knob {
  position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: #fff; box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
  display: grid; place-items: center; color: var(--ink);
}
.compare .knob svg { width: 22px; height: 22px; }
.compare input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.compare input:focus-visible ~ .divider .knob { outline: 3px solid var(--link); outline-offset: 3px; }
.compare .date {
  position: absolute; bottom: 16px; padding: 7px 12px; border-radius: 999px; pointer-events: none;
  font: 600 13px/1 var(--text); color: #fff; background: rgba(20, 12, 24, .48);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.compare .d-then { left: 16px; }
.compare .d-now { right: 16px; }

/* Two tiles: a headline each and a phone rising from the tile's edge. */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 1080px; margin: clamp(80px, 10vw, 120px) auto 0; }
.tile {
  background: var(--bg-2); border-radius: 32px; overflow: hidden; text-align: left;
  padding: clamp(32px, 4vw, 48px) clamp(28px, 4vw, 48px) 0; display: flex; flex-direction: column;
}
.tile h3 { margin: 0; font: 700 clamp(30px, 3.4vw, 40px)/1.06 var(--display); letter-spacing: -0.018em; color: var(--fg); }
.tile p { margin: 14px 0 40px; color: var(--fg-2); max-width: 400px; }
.tile .phone { --cut: 924 / 1120; width: min(300px, 78%); margin: auto auto 0; }
@media (max-width: 820px) { .tiles { grid-template-columns: 1fr; max-width: 520px; } }

/* What people track: the brand device, small, per tracker. */
.gallery { list-style: none; padding: 0; margin: clamp(56px, 7vw, 80px) auto 0; max-width: 1080px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--bg-2); border-radius: 28px; padding: 44px 24px 24px; text-align: left; }
.card .pair { gap: 8px; }
.card .pair figure { width: 44%; }
.card .pair img { border-radius: 14px; }
.card .pair .now img { box-shadow: 0 0 0 1px var(--ring), 0 0 36px var(--halo); }
.card .pair::before { width: 60%; right: 0; top: -20%; }
.card h3 { margin: 20px 0 4px; font: 600 21px/1.2 var(--display); letter-spacing: -0.01em; color: var(--fg); }
.card p { margin: 0; font-size: 15px; color: var(--fg-2); }
@media (max-width: 900px) { .gallery { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .gallery {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-inline: calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .gallery::-webkit-scrollbar { display: none; }
  .card { scroll-snap-align: start; }
}

/* Privacy */
.privacy .facts { margin-top: clamp(56px, 7vw, 88px); }
.privacy .facts li { border-top: 1px solid var(--line); padding-top: 22px; }
.more { display: inline-block; margin-top: 48px; font-size: 17px; }

/* Free and Pro */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 860px; margin: clamp(56px, 7vw, 80px) auto 0; text-align: left; }
.plan { background: var(--bg-2); border-radius: 28px; padding: 36px 32px; }
.plan h3 { margin: 0 0 10px; font: 700 26px/1.1 var(--display); letter-spacing: -0.012em; color: var(--fg); }
.plan p { margin: 0; color: var(--fg-2); }
.plan.pro { box-shadow: inset 0 0 0 1.5px var(--ring), 0 18px 50px -24px var(--halo); }
.pro-cta { margin-top: 48px; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; max-width: 520px; } }

/* Contact */
.form { max-width: 640px; margin: clamp(48px, 6vw, 64px) auto 0; display: grid; gap: 16px; text-align: left; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { display: grid; gap: 8px; font-size: 14px; color: var(--fg-2); }
.form label small { font-size: 14px; }
.form input, .form select, .form textarea {
  width: 100%; font: 400 17px/1.4 var(--text); color: var(--fg); background: var(--field);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; appearance: none;
}
.form select {
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-2) 50%), linear-gradient(135deg, var(--fg-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px;
}
.form textarea { resize: vertical; min-height: 150px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--link); outline-offset: 0; border-color: transparent; }
.form .trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--pill-bg); color: var(--pill-fg); font: 600 17px/1 var(--text); cursor: pointer;
}
.button:hover { text-decoration: none; filter: brightness(1.08); }
.button:disabled { opacity: .5; cursor: progress; }
.form-status { font-size: 15px; color: var(--fg-2); }
.form-status[data-kind="ok"] { color: var(--link); }
.form-status[data-kind="error"] { color: var(--error); }
@media (max-width: 600px) { .form .row { grid-template-columns: 1fr; } }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 28px var(--gutter) 40px; font-size: 13px; color: var(--fg-2); }
.foot .inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot nav a { color: var(--fg-2); }
.foot nav a:hover { color: var(--fg); }
.foot .legal { flex-basis: 100%; margin: 4px 0 0; line-height: 1.5; }

/* Documents: privacy, terms, support. */
.doc { max-width: 720px; margin: 0 auto; padding: clamp(56px, 8vw, 96px) var(--gutter) 96px; }
.doc h1 { margin: 0 0 12px; font: 700 clamp(40px, 6vw, 60px)/1.05 var(--display); letter-spacing: -0.02em; }
.doc h2 { margin: 44px 0 8px; font: 600 22px/1.25 var(--display); letter-spacing: -0.01em; }
.doc p { margin: 0 0 14px; color: var(--fg-2); }
.doc p.lead { font-size: 20px; color: var(--fg); }
.doc .muted { font-size: 15px; }
.doc .button { margin-top: 8px; }

/* Appear on scroll, once. Without JS or with reduced motion, everything is simply there. */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
