/* jellytrove.com home page. The idea: the shelf is the page. App screenshots stand on the same
   blush shelves the app draws, like Jellycats lined up in a room. */

:root {
  --navy: #1f2a44;
  --cream: #f6efe4;
  --terracotta: #c24c3b;
  --phone: #24181f;
}

/* Phones and shelves */
.phone {
  position: relative;
  aspect-ratio: 1206 / 2622;
  padding: 3.2%;
  border-radius: 13% / 6%;
  background: var(--phone);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 18px 30px -18px rgba(55,26,46,.55);
}
.phone img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 10.5% / 4.9%;
  object-fit: cover;
}
/* The soft patch of shadow where a phone meets its shelf. */
.phone::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -9px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(90,45,42,.38), rgba(90,45,42,0));
  z-index: -1;
}
.ledge {
  height: 1.15rem;
  border-radius: 5px 5px 12px 12px;
  background: linear-gradient(var(--ledge-light), var(--ledge-mid) 55%, var(--ledge-dark));
  box-shadow: 0 10px 18px -6px rgba(55,26,46,.22);
}

/* Intro */
.intro {
  display: grid;
  gap: 2.5rem;
  align-items: end;
  padding-top: 1.5rem;
  padding-bottom: 3.5rem;
}
.intro h1 {
  margin: 0 0 1.25rem;
  font: 500 clamp(2.5rem, 7.4vw, 4.75rem)/1.02 var(--display);
  letter-spacing: -.025em;
  max-width: 15ch;
  text-wrap: balance;
}
.intro-lead {
  margin: 0 0 1.75rem;
  max-width: 30rem;
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  line-height: 1.5;
  color: var(--muted);
}
.soon {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin: 0;
  padding: .55rem 1.05rem .55rem .85rem;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  background: #fff;
  font-weight: 500;
  color: var(--ink);
}
.soon img { width: .7rem; height: auto; }
.intro-stand {
  margin: 0;
  display: grid;
  justify-items: center;
}
.phone-hero {
  width: min(68vw, 19.5rem);
  margin-bottom: -2px;
  z-index: 1;
}
.ledge-hero { width: min(92vw, 30rem); }

/* One moment of motion: the phone lands on its shelf, the way toys drop into place in the app. */
@media (prefers-reduced-motion: no-preference) {
  .phone-hero { animation: land .9s cubic-bezier(.2,.9,.25,1.15) .15s both; }
  @keyframes land {
    0% { transform: translateY(-2.5rem); }
    60% { transform: translateY(0) scale(1.01, .99); }
    100% { transform: none; }
  }
}

/* The cabinet: three phones on one long shelf */
.cabinet {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
  border-top: 1px solid var(--rule);
}
.cabinet h2, .origin h2, .plans h2 {
  margin: 0 0 2.25rem;
  font: 500 clamp(1.9rem, 4vw, 2.6rem)/1.1 var(--display);
  letter-spacing: -.015em;
}
.cabinet-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2.5rem;
}
/* On a phone, each screen stands on its own short shelf with its words beside it. */
.cabinet-row li {
  display: grid;
  grid-template-columns: 38% 1fr;
  grid-template-rows: auto auto;
  column-gap: 1.4rem;
}
.cabinet-row .phone { grid-column: 1; grid-row: 1; }
.cabinet-row li::before {
  content: "";
  grid-column: 1;
  grid-row: 2;
  height: .9rem;
  margin: -2px -12% 0;
  border-radius: 4px 4px 10px 10px;
  background: linear-gradient(var(--ledge-light), var(--ledge-mid) 55%, var(--ledge-dark));
  box-shadow: 0 8px 14px -6px rgba(55,26,46,.22);
}
.cabinet-row .text { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.cabinet-row h3 { margin: 0 0 .35rem; font: 500 1.35rem/1.2 var(--display); }
.cabinet-row p { margin: 0; color: var(--muted); }

.share {
  margin: 3.25rem auto 0;
  display: grid;
  gap: .35rem;
  justify-items: center;
  text-align: center;
}
.share h3 { margin: 0; font: 500 1.35rem/1.2 var(--display); }
.share p { margin: 0; color: var(--muted); max-width: 30rem; }
.share-link {
  margin-top: .5rem;
  padding: .45rem .95rem;
  border-radius: 999px;
  background: var(--ledge-light);
  color: var(--ink);
  font-weight: 500;
  letter-spacing: .01em;
}

/* Our story */
.origin {
  display: grid;
  gap: 2rem;
  align-items: center;
  padding-top: 3.5rem;
  padding-bottom: 4rem;
  border-top: 1px solid var(--rule);
}
.origin h2 { margin-bottom: 1.25rem; }
.origin-lead { font-size: 1.25rem; line-height: 1.5; color: var(--ink); }
.origin p { margin: 0 0 1rem; max-width: 34rem; }
.origin p:not(.origin-lead) { color: var(--muted); }
.origin-room { width: 100%; height: auto; }

/* Free and Pro */
.plans { background: var(--navy); color: var(--cream); }
.plans-inner {
  display: grid;
  gap: 3rem;
  padding-top: 3.75rem;
  padding-bottom: 4rem;
}
.plans h2 { margin-bottom: 1.25rem; color: #fff; }
.plans ul { margin: 0; padding: 0; list-style: none; }
.plans li {
  position: relative;
  padding: .55rem 0 .55rem 1.6rem;
  border-top: 1px solid rgba(246,239,228,.14);
}
.plans li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: var(--ledge-mid);
}
.plan-pro li::before { background: var(--terracotta); box-shadow: 0 0 0 2px var(--ledge-light); }
.plan-price {
  display: inline-block;
  margin: 0 0 1.25rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: var(--ledge-light);
  color: var(--navy);
  font-weight: 600;
}
.plan-note { margin: 1.25rem 0 0; color: #d8cfc4; max-width: 28rem; }

/* Closing */
.closing { padding-top: 3.5rem; padding-bottom: 3.5rem; text-align: center; }
.closing-line { margin: 0 0 .5rem; font: 500 clamp(1.6rem, 3.6vw, 2.2rem)/1.2 var(--display); }
.closing p { margin: 0; }

@media (min-width: 52rem) {
  .intro { grid-template-columns: 1.15fr 1fr; align-items: center; padding-top: 2.5rem; padding-bottom: 4.5rem; }
  .intro-stand { justify-items: center; }

  /* One long shelf under three phones: the phones fill row 1, the shelf row 2, the words row 3. */
  .cabinet-row {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 3rem;
    row-gap: 0;
    padding: 0 2rem;
  }
  .cabinet-row li { display: contents; }
  .cabinet-row li::before { display: none; }
  .cabinet-row::after {
    content: "";
    grid-column: 1 / -1;
    grid-row: 2;
    height: 1.15rem;
    margin: -2px -2rem 0;
    border-radius: 5px 5px 12px 12px;
    background: linear-gradient(var(--ledge-light), var(--ledge-mid) 55%, var(--ledge-dark));
    box-shadow: 0 10px 18px -6px rgba(55,26,46,.22);
  }
  .cabinet-row .phone { grid-row: 1; width: min(100%, 14.5rem); justify-self: center; z-index: 1; }
  .cabinet-row .text { grid-row: 3; align-self: start; text-align: center; padding-top: 1.6rem; }
  .cabinet-row li:nth-child(1) > * { grid-column: 1; }
  .cabinet-row li:nth-child(2) > * { grid-column: 2; }
  .cabinet-row li:nth-child(3) > * { grid-column: 3; }
  .cabinet-row p { max-width: 16rem; margin: 0 auto; }


  .origin { grid-template-columns: 1fr 1.05fr; gap: 3.5rem; }
  .plans-inner { grid-template-columns: 1fr 1fr; gap: 4.5rem; }
}
