:root {
  --bg: #f3f3f4;
  --ink: #1d1d1f;
  --muted: #86868b;
  --hero-font: ui-serif, "New York", "Times New Roman", Georgia, serif;
  --body-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;

  /* Phone screen inset (from iPhone 17 Pro.svg path id="Screen": 72/1680, 60/3556 of 1752x3616) */
  --screen-inset-x: 4.11%;
  --screen-inset-y: 1.66%;
  --screen-radius: 11.5%;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(32px, 6vw, 64px) 24px 24px;
  gap: clamp(20px, 3.5vw, 36px);
}

.hero {
  text-align: center;
  max-width: 720px;
}

.hero h1 {
  margin: 0;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 3.1rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 400;
  font-size: 1.1rem;
}

.device {
  display: flex;
  justify-content: center;
  width: 100%;
}

.phone {
  display: block;
  aspect-ratio: 1794.58 / 3673.11;
  height: min(78svh, 820px);
  width: auto;
  max-width: 100%;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  filter:
    drop-shadow(0 10px 14px rgba(0, 0, 0, 0.14))
    drop-shadow(0 26px 28px rgba(0, 0, 0, 0.07));
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.phone.is-shaking {
  animation: phone-shake 800ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes phone-shake {
  10%, 90% { transform: translate3d(-1px, 0, 0) rotate(-0.25deg); }
  20%, 80% { transform: translate3d(1.5px, 0, 0) rotate(0.4deg); }
  30%, 50%, 70% { transform: translate3d(-2.5px, 0, 0) rotate(-0.55deg); }
  40%, 60% { transform: translate3d(2.5px, 0, 0) rotate(0.55deg); }
}

@media (prefers-reduced-motion: reduce) {
  .phone.is-shaking { animation: none; }
}

.phone #screen-images > g {
  opacity: 0;
  transition: opacity 800ms ease;
}

.phone #screen-images > g.is-active {
  opacity: 1;
}

.cta {
  display: flex;
  justify-content: center;
}

.reviews {
  width: 100%;
  max-width: 640px;
  margin: clamp(32px, 6vw, 64px) auto 0;
  padding: 0 16px;
}

.reviews__list {
  display: grid;
  grid-template-areas: "stack";
  list-style: none;
  margin: 0;
  padding: 0;
}

.review {
  grid-area: stack;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 8px 12px;
  opacity: 0;
  transition: opacity 600ms ease;
  pointer-events: none;
}

.review.is-active {
  opacity: 1;
  pointer-events: auto;
}

.review__stars {
  color: #ffb800;
  letter-spacing: 3px;
  font-size: 1rem;
  line-height: 1;
}

.review__title {
  margin: 0;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.review__content {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 540px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-bottom: 0.15em;
}

.review__meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.appstore {
  display: inline-block;
  height: 52px;
  transition: transform 150ms ease;
}

.appstore img { height: 100%; width: auto; display: block; }

footer {
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

footer a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.footer-icon-link {
  display: inline-flex;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: inherit;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}

.footer-icon-link svg {
  display: block;
  width: 18px;
  height: auto;
  fill: currentColor;
}

.footer-email-link svg {
  width: auto;
  height: 16px;
}

.footer-icon-link:hover {
  text-decoration: none;
}

.footer-icon-link:active,
.footer-icon-link:focus-visible {
  transform: none;
  text-decoration: none;
}

@media (min-width: 960px) {
  main {
    display: grid;
    grid-template-columns: minmax(280px, 430px) minmax(360px, 560px);
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas:
      "hero device"
      "cta device"
      "reviews device"
      "spacer device"
      "footer footer";
    justify-content: center;
    align-items: start;
    column-gap: 24px;
    row-gap: 22px;
    padding: clamp(48px, 7svh, 76px) clamp(32px, 6vw, 88px) 24px;
  }

  .hero {
    grid-area: hero;
    justify-self: center;
    text-align: center;
    padding-top: 4px;
  }

  .hero h1 {
    font-size: 3.1rem;
  }

  .tagline {
    font-size: 1.2rem;
    line-height: 1.45;
  }

  .cta {
    grid-area: cta;
    justify-content: center;
    width: 100%;
  }

  .device {
    grid-area: device;
    justify-self: start;
    align-self: start;
  }

  .phone {
    height: min(74svh, 760px);
    max-height: calc(100svh - 152px);
  }

  .reviews {
    grid-area: reviews;
    justify-self: center;
    margin: 18px 0 0;
    padding: 0;
    max-width: 560px;
  }

  .review {
    align-items: center;
    text-align: center;
    padding: 8px 0;
  }

  footer {
    grid-area: footer;
    justify-self: center;
    width: 100%;
    padding-top: 20px;
  }
}

@media (max-width: 600px) {
  .device {
    width: calc(100% + 48px);
    margin-inline: -24px;
  }

  .phone {
    width: min(88vw, 390px);
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone__screen img { transition: none; }
  .review { transition: none; }
}
