/* ------------------------------------------------------------------
   Our Little Bake Stand
   Kraft-paper table, index cards, a scalloped sign, and stickers.
   Colors that change with the season live on each item (color: in
   the item file), so this base works all year.
------------------------------------------------------------------- */

@font-face {
  font-family: "Amatic SC";
  src: url("fonts/AmaticSC-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Patrick Hand";
  src: url("fonts/PatrickHand-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --kraft: #D5BD94;
  --paper: #FFFCF3;
  --ink: #3D352D;
  --ink-soft: #6A5C4D;
  --brown: #8B4A1F;
  --brown-deep: #5E3216;
  --rule: #BCD0E4;
  --margin-red: #E6A098;
  --sticky: #F6E58E;
  --pen-blue: #2D5689;

  --line: 2rem; /* one ruled line on the cards */
  --hand: "Patrick Hand", "Chalkboard SE", "Comic Neue", "Segoe Print", cursive, sans-serif;
  --marker: "Amatic SC", "Chalkboard SE", "Marker Felt", cursive, sans-serif;

  color-scheme: light;
}

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

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

body {
  margin: 0;
  font-family: var(--hand);
  font-size: 1.25rem;
  line-height: var(--line);
  color: var(--ink);
  background-color: var(--kraft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
}

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

a { color: inherit; }

:focus-visible {
  outline: 3px dashed var(--brown);
  outline-offset: 3px;
}

/* ---------- The sign (the one loud thing on the page) ---------- */

.sign {
  position: relative;
  max-width: 31rem;
  margin: 0 auto 4rem;
  padding: 2.75rem 2.25rem 2.25rem;
  text-align: center;
  background-color: var(--paper);
  border: 22px solid transparent;
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M6 6a3 3 0 0 1 6 0a3 3 0 0 1 6 0a3 3 0 0 1 6 0a3 3 0 0 1 6 0a3 3 0 0 1 6 0a3 3 0 0 1 6 0a3 3 0 0 1 0 6a3 3 0 0 1 0 6a3 3 0 0 1 0 6a3 3 0 0 1 0 6a3 3 0 0 1 0 6a3 3 0 0 1 0 6a3 3 0 0 1 -6 0a3 3 0 0 1 -6 0a3 3 0 0 1 -6 0a3 3 0 0 1 -6 0a3 3 0 0 1 -6 0a3 3 0 0 1 -6 0a3 3 0 0 1 0 -6a3 3 0 0 1 0 -6a3 3 0 0 1 0 -6a3 3 0 0 1 0 -6a3 3 0 0 1 0 -6a3 3 0 0 1 0 -6Z' fill='none' stroke='%23A65B24' stroke-width='2.2'/%3E%3C/svg%3E") 12 round;
  transform: rotate(-1.2deg);
  filter: drop-shadow(0 10px 14px rgba(70, 44, 18, .28));
}

.sign__name {
  font-size: 1.35rem;
  color: var(--ink-soft);
  letter-spacing: .02em;
}

.sign__headline {
  margin: .5rem 0 .75rem;
  font-family: var(--marker);
  font-weight: 700;
  font-size: clamp(3.4rem, 12vw, 5.4rem);
  line-height: .92;
  color: var(--brown);
  text-shadow: .03em .03em 0 rgba(166, 91, 36, .22);
  text-wrap: balance;
}

.sign__bakers {
  font-size: 1.35rem;
  color: var(--ink);
}

.sign__today {
  display: inline-block;
  margin-top: 1rem;
  padding: 0 .4rem;
  font-size: 1.1rem;
  color: var(--brown-deep);
  background: linear-gradient(transparent 58%, rgba(246, 229, 142, .9) 58%, rgba(246, 229, 142, .9) 92%, transparent 92%);
}

.doodle {
  position: absolute;
  filter: url(#wobble);
  pointer-events: none;
}
.doodle--sprig  { width: 4.2rem; height: 4.9rem; top: .1rem; left: .4rem; transform: rotate(-8deg); }
.doodle--heart  { width: 2.8rem; height: 2.8rem; top: .9rem; right: 1.1rem; transform: rotate(12deg); }
.doodle--heart2 { width: 2rem; height: 2rem; bottom: 1.6rem; right: 1.2rem; transform: rotate(-10deg); }
.doodle--cookie { width: 4.8rem; height: 4.1rem; bottom: .3rem; left: .3rem; }
.doodle--rays   { width: 1.8rem; height: 1.8rem; bottom: 4.1rem; left: 4.6rem; }

/* ---------- Index cards ---------- */

.card {
  position: relative;
  padding: var(--line) 1.5rem var(--line);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--margin-red), var(--margin-red)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  background-size: 100% 2px, 100% 100%;
  background-position: 0 calc(var(--line) * 3 - 4px), 0 -4px;
  background-repeat: no-repeat, repeat;
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(60, 40, 20, .12), 0 12px 20px -12px rgba(60, 38, 16, .55);
  transform: rotate(var(--tilt, 0deg));
}

.card h2 {
  font-family: var(--marker);
  font-weight: 700;
  font-size: 3rem;
  line-height: calc(var(--line) * 2);
  color: var(--brown);
  margin-bottom: var(--line);
}

.card p { margin-bottom: var(--line); }
.card > :last-child { margin-bottom: 0; }

.tape {
  position: absolute;
  top: -.9rem;
  left: 50%;
  width: 7.5rem;
  height: 1.9rem;
  transform: translateX(-50%) rotate(-3deg);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .28) 0 6px, transparent 6px 12px),
    color-mix(in srgb, var(--item, #C7A86A) 42%, rgba(255, 252, 240, .55));
  clip-path: polygon(0 8%, 4% 0, 8% 10%, 12% 0, 16% 8%, 100% 0, 100% 92%, 96% 100%, 92% 90%, 88% 100%, 84% 92%, 0 100%);
  opacity: .9;
}

/* ---------- How to pay ---------- */

.pay {
  --tilt: .6deg;
  margin-bottom: 4.5rem;
}

.pay__list {
  list-style: none;
  margin: 0 0 var(--line);
  padding: 0;
}

.pay__method {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1rem;
  min-height: calc(var(--line) * 2);
}

.pay__name {
  flex: 0 0 5.5rem;
  font-family: var(--marker);
  font-weight: 700;
  font-size: 2.25rem;
  line-height: calc(var(--line) * 2);
  color: var(--brown);
}

.pay__detail {
  flex: 1 1 12rem;
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.pay__action {
  min-height: 2.75rem;
  margin: .25rem 0;
  padding: 0 1.1rem;
  font: inherit;
  font-size: 1.15rem;
  color: var(--brown-deep);
  text-decoration: none;
  line-height: 2.5rem;
  background: transparent;
  border: 2px solid var(--brown);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  cursor: pointer;
}
.pay__action:hover { background: rgba(246, 229, 142, .55); }

.pay__thanks { color: var(--ink-soft); }

/* ---------- On the stand ---------- */

.table-heading,
.archive h2 {
  font-family: var(--marker);
  font-weight: 700;
  font-size: 3.25rem;
  line-height: 1.1;
  color: var(--brown-deep);
  margin: 0 0 2rem .25rem;
}

.item {
  display: grid;
  grid-template-columns: 11rem 1fr;
  align-items: start;
  margin-bottom: 4rem;
}

.item__sticker {
  position: relative;
  z-index: 2;
  margin: 1.5rem -2.75rem 0 0;
  transform: rotate(calc(var(--tilt) * -5));
}

.item:nth-of-type(even) { grid-template-columns: 1fr 11rem; }
.item:nth-of-type(even) .item__sticker { order: 2; margin: 1.5rem 0 0 -2.75rem; }
.item:nth-of-type(even) .item__card { order: 1; }

.item__card { padding-left: 3.75rem; }
.item:nth-of-type(even) .item__card { padding-left: 1.5rem; padding-right: 3.75rem; }

.sticker {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  filter: drop-shadow(0 5px 6px rgba(60, 38, 16, .38));
}

.sticker--plain {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 1rem;
  text-align: center;
  background: var(--paper);
  border: 3px dashed var(--item, var(--brown));
  box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 8px color-mix(in srgb, var(--item, var(--brown)) 35%, transparent);
}
.sticker--plain span {
  font-family: var(--marker);
  font-weight: 700;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--item, var(--brown));
}
.sticker--plain small {
  display: block;
  margin-top: .3rem;
  font-family: var(--hand);
  font-size: 1rem;
  color: var(--ink-soft);
}

.item__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: var(--line);
}

.item h3 {
  font-family: var(--marker);
  font-weight: 700;
  font-size: 3rem;
  line-height: calc(var(--line) * 2);
  color: var(--item);
}

.item h3 .kind { display: block; line-height: var(--line); margin-top: -.25rem; }

.kind {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--ink-soft);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  margin: calc(var(--line) * -.5) 0 var(--line) !important;
  padding: 0;
  list-style: none;
}
.tag {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 8rem;
  padding: .3rem 1rem .5rem 2.1rem;
  background:
    radial-gradient(circle at 1rem 50%, var(--paper) .28rem, #7A5A36 .3rem, #7A5A36 .38rem, transparent .4rem),
    #EBD3A4;
  clip-path: polygon(1.2rem 0, 100% 0, 100% 100%, 1.2rem 100%, 0 50%);
  filter: drop-shadow(0 2px 2px rgba(60, 38, 16, .25));
  transform: rotate(-3deg);
}
.tag:nth-child(even) { transform: rotate(2.5deg) translateY(.2rem); }
.tag__price {
  font-family: var(--marker);
  font-weight: 700;
  font-size: 2.4rem;
  line-height: 2.4rem;
  color: var(--ink);
}
.tag small { font-size: 1.05rem; line-height: 1.2rem; color: var(--ink-soft); }

.item h4 {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: var(--line);
  color: var(--item);
  text-decoration: underline wavy;
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
}

.contains mark {
  color: inherit;
  padding: 0 .15rem;
  background: linear-gradient(transparent 55%, rgba(246, 229, 142, .95) 55%, rgba(246, 229, 142, .95) 92%, transparent 92%);
}

.polaroid {
  float: right;
  width: 42%;
  margin: 0 0 1rem 1rem;
  padding: .5rem .5rem 1.75rem;
  background: #fff;
  box-shadow: 0 6px 12px -6px rgba(60, 38, 16, .5);
  transform: rotate(3deg);
}
.polaroid img { display: block; width: 100%; height: auto; }

.empty {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 2rem;
  font-size: 1.3rem;
  color: var(--brown-deep);
  text-align: center;
  background: var(--paper);
  border: 2px dashed var(--brown);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transform: rotate(-.8deg);
}
.empty p { margin: 0 0 1rem; }
.empty > :last-child { margin-bottom: 0; }
.empty__cookie {
  display: block;
  width: 5rem;
  height: 4.3rem;
  margin: 0 auto .5rem;
  filter: url(#wobble);
  transform: rotate(-10deg);
}
.empty__title {
  font-family: var(--marker);
  font-weight: 700;
  font-size: 2.6rem;
  line-height: 1.1;
  color: var(--brown);
}
.empty strong {
  font-weight: normal;
  font-size: 1.4rem;
  color: var(--brown);
  background: linear-gradient(transparent 58%, rgba(246, 229, 142, .9) 58%, rgba(246, 229, 142, .9) 92%, transparent 92%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.empty__small { font-size: 1.1rem; color: var(--ink-soft); }
.empty__contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem .75rem;
}
.empty .pay__action { display: inline-block; overflow-wrap: anywhere; }

/* ---------- Why we're doing this: a notebook page ---------- */

.notebook {
  position: relative;
  margin: 1rem 0 4.5rem;
  padding: var(--line) 1.75rem calc(var(--line) * 1.5) 4.75rem;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 1.6rem 15%, var(--kraft) .55rem, transparent .6rem),
    radial-gradient(circle at 1.6rem 50%, var(--kraft) .55rem, transparent .6rem),
    radial-gradient(circle at 1.6rem 85%, var(--kraft) .55rem, transparent .6rem),
    linear-gradient(to right, transparent 3.6rem, var(--margin-red) 3.6rem, var(--margin-red) calc(3.6rem + 2px), transparent calc(3.6rem + 2px)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  background-position: 0 0, 0 0, 0 0, 0 0, 0 -4px;
  box-shadow: 0 1px 0 rgba(60, 40, 20, .12), 0 14px 22px -14px rgba(60, 38, 16, .6);
  transform: rotate(-.5deg);
}

.notebook h2 {
  font-family: var(--marker);
  font-weight: 700;
  font-size: 3rem;
  line-height: calc(var(--line) * 2);
  color: var(--brown);
  margin-bottom: var(--line);
}

.notebook p {
  max-width: 34rem;
  margin-bottom: var(--line);
}

.kid-note {
  width: min(16rem, 100%);
  margin: calc(var(--line) * -.25) 0 0 auto;
  padding: 1rem 1.1rem 1.2rem;
  font-size: 1.3rem;
  line-height: 1.6rem;
  color: var(--pen-blue);
  background: var(--sticky);
  box-shadow: 0 10px 14px -10px rgba(60, 38, 16, .55);
  transform: rotate(3.5deg);
}
.kid-note p { margin: 0; }

/* ---------- Baked before ---------- */

.archive { margin-bottom: 3rem; }

.archive__intro {
  max-width: 34rem;
  margin: -1.25rem 0 2rem .25rem;
  color: var(--brown-deep);
}

.archive__list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.past {
  width: 8.5rem;
  text-align: center;
}
.past:nth-child(odd) { transform: rotate(-4deg); }
.past:nth-child(even) { transform: rotate(3deg); }

.past .sticker { filter: saturate(.75) drop-shadow(0 4px 4px rgba(60, 38, 16, .3)); }
.past .sticker--plain span { font-size: 1.5rem; }

.past__name { margin-top: .5rem; color: var(--brown-deep); }
.past__price { font-size: 1rem; line-height: 1.3rem; color: var(--ink-soft); }

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

.footer {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  font-size: 1.05rem;
  line-height: 1.5rem;
  text-align: center;
  color: var(--brown-deep);
}
.footer p + p { margin-top: .75rem; opacity: .8; }

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

@media (max-width: 40rem) {
  body { font-size: 1.2rem; }

  .sign { padding: 3rem 1.5rem 3.25rem; }
  .doodle--sprig { width: 3rem; height: 3.5rem; }
  .doodle--cookie { width: 3.6rem; height: 3.1rem; }
  .doodle--rays { display: none; }

  .card { padding-left: 1.25rem; padding-right: 1.25rem; }

  .item,
  .item:nth-of-type(even) { grid-template-columns: 1fr; }

  .item__sticker,
  .item:nth-of-type(even) .item__sticker {
    order: 0;
    justify-self: end;
    width: 8.5rem;
    margin: 0 .25rem -5.5rem 0;
  }
  .item:nth-of-type(even) .item__card { order: 1; }

  .item__card,
  .item:nth-of-type(even) .item__card { padding: var(--line) 1.25rem; }

  .item__head {
    flex-direction: column;
    gap: 0;
    padding-right: 7rem;
  }
  .item .tape { left: 38%; }
  .item h3 { font-size: 2.75rem; }

  .notebook { padding-left: 3.75rem; padding-right: 1.25rem; }
  .notebook {
    background-image:
      radial-gradient(circle at 1.1rem 15%, var(--kraft) .45rem, transparent .5rem),
      radial-gradient(circle at 1.1rem 50%, var(--kraft) .45rem, transparent .5rem),
      radial-gradient(circle at 1.1rem 85%, var(--kraft) .45rem, transparent .5rem),
      linear-gradient(to right, transparent 2.6rem, var(--margin-red) 2.6rem, var(--margin-red) calc(2.6rem + 2px), transparent calc(2.6rem + 2px)),
      repeating-linear-gradient(to bottom, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  }
}

@media print {
  body { background: #fff; }
  .card, .notebook, .sign { box-shadow: none; filter: none; transform: none; }
  .pay__action { display: none; }
}
