/* Our work: Douglas in the big excavator with the "Back to homepage" sign (templates/partials/dig-home.html,
   assets/js/dig-home.js). It is the page's whole header picture: wide screens stand it on the lawn across the
   left of the header with the words beside it; phones put the words on top and the machine across the lawn below.
   The cleanout prop of the other pages steps aside here. Drawing: 960 x 550 units, ground line 50 units up
   (0.0521 of the width), cab roof 500 units above it (0.5208 of the width); it stands 16 px into the grass. */
.pop--dig { --ew: min(calc(calc(100 * min(1vw, 19.2px)) - 16px), 600px); padding-bottom: calc(var(--lawn) - 16px + var(--ew) * 0.5208 + 14px); }
.pop--dig .co-art--pop, .pop--dig .co-btn { display: none; }
.dig-home { position: absolute; z-index: 3; left: 6px; bottom: calc(var(--lawn) - 16px - var(--ew) * 0.0521); width: var(--ew);
  line-height: 0; color: var(--char); -webkit-tap-highlight-color: transparent; touch-action: manipulation; border-radius: 14px; }
.dig-ex { display: block; width: 100%; height: auto; overflow: visible; }
.ex-sign-text { font: 800 46px var(--display); fill: #392E2B; letter-spacing: .01em; }
.dig-home:focus-visible { outline: 3px solid var(--kubota); outline-offset: 4px; }
@media (min-width: 761px) {
  /* the machine keeps growing with the screen: over half the width on any computer, capped only by the window height */
  .pop--dig { --ew: clamp(400px, min(calc(56 * min(1vw, 19.2px)), calc((100svh - 120px) * 1.75)), 1560px); justify-content: center; min-height: calc(var(--ew) * 0.5208 + var(--lawn) + 34px);
    padding: 92px var(--m) calc(var(--lawn) + 28px) calc(var(--m) + var(--ew) + 20px); }
  .pop--dig .pop-copy { max-width: 34rem; }
  .pop--dig h1 { max-width: none; }
  .dig-home { left: calc(var(--m) - 14px); }
}
/* big monitors: the words grow with the machine so they still read as its caption */
@media (min-width: 1700px) {
  .pop--dig .pop-copy { max-width: 44rem; }
  .pop--dig h1 { font-size: clamp(4rem, 1rem + calc(2.9 * min(1vw, 19.2px)), 5.75rem); }
  .pop--dig .lede { font-size: clamp(1.375rem, 0.6rem + calc(0.75 * min(1vw, 19.2px)), 1.75rem); max-width: 34ch; }
}
/* Life while it waits: a lazy puff of exhaust now and then, the beacon glowing; a bigger belch when it digs */
@media (prefers-reduced-motion: no-preference) {
  .ex-smoke { opacity: 1; }
  .ex-puff { transform-box: fill-box; transform-origin: 50% 100%; opacity: 0; animation: ex-puff 5.5s ease-out infinite; }
  .ex-puff--2 { animation-delay: 1.1s; }
  @keyframes ex-puff { 0% { opacity: 0; transform: translate(0, 10px) scale(.4); } 8% { opacity: .75; }
    40% { opacity: 0; transform: translate(14px, -46px) scale(1.5); } 100% { opacity: 0; transform: translate(14px, -46px) scale(1.5); } }
  .dig-home.is-digging .ex-puff { animation: ex-belch .7s ease-out infinite; fill: #8D8781; }
  .dig-home.is-digging .ex-puff--2 { animation-delay: .25s; }
  @keyframes ex-belch { 0% { opacity: 0; transform: translate(0, 8px) scale(.5); } 15% { opacity: .9; } 100% { opacity: 0; transform: translate(26px, -70px) scale(2.2); } }
  .ex-beacon { transition: fill .2s; }
  .dig-home.is-digging .ex-beacon { animation: ex-flash .36s steps(2, jump-none) infinite; }
  @keyframes ex-flash { from { fill: #FFB000; } to { fill: #FFF1A8; } }
  .ex-eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: ex-blink 4.6s infinite; }
  @keyframes ex-blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
  @media (hover: hover) and (pointer: fine) {
    .dig-home .ex-hat { transition: transform .25s ease; transform-box: fill-box; transform-origin: 50% 100%; }
    .dig-home:hover .ex-hat { transform: translateY(-6px) rotate(-7deg); }
  }
}

/* The dirt dumped at the screen on the way home, and the same dirt falling away on the home page */
.dig-wipe { position: fixed; inset: 0; z-index: 3000; pointer-events: none; overflow: hidden; }
.dig-wipe svg { position: absolute; overflow: visible; }
.dig-wipe .dig-clod { position: absolute; display: block; will-change: transform, opacity; }
html.dig-arrive body::after { content: ''; position: fixed; inset: 0; z-index: 3000; pointer-events: none;
  background: radial-gradient(circle at 30% 20%, #9C7854, #7A5A3E 55%, #5A4230); animation: dig-cover-safety 0s 2.6s forwards; }
@keyframes dig-cover-safety { to { visibility: hidden; } }
