/*
  Pottles — pottles.app

  The tokens are the app's own (DesignSystem/PottleColor.swift), including its one
  rule that matters most here: the page behind a character is always white. Cream is
  for things that sit ON the page — bubbles, the promise panel — never for the page.

  The apricot dot means what it means in the app: a plant has something to say.
  It never pushes, so it never pulses.

  The type is the app's too. `ui-rounded` is SF Rounded on the iPhones and Macs this
  app is for; Nunito stands in everywhere else.
*/

:root {
  --white: #ffffff;
  --cream: #fdf8ee;
  --cream-press: #f6efe0;
  --butter: #f5c95d;
  --butter-press: #e9b944;
  --honey: #d9942b;
  --cocoa: #4a3f33;
  --latte: #9a8b77;
  --apricot: #eba268;
  --hairline: rgba(74, 63, 51, 0.12);

  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 1080px;

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--cocoa);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--honey);
  text-underline-offset: 0.18em;
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--cocoa);
  outline-offset: 3px;
  border-radius: 10px;
}

.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Header & footer ---------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
}

.logo {
  display: inline-block;
  line-height: 0;
}

.logo img {
  height: 38px;
  width: auto;
}

.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: clamp(64px, 10vw, 120px);
  padding-block: 28px 40px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
}

.site-footer .logo img {
  height: 26px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--latte);
  font-size: 0.95rem;
}

.footer-links a {
  color: var(--latte);
  text-decoration: none;
}

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

/* ---- The button --------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1.5px solid var(--butter-press);
  background: var(--butter);
  color: var(--cocoa);
  font: 700 1.05rem/1 var(--font);
  text-decoration: none;
  box-shadow: 0 6px 16px -8px rgba(217, 148, 43, 0.55);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.button:hover {
  background: var(--butter-press);
}

.button:active {
  transform: translateY(1px);
}

.button--small {
  min-height: 40px;
  padding: 10px 18px;
  font-size: 0.95rem;
}

.button svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Apple's own "Download on the App Store" badge — used unmodified, per their
   marketing guidelines, so no color, hover or press treatment of our own. */
.app-store-badge {
  display: inline-block;
  line-height: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

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

/* ---- Hero --------------------------------------------------------------- */

.hero {
  text-align: center;
  padding-top: clamp(28px, 6vw, 72px);
}

.hero h1 {
  margin: 0 auto;
  max-width: 13ch;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.hero .lede {
  margin: 22px auto 30px;
  max-width: 34ch;
  color: var(--latte);
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  line-height: 1.5;
}

/* ---- The windowsill: the plants say the page's promises themselves ------ */

.sill {
  position: relative;
  margin: clamp(48px, 8vw, 88px) auto 0;
  max-width: 980px;
}

.sill__cast {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: clamp(12px, 3vw, 40px);
  margin: 0;
  padding: 0 clamp(8px, 3vw, 48px);
  list-style: none;
}

.sill__board {
  position: absolute;
  inset: auto -4% 0 -4%;
  z-index: 0;
  pointer-events: none;
  /* Half the plank hangs below the pots, so they stand on its top face rather
     than its front edge. */
  transform: translateY(52%);
}

.sill__board img {
  width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.plant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Sized by height, not width: a snake plant is tall and narrow and a fern is round,
   and a shared width would make one of them a giant. */
.plant__stand {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: clamp(150px, 21vw, 230px);
}

/* A soft cast shadow grounds each pot on the sill instead of letting it float. */
.plant__stand::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 62%;
  height: 16px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(74, 63, 51, 0.18), transparent 72%);
}

.plant__art {
  height: 100%;
  width: auto;
  max-width: none;
  animation: breathe 5s ease-in-out infinite;
  transform-origin: 50% 100%;
}

.plant:nth-child(2) .plant__art {
  animation-delay: -1.6s;
}

.plant:nth-child(3) .plant__art {
  animation-delay: -3.2s;
}

.bubble {
  position: relative;
  max-width: 250px;
  margin: 0;
  padding: 14px 18px 15px 34px;
  border: 1px solid var(--hairline);
  border-radius: 22px;
  background: var(--cream);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  animation: speak 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.plant:nth-child(1) .bubble {
  animation-delay: 0.35s;
}

.plant:nth-child(2) .bubble {
  animation-delay: 0.95s;
}

.plant:nth-child(3) .bubble {
  animation-delay: 1.55s;
}

/* The app's "has something to say" dot. */
.bubble::before {
  content: "";
  position: absolute;
  top: 19px;
  left: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--apricot);
}

/* The tail, pointing down at whoever is speaking. */
.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  background: var(--cream);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  transform: rotate(45deg);
}

@keyframes breathe {
  0%,
  100% {
    transform: translateY(0) scaleY(1);
  }
  50% {
    transform: translateY(-3px) scaleY(1.012);
  }
}

@keyframes speak {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- What it's like ----------------------------------------------------- */

.section {
  margin-top: clamp(80px, 12vw, 150px);
}

.section-title {
  margin: 0 auto;
  max-width: 16ch;
  text-align: center;
  font-size: clamp(2rem, 4.6vw, 3rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.feelings {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(36px, 6vw, 72px) clamp(24px, 6vw, 80px);
  margin: clamp(40px, 7vw, 72px) 0 0;
  padding: 0;
  list-style: none;
}

.feeling {
  display: grid;
  grid-template-columns: clamp(96px, 14vw, 150px) 1fr;
  align-items: center;
  gap: clamp(16px, 3vw, 28px);
}

.feeling img {
  width: 100%;
  /* The art is painted on paper that is almost, not quite, white. */
  mix-blend-mode: multiply;
}

.feeling h3 {
  margin: 0 0 6px;
  font-size: clamp(1.3rem, 2.4vw, 1.55rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.feeling p {
  margin: 0;
  color: var(--latte);
}

/* ---- The promise -------------------------------------------------------- */

.promise {
  display: grid;
  grid-template-columns: minmax(160px, 300px) 1fr;
  align-items: center;
  gap: clamp(20px, 5vw, 64px);
  padding: clamp(28px, 5vw, 56px);
  border-radius: 36px;
  background: var(--cream);
  box-shadow: 0 28px 48px -32px rgba(74, 63, 51, 0.26);
}

.promise img {
  width: 100%;
  border-radius: 24px;
  /* The art is painted on white; cream around it would frame it in a box. */
  mix-blend-mode: multiply;
}

.promise h2 {
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 5.4vw, 3.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
}

.promise p {
  margin: 0;
  max-width: 36ch;
  color: var(--latte);
  font-size: clamp(1.1rem, 2vw, 1.25rem);
}

/* ---- The last ask ------------------------------------------------------- */

.closing {
  text-align: center;
}

.closing .section-title {
  margin-bottom: 26px;
}

.note {
  margin: 14px 0 0;
  color: var(--latte);
  font-size: 0.95rem;
}

/* ---- Prose pages (privacy, support) ------------------------------------ */

.prose {
  max-width: 68ch;
  margin: clamp(24px, 6vw, 64px) auto 0;
}

.prose h1 {
  margin: 0 0 8px;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.prose .updated {
  margin: 0 0 36px;
  color: var(--latte);
}

.prose h2 {
  margin: 44px 0 10px;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.prose p,
.prose li {
  line-height: 1.65;
}

.prose ul {
  padding-left: 1.2em;
}

.prose li + li {
  margin-top: 8px;
}

.prose .summary {
  margin: 0;
  padding: 22px 26px;
  border-radius: 24px;
  background: var(--cream);
}

.prose .summary p {
  margin: 0;
}

.prose .summary p + p {
  margin-top: 8px;
}

/* ---- Narrow screens ----------------------------------------------------- */

@media (max-width: 720px) {
  .site-header .button {
    display: none;
  }

  /* The sill turns into a column: each plant beside what it says. */
  .sill__board {
    display: none;
  }

  .sill__cast {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 0;
  }

  .plant {
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 16px;
  }

  .plant__stand {
    width: 96px;
    height: 110px;
    flex: none;
  }

  .bubble {
    max-width: none;
    flex: 1;
  }

  /* The plant is to the bubble's left here, so the tail turns to face it. */
  .bubble::after {
    left: -8px;
    top: 50%;
    bottom: auto;
    margin: -8px 0 0;
    transform: rotate(135deg);
  }

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

  .promise {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .promise img {
    max-width: 220px;
    margin-inline: auto;
  }

  .promise p {
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .plant__art,
  .bubble {
    animation: none;
  }

  .button {
    transition: none;
  }
}
