/* Home page only; colours follow the app theme (sync-frontend/components/services/theme.ts). */

.home {
  --blue: #007bff;
  --blue-soft: rgba(0, 123, 255, 0.1);
  --tint: #f1f5f9;
  --tint-more: #d3dde7;
  --paper: #ffffff;
  --text: #1c1b1e;
  --text-soft: #59555e;
  --red: #ff3b2d;
  --green: #34c759;
  --amber: #f59e0b;
  --shadow: 0 24px 60px rgba(50, 47, 56, 0.16);

  background: var(--tint);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.home main {
  max-width: none;
  padding: 0;
}

.home-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 max(20px, calc((100% - 1000px) / 2));
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.home-nav .brand {
  font-size: 17px;
  gap: 10px;
}

.home-nav .brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.home-nav .nav a {
  font-size: 14px;
}

.tint {
  background: var(--tint);
}

.plain {
  background: var(--paper);
}

.home section {
  padding: 120px max(20px, calc((100% - 1000px) / 2));
}

.display {
  text-wrap: balance;
  font-size: clamp(34px, 5.6vw, 60px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 20px;
}

.center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.accent {
  color: var(--blue);
}

.home .eyebrow {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--blue);
}

.lede {
  text-wrap: balance;
  font-size: clamp(19px, 2.2vw, 22px);
  line-height: 1.45;
  font-weight: 500;
  max-width: 640px;
  color: var(--text-soft);
}

/* Hero */

.hero-x {
  text-align: center;
  padding-top: 96px !important;
  padding-bottom: 0 !important;
  background:
    radial-gradient(
      55% 45% at 50% 88%,
      rgba(255, 255, 255, 0.9),
      transparent 70%
    ),
    linear-gradient(var(--tint-more), var(--tint) 85%);
}

.kicker {
  display: inline-block;
  margin: 0 0 20px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 15px;
  font-weight: 600;
}

.hero-x h1 {
  text-wrap: balance;
  font-size: clamp(40px, 9vw, 92px);
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 24px;
}

.hero-x .lede {
  margin: 0 auto 64px;
}

.devices {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 120px;
}

.device {
  margin: 0;
  padding: 2.2%;
  border-radius: 5.5% / 4.1%;
  background: var(--paper);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    var(--shadow);
}

.device img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3.4% / 2.55%;
}

.devices .device {
  width: 60%;
}

.device-back {
  position: absolute;
  left: 0;
  top: 48px;
  transform: rotate(-6deg);
  opacity: 0.85;
}

.device-front {
  position: relative;
  margin-left: auto !important;
  animation: float 7s ease-in-out infinite;
}

@keyframes float {
  50% {
    transform: translateY(-12px);
  }
}

.toast {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(50, 47, 56, 0.2);
}

.toast-hero {
  left: 50%;
  top: 62%;
  transform: translateX(-50%);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.6);
  animation: ping 2s infinite;
}

.dot-off {
  background: var(--amber);
  animation: none;
}

@keyframes ping {
  70% {
    box-shadow: 0 0 0 10px rgba(52, 199, 89, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
}

/* Story */

.story {
  text-align: center;
}

.story .lede {
  margin: 0 auto;
}

.story em {
  font-style: normal;
  color: var(--text-soft);
  text-decoration: line-through;
  text-decoration-thickness: 0.08em;
  text-decoration-color: var(--red);
}

.files {
  list-style: none;
  padding: 0;
  margin: 0 auto 48px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 720px;
}

.files li {
  margin: 0;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--tint);
  color: var(--text-soft);
  font:
    500 14px ui-monospace,
    "SF Mono",
    Menlo,
    monospace;
  text-decoration: line-through;
  text-decoration-color: var(--red);
}

/* Split feature sections */

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

.split .device {
  position: relative;
  max-width: 420px;
  width: 100%;
  justify-self: center;
}

.flip .split-text {
  order: 2;
}

.toast-offline {
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
}

/* Tiles */

.bento-wrap .display {
  max-width: 720px;
  margin-bottom: 56px;
}

.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.tile {
  margin: 0;
  padding: 36px 32px;
  border-radius: 28px;
  background: var(--tint);
  min-height: 240px;
}

.tile h3 {
  margin: 0 0 12px;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.tile p:not(.eyebrow) {
  margin: 0;
  color: var(--text-soft);
  font-size: 17px;
}

.tile-wide {
  grid-column: span 2;
}

.tile-soft {
  background:
    radial-gradient(
      90% 140% at 100% 0%,
      rgba(0, 123, 255, 0.12),
      transparent 60%
    ),
    var(--tint);
}

.tile-soft h3 {
  font-size: clamp(28px, 3.4vw, 40px);
}

/* Steps */

.steps-wrap .display {
  max-width: 760px;
  margin-bottom: 64px;
}

.big-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.big-steps li {
  margin: 0;
  padding: 28px 24px;
  border-radius: 24px;
  background: var(--paper);
  color: var(--text-soft);
  font-size: 17px;
}

.big-steps span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.big-steps strong {
  display: block;
  margin-bottom: 4px;
  font-size: 20px;
  color: var(--text);
}

/* Who it's for */

.who {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.who .display {
  padding: 0 20px;
  margin-bottom: 64px;
}

.marquee {
  display: flex;
  overflow: hidden;
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
}

.marquee ul {
  list-style: none;
  display: flex;
  flex-shrink: 0;
  gap: 14px;
  margin: 0;
  padding: 0 14px 0 0;
  animation: scroll 40s linear infinite;
}

.marquee li {
  margin: 0;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
}

@keyframes scroll {
  to {
    transform: translateX(-100%);
  }
}

/* Call to action */

.cta {
  text-align: center;
  padding-bottom: 140px !important;
  background: linear-gradient(var(--tint), var(--tint-more));
}

.cta-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.cta .lede {
  margin: 0 auto 40px;
}

.pill {
  display: inline-block;
  padding: 16px 32px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(0, 123, 255, 0.3);
  transition: transform 0.2s ease;
}

.pill:hover {
  transform: scale(1.04);
}

.home-footer {
  padding: 24px 20px 48px;
  background: var(--tint-more);
  color: var(--text-soft);
  font-size: 13px;
  text-align: center;
}

/* Scroll reveal; without JS everything is simply visible */

.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.9s ease,
    transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero-x > * {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

.hero-x > :nth-child(2) {
  animation-delay: 0.1s;
}

.hero-x > :nth-child(3) {
  animation-delay: 0.2s;
}

.hero-x > :nth-child(4) {
  animation-delay: 0.35s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
}

.js .reveal.shown {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-x > *,
  .device-front,
  .dot,
  .marquee ul {
    animation: none;
  }
}

@media (max-width: 820px) {
  .home section {
    padding-top: 88px;
    padding-bottom: 88px;
  }

  .split {
    grid-template-columns: 1fr;
    gap: 56px;
    text-align: center;
  }

  .split .lede {
    margin-left: auto;
    margin-right: auto;
  }

  .flip .split-text {
    order: 0;
  }

  .split .device {
    max-width: 320px;
  }

  .bento {
    grid-template-columns: 1fr;
  }

  .tile-wide {
    grid-column: auto;
  }

  .tile {
    min-height: 0;
  }

  .big-steps {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .home-nav .nav a[href="#early"] {
    display: none;
  }

  .devices {
    padding-bottom: 96px;
  }

  .devices .device {
    width: 70%;
  }

  .device-back {
    left: 0;
  }

  .toast {
    font-size: 13px;
    padding: 10px 14px;
  }

  .big-steps {
    grid-template-columns: 1fr;
  }

  .marquee li {
    font-size: 17px;
    padding: 12px 22px;
  }
}

.plans-wrap [data-plans] {
  max-width: 880px;
  margin: 40px auto 0;
}

.plans-wrap .plans-grid {
  gap: 20px;
  margin: 0;
}

.plans-wrap .plan {
  border-radius: 24px;
}

.plans-wrap .plan-body {
  padding: 24px 24px 28px;
}

.plans-wrap .plan:not(.recommended) .plan-body {
  padding-top: 53px;
}

.plans-wrap .plan-storage {
  font-size: 40px;
}

.plans-small {
  max-width: 560px;
  margin-top: 28px;
  font-size: 15px;
  color: var(--text-soft);
}

@media (max-width: 560px) {
  .plans-wrap .plan:not(.recommended) .plan-body {
    padding-top: 24px;
  }
}
