:root {
  --blue: #007aff;
  --blue-hover: #0056d6;
  --blue-tint: rgba(0, 122, 255, 0.12);
  --black: #000000;
  --white: #ffffff;
  --gray-600: #555555;
  --gray-400: #8e8e93;
  --radius-pill: 980px;
  --phone-bezel: #1a1a1c;
  --phone-w: clamp(14.65rem, 58.5vw, 20.65rem);
  --phone-peek: clamp(3.65rem, 16vw, 5.65rem);
  --phones-viewport-w: calc(var(--phone-w) + var(--phone-peek));
  --phone-frame-h: calc(var(--phone-w) * 19.5 / 9);
  --phone-visible-ratio: 0.92;
  --phones-max-height: 575px;
  --phone-ui-scale: 1.5;
  --app-surface: #eef2f7;
  --app-surface-top: #f4f7fb;
  --app-inset-x: 7%;
  --app-inset-badge-top: 6%;
  --app-inset-content-top: 2%;
  --app-inset-callback-x: 8%;
  --app-inset-callback-bottom: 14%;
  --app-inset-clock-right: 7%;
  --phones-fade-w: max(2.25rem, calc(22% - 50px));
  --phone-island-top: calc(0.5rem + 0.2rem + 3px);
  --phone-island-h: calc(0.42rem + 13px);
}

@media (max-width: 640px) {
  :root {
    --app-inset-x: 6.3%;
    --app-inset-badge-top: 5.4%;
    --app-inset-content-top: 1.8%;
    --app-inset-callback-x: 7.2%;
    --app-inset-callback-bottom: 12.6%;
    --app-inset-clock-right: 6.3%;
    --phone-visible-ratio: 1;
    --phone-w: clamp(16.12rem, 64.35vw, 22.72rem);
    --phone-peek: clamp(4.02rem, 17.6vw, 6.22rem);
    --phone-label-h: 2rem;
    --phone-bottom-pad: 1.5rem;
    --phones-fade-w: calc(var(--phone-peek) * 0.72);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  display: flex;
  align-items: center;
}

.container {
  width: min(100% - 2rem, 40rem);
  margin-inline: auto;
}

.hero {
  width: 100%;
  padding: 3rem 0 4rem;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  background: var(--blue-tint);
  border-radius: var(--radius-pill);
}

.brand-logo {
  display: block;
  width: min(16rem, 72vw);
  height: auto;
  margin: 0 auto 2rem;
}

.hero-inner {
  text-align: center;
}

/*
 * Viewport = one full phone + peek of the other.
 * Active phone centered; inactive peeks from left or right edge.
 */
.phones-viewport {
  position: relative;
  width: min(var(--phones-viewport-w), 100%);
  height: min(
    var(--phones-max-height),
    calc(1.75rem + var(--phone-frame-h) * var(--phone-visible-ratio))
  );
  margin: 0 auto 2.5rem;
  overflow: hidden;
}

/* Desktop — soft shadow at bottom crop line */
.phones-viewport::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.75rem;
  z-index: 11;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.09) 0%,
    rgba(0, 0, 0, 0.035) 28%,
    transparent 100%
  );
}

@media (max-width: 640px) {
  main {
    align-items: flex-start;
  }

  .hero {
    padding-top: 2rem;
    padding-bottom: 2.5rem;
  }

  .phones-viewport {
    width: 100%;
    height: auto;
    min-height: calc(
      var(--phone-label-h) + var(--phone-frame-h) + var(--phone-bottom-pad)
    );
    padding-bottom: var(--phone-bottom-pad);
    overflow-x: clip;
    overflow-y: visible;
  }

  .phones-viewport::after {
    display: none;
  }

  .phones-track {
    height: auto;
    min-height: calc(var(--phone-label-h) + var(--phone-frame-h));
  }

  .phones-fade {
    top: var(--phone-label-h);
    bottom: var(--phone-bottom-pad);
    width: var(--phones-fade-w);
    max-width: 32%;
  }

  .phones-fade--left {
    left: 0;
    right: auto;
  }

  .phones-fade--right {
    right: 0;
    left: auto;
  }

  .app-badge-logo {
    height: clamp(0.41rem, 1.92vw, 0.66rem);
  }

  .notification-wordmark {
    height: clamp(0.29rem, 1.35vw, 0.41rem);
  }
}

.phones-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.phones-fade {
  position: absolute;
  top: 1.75rem;
  bottom: 0;
  width: var(--phones-fade-w);
  z-index: 10;
  pointer-events: none;
}

.phones-fade--right {
  right: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.75) 70%,
    #ffffff 100%
  );
}

.phones-fade--left {
  left: 0;
  background: linear-gradient(
    270deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.75) 70%,
    #ffffff 100%
  );
}

.phone-device {
  position: absolute;
  top: 0;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--phone-w);
  transition:
    transform 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.55s ease;
  transform: translateX(-50%);
  opacity: 0.55;
  z-index: 1;
}

.phone-device.is-centered {
  transform: translateX(-50%);
  opacity: 1;
  z-index: 3;
}

/* Exactly var(--phone-peek) of inactive phone visible at viewport edge */
.phone-device.is-off-right {
  transform: translateX(calc(-50% + var(--phone-w) - var(--phone-peek) * 0.5));
  opacity: 0.7;
  z-index: 2;
}

.phone-device.is-off-left {
  transform: translateX(calc(-50% - var(--phone-w) + var(--phone-peek) * 0.5));
  opacity: 0.7;
  z-index: 2;
}

.phone-label {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-600);
  transition: color 0.4s ease;
}

.phone-device.is-centered .phone-label {
  color: var(--blue);
}

/* CSS smartphone mockup */
.phone-frame {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  padding: calc(0.32rem + 5px);
  border-radius: 1.85rem;
  background: linear-gradient(145deg, #3a3a3c 0%, var(--phone-bezel) 40%, #0d0d0f 100%);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.08),
    0 16px 40px rgba(0, 0, 0, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.phone-frame::before {
  content: "";
  position: absolute;
  top: var(--phone-island-top);
  left: 50%;
  z-index: 30;
  width: 28%;
  height: var(--phone-island-h);
  border-radius: 999px;
  background: var(--phone-bezel);
  transform: translateX(-50%);
  pointer-events: none;
}

.phone-frame::after {
  content: "";
  position: absolute;
  right: -0.12rem;
  top: 28%;
  width: 0.12rem;
  height: 14%;
  border-radius: 0 2px 2px 0;
  background: #2c2c2e;
}

.phone-screen {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 1.48rem;
}

.phone-screen--sam {
  --lock-time-tone: #b88472;
  background: linear-gradient(168deg, #fff8f0 0%, #ffe8d6 45%, #ffd4c4 100%);
}

.phone-screen--alex {
  --lock-time-tone: #5a84b8;
  background: linear-gradient(168deg, #eef6ff 0%, #d9ecff 50%, #c4dfff 100%);
}

/* Lock screen — large centered clock */
.phone-status {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  padding-top: 12%;
  pointer-events: none;
  transition: padding 0.35s ease;
}

.phone-time {
  display: block;
  font-size: clamp(3.24rem, 15.3vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--lock-time-tone, var(--black));
  text-align: center;
  opacity: 0.5;
  transition:
    font-size 0.35s ease,
    text-align 0.35s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.phone-time.is-ticking {
  animation: clock-tick 0.35s ease;
}

@keyframes clock-tick {
  0% {
    transform: scale(1);
    opacity: 0.35;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.65;
  }
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
}

/* In-app — status time top-right, vertically aligned with dynamic island */
.phone-screen.is-in-app .phone-status {
  top: calc(var(--phone-island-top) - 10px);
  right: var(--app-inset-x);
  left: auto;
  width: auto;
  height: var(--phone-island-h);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.phone-screen.is-in-app .phone-time {
  display: inline-block;
  font-size: clamp(0.63rem, 3vw, 0.87rem);
  font-weight: 600;
  color: var(--black);
  text-align: right;
  line-height: 1;
  opacity: 0.95;
}

.phone-screen.is-in-app .app-badge {
  padding-top: calc(var(--phone-island-top) + var(--phone-island-h) + 0.35rem);
}

.phone-content {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  width: calc(100% / var(--phone-ui-scale));
  height: calc(100% / var(--phone-ui-scale));
  transform: scale(var(--phone-ui-scale));
  transform-origin: top left;
  overflow: visible;
}

.screen-card {
  transition:
    opacity 0.52s ease,
    transform 0.52s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: translateY(0);
}

.screen-card.is-entering {
  opacity: 0;
  transform: translateY(0.65rem);
}

.screen-card.is-exiting {
  opacity: 0;
  transform: translateY(-0.65rem);
}

.screen-card.is-exiting.notification--expandable {
  transform: translateY(-0.35rem);
  max-height: none;
}

/* Full-screen in-app compose */
.app-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--app-surface-top) 0%, var(--app-surface) 100%);
  text-align: left;
}

.app-badge {
  display: block;
  padding:
    calc(var(--app-inset-badge-top) + 0.15rem)
    var(--app-inset-x)
    0.35rem;
  line-height: 0;
}

.app-badge-logo {
  display: block;
  width: auto;
  height: clamp(0.92rem, 4.32vw, 1.48rem);
  padding: 0.12rem 0;
}

.notification-wordmark {
  display: block;
  align-self: center;
  width: auto;
  height: clamp(0.64rem, 3.04vw, 0.92rem);
  padding: 0.08rem 0;
}

.app-compose-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  padding: 0 var(--app-inset-x) 0;
  overflow: hidden;
}

.app-compose-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

.app-compose-scroll::-webkit-scrollbar {
  display: none;
}

.app-compose-top {
  padding-top: var(--app-inset-content-top);
  padding-bottom: 0.35rem;
}

.app-compose-heading {
  margin: 0 0 0.65rem;
  font-size: clamp(0.52rem, 2.5vw, 0.68rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--black);
}

.app-time-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.app-time-chip {
  position: relative;
  isolation: isolate;
  padding: 0.35rem 0.55rem;
  font-family: inherit;
  font-size: clamp(0.44rem, 2.1vw, 0.56rem);
  font-weight: 600;
  color: var(--gray-600);
  background: var(--white);
  border: 1.5px solid transparent;
  border-radius: 999px;
  cursor: default;
  transition:
    transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.15s ease;
}

.app-time-chip::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -45%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(0, 122, 255, 0.28) 0%,
    rgba(0, 122, 255, 0.08) 45%,
    transparent 70%
  );
  filter: blur(6px);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.app-time-chip.is-hovering::before {
  opacity: 1;
  transform: scale(1);
}

.app-time-chip.is-pressed,
.app-time-chip.is-selected {
  transform: scale(0.94);
  color: var(--blue);
  background: var(--blue-tint);
  border-color: rgba(0, 122, 255, 0.4);
  box-shadow: inset 0 2px 5px rgba(0, 60, 140, 0.12);
}

.app-send-row {
  padding: 0.5rem 0 0.15rem;
  border-bottom: none;
  list-style: none;
}

.app-send-btn {
  display: block;
  width: 100%;
  padding: 0.45rem 0.35rem;
  font-family: inherit;
  font-size: clamp(0.42rem, 2vw, 0.54rem);
  font-weight: 700;
  color: var(--white);
  background: var(--blue);
  border: none;
  border-radius: 0.45rem;
  cursor: default;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.2s ease;
}

.app-send-btn.is-hovering {
  transform: scale(1.02);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.28);
}

.app-send-btn.is-tapped {
  transform: scale(0.96);
  background: var(--blue-hover);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.35);
}

.app-section-label {
  margin: 0 0 0.3rem;
  font-size: clamp(0.44rem, 2vw, 0.56rem);
  font-weight: 600;
  color: var(--gray-600);
}

.app-group-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.28rem 0.2rem;
  margin: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 0.35rem;
  transition:
    background 0.2s ease,
    transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.15s ease;
}

.app-group-row--selectable.is-hovering {
  background: rgba(0, 122, 255, 0.1);
}

.app-group-row--selectable.is-pressed,
.app-group-row--selectable.is-selected {
  transform: scale(0.98);
  background: var(--blue-tint);
  box-shadow: inset 0 0 0 1.5px rgba(0, 122, 255, 0.35);
}

.app-group-row--selectable.is-selected .app-group-name {
  color: var(--blue);
}

.app-group-row:last-child {
  border-bottom: none;
}

.app-group-info {
  min-width: 0;
  flex: 1;
}

.app-group-name {
  display: block;
  font-size: clamp(0.46rem, 2.1vw, 0.58rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--black);
}

.app-group-members {
  display: block;
  margin-top: 0.05rem;
  font-size: clamp(0.38rem, 1.75vw, 0.48rem);
  font-weight: 500;
  line-height: 1.3;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-group-edit,
.app-footer-settings {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  color: var(--gray-400);
  background: transparent;
  border: none;
  border-radius: 0.2rem;
  cursor: default;
}

.app-group-edit svg,
.app-footer-settings svg {
  width: 0.55rem;
  height: 0.55rem;
}

.app-group-row--action {
  padding: 0.32rem 0;
  font-size: clamp(0.44rem, 2vw, 0.54rem);
  font-weight: 600;
  color: var(--blue);
}

.app-group-row--action.app-group-row--pick {
  color: var(--black);
}

.app-group-row--action.app-group-row--pick .app-row-chevron {
  color: var(--gray-600);
}

.app-group-row--action.app-group-row--muted {
  color: var(--gray-600);
  font-weight: 500;
}

.app-row-chevron {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  color: var(--gray-400);
}

.app-compose-footer {
  display: none;
}

.app-footer-link {
  padding: 0;
  font-family: inherit;
  font-size: clamp(0.4rem, 1.85vw, 0.5rem);
  font-weight: 600;
  color: var(--blue);
  background: transparent;
  border: none;
  cursor: default;
  white-space: nowrap;
}

.app-compose-footer .app-footer-settings {
  margin-left: auto;
}

.app-footer-settings svg {
  width: 0.65rem;
  height: 0.65rem;
}

/* Push notifications on lock screen */
.notification {
  position: absolute;
  top: 28%;
  left: 2.5%;
  right: 2.5%;
  width: auto;
  padding: 0.55rem 0.55rem 0.6rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 0.65rem;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.08);
}

.notification--handshake {
  border-left: 2px solid var(--blue);
}

.notification--expandable {
  transition:
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.4s ease,
    opacity 0.52s ease;
}

.notification--expandable.is-pulling {
  transform: translateY(0.45rem) scale(1.015);
}

.notification--expandable.is-expanded {
  transform: translateY(0.55rem);
  padding-bottom: 0.65rem;
}

.notification-pull {
  width: 1.75rem;
  height: 0.18rem;
  margin: 0 auto 0.35rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.14);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.notification--expandable.is-expanded .notification-pull {
  opacity: 1;
}

.notification-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease,
    margin-top 0.4s ease;
}

.notification.is-expanded .notification-actions {
  max-height: 7rem;
  margin-top: 0.5rem;
  opacity: 1;
}

.notification-action {
  position: relative;
  isolation: isolate;
  width: 100%;
  padding: 0.45rem 0.5rem;
  font-family: inherit;
  font-size: clamp(0.5rem, 2.3vw, 0.65rem);
  font-weight: 600;
  line-height: 1.25;
  border: none;
  border-radius: 0.45rem;
  cursor: default;
  text-align: center;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.2s ease;
}

.notification-action::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(0, 122, 255, 0.28) 0%,
    rgba(0, 122, 255, 0.08) 45%,
    transparent 70%
  );
  filter: blur(6px);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.notification-action.is-hovering::before {
  opacity: 1;
  transform: scale(1);
}

.notification-action--primary {
  color: var(--white);
  background: var(--blue);
}

.notification-action--secondary {
  color: var(--blue);
  background: var(--blue-tint);
}

.notification-action.is-tapped {
  transform: scale(0.97);
}

.app-callback-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding:
    var(--app-inset-content-top)
    var(--app-inset-callback-x)
    var(--app-inset-callback-bottom);
}

.notification-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.2rem;
}

.app-icon-img {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 0.26rem;
  flex-shrink: 0;
  object-fit: cover;
}

.app-name {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--gray-600);
  text-transform: lowercase;
}

.notification-time {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--gray-400);
}

.notification-body {
  margin: 0;
  padding-left: 1.45rem;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--black);
}

.notification-meta {
  margin: 0.2rem 0 0;
  padding-left: 1.45rem;
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--gray-600);
}

.lead {
  max-width: 24em;
  margin: 0 auto 2rem;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--gray-600);
}

.hero-actions {
  display: flex;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--black);
  color: var(--white);
}

.btn-primary:hover {
  background: #333333;
  color: var(--white);
}

.site-footer {
  padding: 1.5rem 0 2.5rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.footer-inner p {
  margin: 0;
}
