/* Addie's Cleaning Services
   A web version of the printed flyer (reference/flyer.jpg): cream paper, sage ink,
   a brush-script wordmark and a warm serif. One file, no build step. */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */

@font-face {
  font-family: "Alex Brush";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/alex-brush-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: Lora;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/lora-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: Lora;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/lora-latin-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: Lora;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/lora-latin-600-normal.woff2") format("woff2");
}

/* Stand-in for Alex Brush while it loads, or where web fonts are blocked.
   Windows' script font runs half again as wide, so it is scaled down to about
   the same width; other systems fall through to the next font in the stack. */
@font-face {
  font-family: "Alex Brush Fallback";
  src: local("Segoe Script");
  size-adjust: 66%;
}

/* ---------- Tokens ---------- */

:root {
  /* Sampled from the flyer. */
  --cream: #f5eede;
  --card: #f9f4e7;
  --sage: #586044;
  --sage-deep: #454c35;
  --ink: #2b2a22;
  --tan: #c2b48f;
  --rule: rgb(88 96 68 / 0.55);

  --font-script: "Alex Brush", "Alex Brush Fallback", "Snell Roundhand", "Brush Script MT", cursive;
  --font-serif: Lora, Georgia, "Times New Roman", serif;

  --gutter: clamp(1rem, 4.5vw, 2rem);
  --page: 68rem;
  --radius: 1.5rem;

  color-scheme: light;
  color-scheme: only light;
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  /* viewport-fit=cover lets the page run edge to edge; these keep its content
     out from under the notch when a phone is held sideways. */
  padding-right: env(safe-area-inset-right);
  padding-left: env(safe-area-inset-left);
  background-color: var(--cream);
  /* A little unevenness, like the flyer's paper. */
  background-image:
    radial-gradient(60rem 36rem at 12% 0%, rgb(255 255 255 / 0.4), transparent 62%),
    radial-gradient(48rem 40rem at 96% 46%, rgb(214 203 170 / 0.26), transparent 66%),
    radial-gradient(52rem 36rem at 4% 92%, rgb(214 203 170 / 0.22), transparent 64%);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--sage-deep);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.22em;
}

:focus-visible {
  outline: 3px solid var(--sage-deep);
  outline-offset: 3px;
}

::selection {
  background: var(--sage);
  color: var(--cream);
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.script {
  font-family: var(--font-script);
  font-weight: 400;
}

.sparkle,
.heart {
  flex: none;
  width: 1em;
  height: 1em;
}

.sparkle {
  color: var(--tan);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.5rem 1.5rem;
  border: 2px solid var(--sage);
  border-radius: 999px;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 0.18s ease-out,
    border-color 0.18s ease-out,
    color 0.18s ease-out;
}

.btn--solid {
  background-color: var(--sage);
  color: var(--cream);
  box-shadow: 0 0.35rem 0.9rem -0.45rem rgb(43 42 34 / 0.55);
}

.btn--solid:hover {
  border-color: var(--sage-deep);
  background-color: var(--sage-deep);
}

.btn--outline {
  background-color: rgb(249 244 231 / 0.7);
  color: var(--sage-deep);
}

.btn--outline:hover {
  background-color: rgb(88 96 68 / 0.12);
}

.btn:active {
  translate: 0 1px;
}

/* Button group: the two message buttons, then the number in plain text
   for visitors on a computer, where a text link does nothing. */
.cta {
  display: grid;
  gap: 0.75rem;
  justify-items: stretch;
  width: min(100%, 21rem);
  margin-inline: auto;
}

.number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-height: 2.75rem;
  padding-inline: 0.75rem;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  font-variant-numeric: lining-nums;
}

/* ---------- Header ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.1rem, 4.5vw, 3rem) var(--gutter) clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}

.hero > :not(.leaf),
.closing > :not(.leaf),
.notfound > :not(.leaf) {
  position: relative;
}

/* Leaf sprigs in the corners of the header and the closing section.
   Decoration only: they sit clear of the lettering and shrink on phones
   so they never crowd the buttons. */
.leaf {
  position: absolute;
  width: clamp(3.75rem, 14vw, 13rem);
  aspect-ratio: 200 / 250;
  color: var(--sage);
  pointer-events: none;
}

.leaf--top-left {
  top: -0.5rem;
  left: -1.1rem;
}

.leaf--top-right {
  top: -0.5rem;
  right: -1.1rem;
  scale: -1 1;
}

.leaf--bottom-left {
  bottom: -0.5rem;
  left: -1.1rem;
  scale: 1 -1;
}

.leaf--bottom-right {
  right: -1.1rem;
  bottom: -0.5rem;
  scale: -1 -1;
}

.leaf__back {
  opacity: 0.32;
}

.wordmark {
  position: relative;
  display: grid;
  justify-items: center;
  width: fit-content;
  margin-inline: auto;
  color: var(--sage);
  line-height: 1;
}

/* The flyer's small sparkles beside the name. Wide screens only: on a phone
   the margins belong to the leaves. */
.wordmark__sparkles {
  display: none;
  position: absolute;
  width: 3rem;
  height: 3rem;
  color: var(--tan);
}

.wordmark__sparkles--left {
  top: 58%;
  right: calc(100% + 0.5rem);
}

.wordmark__sparkles--right {
  top: 2%;
  left: calc(100% + 0.25rem);
}

.wordmark__top {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  font-size: clamp(3.5rem, 17.5vw, 7.75rem);
}

.wordmark__roof {
  flex: none;
  width: 0.92em;
  height: 0.77em;
  margin-right: -0.14em;
  margin-bottom: 0.3em;
}

.wordmark .script {
  padding-right: 0.08em;
  line-height: 1.05;
  /* The flyer's wordmark is a heavier brush than the font's single weight. */
  -webkit-text-stroke: 0.014em currentColor;
}

.wordmark .serif {
  margin-top: -0.32em;
  font-size: clamp(1.7rem, 7.6vw, 3.5rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* One line with the web font. With a wider stand-in font the two halves
   stack instead of running off the screen. */
.tagline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 0.6em;
  margin-top: 0.7rem;
  color: var(--sage-deep);
  font-size: clamp(0.8125rem, 3.9vw, 1.0625rem);
  letter-spacing: 0.13em;
}

.tagline span {
  white-space: nowrap;
}

.tagline .sparkle {
  width: 0.85em;
  height: 0.85em;
}

/* One line with the web font; wraps evenly if a stand-in font runs wide. */
.line {
  margin-top: 0.15rem;
  color: var(--sage-deep);
  font-family: var(--font-script);
  font-size: clamp(1.3rem, 6.9vw, 2.1rem);
  line-height: 1.25;
  text-wrap: balance;
}

.line .heart {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-left: 0.1em;
  vertical-align: -0.04em;
}

.hero .cta {
  margin-top: clamp(0.9rem, 3vw, 1.5rem);
}

/* ---------- Page rhythm ---------- */

main {
  display: grid;
  row-gap: clamp(1.5rem, 4.5vw, 2.5rem);
}

.areas,
.packages,
.card--wide {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

/* ---------- Areas served ---------- */

.areas {
  padding-block: 0.9rem 1.1rem;
  border-block: 1px solid var(--rule);
  text-align: center;
}

.areas h2 {
  color: var(--sage);
  font-family: var(--font-script);
  font-size: clamp(1.75rem, 7.4vw, 2.2rem);
  font-weight: 400;
  line-height: 1.2;
}

.areas ul {
  margin-top: 0.3rem;
}

/* Towns run as centred lines with a dot between neighbours. Each width has a
   set number of towns per line, so no line ever ends on a stray dot. */
.areas li {
  display: inline;
  white-space: nowrap;
}

.areas li:not(:last-child)::after {
  content: "·";
  content: "·" / "";
  margin-inline: 0.5em 0.25em;
  color: var(--sage);
  font-weight: 600;
}

@media (max-width: 22.49rem) {
  .areas li:nth-child(2n):not(:last-child)::after {
    content: "\A";
    margin: 0;
    white-space: pre;
  }
}

@media (min-width: 22.5rem) and (max-width: 29.99rem) {
  .areas li:nth-child(3n):not(:last-child)::after {
    content: "\A";
    margin: 0;
    white-space: pre;
  }
}

@media (min-width: 30rem) and (max-width: 44.99rem) {
  .areas li:nth-child(4n):not(:last-child)::after {
    content: "\A";
    margin: 0;
    white-space: pre;
  }
}

@media (min-width: 45rem) {
  .areas li:nth-child(6)::after {
    content: "\A";
    margin: 0;
    white-space: pre;
  }
}

.state {
  margin-top: 0.45rem;
  color: var(--sage-deep);
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ---------- Cards ---------- */

.packages {
  display: grid;
  gap: clamp(1rem, 3vw, 1.5rem);
}

.card {
  --pad: clamp(1rem, 4vw, 1.5rem);

  display: grid;
  grid-template-columns: auto 1fr;
  align-content: start;
  column-gap: 0.65rem;
  overflow: hidden;
  padding: 0 var(--pad) calc(var(--pad) + 0.15rem);
  border: 1.5px solid var(--sage);
  border-radius: var(--radius);
  background-color: var(--card);
}

.card__icon {
  grid-row: 1 / span 2;
  align-self: center;
  width: clamp(2.9rem, 12.5vw, 3.6rem);
  height: clamp(2.9rem, 12.5vw, 3.6rem);
  margin-top: 0.65rem;
  color: var(--sage);
}

/* The flyer's header tab: a sage pill that runs off the card's right edge. */
.card__tab {
  grid-column: 2;
  margin-right: calc(var(--pad) * -1);
  padding: 0.5rem var(--pad) 0.55rem 1.15rem;
  border-radius: 1.6rem 0 0 1.6rem;
  background-color: var(--sage);
  color: var(--cream);
  font-size: clamp(1.35rem, 6vw, 1.6rem);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
}

.subtitle {
  grid-column: 2;
  margin-top: 0.4rem;
  font-size: 1.125rem;
  font-style: italic;
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
}

.checklist {
  display: grid;
  grid-column: 1 / -1;
  gap: 0.22rem;
  margin-top: 0.85rem;
}

.checklist li {
  position: relative;
  padding-left: 1.8em;
  line-height: 1.4;
}

/* The flyer's round tick: a sage disc with a cream check. */
.checklist li::before {
  content: "";
  position: absolute;
  top: 0.19em;
  left: 0;
  width: 1.05em;
  height: 1.05em;
  border-radius: 50%;
  background: var(--sage)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 12.6l3.5 3.5 7.3-8' fill='none' stroke='%23f5eede' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 100% no-repeat;
}

@media (forced-colors: active) {
  .checklist li::before {
    forced-color-adjust: none;
  }
}

.aside {
  font-size: 0.84em;
}

.body {
  grid-column: 1 / -1;
  margin-top: 1.1rem;
  font-size: clamp(1.2rem, 5.2vw, 1.45rem);
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}

.divider {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 0.9rem;
  color: var(--sage);
}

.divider::before,
.divider::after {
  content: "";
  width: clamp(3rem, 18vw, 5.5rem);
  height: 1px;
  background: var(--rule);
}

.divider .heart {
  width: 1.6rem;
  height: 1.6rem;
}

/* Add-ons: one wide card whose title sits in a pill, as on the flyer. */
.card--wide {
  display: block;
  padding-top: var(--pad);
}

.card__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 1.5rem 0.4rem 0.45rem;
  border-radius: 999px;
  background-color: var(--sage);
  color: var(--cream);
}

.card__pill .card__icon {
  width: 2.1rem;
  height: 2.1rem;
  margin: 0;
  color: var(--cream);
}

.card__pill h2 {
  font-size: clamp(1.35rem, 6vw, 1.6rem);
  font-weight: 600;
  line-height: 1.2;
}

.addons {
  margin-top: 0.9rem;
  padding-left: 0.35rem;
  column-gap: 2rem;
}

.addons li {
  position: relative;
  padding-left: 1.05em;
  line-height: 1.5;
  break-inside: avoid;
}

.addons li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 0.32em;
  height: 0.32em;
  border-radius: 50%;
  background-color: var(--ink);
}

/* ---------- Closing call to action ---------- */

.closing {
  position: relative;
  overflow: hidden;
  padding: clamp(0.5rem, 2vw, 1.5rem) var(--gutter) clamp(2.75rem, 7vw, 4rem);
  text-align: center;
}

/* The flyer's banner: the script line in cream on a sage pill. On a phone it is one
   line that hugs its words, a little narrower and no taller than the buttons beneath
   it, so it reads as their heading and not as one more button. Wide screens get the
   flyer's full-size banner (see the 45rem block below). */
.closing__banner {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 0.3em 0.9em 0.22em;
  border-radius: 999px;
  background-color: var(--sage);
  color: var(--cream);
  font-size: clamp(1.5rem, 7.2vw, 1.75rem);
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
}

.closing__banner .heart {
  display: inline-block;
  width: 0.66em;
  height: 0.66em;
  margin-left: 0.12em;
  vertical-align: -0.04em;
}

.closing .cta {
  margin-top: clamp(1.1rem, 3vw, 1.6rem);
}

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

.footer {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 1.5rem var(--gutter) calc(2rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
  text-align: center;
}

.footer__name {
  color: var(--sage);
  font-size: 1.1875rem;
  font-weight: 600;
}

.footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding-inline: 0.75rem;
  font-weight: 600;
}

/* ---------- Page not found (404.html) ---------- */

/* One screen: the name, what happened and the way back, framed by the leaves. */
.notfound {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  row-gap: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(2rem, 8vw, 4rem) var(--gutter) calc(clamp(2rem, 8vw, 4rem) + env(safe-area-inset-bottom));
  text-align: center;
}

/* The name steps down here: on this page the message is what the visitor needs. */
.notfound .wordmark__top {
  font-size: clamp(3rem, 14vw, 5rem);
}

.notfound .wordmark .serif {
  font-size: clamp(1.45rem, 6.2vw, 2.25rem);
}

.notfound__title {
  margin-top: clamp(1.75rem, 6vw, 2.75rem);
  color: var(--sage-deep);
  font-size: clamp(1.5rem, 6.4vw, 2.125rem);
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

.notfound__text {
  margin-top: 0.5rem;
  text-wrap: balance;
}

/* The label is long, so on the narrowest phones it may take two even lines. */
.notfound .btn {
  max-width: 100%;
  margin-top: 1.75rem;
  text-wrap: balance;
}

/* ---------- Sticky message bar (phones) ---------- */

/* Shown by the script in index.html only while no other set of message
   buttons is on screen. */
.sticky-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  padding: 0.6rem max(var(--gutter), env(safe-area-inset-right)) calc(0.6rem + env(safe-area-inset-bottom))
    max(var(--gutter), env(safe-area-inset-left));
  border-top: 1px solid var(--rule);
  background-color: var(--cream);
  box-shadow: 0 -0.5rem 1.25rem -0.75rem rgb(43 42 34 / 0.45);
  transition:
    translate 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.28s ease-out;
}

/* Slides up from the edge when it appears, where the browser supports it. */
@starting-style {
  .sticky-bar {
    opacity: 0;
    translate: 0 100%;
  }
}

.sticky-bar .btn {
  min-height: 2.875rem;
  padding-inline: 1.15rem;
}

.sticky-bar .btn--solid {
  box-shadow: none;
}

/* Never on wide screens, and never on a short one such as a phone held
   sideways, where it would take too much of the view. */
@media (min-width: 45rem), (max-height: 29.99rem) {
  .sticky-bar {
    display: none;
  }
}

@media (min-width: 30rem) and (max-width: 44.99rem) {
  .addons {
    columns: 2;
  }
}

@media (min-width: 45rem) {
  .cta {
    grid-template-columns: 1fr 1fr;
    width: min(100%, 36rem);
  }

  .cta .number {
    grid-column: 1 / -1;
  }

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

  /* Two cards share the row here, so the tab titles step down to stay on one line. */
  .card__tab {
    font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  }

  /* Room for the flyer's banner at its full size. */
  .closing__banner {
    width: min(100%, 40rem);
    padding: 0.34em 0.8em 0.26em;
    font-size: 3.25rem;
  }

  /* Beside the banner and buttons the bottom leaves only get the spare margin. */
  .leaf--bottom-left,
  .leaf--bottom-right {
    width: clamp(3.75rem, calc((100vw - 40rem) / 2), 13rem);
  }

  /* Three columns of 4, 3 and 3, reading down each column like the flyer. */
  .addons {
    columns: 3;
  }

  .addons li:nth-child(4),
  .addons li:nth-child(7) {
    break-after: column;
  }

  /* The flyer frames the tagline with a thin rule on each side. */
  .tagline::before,
  .tagline::after {
    content: "";
    width: clamp(2rem, 7vw, 5rem);
    height: 1px;
    background: var(--rule);
  }
}


@media (min-width: 60rem) {
  .wordmark__sparkles {
    display: block;
  }
}

@media (min-width: 64rem) {
  .leaf--top-left,
  .leaf--top-right {
    width: min(13rem, 16.25vw);
  }
}

@media (max-width: 22.49rem) {
  /* Very narrow phones: the longest card title and the bar's labels each
     keep to one line. */
  .card__tab {
    padding-left: 0.9rem;
    font-size: 1.125rem;
  }

  .sticky-bar {
    gap: 0.5rem;
  }

  .sticky-bar .btn {
    padding-inline: 0.7rem;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation: none !important;
  }
}
