/* Cormorant Garamond, served from this site (never from Google). See README.md. */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/cormorant-garamond-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/cormorant-garamond-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root { --ink: #2a261f; --ink-soft: rgba(42,38,31,.62); --chip: rgba(250,247,238,.86); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #dfe8e2; }
body { font-family: "Cormorant Garamond", Georgia, serif; color: var(--ink); -webkit-font-smoothing: antialiased; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#stage.over { cursor: copy; }
.land { transition: opacity 1.1s ease; }
.sheep { cursor: pointer; }
.pop { animation: drop .6s cubic-bezier(.3,1.45,.5,1) both; }
@keyframes drop { from { transform: translateY(-70px); opacity: 0; } 45% { opacity: 1; } to { transform: none; opacity: 1; } }
.hop { animation: hop .45s ease-out; }
@keyframes hop { 0%,100% { transform: none; } 40% { transform: translateY(-22px); } }
.walking .legA { animation: trot .36s ease-in-out infinite alternate; }
.walking .legB { animation: trot .36s ease-in-out infinite alternate-reverse; }
.walking .wool { animation: bob .36s ease-in-out infinite alternate; }
.walking .legA, .walking .legB, .walking .wool { animation-delay: var(--trot, 0s); }
@keyframes trot { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-2px); } }

header { position: fixed; top: max(20px, env(safe-area-inset-top)); left: 26px; pointer-events: none; text-shadow: 0 1px 10px rgba(255,255,250,.7); }
header h1 { margin: 0; font-weight: 500; font-style: italic; font-size: 38px; letter-spacing: .01em; line-height: 1; }
header p { margin: 6px 0 0 2px; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); }

.chip { background: var(--chip); border: 1px solid rgba(42,38,31,.16); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); box-shadow: 0 2px 14px rgba(40,50,30,.12); }
#count { position: fixed; left: 22px; bottom: max(20px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; padding: 9px 16px 9px 12px; border-radius: 999px; }
#count svg { width: 34px; height: 28px; flex: none; }
#count .n { font-size: 26px; font-weight: 500; line-height: 1; font-variant-numeric: oldstyle-nums; display: inline-block; }
#count .n.bump { animation: bump .35s ease-out; }
@keyframes bump { 40% { transform: scale(1.25); } }
#count .label { font-size: 16px; line-height: 1.15; }
#count .all { display: block; font-size: 13px; color: var(--ink-soft); letter-spacing: .04em; }
#month { margin: 10px 0 0 2px; font-size: 19px; font-style: italic; }
#month small { font-style: normal; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-left: 6px; }
body.dusk header, body.dusk #month small, body.dusk header p { color: #f6efdc; text-shadow: 0 1px 10px rgba(20,20,40,.6); }
body.dusk #flock { filter: brightness(.8) saturate(.85); }
.fly { animation: fly 3.2s ease-in-out infinite; }
@keyframes fly { 0%,100% { opacity: 0; } 45%,60% { opacity: 1; } }

nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(22px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 2px; padding: 5px 8px; border-radius: 999px; }
nav button { font: inherit; color: var(--ink-soft); background: none; border: 0; padding: 6px 11px; font-size: 17px; cursor: pointer; border-radius: 999px; transition: color .3s; position: relative; }
nav button:hover { color: var(--ink); }
nav button.on { color: var(--ink); font-style: italic; }
nav button.now::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; opacity: .6; }
nav .arrow { display: none; font-size: 20px; padding: 4px 10px; }

#reset { position: fixed; right: 24px; bottom: max(28px, env(safe-area-inset-bottom)); font: inherit; font-size: 15px; color: var(--ink); background: var(--chip); border: 1px solid rgba(42,38,31,.16); border-radius: 999px; cursor: pointer; padding: 6px 14px; letter-spacing: .03em; opacity: .8; }
#reset:hover { opacity: 1; }
#reset.armed { font-style: italic; opacity: 1; }

#sound { position: fixed; top: max(22px, env(safe-area-inset-top)); right: 22px; width: 46px; height: 46px; border-radius: 50%; padding: 0; display: grid; place-items: center; color: var(--ink); cursor: pointer; }
#sound svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#sound .on { display: none; } #sound[aria-pressed="true"] .on { display: inline; } #sound[aria-pressed="true"] .off { display: none; }
.baa { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 500; animation: baa 1.6s ease-out forwards; pointer-events: none; paint-order: stroke; stroke: rgba(255,253,245,.85); stroke-width: 3px; }
@keyframes baa { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; } 70% { opacity: .9; } 100% { opacity: 0; transform: translateY(-28px); } }

#hint { position: fixed; left: 50%; top: 72%; transform: translate(-50%, -50%); font-size: 23px; font-style: italic; pointer-events: none; transition: opacity .8s; padding: 4px 16px; border-radius: 999px; }
#hint.gone { opacity: 0; }

@media (max-width: 760px) {
  header { left: 16px; } header h1 { font-size: 32px; } header p { font-size: 12px; }
  nav { bottom: auto; top: calc(max(20px, env(safe-area-inset-top)) + 118px); left: 50%; white-space: nowrap; }
  #month { font-size: 17px; }
  nav .names button:not(.on) { display: none; }
  nav .arrow { display: inline; }
  #count { left: 12px; } #reset { right: 12px; }
  #sound { width: 42px; height: 42px; }
  #hint { top: 64%; font-size: 20px; white-space: nowrap; }
}
