:root {
  --paper: #f3e6cf;
  --paper-light: #f8eedb;
  --ink: #26221f;
  --clay: #a8492a;
  --shadow: 60, 38, 18;
  --s: 1; /* stage scale, set by hero.js */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------ stage */

.hero {
  position: relative;
  width: 100%;
  height: calc(868px * var(--s));
  overflow: hidden;
  background: var(--paper);
}

/* everything is laid out on a fixed 1536 x 868 board and scaled to the window */
.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1536px;
  height: 868px;
  transform-origin: 0 0;
  transform: scale(var(--s));
}

.scene {
  position: absolute;
  left: 0;
  top: -64px;
  width: 1536px;
  height: 1024px;
}

.scene img, .front img { position: absolute; display: block; user-select: none; -webkit-user-drag: none; }

.plate { left: 0; top: 0; width: 1536px; height: 1024px; }

.layer { position: absolute; inset: 0; will-change: transform; pointer-events: none; }
.layer > * { pointer-events: auto; }

.tree {
  filter: drop-shadow(3px 5px 4px rgba(var(--shadow), .28));
  pointer-events: none !important;
}

#leaves { position: absolute; left: 0; top: 0; pointer-events: none; }

/* the bottom sheet of paper lies over the grass and the foot of the trunk */
.strip {
  left: 0;
  top: 774px;
  width: 1536px;
  height: 224px;
  filter: drop-shadow(0 -3px 4px rgba(var(--shadow), .22));
  pointer-events: none;
}
.scene::after { /* solid paper below the strip image */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 990px; bottom: 0;
  background: #f4e7d0;
}

/* ------------------------------------------------------------ plants and people */

/* every blade, flower and corner leaf is its own piece of paper */
#plants, #plantsFront, #vegBack, #vegFront { position: absolute; inset: 0; pointer-events: none; }
.piece {
  position: absolute;
  display: block;
  transform-origin: var(--ox, 50%) 100%;
  filter: drop-shadow(1.5px 2.5px 1.5px rgba(var(--shadow), .3));
  will-change: transform;
  pointer-events: none;
}
.patch {
  position: absolute;
  display: block;
  pointer-events: none;
  filter: drop-shadow(1px 2px 1.5px rgba(var(--shadow), .34));
}
.front { inset: 0; }

.veg {
  position: absolute;
  display: block;
  transform-origin: 50% 100%;
  pointer-events: none;
  filter: drop-shadow(1.5px 2.5px 2px rgba(var(--shadow), .3));
  will-change: transform, filter;
}
.buildings { filter: drop-shadow(2px 3px 2.5px rgba(var(--shadow), .3)); pointer-events: none; }
.fronthill { filter: drop-shadow(0 -2px 3px rgba(var(--shadow), .25)); pointer-events: none; }
.near { transform-origin: 50% 85%; }

.figure {
  position: absolute;
  transform-origin: 0 0;
  transform: scale(.6);
}
.figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(3px 6px 5px rgba(var(--shadow), .3));
}
.figure { pointer-events: none !important; }

/* ------------------------------------------------------------ flag and smoke */

.flag { position: absolute; width: 54px; height: 31px; transform-origin: 0 50%; filter: drop-shadow(1px 2px 1px rgba(var(--shadow), .3)); }
.flag i {
  position: absolute;
  top: 0;
  height: 31px;
  background: url(assets/flag.png) 0 0 / 54px 31px no-repeat;
  animation: wave 2.6s ease-in-out infinite;
}
@keyframes wave {
  0%, 100% { transform: translateY(calc(var(--a) * -1)); }
  50%      { transform: translateY(var(--a)); }
}

.smoke { position: absolute; width: 0; height: 0; pointer-events: none; }
.smoke i {
  position: absolute;
  left: -7px;
  top: -8px;
  width: 15px;
  height: 14px;
  background: #e4dccd;
  border-radius: 58% 42% 55% 45% / 50% 60% 40% 50%;
  box-shadow: 1px 1.5px 1.5px rgba(var(--shadow), .22);
  opacity: 0;
  animation: puff 11s linear infinite;
}
.smoke i:nth-child(2) { animation-delay: -3.7s; border-radius: 45% 55% 40% 60% / 60% 45% 55% 40%; }
.smoke i:nth-child(3) { animation-delay: -7.3s; border-radius: 52% 48% 60% 40% / 42% 58% 46% 54%; }
.smoke + .smoke i { animation-duration: 13s; }
@keyframes puff {
  0%   { opacity: 0;   transform: translate(0, 0) scale(.35) rotate(0deg); }
  10%  { opacity: .9; }
  55%  { opacity: .55; transform: translate(14px, -46px) scale(1.15) rotate(40deg); }
  100% { opacity: 0;   transform: translate(40px, -92px) scale(1.7) rotate(80deg); }
}

/* ------------------------------------------------------------ interface */

.logo { position: absolute; left: 44px; top: 13px; display: block; }
.logo img { display: block; height: 82px; width: auto; }

.nav { position: absolute; right: 46px; top: 36px; display: flex; gap: 50px; }
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .005em;
  padding: 4px 0;
  background: linear-gradient(var(--clay), var(--clay)) 0 100% / 0 2px no-repeat;
  transition: background-size .3s ease;
}
.nav a:hover { background-size: 100% 2px; }

.pitch { position: absolute; left: 178px; top: 362px; will-change: transform; }

h1 {
  margin: 0;
  font-size: 77px;
  line-height: .97;
  font-weight: 600;
  letter-spacing: -.012em;
  color: var(--ink);
  white-space: nowrap;
}
h1 .ch {
  display: inline-block;
  will-change: transform;
  text-shadow: 0 1px 0 rgba(255, 250, 235, .55), 1px 2px 2px rgba(var(--shadow), .22);
}

.paper-btn, .tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  isolation: isolate;
  transition: transform .45s cubic-bezier(.3, 1.9, .5, 1);
}
.paper-btn::before, .tag::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  filter: url(#torn) drop-shadow(1px 3px 2px rgba(var(--shadow), .32));
  transition: filter .3s ease;
}
.paper-btn:hover, .tag:hover { transform: translateY(-4px) rotate(-.5deg); }
.paper-btn:hover::before, .tag:hover::before { filter: url(#torn) drop-shadow(3px 9px 6px rgba(var(--shadow), .28)); }

.paper-btn {
  margin-top: 26px;
  padding: 0 40px;
  height: 60px;
  color: #fbf1df;
  font-size: 27px;
  font-weight: 500;
}
.paper-btn::before { background: linear-gradient(180deg, #b25232, #9c4124); border-radius: 13px; }

.tags {
  position: absolute;
  left: 86px;
  right: 54px;
  top: 786px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 355fr 455fr 530fr;
  gap: 28px;
}
.tag {
  width: 100%;
  height: 62px;
  justify-content: center;
  gap: 16px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
}
.tag::before { background: linear-gradient(180deg, #f9f0df, #f1e4cc); border-radius: 4px; }
.tag svg { height: 38px; width: auto; fill: #2e2925; }
.tag svg .pulse { stroke: #f5ead6; }

@media (prefers-reduced-motion: reduce) {
  .flag i, .smoke i { animation: none !important; }
}
