/* Brand palette from the K.B. Barrett Designs style sheet. */
:root {
  --navy: #095EAF;
  --berry: #B6025F;
  --sky: #02A2F1;
  --plum: #4A0E2E;      /* the deep wine of the logo's capitals */
  --paper: #FFFBF8;
  --blush: #FBE3EE;
  --mist: #E2F2FB;

  --sans: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", "Open Sans", system-ui, sans-serif;
  --script: "Sacramento", "Segoe Script", cursive;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--plum);
  font: 400 1.0625rem/1.7 var(--sans);
  /* Watercolour blooms, so the page reads as paper rather than a screen. */
  background:
    radial-gradient(40rem 28rem at 92% 58%, rgb(251 227 238 / .75), transparent 70%),
    radial-gradient(36rem 26rem at 4% 82%, rgb(226 242 251 / .9), transparent 70%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--navy); }

.script {
  font-family: var(--script);
  font-weight: 400;
  color: var(--sky);
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- Logo-style lockup: tracked capitals with script laid over them ---------- */

.lockup {
  margin: 0 0 2.5rem;
  display: grid;
  justify-items: center;
  text-align: center;
  font-weight: 400;
}
.lockup__caps {
  font: 400 clamp(1.4rem, 3.4vw, 2.1rem)/1.1 var(--sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--plum);
}
.lockup__script {
  font-family: var(--script);
  font-size: clamp(2.1rem, 5.2vw, 3.2rem);
  line-height: .8;
  color: var(--sky);
  margin-top: -.42em;
  margin-left: 1.5em;
}
.lockup--left { justify-items: start; text-align: left; }
.lockup--small .lockup__caps { font-size: 1rem; }
.lockup--small .lockup__script { font-size: 2rem; }

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

.hero {
  position: relative;
  min-height: min(70vh, 640px);
  display: grid;
  align-items: center;
  justify-items: end;
  padding: clamp(6rem, 18vw, 10rem) clamp(1rem, 5vw, 5rem) 5rem;
  background:
    /* a soft white wash where the logo sits, so the sky-blue script holds up against the boards */
    radial-gradient(60% 55% at 66% 56%, rgb(255 255 255 / .92), rgb(255 255 255 / .55) 55%, transparent 80%),
    url("/assets/img/mums-wood.jpg") left top / cover no-repeat;
  background:
    radial-gradient(60% 55% at 66% 56%, rgb(255 255 255 / .92), rgb(255 255 255 / .55) 55%, transparent 80%),
    image-set(url("/assets/img/mums-wood.webp") type("image/webp"), url("/assets/img/mums-wood.jpg") type("image/jpeg")) left top / cover no-repeat;
  overflow: hidden;
}
/* Torn-paper edge into the page below. */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 38px;
  background: var(--paper);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 38' preserveAspectRatio='none'%3E%3Cpath d='M0 18 L40 12 L75 20 L120 9 L160 17 L210 11 L250 21 L300 13 L345 19 L390 8 L440 18 L480 12 L530 22 L575 14 L620 19 L665 10 L710 18 L760 13 L800 21 L850 11 L895 18 L940 12 L990 20 L1030 9 L1080 17 L1120 12 L1160 19 L1200 13 L1200 38 L0 38 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 38' preserveAspectRatio='none'%3E%3Cpath d='M0 18 L40 12 L75 20 L120 9 L160 17 L210 11 L250 21 L300 13 L345 19 L390 8 L440 18 L480 12 L530 22 L575 14 L620 19 L665 10 L710 18 L760 13 L800 21 L850 11 L895 18 L940 12 L990 20 L1030 9 L1080 17 L1120 12 L1160 19 L1200 13 L1200 38 L0 38 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.hero__inner {
  width: min(100%, 760px);
  text-align: center;
}
.hero__logo { margin: 0; }
.hero__logo img { width: 100%; }

/* ---------- Buy ---------- */

.buy {
  padding: clamp(3.5rem, 8vw, 6rem) 1rem clamp(3rem, 6vw, 5rem);
}
.buy__body {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}
.steps li {
  position: relative;
  padding: 0 0 1.4rem 4.2rem;
  min-height: 3.2rem;
  font-size: 1.12rem;
}
.steps__n {
  position: absolute;
  left: 0;
  top: -.55rem;
  font-family: var(--script);
  font-size: 3.6rem;
  line-height: 1;
  color: var(--berry);
}
.steps li:nth-child(2) .steps__n { color: var(--navy); }
.steps li:nth-child(3) .steps__n { color: var(--sky); }

.buy__cta {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
}
.qr {
  margin: 0;
  display: grid;
  justify-items: center;
  transform: rotate(2.5deg);
}
.qr__code {
  width: 190px;
  height: 190px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgb(74 14 46 / .15), 0 14px 30px -18px rgb(74 14 46 / .5);
}
.qr figcaption { font-size: 2rem; line-height: 1.2; color: var(--berry); }
.arrow {
  position: absolute;
  width: 96px;
  left: -64px;
  top: 30px;
  color: var(--sky);
}

/* ---------- Books: one shelf per series, covers propped up a little crooked ---------- */

.books { padding: 1rem 1rem clamp(3rem, 6vw, 4.5rem); }

.shelf { margin: 0 auto; }
.shelf + .shelf { margin-top: clamp(2.2rem, 5vw, 3.5rem); }
/* A special-edition shelf belongs to the series above it, so it sits closer. */
.shelf + .shelf--se { margin-top: clamp(1.2rem, 3vw, 2rem); }
.shelf__title {
  margin: 0 0 1.1rem;
  text-align: center;
  font: 400 clamp(.78rem, 1.6vw, .95rem)/1.4 var(--sans);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--plum);
}
.shelf__se { color: var(--berry); }
.shelf__se::before { content: "· "; color: var(--plum); }

/* Every series stays on one row: --n columns that shrink with the screen, never wrap. */
.stack {
  --n: 5;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: calc(var(--n) * 140px + (var(--n) - 1) * 1.5rem);
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: clamp(.4rem, 2vw, 1.5rem);
}
.stack__book { min-width: 0; text-align: center; container-type: inline-size; }
.stack__book img {
  border-radius: 2px 5px 5px 2px;
  box-shadow: 0 16px 26px -14px rgb(74 14 46 / .6);
  transform: rotate(-2.5deg);
  transition: transform .2s ease;
}
.stack__book:nth-child(even) img { transform: rotate(2deg); }
.stack__book:nth-child(3n) img { transform: rotate(-1deg) translateY(-5px); }
.stack__book:hover img { transform: rotate(0) translateY(-8px); }
/* Sized to the cover's own width, so "Book 6.5" always fits under it. */
.stack__n {
  margin: .45rem 0 0;
  font-size: clamp(.55rem, 19cqi, 1.6rem);
  line-height: 1.1;
  white-space: nowrap;
  color: var(--berry);
}
.stack__book:nth-child(3n+2) .stack__n { color: var(--navy); }
.stack__book:nth-child(3n) .stack__n { color: #0A79AF; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Divider ---------- */

.divider {
  display: block;
  width: min(560px, 80%);
  height: 24px;
  margin: 0 auto;
  color: var(--sky);
}

/* ---------- Meet Jennifer ---------- */

.meet {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) 1rem;
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}
.polaroid {
  position: relative;
  margin: 1rem 0 0;
  padding: 14px 14px 0;
  background: #fff;
  box-shadow: 0 1px 2px rgb(74 14 46 / .12), 0 24px 40px -22px rgb(74 14 46 / .55);
  transform: rotate(-3deg);
}
/* washi tape */
.polaroid::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 120px;
  height: 30px;
  translate: -50% 0;
  rotate: 4deg;
  background: repeating-linear-gradient(45deg, rgb(2 162 241 / .38) 0 8px, rgb(2 162 241 / .26) 8px 16px);
}
.polaroid__img { aspect-ratio: 1; width: 100%; object-fit: cover; background: var(--mist); }
.polaroid figcaption {
  padding: .5rem 0 .9rem;
  text-align: center;
  font-size: 2.1rem;
  line-height: 1.2;
  color: var(--navy);
}

.meet__text p { margin: 0 0 1.1rem; max-width: 60ch; }
.dropcap::first-letter {
  float: left;
  font-family: var(--script);
  font-size: 5.4rem;
  line-height: .72;
  padding: .12em .12em 0 0;
  color: var(--berry);
}
.pull {
  margin: .4rem 0 1.6rem;
  padding: 0;
  font-family: var(--script);
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  line-height: 1.05;
  color: var(--berry);
  transform: rotate(-2deg);
  transform-origin: left center;
}

.census {
  margin: 2rem 0 0;
  max-width: 420px;
  padding: 1.1rem 1.4rem;
  background:
    repeating-linear-gradient(transparent 0 2.15rem, rgb(2 162 241 / .25) 2.15rem calc(2.15rem + 1px)),
    #fff;
  background-position: 0 .55rem;
  border-left: 2px solid rgb(182 2 95 / .35);
  box-shadow: 0 16px 30px -24px rgb(74 14 46 / .6);
  transform: rotate(1deg);
}
.census div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  height: 2.15rem;
}
.census dt { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; }
.census dd { margin: 0; font-family: var(--script); font-size: 1.9rem; line-height: 1; color: var(--navy); }
.census dd.script { color: var(--berry); }

/* ---------- Footer ---------- */

.foot {
  padding: 3rem 1rem 3.5rem;
  text-align: center;
  background: linear-gradient(transparent, rgb(226 242 251 / .9));
}
.foot__heart { width: 92px; margin: 0 auto 1rem; }
.foot .lockup { margin-bottom: 1.4rem; }
.foot__note { max-width: 42ch; margin: 0 auto .8rem; }
.foot__copy { margin: 0; font-size: .82rem; opacity: .7; }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  /* Flowers across the top, logo underneath on a white wash. */
  .hero {
    justify-items: center;
    min-height: 0;
    padding-top: 42vw;
    background:
      linear-gradient(transparent 22%, rgb(255 255 255 / .8) 42%, rgb(255 255 255 / .9)),
      url("/assets/img/mums-wood.jpg") left top / 190% auto no-repeat,
      #cfe9f5;
  }
  .buy__body, .meet { grid-template-columns: 1fr; }
  /* You can't scan a QR code with the phone that's showing it. */
  .buy__cta { display: none; }
  .steps { max-width: 30rem; margin-inline: auto; }
  .polaroid { max-width: 300px; margin-inline: auto; }
  .lockup--left { justify-items: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stack__book img { transition: none; }
}
