/* The zen garden footer: the footer of a small tea house on a white page, its whole ground a raked sand garden lit
   by a low sun, with the newsletter, three columns of links and the small print on top and the house's name pressed
   into the sand along the bottom. */
:root {
  --page: #ffffff;          /* the page */
  --sand: #e6dfd1;          /* the sand on flat ground */
  --sand-lit: #fcfaf4;      /* the sand on the slopes facing the sun */
  --sand-shade: #b0a490;    /* the sand on the slopes turned away from it */
  --stone: #4d4944;         /* the stones */
  --stone-lit: #a19a8e;     /* the stones where the sun catches them */
  --stone-dark: #1f1d1b;    /* the stones in their own shadow */
  --moss: #55632a;          /* the moss */
  --moss-lit: #95a24a;      /* the moss in the sun */
  --moss-dark: #232b0f;     /* the moss in shadow */
  --wood: #c29c62;          /* the rake */
  --wood-lit: #efdcb0;      /* the rake's sunny side */
  --wood-dark: #6f5230;     /* the rake's shady side and its teeth */
  --ink: #26221d;           /* titles, the link pointed at, the button */
  --muted: #51483e;         /* links and text */
  --faint: #685d51;         /* the small print and the help under the field */
  --field: #f8f5ee;         /* the email field */
  --line: #cfc4b2;          /* the edge of the field */
  --button-ink: #f8f5ee;    /* the word on the button */
  --focus: #3c5a35;         /* the focus ring, and the thanks */
  --wrong: #9e3720;         /* an email that does not look right */
}

* {
  box-sizing: border-box;
}

/* a tap is a click at once: no wait for a double tap */
html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 40px 16px;
}

/* ---------------------------------------------------------------- the footer and its garden */
.zg {
  position: relative;
  width: min(1080px, 100%);
  padding: 36px 44px 6px;
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
  background: var(--sand);
  color: var(--muted);
  box-shadow: 0 1px 2px rgba(70, 54, 30, 0.12), 0 34px 60px -38px rgba(70, 54, 30, 0.5);
  /* a finger dragged sideways rakes the sand; up and down still scrolls the page */
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

/* the sand (drawn at half size and smoothed up), the grain and the stones, and the rake: all behind the words */
.zg__sand,
.zg__still,
.zg__rake {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.zg__top,
.zg__base,
.zg__foot {
  position: relative;
  z-index: 1;
}

.zg__top {
  display: grid;
  grid-template-columns: minmax(0, 372px) minmax(120px, 1fr) minmax(0, 408px);
  gap: 0 24px;
  align-items: start;
}

/* ---------------------------------------------------------------- where the stones lie */
.zg__garden {
  position: relative;
  align-self: stretch;
  min-height: 150px;
}

.zg__stone {
  position: absolute;
  display: block;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.zg__stone--big {
  left: 44%;
  top: 46%;
  width: 70px;
  height: 52px;
}

.zg__stone--small {
  left: 84%;
  top: 80%;
  width: 30px;
  height: 24px;
}

/* ---------------------------------------------------------------- the newsletter */
.zg__form {
  margin: 0;
}

.zg__title {
  margin: 0;
  color: var(--ink);
  font-family: 'Newsreader Variable', Georgia, serif;
  font-size: 26px;
  font-weight: 450;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.zg__lede {
  margin: 8px 0 18px;
  font-size: 15px;
  line-height: 22px;
  text-wrap: pretty;
}

.zg__field {
  --send-w: 112px;
  position: relative;
  height: 50px;
  border-radius: 999px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--line), 0 8px 18px -12px rgba(70, 52, 26, 0.45);
  transition: box-shadow 0.25s ease;
}

.zg__field:has(.zg__input:focus) {
  box-shadow: inset 0 0 0 1px var(--focus), 0 0 0 4px rgba(60, 90, 53, 0.16), 0 8px 18px -12px rgba(70, 52, 26, 0.45);
}

.zg__field.is-wrong,
.zg__field.is-wrong:has(.zg__input:focus) {
  box-shadow: inset 0 0 0 1px var(--wrong), 0 0 0 4px rgba(158, 55, 32, 0.14), 0 8px 18px -12px rgba(70, 52, 26, 0.45);
}

.zg__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 calc(var(--send-w) + 14px) 0 22px;
  border: 0;
  border-radius: inherit;
  outline: none;
  background: transparent;
  color: var(--ink);
  caret-color: var(--focus);
  font: 450 16px/normal 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.zg__input::placeholder {
  color: var(--faint);
  opacity: 1;
}

/* the browser's autofill paints the field light blue: back to the field's own colours */
.zg__input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 60px var(--field) inset;
  caret-color: var(--focus);
}

.zg__input[readonly] {
  color: var(--muted);
}

/* the button: the elastic pill, its word widening while the colour swells under the pointer */
.zg__send {
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  width: var(--send-w);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--button-ink);
  font: 600 15px/1 'Mona Sans Variable', system-ui, sans-serif;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.zg__send > * {
  grid-area: 1 / 1;
}

.zg__send-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--ink);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  transition: inset 0.6s cubic-bezier(0.3, 1.7, 0.45, 1), transform 0.16s ease-out;
}

.zg__send-label {
  display: block;
  font-stretch: 90%;
  white-space: nowrap;
  transition: font-stretch 0.6s cubic-bezier(0.3, 1.7, 0.45, 1);
}

@media (hover: hover) and (pointer: fine) {
  .zg__send:not([aria-disabled='true']):hover .zg__send-bg {
    inset: -2px -4px;
  }

  .zg__send:not([aria-disabled='true']):hover .zg__send-label {
    font-stretch: 108%;
  }
}

.zg__send:not([aria-disabled='true']):active .zg__send-bg {
  transform: scale(1.03, 0.88);
}

.zg__send[aria-disabled='true'] {
  cursor: default;
}

.zg__send:focus {
  outline: none;
}

.zg__send:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.zg__spin,
.zg__done {
  width: 22px;
  height: 22px;
  overflow: visible;
  opacity: 0;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zg__spin {
  stroke-width: 2.4;
  stroke-dasharray: 30 60;
}

.zg__done {
  stroke-width: 2.6;
}

/* the line under the field: help, then what went wrong, then the thanks */
.zg__note {
  position: relative;
  min-height: 20px;
  margin: 10px 0 0 22px;
  color: var(--faint);
  font-size: 13.5px;
  line-height: 20px;
}

.zg__line {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.zg__line.is-going {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  pointer-events: none;
}

.zg__line svg {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2.5px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zg__line.is-wrong {
  color: var(--wrong);
}

.zg__line.is-done {
  color: var(--ink);
}

.zg__line.is-done svg {
  color: var(--focus);
}

/* ---------------------------------------------------------------- the links */
.zg__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-top: 4px;
}

.zg__head {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: 'Newsreader Variable', Georgia, serif;
  font-size: 18px;
  font-weight: 450;
  font-style: italic;
  line-height: 22px;
}

.zg__cols ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* a link pointed at: a ring is raked round its word in the sand, and the word darkens */
.zg__link {
  position: relative;
  display: inline-block;
  padding: 4px 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 22px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.zg__link.is-on {
  color: var(--ink);
}

@media (hover: hover) and (pointer: fine) {
  .zg__link:hover {
    color: var(--ink);
  }
}

.zg__link:focus {
  outline: none;
}

.zg__link:focus-visible {
  color: var(--ink);
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- the small print */
.zg__base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 30px;
  color: var(--faint);
  font-size: 13px;
  line-height: 20px;
}

.zg__brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
}

.zg__mark {
  flex: none;
  width: 22px;
  height: 22px;
  margin-right: -8px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zg__copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
}

/* the copyright sign, drawn: the character can turn into an emoji on some phones */
.zg__copy svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
}

.zg__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 22px;
}

.zg__link--small {
  padding: 3px 0;
  font-size: 13px;
  line-height: 20px;
  color: var(--faint);
}

/* ---------------------------------------------------------------- the house's name, pressed into the sand */
.zg__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 42px;
}

/* the words are there for screen readers and to say where the letters go: what shows is the sand */
.zg__name {
  margin: 0 0 0 -6px;
  color: transparent;
  font-family: 'Newsreader Variable', Georgia, serif;
  font-size: 132px;
  font-weight: 520;
  line-height: 0.62;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.zg__stone--corner {
  position: relative;
  flex: none;
  width: 58px;
  height: 46px;
  margin: 0 46px 30px 0;
  transform: none;
}

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

/* ---------------------------------------------------------------- a narrower screen */
@media (max-width: 960px) {
  .zg__top {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.7fr);
    gap: 30px 24px;
  }

  .zg__cols {
    grid-column: 1 / -1;
  }

  .zg__base {
    flex-wrap: wrap;
  }

  /* the name keeps clear of the stone in the corner */
  .zg__name {
    font-size: calc((100vw - 240px) / 5.7);
  }
}

/* narrower still: the name on two lines, Hollow and Pine, with the stone beside Pine */
@media (max-width: 780px) {
  .zg__foot {
    position: relative;
    margin-top: 10px;
  }

  .zg__name {
    margin-left: -3px;
    font-size: min(124px, calc((100vw - 120px) / 3.5));
    line-height: 0.86;
    white-space: normal;
  }

  .zg__stone--corner {
    position: absolute;
    right: 4px;
    bottom: 22px;
    width: 52px;
    height: 40px;
    margin: 0;
  }
}

/* a phone: one column, a strip of open sand with the stones between the newsletter and the links, and the name on
   two lines */
@media (max-width: 640px) {
  .zg {
    padding: 30px 20px 8px;
    border-radius: 24px;
  }

  .zg__top {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .zg__title {
    font-size: 24px;
  }

  .zg__field {
    --send-w: 104px;
    height: 52px;
  }

  .zg__input {
    padding-left: 18px;
  }

  /* room for two lines, so a longer message never moves the rest of the footer */
  .zg__note {
    min-height: 40px;
    margin-left: 18px;
  }

  .zg__garden {
    min-height: 116px;
  }

  .zg__stone--big {
    left: 68%;
    top: 52%;
    width: 60px;
    height: 46px;
  }

  .zg__stone--small {
    left: 20%;
    top: 58%;
    width: 28px;
    height: 22px;
  }

  .zg__cols {
    gap: 10px;
  }

  .zg__head {
    margin-bottom: 6px;
    font-size: 17px;
  }

  .zg__link {
    padding: 4px 0;
    font-size: 14px;
  }

  .zg__base {
    flex-direction: column;
    align-items: flex-start;
    margin-top: 28px;
  }

  .zg__brand {
    gap: 4px 14px;
  }

  .zg__hours {
    width: 100%;
  }

  .zg__legal {
    gap: 0 20px;
  }

  .zg__link--small {
    padding: 8px 0;
  }

  .zg__name {
    font-size: calc((100vw - 72px) * 0.29);
  }
}

/* la casella bassa dell'anteprima sul telefono: il piede intero, con meno sabbia vuota fra i pezzi e il nome più
   piccolo */
@media (max-width: 640px) and (max-height: 760px) {
  .stage {
    padding: 10px 16px;
  }

  .zg {
    padding-top: 24px;
  }

  .zg__lede {
    margin-bottom: 14px;
  }

  .zg__garden {
    min-height: 64px;
  }

  .zg__stone--big {
    width: 52px;
    height: 40px;
  }

  .zg__link {
    padding: 2px 0;
  }

  .zg__base {
    margin-top: 16px;
  }

  .zg__link--small {
    padding: 4px 0;
  }

  .zg__foot {
    margin-top: 4px;
  }

  .zg__name {
    font-size: calc((100vw - 72px) * 0.2);
  }

  .zg__stone--corner {
    bottom: 12px;
    width: 44px;
    height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zg__send-label,
  .zg__send-bg {
    transition: none;
  }
}
