/* Creating & Celebrating. Colors and the white highlight dots come from the logo's lettering. */

:root {
  --paper: #fffcf6;
  --teal: #12b3c1;
  --teal-deep: #0b7d88;
  --red: #ee1c34;
  --red-deep: #c8102a;
  --gold: #c99a40;
  --gold-deep: #96701f;
  --ink: #2c2a35;
  --ink-soft: #5d5a66;
  --line: #e9dfcc;
  --sticker-shadow: #e7e0d4;
  --heading: "Fredoka", "Trebuchet MS", sans-serif;
  --body: "Nunito", "Helvetica Neue", Helvetica, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  background-color: var(--paper);
}

a {
  color: var(--teal-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Paper bunting strung across the top. Flags are placed along the string by site.js. */

.bunting {
  display: block;
  width: 100%;
  height: 112px;
  overflow: visible;
}

.bunting .string {
  fill: none;
  stroke: #c9b796;
  stroke-width: 1.5;
}

.bunting .shadow {
  fill: var(--sticker-shadow);
}

.bunting .flag-teal {
  fill: var(--teal);
}

.bunting .flag-red {
  fill: var(--red);
}

.bunting .flag-gold {
  fill: var(--gold);
}

.bunting .shine {
  fill: #ffffff;
  fill-opacity: 0.85;
}

.bunting .sway {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: drop 600ms cubic-bezier(0.3, 1.5, 0.5, 1) both, sway 6s ease-in-out infinite;
}

/* Hero: the logo, one line about the site, and a stitched ribbon. */

.hero {
  position: relative;
  z-index: 0;
  /* The hero is its own stacking context, so the logo's multiply blend needs a backdrop inside it. */
  background-color: var(--paper);
  padding: 8px 16px clamp(56px, 9vw, 96px);
  text-align: center;
}

.logo {
  margin: 0 auto;
  width: min(660px, 100%);
  line-height: 0;
}

.logo img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
  animation: pop 700ms cubic-bezier(0.25, 1.4, 0.5, 1) 150ms both;
}

.lede {
  max-width: 36ch;
  margin: clamp(8px, 2vw, 20px) auto 0;
  color: var(--ink-soft);
  font-size: clamp(19px, 2.3vw, 22px);
  line-height: 1.55;
}

.ribbon {
  display: inline-block;
  margin: 32px 0 0;
  filter: drop-shadow(2px 3px 0 var(--sticker-shadow));
  animation: pop 500ms cubic-bezier(0.25, 1.4, 0.5, 1) 650ms both;
}

.ribbon span {
  display: block;
  padding: 11px 40px;
  color: #ffffff;
  font-family: var(--heading);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  background-color: var(--red-deep);
  outline: 1.5px dashed rgba(255, 255, 255, 0.75);
  outline-offset: -6px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 50%, 100% 100%, 0 100%, 16px 50%);
}

/* Confetti around the logo, kept to the margins so it never sits on the lettering. */

.confetti {
  position: absolute;
  inset: 0;
  z-index: -1;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.confetti li {
  position: absolute;
  left: var(--x);
  top: var(--y);
  rotate: var(--r, 0deg);
  animation-delay: var(--d, 300ms);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation-name: pop;
  animation-duration: 500ms;
  animation-timing-function: cubic-bezier(0.25, 1.6, 0.5, 1);
  animation-fill-mode: both;
}

.confetti .bit {
  width: 8px;
  height: 18px;
  border-radius: 3px;
}

.confetti .small {
  width: 8px;
  height: 8px;
}

.confetti .teal {
  background-color: var(--teal);
}

.confetti .red {
  background-color: var(--red);
}

.confetti .gold {
  background-color: var(--gold);
}

.confetti .squiggle {
  width: 46px;
  height: 18px;
  border-radius: 0;
  background: none;
}

.confetti .squiggle svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.confetti .squiggle path {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}

.confetti .squiggle.teal {
  color: var(--teal);
  background: none;
}

.confetti .squiggle.red {
  color: var(--red);
  background: none;
}

.confetti .squiggle.gold {
  color: var(--gold);
  background: none;
}

.confetti .squiggle path {
  stroke: currentColor;
}

/* What the site will cover. */

.find {
  width: min(680px, calc(100% - 32px));
  margin: 0 auto;
}

.find h2 {
  margin: 0;
  color: var(--teal-deep);
  font-family: var(--heading);
  font-size: clamp(30px, 4.6vw, 40px);
  font-weight: 600;
  line-height: 1.15;
}

.flourish {
  display: block;
  width: 132px;
  height: 18px;
  margin: 8px 0 12px;
}

.flourish path {
  fill: none;
  stroke: var(--red);
  stroke-width: 3.5;
  stroke-linecap: round;
}

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

.things li {
  display: grid;
  grid-template-columns: 34px 1fr;
  padding: 20px 0;
  border-bottom: 2px dotted var(--line);
}

.things li::before {
  content: "";
  grid-row: 1 / span 2;
  width: 18px;
  height: 18px;
  margin-top: 6px;
  border-radius: 50%;
  background-color: var(--teal);
  /* The white dot is the same highlight the logo's lettering carries. */
  box-shadow: inset 4px 4px 0 -2px rgba(255, 255, 255, 0.9), 2px 2px 0 var(--sticker-shadow);
}

.things li:nth-child(3n + 2)::before {
  background-color: var(--red);
}

.things li:nth-child(3n + 3)::before {
  background-color: var(--gold);
}

.things h3 {
  margin: 0;
  color: var(--teal-deep);
  font-family: var(--heading);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
}

.things li:nth-child(3n + 2) h3 {
  color: var(--red-deep);
}

.things li:nth-child(3n + 3) h3 {
  color: var(--gold-deep);
}

.things p {
  grid-column: 2;
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.note {
  margin: 28px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  font-style: italic;
}

/* Footer under a row of dots in the logo's three colors. */

.foot {
  margin-top: clamp(72px, 12vw, 120px);
  padding: 0 16px 36px;
}

.dots {
  width: min(680px, 100%);
  height: 10px;
  margin: 0 auto 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='10'%3E%3Ccircle cx='5' cy='5' r='3.5' fill='%2312b3c1'/%3E%3Ccircle cx='21' cy='5' r='3.5' fill='%23ee1c34'/%3E%3Ccircle cx='37' cy='5' r='3.5' fill='%23c99a40'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  width: min(680px, 100%);
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 14px;
}

.foot-row p {
  margin: 0;
}

/* 404 */

.lost .logo {
  width: min(380px, 80%);
}

.lost h2 {
  margin: 20px 0 0;
  color: var(--teal-deep);
  font-family: var(--heading);
  font-size: clamp(28px, 4.4vw, 38px);
  font-weight: 600;
  line-height: 1.2;
}

@media (max-width: 640px) {
  .bunting {
    height: 92px;
  }

  .confetti .hide-sm {
    display: none;
  }

  .confetti li {
    left: var(--xs, var(--x));
    top: var(--ys, var(--y));
  }

  .ribbon span {
    padding: 10px 34px;
    font-size: 16px;
  }

  .things li {
    grid-template-columns: 30px 1fr;
  }
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-24px) rotate(-6deg);
  }
  to {
    opacity: 1;
  }
}

@keyframes sway {
  0%,
  100% {
    rotate: 0deg;
  }
  25% {
    rotate: 2deg;
  }
  75% {
    rotate: -2deg;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bunting .sway,
  .logo img,
  .ribbon,
  .confetti li {
    animation: none;
  }
}

/* Site header: small logo and the nav. The homepage hides the small logo since the big one is right below. */

.masthead {
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 8px;
  background-color: var(--paper);
}

.brand {
  display: block;
  width: clamp(132px, 22vw, 176px);
  line-height: 0;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.home .masthead {
  justify-content: flex-end;
}

.home .brand {
  display: none;
}

.nav {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  color: var(--teal-deep);
  font-family: var(--heading);
  font-size: 19px;
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  text-decoration: underline wavy var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.ribbon a {
  color: inherit;
  text-decoration: none;
}

.ribbon a:hover span {
  background-color: var(--red);
}

/* Inner pages share one reading column. */

.page {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: clamp(16px, 4vw, 40px);
}

.page h1 {
  margin: 0;
  color: var(--teal-deep);
  font-family: var(--heading);
  font-size: clamp(36px, 6vw, 52px);
  font-weight: 600;
  line-height: 1.1;
}

.page .intro {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(18px, 2.2vw, 20px);
}

.crumb {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

/* Crafts index: each craft is a sticker-style card. */

.craft-list {
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.craft-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: center;
  padding: 24px 28px 24px 20px;
  color: inherit;
  text-decoration: none;
  background-color: #ffffff;
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: 4px 5px 0 var(--sticker-shadow);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.craft-card:hover,
.craft-card:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 6px 8px 0 var(--sticker-shadow);
}

.craft-card img {
  display: block;
  width: 100%;
  height: auto;
}

.craft-card h2 {
  margin: 0;
  color: var(--red-deep);
  font-family: var(--heading);
  font-size: clamp(24px, 3.4vw, 28px);
  font-weight: 600;
  line-height: 1.2;
}

.craft-meta {
  margin: 6px 0 0;
  color: var(--gold-deep);
  font-size: 15px;
  font-weight: 700;
}

.craft-card p.summary {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.craft-card .go {
  display: inline-block;
  margin-top: 12px;
  color: var(--teal-deep);
  font-family: var(--heading);
  font-size: 17px;
  font-weight: 600;
}

.craft-card:hover .go {
  text-decoration: underline wavy var(--red);
  text-underline-offset: 5px;
}

/* A single craft. */

.how-to .art {
  display: block;
  width: min(300px, 70%);
  height: auto;
  margin: 0 auto 8px;
}

.how-to h1 {
  text-align: center;
}

.how-to .intro {
  max-width: 40ch;
  margin: 14px auto 0;
  text-align: center;
}

.glance {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 32px 0 0;
  padding: 18px 20px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background-color: #ffffff;
}

.glance div {
  text-align: center;
}

.glance dt {
  color: var(--ink-soft);
  font-size: 14px;
}

.glance dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-family: var(--heading);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.how-to h2 {
  margin: 44px 0 0;
  color: var(--teal-deep);
  font-family: var(--heading);
  font-size: clamp(26px, 4vw, 32px);
  font-weight: 600;
  line-height: 1.2;
}

.supplies {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.supplies li {
  position: relative;
  padding: 6px 0 6px 30px;
  font-size: 18px;
}

.supplies li::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--teal);
  box-shadow: inset 3px 3px 0 -1.5px rgba(255, 255, 255, 0.9), 2px 2px 0 var(--sticker-shadow);
}

.supplies li:nth-child(3n + 2)::before {
  background-color: var(--red);
}

.supplies li:nth-child(3n + 3)::before {
  background-color: var(--gold);
}

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

.steps {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 0 0 26px 62px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #ffffff;
  font-family: var(--heading);
  font-size: 20px;
  font-weight: 600;
  border-radius: 50%;
  background-color: var(--teal-deep);
  box-shadow: 2px 3px 0 var(--sticker-shadow);
}

.steps li:nth-child(3n + 2)::before {
  background-color: var(--red-deep);
}

.steps li:nth-child(3n + 3)::before {
  background-color: var(--gold-deep);
}

/* A dotted thread between step numbers. */
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50px;
  bottom: 6px;
  left: 20px;
  border-left: 2px dotted var(--line);
}

.steps h3 {
  margin: 0;
  padding-top: 7px;
  color: var(--ink);
  font-family: var(--heading);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
}

.steps p {
  margin: 6px 0 0;
  color: var(--ink-soft);
}

.tip {
  color: var(--ink);
}

.tip strong {
  color: var(--gold-deep);
}

.callout {
  margin: 36px 0 0;
  padding: 18px 22px;
  border: 2px dashed var(--red);
  border-radius: 14px;
  background-color: #ffffff;
}

.callout h2 {
  margin: 0;
  color: var(--red-deep);
  font-size: 22px;
}

.callout p {
  margin: 6px 0 0;
  color: var(--ink-soft);
}

.ideas {
  margin: 12px 0 0;
  padding-left: 22px;
  color: var(--ink-soft);
}

.ideas li {
  padding: 3px 0;
}

.credit {
  margin: 40px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  font-style: italic;
}

.back {
  margin: 20px 0 0;
  font-weight: 600;
}

@media (max-width: 640px) {
  .craft-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px;
  }

  .craft-card img {
    width: min(220px, 70%);
    margin: 0 auto;
  }

  .glance {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 16px;
  }

  .steps li {
    padding-left: 54px;
  }

  .steps li::before {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .steps li:not(:last-child)::after {
    left: 18px;
    top: 46px;
  }

  .steps h3 {
    padding-top: 5px;
  }
}

/* ---------- Wide pages: the place card maker and the free printables ---------- */

.wide .brand {
  width: clamp(150px, 24vw, 230px);
}

.studio-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
  width: min(1180px, calc(100% - 32px));
  margin: clamp(12px, 3vw, 32px) auto 28px;
}

.studio-head h1 {
  margin: 0;
  color: var(--teal-deep);
  font-family: var(--heading);
  font-size: clamp(34px, 5.4vw, 52px);
  font-weight: 600;
  line-height: 1.08;
}

.studio-head .intro {
  max-width: 44ch;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: clamp(18px, 2.1vw, 20px);
}

/* Christmas countdown: four paper tiles. */

.countdown {
  margin: 0;
}

.countdown-title {
  margin: 0 0 8px;
  color: var(--red-deep);
  font-family: var(--heading);
  font-size: 18px;
  font-weight: 600;
}

.countdown-tiles {
  display: flex;
  gap: 10px;
}

.tile {
  min-width: 70px;
  padding: 8px 6px 7px;
  text-align: center;
  background-color: #ffffff;
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: 3px 4px 0 var(--sticker-shadow);
}

.tile b {
  display: block;
  color: var(--teal-deep);
  font-family: var(--heading);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.tile:first-child b {
  color: var(--red-deep);
}

.tile span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.countdown-merry {
  margin: 0;
  color: var(--red-deep);
  font-family: var(--heading);
  font-size: 30px;
  font-weight: 600;
}

/* ---------- Maker ---------- */

.maker {
  display: grid;
  grid-template-columns: minmax(290px, 370px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.controls {
  position: sticky;
  top: 16px;
  padding: 24px 22px;
  background-color: #ffffff;
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: 4px 5px 0 var(--sticker-shadow);
}

.field {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.field > label,
.field legend {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  color: var(--ink);
  font-family: var(--heading);
  font-size: 18px;
  font-weight: 600;
}

.opt {
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: 14px;
  font-weight: 400;
}

.hint {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
}

.controls textarea,
.controls input[type="text"],
.controls input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  line-height: 1.45;
  background-color: var(--paper);
  border: 2px solid var(--line);
  border-radius: 10px;
}

.controls textarea {
  resize: vertical;
  min-height: 132px;
}

.controls input[type="number"] {
  width: 96px;
}

.controls textarea:focus,
.controls input:focus-visible {
  outline: 3px solid rgba(18, 179, 193, 0.35);
  border-color: var(--teal);
}

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modes legend {
  grid-column: 1 / -1;
}

.choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice > span {
  display: block;
  height: 100%;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background-color: var(--paper);
}

.choice strong {
  display: block;
  color: var(--ink);
  font-family: var(--heading);
  font-size: 17px;
  font-weight: 600;
}

.choice small {
  display: block;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.35;
}

.choice input:checked + span {
  border-color: var(--teal);
  background-color: #eefafb;
  box-shadow: inset 0 0 0 1px var(--teal);
}

.choice input:focus-visible + span {
  outline: 3px solid rgba(18, 179, 193, 0.4);
  outline-offset: 2px;
}

.check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-family: var(--body) !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--teal-deep);
}

.blank-count {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
}

.blank-count[hidden] {
  display: none;
}

.themes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.themes legend {
  grid-column: 1 / -1;
}

.themes .choice > span {
  padding: 8px;
}

.swatch {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 350 / 166.67;
  margin-bottom: 6px;
  overflow: hidden;
  background-color: #ffffff;
  border-radius: 6px;
}

.swatch .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.swatch .nm {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  line-height: 1;
}

.themes strong {
  font-size: 15px;
}

.print-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.print-btn {
  padding: 12px 34px;
  color: #ffffff;
  font-family: var(--heading);
  font-size: 19px;
  font-weight: 600;
  background-color: var(--red-deep);
  border: 0;
  border-radius: 12px;
  box-shadow: 3px 4px 0 var(--sticker-shadow);
  cursor: pointer;
}

.print-btn:hover {
  background-color: var(--red);
}

.print-btn:disabled {
  background-color: #c9c3ba;
  cursor: not-allowed;
}

.print-row .hint {
  margin: 0;
  font-weight: 600;
}

.print-help {
  margin-top: 14px;
}

/* Preview */

.preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.preview-head h2 {
  margin: 0;
  color: var(--teal-deep);
  font-family: var(--heading);
  font-size: 24px;
  font-weight: 600;
}

.preview-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.sheets {
  --u: 60px;
  display: grid;
  justify-content: center;
  gap: 30px;
}

.paper {
  position: relative;
  width: calc(var(--u) * 8.5);
  height: calc(var(--u) * 11);
  padding: calc(var(--u) * 0.5);
  background-color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 4px 6px 0 var(--sticker-shadow);
}

.paper-label {
  position: absolute;
  right: 0;
  bottom: calc(-1 * 24px);
  color: var(--ink-soft);
  font-size: 13px;
}

.sheet {
  position: relative;
  display: grid;
  width: calc(var(--u) * 7.5);
  height: calc(var(--u) * 10);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.sheet.place {
  grid-template-columns: repeat(2, calc(var(--u) * 3.5));
  grid-template-rows: repeat(3, 1fr);
  justify-content: center;
}

.sheet.tag {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.sheet .cut {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.card {
  position: relative;
  overflow: hidden;
}

.card.sample .nm {
  opacity: 0.4;
}

.card .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.card .nm {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.card .rule {
  position: absolute;
  left: 50%;
  width: calc(var(--u) * 2.3);
  border-bottom: calc(var(--u) * 0.012) solid currentColor;
  transform: translateX(-50%);
}

.card .wm {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--u) * 0.09);
  color: #8f8f8f;
  font-family: var(--body);
  font-size: calc(var(--u) * 0.07);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: center;
}

.pc-half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
}

.pc-back {
  top: 0;
  transform: rotate(180deg);
}

.pc-front {
  bottom: 0;
}

.pc-front .rule {
  top: 64%;
}

.tg .lbl {
  position: absolute;
  left: 0;
  right: 0;
  font-size: calc(var(--u) * 0.13);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.tg .lbl.to {
  top: calc(var(--u) * 1.08);
}

.tg .lbl.from {
  top: calc(var(--u) * 2.06);
}

.tg .slot {
  position: absolute;
  left: 0;
  right: 0;
}

.tg .slot.to {
  top: calc(var(--u) * 1.3);
  height: calc(var(--u) * 0.62);
}

.tg .slot.from {
  top: calc(var(--u) * 2.26);
  height: calc(var(--u) * 0.4);
}

.tg .slot .rule {
  bottom: 18%;
  width: calc(var(--u) * 1.8);
}

.tg .slot .rule.short {
  width: calc(var(--u) * 1.5);
}

/* ---------- Free printables ---------- */

.vault {
  width: min(1180px, calc(100% - 32px));
  margin: clamp(12px, 3vw, 32px) auto 0;
}

.vault h1 {
  margin: 0;
  color: var(--teal-deep);
  font-family: var(--heading);
  font-size: clamp(30px, 4.6vw, 42px);
  font-weight: 600;
  line-height: 1.1;
}

.vault .intro {
  max-width: 52ch;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
}

.freebies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.freebie {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 20px;
  align-items: start;
  height: 100%;
  padding: 20px;
  background-color: #ffffff;
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: 4px 5px 0 var(--sticker-shadow);
}

.freebie img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  box-shadow: 2px 3px 0 var(--sticker-shadow);
}

.freebie h2 {
  margin: 0;
  color: var(--red-deep);
  font-family: var(--heading);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
}

.freebie p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.5;
}

.freebie .meta {
  color: var(--gold-deep);
  font-size: 14px;
  font-weight: 700;
}

.download {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 18px;
  color: #ffffff;
  font-family: var(--heading);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  background-color: var(--teal-deep);
  border-radius: 10px;
  box-shadow: 2px 3px 0 var(--sticker-shadow);
}

.download:hover {
  background-color: #0a6c76;
}

/* A line under a tool page pointing to the other one. */

.more {
  width: min(1180px, calc(100% - 32px));
  margin: clamp(40px, 6vw, 64px) auto 0;
  color: var(--ink-soft);
  font-size: 18px;
  text-align: center;
}

.vault .more {
  width: auto;
}

@media (max-width: 900px) {
  .maker {
    grid-template-columns: 1fr;
  }

  .controls {
    position: static;
  }

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

@media (max-width: 640px) {
  .tile {
    min-width: 0;
    flex: 1;
  }

  .tile b {
    font-size: 24px;
  }

  .freebie {
    grid-template-columns: 96px 1fr;
    gap: 14px;
    padding: 16px;
  }
}

/* ---------- Print: only the sheets, at real size ---------- */

@page {
  size: letter;
  margin: 0.5in;
}

@media print {
  html,
  body {
    margin: 0;
    padding: 0;
    background: #ffffff;
  }

  .bunting,
  .masthead,
  .studio-head,
  .controls,
  .preview-head,
  .paper-label,
  .more,
  .foot {
    display: none !important;
  }

  .maker,
  .preview {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
  }

  .sheets {
    --u: 1in !important;
    display: block;
  }

  .paper {
    width: 7.5in;
    height: 9.98in;
    padding: 0;
    overflow: hidden;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }

  .paper:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .sheet {
    height: 9.98in;
  }

  /* Printing before typing any names gives decorated cards with no names, not the examples. */
  .card.sample .nm {
    visibility: hidden;
  }
}

/* Wide-page alignment and small-screen fixes */

.home .masthead,
.wide .masthead {
  width: min(1180px, calc(100% - 32px));
}

.nav a {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .masthead {
    flex-direction: column;
    gap: 4px;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 18px;
  }

  .nav a {
    font-size: 17px;
  }

  .wide .brand {
    width: 128px;
  }

  .countdown {
    width: 100%;
  }

  .countdown-tiles {
    gap: 8px;
  }

  .tile {
    padding: 8px 2px 7px;
  }

  .tile span {
    font-size: 12px;
  }
}

/* ---------- Homepage: the logo, the countdown, and a door to each part of the site ---------- */

.home .hero {
  padding-bottom: 0;
}

.home .logo {
  width: min(520px, 100%);
}

.home .lede {
  max-width: 40ch;
  text-wrap: balance;
}

.hero .countdown {
  display: inline-block;
  margin-top: clamp(24px, 4vw, 36px);
}

.hero .countdown-tiles {
  justify-content: center;
}

.doors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  width: min(1180px, calc(100% - 32px));
  margin: clamp(48px, 7vw, 80px) auto 0;
  padding: 0;
  list-style: none;
}

.doors li {
  scroll-margin-top: 24px;
}

.door {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: 24px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background-color: #ffffff;
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: 4px 5px 0 var(--sticker-shadow);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.door:hover,
.door:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 6px 8px 0 var(--sticker-shadow);
}

.door-art {
  position: relative;
  height: 236px;
  overflow: hidden;
  border-bottom: 2px solid var(--line);
}

.door.teal .door-art {
  background-color: #e2f5f7;
}

.door.red .door-art {
  background-color: #fdeced;
}

.door.gold .door-art {
  background-color: #f7eedb;
}

.door-art img {
  position: absolute;
  display: block;
  height: auto;
}

/* Two place cards and a gift tag, laid on the table. */

.cards .c1,
.cards .c2 {
  width: 64%;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 3px 4px 0 rgba(44, 42, 53, 0.08);
}

.cards .c1 {
  left: 5%;
  top: 9%;
  transform: rotate(-5deg);
}

.cards .c2 {
  left: 10%;
  top: 49%;
  transform: rotate(3deg);
}

.cards .c3 {
  position: absolute;
  right: 6%;
  top: 8%;
  width: 29%;
  transform: rotate(7deg);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.14)) drop-shadow(3px 4px 0 rgba(44, 42, 53, 0.08));
}

.cards .c3 img {
  position: static;
  width: 100%;
  clip-path: polygon(16% 0, 84% 0, 100% 11.5%, 100% 100%, 0 100%, 0 11.5%);
}

/* Three of the printables, fanned out. */

.sheets-fan img {
  top: 13%;
  width: 34%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 3px 4px 0 rgba(44, 42, 53, 0.08);
}

.sheets-fan .s1 {
  left: 8%;
  transform: rotate(-9deg);
}

.sheets-fan .s2 {
  left: 58%;
  transform: rotate(8deg);
}

.sheets-fan .s3 {
  left: 33%;
  top: 9%;
  transform: rotate(-1deg);
}

.craft img {
  left: 50%;
  top: 50%;
  width: auto;
  height: 82%;
  transform: translate(-50%, -50%) rotate(-4deg);
}

.door h2 {
  margin: 20px 24px 0;
  color: var(--teal-deep);
  font-family: var(--heading);
  font-size: clamp(24px, 2.4vw, 27px);
  font-weight: 600;
  line-height: 1.2;
}

.door.red h2 {
  color: var(--red-deep);
}

.door.gold h2 {
  color: var(--gold-deep);
}

.door p {
  flex: 1;
  margin: 8px 24px 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.55;
}

.door .go {
  align-self: flex-start;
  justify-self: start;
  margin: 16px 24px 0;
  padding: 8px 18px;
  color: #ffffff;
  font-family: var(--heading);
  font-size: 17px;
  font-weight: 600;
  background-color: var(--teal-deep);
  border-radius: 10px;
  box-shadow: 2px 3px 0 var(--sticker-shadow);
}

.door.red .go {
  background-color: var(--red-deep);
}

.door.gold .go {
  background-color: var(--gold-deep);
}

@media (max-width: 960px) {
  .doors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Two across leaves the third door alone, so it runs the full width with its picture on the left. */
@media (min-width: 641px) and (max-width: 960px) {
  .doors li:last-child {
    grid-column: 1 / -1;
  }

  .doors li:last-child .door {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    padding-bottom: 0;
  }

  .doors li:last-child .door-art {
    grid-row: 1 / span 3;
    height: auto;
    min-height: 236px;
    border-right: 2px solid var(--line);
    border-bottom: 0;
  }

  .doors li:last-child .go {
    margin-bottom: 24px;
  }
}

@media (max-width: 640px) {
  .doors {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .door-art {
    height: 210px;
  }

  .door h2,
  .door p,
  .door .go {
    margin-left: 20px;
    margin-right: 20px;
  }
}
