:root {
  --ink: #0f1b2d;
  --muted: #6b7280;
  --line: #e7ebf0;
  --blue: #2f6fed;
  --max: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  line-height: 1.45;
}

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

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

.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
}

.viewport {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(640px 380px at 8% -5%, rgba(255, 255, 255, 0.28), transparent 55%),
    linear-gradient(118deg, #1a9fff 0%, #4a6ff0 48%, #7a48f0 100%);
  color: #fff;
  overflow: hidden;
}

.hero {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) minmax(16rem, 1fr);
  gap: 1rem 2.5rem;
  align-items: center;
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 0 5.5rem 0 0.5rem;
}

.copy {
  padding-bottom: 0;
  padding-left: 2.5rem;
  padding-top: 1.75rem;
  z-index: 2;
}

.wordmark {
  margin: 0 0 0.85rem;
}

.wordmark img {
  width: 248px;
  height: auto;
}

.wordmark a {
  color: inherit;
  text-decoration: none;
}

.copy-align {
  padding-left: 62px;
}

.lead {
  margin: 0 0 1rem;
  font-size: 1.45rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.94);
}

.store-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.store-badge {
  display: inline-block;
  line-height: 0;
  opacity: 0.42;
  filter: grayscale(0.15);
  pointer-events: none;
  user-select: none;
}

.store-badge img {
  height: 44px;
  width: auto;
}

/* Overlapping phones — habitdaily-style cluster */
.phones {
  position: relative;
  height: min(620px, calc(100dvh - 6.5rem));
  width: 100%;
  max-width: 480px;
  justify-self: center;
  margin: 0 2.5rem 0 auto;
}

.phone {
  position: absolute;
  width: 260px;
  filter: drop-shadow(0 22px 40px rgba(12, 20, 55, 0.38));
}

.phone-frame {
  border-radius: 32px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.phone-frame img {
  width: 100%;
  border-radius: 24px;
  background: #111;
}

.phone-back {
  left: 0;
  top: 50%;
  bottom: auto;
  width: 236px;
  transform: translateY(calc(-50% - 1.6rem)) rotate(-11deg);
  opacity: 0.96;
  z-index: 1;
}

.phone-back .phone-frame {
  background: rgba(20, 20, 30, 0.35);
  border-color: rgba(255, 255, 255, 0.22);
}

.phone-front {
  right: 0.5rem;
  top: 50%;
  bottom: auto;
  width: 272px;
  z-index: 3;
  transform: translateY(-50%) rotate(2.5deg);
}

.footer-shell {
  position: relative;
  flex: 0 0 auto;
  background: #fff;
  z-index: 4;
  /* Kill any hairline seam above the footer */
  box-shadow: 0 -3px 0 #fff;
}

.wave {
  position: absolute;
  left: 0;
  right: 0;
  /* Overlap into the white footer so no gap/line shows */
  bottom: calc(100% - 4px);
  display: block;
  width: 100%;
  height: 56px;
  pointer-events: none;
  z-index: 1;
}

.foot {
  background: #fff;
  color: var(--muted);
  font-size: 0.84rem;
  padding: 0.15rem 0 0.35rem;
  position: relative;
  z-index: 2;
  border: 0;
  box-shadow: none;
  outline: none;
}

.footer-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.footer-meta {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1.15rem;
  row-gap: 0.15rem;
  min-width: 0;
}

.foot .copy-right {
  margin: 0 0 0 auto;
  opacity: 0.55;
}

.footer-links {
  display: flex;
  gap: 1.15rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-home {
  display: flex;
  flex-shrink: 0;
  line-height: 0;
}

.footer-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
}

/* Legal pages */
.legal-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.legal-page .hero {
  overflow: visible;
  padding: 0 5.5rem 0 0.5rem;
}

.legal-page .copy {
  color: var(--ink);
  padding: 1.75rem 0 0 2.5rem;
}

.legal-page .wordmark img {
  width: 248px;
  height: auto;
}

.go-back {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.85rem;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
}

.go-back:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.legal-body {
  max-width: 32rem;
  padding: 0.25rem 1rem 1rem 0;
}

.legal-body h1 {
  margin: 0 0 0.85rem;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.legal-body p,
.legal-body li {
  color: #334155;
}

.legal-body p + p {
  margin-top: 0.85rem;
}

.legal-body .muted {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.legal-footer {
  flex: 0 0 auto;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 0.85rem 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  background: #fff;
}

.legal-footer .copy-right {
  margin: 0 0 0 auto;
  opacity: 0.55;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    justify-items: stretch;
    align-content: center;
    align-items: start;
    padding: 0.5rem 1.15rem 0;
    gap: 0.75rem;
  }

  .copy {
    padding-bottom: 0.25rem;
    padding-top: 0.5rem;
    padding-left: 0;
    text-align: left;
    justify-self: start;
    width: max-content;
    max-width: 100%;
    margin: 0;
  }

  .copy-align {
    padding-left: 62px;
  }

  .wordmark img {
    margin: 0;
  }

  .store-row {
    justify-content: flex-start;
  }

  .store-badge img {
    height: 54px;
  }

  .phones {
    height: min(460px, 56vh);
    max-width: 360px;
    margin: 0 auto;
    justify-self: center;
  }

  .phone-back {
    width: 188px;
    left: 0;
    top: auto;
    bottom: 1.5rem;
    transform: rotate(-11deg) translate(-0.2rem, -0.8rem);
  }

  .phone-front {
    width: 214px;
    right: 0;
    top: auto;
    bottom: 0;
    transform: rotate(2.5deg);
  }

  .wave {
    height: 44px;
    bottom: calc(100% - 4px);
  }

  .foot {
    padding: 0.25rem 0 0.4rem;
  }

  .legal-footer {
    border-top: none;
  }

  .legal-page .hero {
    grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
    justify-items: stretch;
    align-items: start;
    align-content: start;
    padding: 0.5rem 1.15rem 0;
    gap: 0.75rem;
  }

  .legal-page .copy {
    padding: 2.75rem 0 0.25rem;
    width: auto;
    max-width: none;
    justify-self: start;
  }

  .legal-body {
    max-width: 32rem;
    padding: 0.25rem 0 1rem;
  }
}

@media (max-width: 640px) {
  .legal-page .hero {
    grid-template-columns: 1fr;
    align-items: start;
    align-content: start;
    padding: 0.5rem 1.15rem 0;
  }

  .legal-page .copy {
    padding: 2.75rem 0 0.25rem;
  }
}
@media (max-width: 520px) {
  .footer-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.12rem;
  }

  .foot .copy-right,
  .legal-footer .copy-right {
    margin: 0;
  }
}
