/*
 * HeartGlance marketing site.
 *
 * The palette and type scale are the app's, transcribed from spec/tokens.json, so the site and the
 * product look like the same thing. Atkinson Hyperlegible is the app's family; the "Next" cut used
 * in the apps is not on Google Fonts, and the original is close enough that nobody moving between
 * them will notice a different voice.
 *
 * No JavaScript anywhere, which is why nothing here depends on a scroll listener or a class
 * toggled at runtime.
 */

:root {
  --bg: #ffffff;
  --bg2: #fff6f7;
  --ink: #1c1417;
  --ink2: #6b585e;
  --ink3: #9a868c;
  --line: #efdce0;
  --red: #d7263d;
  --red2: #b01e31;
  --pink: #fbe3e7;
  --pink2: #fdf1f3;
  --pink3: #f0a9b5;

  /* One step darker than the app's ink, for the sections that carry white text. */
  --night: #150e10;

  --r-lg: 28px;
  --r-md: 20px;
  --r-pill: 999px;
  --page: 1180px;

  --shadow-card: 0 2px 4px rgba(28, 20, 23, 0.04), 0 12px 32px rgba(28, 20, 23, 0.07);
  --shadow-phone: 0 8px 20px rgba(28, 20, 23, 0.14), 0 40px 90px rgba(28, 20, 23, 0.24);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--red2); }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------------- type */

h1, h2, h3 { margin: 0; text-wrap: balance; }

h1 {
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(30px, 3.8vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.028em;
}

h3 {
  font-size: clamp(23px, 2.5vw, 31px);
  line-height: 1.14;
  letter-spacing: -0.022em;
}

.lede {
  font-size: clamp(18px, 1.5vw, 21px);
  color: var(--ink2);
  margin: 20px 0 0;
  max-width: 34em;
  text-wrap: pretty;
}

/* ---------------------------------------------------------------- navigation */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 70px;
}

.mark {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 24px;
  margin-left: auto;
  align-items: center;
}

/* :not(.btn), because `.nav-links a` outranks `.btn` and would paint the call to action's label
   in body grey on a red pill. */
.nav-links a:not(.btn) {
  color: var(--ink2);
  text-decoration: none;
  font-size: 15px;
}

.nav-links a:not(.btn):hover { color: var(--ink); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 54px;
  padding: 0 28px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 16.5px;
  text-decoration: none;
  cursor: pointer;
  /* A pill has a fixed height, so a label that wraps spills straight out of it. */
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(176, 30, 49, 0.3), 0 10px 24px rgba(215, 38, 61, 0.26);
  transition: transform 130ms ease, background 130ms ease, box-shadow 130ms ease;
}

.btn:hover {
  background: var(--red2);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(176, 30, 49, 0.3), 0 16px 32px rgba(215, 38, 61, 0.3);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  box-shadow: none;
}

.btn.ghost:hover { background: var(--pink2); transform: none; box-shadow: none; }

.btn.small { height: 44px; padding: 0 20px; font-size: 15px; }

.on-night .btn.ghost {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.on-night .btn.ghost:hover { background: rgba(255, 255, 255, 0.09); }

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  background: var(--night);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

/* A slow red bloom behind the phone. One gradient, no image to download. */
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -12% auto auto;
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(215, 38, 61, 0.5), transparent 62%);
  z-index: -1;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto auto -40% -18%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(176, 30, 49, 0.3), transparent 65%);
  z-index: -1;
  pointer-events: none;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  padding-top: 96px;
  padding-bottom: 96px;
}

.hero h1 { color: #fff; }
.hero .lede { color: rgba(255, 255, 255, 0.74); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 34px;
}

.cta-note {
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 16px;
}

.hero-points {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
}

.hero-points svg { flex: none; }

/* ---------------------------------------------------------------- phone frame */

.phone {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 46px;
  padding: 9px;
  background: linear-gradient(160deg, #2c2226, #0d0709 60%);
  box-shadow: var(--shadow-phone);
}

.phone img {
  border-radius: 38px;
  width: 100%;
}

.phone.lift { transform: rotate(-1.4deg); }
.phone.sink { transform: translateY(16px) rotate(1.4deg); }

/* The two hero phones are rotated, so the pair needs a little room either side or the tilt
   clips against the section that hides its overflow. */
.phone-pair {
  padding: 0 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
  width: 100%;
}

.phone-pair .phone { max-width: 100%; border-radius: 34px; padding: 7px; }
.phone-pair .phone img { border-radius: 28px; }

/* ---------------------------------------------------------------- sections */

section { padding: 104px 0; }

section.tint { background: var(--bg2); border-block: 1px solid var(--line); }

.section-head { max-width: 40em; }

/* ---------------------------------------------------------------- steps */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 52px;
  counter-reset: step;
}

.step {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px 28px;
  box-shadow: var(--shadow-card);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 18px;
}

.step h3 { font-size: 21px; letter-spacing: -0.01em; }
.step p { margin: 8px 0 0; color: var(--ink2); font-size: 15.5px; }

/* ---------------------------------------------------------------- features */

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}

.feature + .feature { margin-top: 120px; }

.feature.flip .feature-art { order: -1; }

.feature p { color: var(--ink2); margin: 18px 0 0; font-size: 17.5px; text-wrap: pretty; }

.feature ul { margin: 22px 0 0; padding: 0; list-style: none; }

.feature li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 11px;
  color: var(--ink2);
  font-size: 16.5px;
}

.feature li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--pink);
}

.feature li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 13px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

.feature-art { display: flex; justify-content: center; }

.caption {
  margin-top: 26px;
  font-size: 14px;
  color: var(--ink3);
}

/* ---------------------------------------------------------------- gallery */

.gallery {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 48px 24px 20px;
  scroll-snap-type: x mandatory;
}

.gallery .phone {
  flex: 0 0 250px;
  max-width: 250px;
  scroll-snap-align: center;
  border-radius: 34px;
  padding: 7px;
  transform: none;
}

.gallery .phone img { border-radius: 28px; }

/* ---------------------------------------------------------------- night band */

.band {
  background: var(--night);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 60px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 52px;
  align-items: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.band::before {
  content: "";
  position: absolute;
  inset: -50% -20% auto auto;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(215, 38, 61, 0.38), transparent 64%);
  z-index: -1;
}

.band h2 { color: #fff; }
.band p { color: rgba(255, 255, 255, 0.72); margin: 18px 0 0; font-size: 17.5px; }

.band ul { list-style: none; margin: 0; padding: 0; }

.band li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 16px;
  color: rgba(255, 255, 255, 0.88);
}

.band li:last-child { border-bottom: 0; }
.band li svg { flex: none; margin-top: 4px; }

/* ---------------------------------------------------------------- pricing */

.plans {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 48px;
}

.plan {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 26px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.plan.best {
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--pink), var(--shadow-card);
}

.plan .name { font-weight: 700; font-size: 17px; }
.plan .price { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin-top: 10px; }
.plan .per { color: var(--ink2); font-size: 14.5px; }
.plan .note { color: var(--ink2); font-size: 14.5px; margin-top: 14px; }

.plan .best-tag {
  align-self: flex-start;
  margin-bottom: 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #fff;
  background: var(--red);
  border-radius: var(--r-pill);
  padding: 4px 12px;
}

.compare {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.compare > div {
  border-radius: var(--r-md);
  padding: 26px 28px;
  font-size: 15.5px;
  color: var(--ink2);
}

.compare .free { background: var(--bg); border: 1px solid var(--line); }
.compare .paid { background: var(--night); color: rgba(255, 255, 255, 0.78); }

.compare h4 {
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.compare .paid h4 { color: #fff; }

/* ---------------------------------------------------------------- disclaimer */

.disclaimer {
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: var(--r-md);
  background: var(--pink2);
  padding: 24px 26px;
  color: var(--ink2);
  font-size: 15.5px;
  text-align: left;
}

.disclaimer strong { color: var(--ink); }

/* ---------------------------------------------------------------- footer */

footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 68px;
  color: var(--ink2);
  font-size: 15px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
}

footer h4 {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink3);
  margin: 0 0 14px;
}

footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 10px; }
footer a { color: var(--ink2); text-decoration: none; }
footer a:hover { color: var(--red2); }

.foot-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--ink3);
}

/* ---------------------------------------------------------------- legal pages */

.legal { padding: 72px 0 100px; }

.legal .wrap { max-width: 760px; }

.legal h1 { font-size: clamp(34px, 4.2vw, 48px); }

.legal .updated { color: var(--ink3); font-size: 15px; margin-top: 12px; }

.legal h2 { font-size: 26px; margin-top: 48px; }

.legal h3 { font-size: 19px; margin-top: 30px; margin-bottom: 0; }

.legal p, .legal li { color: var(--ink2); }

.legal ul { padding-left: 22px; }

.legal li { margin-bottom: 9px; }

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 15px;
}

.legal th, .legal td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.legal th { color: var(--ink); font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; }
.legal td { color: var(--ink2); }

.faq {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 4px 22px;
  margin-top: 14px;
  background: var(--bg);
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 18px 0;
  color: var(--ink);
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
  content: "+";
  color: var(--red);
  font-weight: 700;
  margin-right: 12px;
}

.faq[open] summary::before { content: "–"; }

.faq p { margin-top: 0; padding-bottom: 16px; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 64px; padding-bottom: 64px; }
  .steps { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; gap: 34px; }
  .feature + .feature { margin-top: 76px; }
  .feature.flip .feature-art { order: 0; }
  .band { grid-template-columns: 1fr; padding: 38px; }
  .plans { grid-template-columns: repeat(2, 1fr); }
  .compare { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  /* The brand block is wider than a link column, so at two columns it takes the row rather than
     leaving a hole beside Product. */
  .foot-grid > div:first-child { grid-column: 1 / -1; }
  section { padding: 72px 0; }
  .phone.lift, .phone.sink { transform: none; }
}

@media (max-width: 620px) {
  /* At this width the mark and one pill are all that fits. The same links are in the footer, and
     the page's own sections carry their own calls to action. */
  .nav-links a:not(.btn) { display: none; }
  .plans { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .band { padding: 28px 24px; }
  .cta-row .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
  .phone.lift, .phone.sink { transform: none; }
}
