/* Page gags. Hidden entrance states require both JS and motion permission; without either the finished art shows. */
.monument .ltr { display: inline-block; transform-origin: 50% 97%; }
.gag-fx { position: absolute; z-index: 3; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.gag-namebtn { position: absolute; z-index: 6; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.gag-namebtn[hidden] { display: none; }
.gag-namebtn:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 3px; border-radius: 8px; }
.gag-ripple, .gag-mound, .gag-worker { opacity: 0; }
.gag-ripple { position: absolute; z-index: 4; width: 38px; height: 14px; border-radius: 50% 50% 0 0; border: 2.5px solid #222; border-bottom: 0; background: var(--grass); pointer-events: none; }
.gag-mound { position: absolute; z-index: 4; width: 48px; height: 18px; border: 2.5px solid #222; border-radius: 55% 55% 0 0; border-bottom: 0; background: var(--soil-2); pointer-events: none; transform-origin: 50% 100%; }
.gag-worker { position: absolute; z-index: 5; width: 72px; height: 68px; pointer-events: none; overflow: hidden; }
.gag-worker svg { display: block; width: 72px; height: auto; }
@media (prefers-reduced-motion: no-preference) {
  html.js:not(.gag-live):not(.gag-done) .monument { visibility: hidden; animation: gag-show-v 1ms 4s forwards; }
}
@keyframes gag-show-v { to { visibility: visible; } }
/* The prairie dog in its usual hole */
/* no-JS spot: the gap between DIG and IT; gags.js measures the hole when fonts have loaded */
.pdog { position: absolute; z-index: 7; width: clamp(96px, calc(10 * min(1vw, 19.2px)), 172px); left: 59%; bottom: calc(clamp(22px, calc(3.2 * min(1vw, 19.2px)), 46px) * .3); touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; }
@media (max-width: 760px) { .pdog { left: 18px; bottom: 103px; width: clamp(60px, calc(17 * min(1vw, 19.2px)), 80px); } }
.pdog svg { display: block; width: 100%; height: auto; overflow: visible; }
html.js .pdog { visibility: hidden; cursor: pointer; }
html.js .pdog.placed { visibility: visible; }
html.js.gag-live .pdog.placed:not(.arrived) { visibility: hidden; }
.pdog:focus-visible { outline: 3px solid var(--kubota); outline-offset: 2px; border-radius: 8px; }
.pd-body { transform-box: fill-box; transform-origin: 50% 100%; }
.pd-hmph { position: absolute; left: 60%; bottom: 72%; padding: 2px 10px 3px; border: 2px solid var(--char); border-radius: 12px; background: #fff; color: var(--char);
  font: 700 0.9375rem/1.3 var(--text); white-space: nowrap; pointer-events: none; transform-origin: 0% 100%; }
.pd-hmph { opacity: 0; transition: opacity var(--t-press) ease; }
.pdog.huff .pd-hmph { opacity: 1; }
/* He is painted: one picture per pose, and his state picks it. Order of say: popping out > ducking > huff > alarm > look */
.pd-pose, .pd-eyes { opacity: 0; }
.pd-pose--idle { opacity: 1; }
.pdog.look-l .pd-pose--idle, .pdog.look-r .pd-pose--idle, .pdog.alarm .pd-pose--idle, .pdog.huff .pd-pose--idle,
.pdog.popping .pd-pose--idle, html.js .pdog:not(.up) .pd-pose--idle { opacity: 0; }
.pdog.look-l:not(.alarm):not(.huff):not(.popping).up .pd-pose--look-l,
.pdog.look-r:not(.alarm):not(.huff):not(.popping).up .pd-pose--look-r,
.pdog.alarm:not(.huff):not(.popping).up .pd-pose--alarm,
.pdog.huff:not(.popping).up .pd-pose--huff,
.pdog.popping.up .pd-pose--pop { opacity: 1; }
html.js .pdog:not(.up) .pd-pose--duck { opacity: 1; }
html:not(.js) .pdog .pd-pose--idle { opacity: 1; }
/* the copy that pops up under the letters and tosses the clod comes out arms up */
.gag-worker .pd-pose--idle { opacity: 0; }
.gag-worker .pd-pose--pop { opacity: 1; }
.gag-worker .pd-eyes { visibility: hidden; }
/* the blink frame only ever lies over his usual stance */
.pdog.look-l .pd-eyes, .pdog.look-r .pd-eyes, .pdog.alarm .pd-eyes, .pdog.huff .pd-eyes, .pdog.popping .pd-eyes,
html.js .pdog:not(.up) .pd-eyes { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  html.js .pdog:not(.up) .pd-body { transform: translateY(60px); }
}
/* Alive while he waits: breathing and a blink now and then (About dog too) */
@media (prefers-reduced-motion: no-preference) {
  .pd-torso { transform-box: view-box; transform-origin: 32px 92px; animation: pd-breathe 2.6s ease-in-out infinite; }
  .pd-eyes { animation: pd-blink 4.9s 2s infinite; }
}
@keyframes pd-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.025, .985); } }
@keyframes pd-blink { 0%, 95.5%, 100% { opacity: 0; } 96%, 98.5% { opacity: 1; } }

/* The yellow Labrador who chases him down the hole (gags.js): drawn over the lawn, under nothing that can be tapped */
.gag-lab { position: absolute; z-index: 8; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }

/* The About dog rests by 06; on scroll it appears at each marker and works down the trench. */
.trench .n { z-index: 2; }
.trench-dog { position: absolute; z-index: 3; left: -73px; top: 25px; width: 56px; height: auto; overflow: visible; }
.trench-dog-body { transform-box: fill-box; transform-origin: 50% 100%; }
@media (max-width: 900px) { .trench-dog { left: -67px; width: 48px; } }
@media (prefers-reduced-motion: no-preference) {
  html.js .trench-dog { opacity: 0; transition: transform 420ms var(--ease-out), opacity 140ms ease-out; }
  html.js .trench-dog.go { opacity: 1; }
}

/* 5. Flush the estimate (second-opinion view): plays where the form note sits, then the note returns with the answer */
.form-send { position: relative; }
.flush { position: absolute; z-index: 2; overflow: visible; pointer-events: none; }
.form-note.flushing { visibility: hidden; }

/* 6. The rubber duck on the main (the footer, under every view): afloat in the stream inside the cutaway pipe,
   sitting low with its belly under the water line (the water layer is drawn over it), a small wake behind it */
.duck { --sink: clamp(7px, calc(.62 * min(1vw, 19.2px)), 10px); position: absolute; left: 12%; bottom: calc(var(--wall) + 3px + var(--water) - var(--sink)); z-index: 2; width: clamp(40px, calc(3.4 * min(1vw, 19.2px)), 54px); min-height: 48px; display: flex; align-items: flex-end; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.duck.say { z-index: 4; }
.duck-wake { position: absolute; right: 78%; bottom: calc(var(--sink) - 5px); width: 30px; height: 10px; z-index: 4; pointer-events: none; opacity: 0; transform-origin: 100% 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='10'%3E%3Cpath d='M30 5 Q16 1 2 2 M30 5 Q16 9 2 8 M22 5 Q14 3 8 4' fill='none' stroke='%23E4F6FD' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
@media (prefers-reduced-motion: no-preference) { html.js .duck-wake { animation: duck-wake 1.1s ease-in-out infinite; } }
@keyframes duck-wake { 0%, 100% { opacity: .55; transform: scaleX(.8); } 50% { opacity: .95; transform: scaleX(1.15); } }
/* Pages without the gags script still get the swim: the duck drifts downstream on a CSS loop and bobs on the ripples */
@media (prefers-reduced-motion: no-preference) {
  .duck:not(.duck--js) { animation: duck-swim 40s linear infinite; }
  .duck:not(.duck--js) svg { animation: duck-bob 1.4s ease-in-out infinite alternate; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 760px) { .duck:not(.duck--js) { animation-duration: 22s; } }
@keyframes duck-swim { 0% { left: 4%; opacity: 0; } 5%, 95% { opacity: 1; } 100% { left: calc(96% - 64px); opacity: 0; } }
@keyframes duck-bob { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-2px) rotate(3deg); } }
.duck::before { content: ''; position: absolute; inset: -14px -6px -6px; }
.duck svg { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 50% 100%; }
html.js .duck { cursor: pointer; }
.duck:focus-visible { outline: 3px solid var(--kubota); outline-offset: 4px; border-radius: 8px; }
.duck-say { position: absolute; left: 50%; bottom: calc(100% + 8px); padding: 2px 10px 3px; border: 2px solid var(--char); border-radius: 12px; background: #fff; color: var(--char);
  font: 700 0.9375rem/1.3 var(--text); white-space: nowrap; opacity: 0; transform: translateX(-50%); pointer-events: none; }
.duck.say .duck-say { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .duck-say { transition: opacity var(--t-ui) ease; } }
@media (prefers-reduced-motion: no-preference) {
  .duck.say .duck-say { animation: duck-say 900ms var(--ease-out) both; }
}
@keyframes duck-say {
  0% { opacity: 0; transform: translateX(-50%) translateY(6px) scale(.6); }
  25% { opacity: 1; transform: translateX(-50%) translateY(-2px) scale(1.08); }
  40% { transform: translateX(-50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-6px); }
}
@media (max-width: 760px) { .duck { width: 40px; left: 6%; } }   /* rests clear of the first collar (18%), its bubble on screen */

/* The opening contains artwork only; retain its existing geometry anchor. */
.hero-copy { padding: 0; height: 0; }
.hero-accessible-name { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Exact outlined glyphs from logo-dig-it.svg, aligned to the existing gag baseline. */
.monument .logo-letter { position: relative; height: .74em; vertical-align: top; letter-spacing: 0; margin-right: .055em; }
.logo-letter svg { position: absolute; left: 0; top: .03em; width: 100%; height: .688em; overflow: hidden; }
.logo-letter--d { width: .459em; }
.logo-letter--i { width: .092em; }
.logo-letter--g { width: .440em; }
.logo-letter--t { width: .486em; }
.monument .logo-letter:last-child { margin-right: 0; }

/* One line on every screen: the logo's house and pipe pop up with the letters, spaced exactly as in the logo. */
.logo-mark { width: 1.275em; }
/* the whole logo mark, pipe foot included, stands on the same line as the letters' feet (Doug, 17 Nov 2026) */
.monument .logo-mark { height: 1.394em; margin-top: -.676em; margin-bottom: .022em; margin-right: 0.303em; }
.logo-mark svg { top: 0; height: 100%; overflow: visible; }
.monument .logo-letter--d { margin-right: 0.083em; }
.monument .logo-letter--i:nth-child(3) { margin-right: 0.073em; }
.monument .logo-letter--g { margin-right: 0.385em; }
.monument .logo-letter--i:nth-child(5) { margin-right: 0.055em; }
/* The cleanout keeps its spot right of the T; the pipe's foot stays under the lawn. */
.monument:has(.logo-mark) { padding-right: calc(var(--m) * .5 + clamp(48px, calc(7 * min(1vw, 19.2px)), 110px)); }
@media (max-width: 760px) { .monument:has(.logo-mark) { padding: 0 64px 0 14px; } }
/* Every piece stands on the grass tips, nothing tucked under the lawn: the turf rises .55 of its height over the
   name, so the name rises .30 of it (the tips sit .27 down) less the gap under the letters' feet, a hair clear of the tips. */
.monument { margin-bottom: calc(clamp(22px, calc(3.2 * min(1vw, 19.2px)), 46px) * .30 - .022em); }
/* the cartoon dirt on the heads (gags.js) */
.gag-dirt-pile, .gag-clod { pointer-events: none; }
