/* Snow Dog Games: fresh snow by day, moonlit snow by night.
   Every colour is a token. Night swaps the values and shows the moon and the
   snowfall; the markup is the same either way. Night follows the visitor's
   system unless they choose with the button, which theme.js remembers. */

:root {
  color-scheme: light;
  --bg-flat: #f5f9fc;
  --bg: #f5f9fc;
  --ink: #1b2735;
  --slate: #4a5a6b;
  --mitten: #e2702e;
  --mitten-lit: #ea7f3f;
  --mitten-deep: #b4521b;
  --on-mitten: #1b2735;
  --link-hover: #b4521b;
  --card: #ffffff;
  --card-edge: #1b2735;
  --card-lift: #dce7f0;
  --soft: #e8f0f6;
  --print: #cbdbe8;
  --rule: #cbdbe8;
  --fur: #ffffff;
  --fur-shade: #dce7f0;
  --ear: #9db4c8;
  --line: #1b2735;
  --drift: #dce7f0;
  --by-day: block;
  --by-night: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-flat: #15233a;
    --bg: radial-gradient(1100px 820px at 84% 210px, #263d60 0%, #1b2d48 42%, #15233a 74%);
    --ink: #ecf2f8;
    --slate: #a9b9ca;
    --mitten: #ee8340;
    --mitten-lit: #f4975a;
    --mitten-deep: #a8481a;
    --on-mitten: #15233a;
    --link-hover: #f6a46e;
    --card: #1d3049;
    --card-edge: #3f5d80;
    --card-lift: #0f1a2b;
    --soft: rgba(236, 242, 248, .09);
    --print: #2d4565;
    --rule: #2f4866;
    --fur: #e4ecf6;
    --fur-shade: #b4c6da;
    --ear: #7f98b2;
    --line: #0f1a2b;
    --drift: #3a5677;
    --by-day: none;
    --by-night: block;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-flat: #15233a;
  --bg: radial-gradient(1100px 820px at 84% 210px, #263d60 0%, #1b2d48 42%, #15233a 74%);
  --ink: #ecf2f8;
  --slate: #a9b9ca;
  --mitten: #ee8340;
  --mitten-lit: #f4975a;
  --mitten-deep: #a8481a;
  --on-mitten: #15233a;
  --link-hover: #f6a46e;
  --card: #1d3049;
  --card-edge: #3f5d80;
  --card-lift: #0f1a2b;
  --soft: rgba(236, 242, 248, .09);
  --print: #2d4565;
  --rule: #2f4866;
  --fur: #e4ecf6;
  --fur-shade: #b4c6da;
  --ear: #7f98b2;
  --line: #0f1a2b;
  --drift: #3a5677;
  --by-day: none;
  --by-night: block;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-flat);
  color: var(--ink);
  font-family: "Shantell Sans", "Comic Sans MS", system-ui, sans-serif;
  font-variation-settings: "INFM" 40;
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  min-height: 100vh;
  background: var(--bg);
  overflow: clip;
}

.wrap {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

.defs { position: absolute; }

a { color: var(--ink); }
a:hover { color: var(--link-hover); }
a:focus-visible,
.toggle:focus-visible {
  outline: 3px solid var(--mitten);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3, p { margin: 0; }

/* The header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -.3px;
}

.header-end { display: flex; align-items: center; gap: 30px; }

.site-nav { display: flex; gap: 30px; }
.site-nav a { text-decoration: none; font-weight: 600; font-size: 18px; }
.site-nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2.5px var(--ink);
  cursor: pointer;
}
.toggle:hover { background: var(--soft); }
.toggle .to-night { display: var(--by-day); }
.toggle .to-day { display: var(--by-night); }

/* The dog, drawn in tokens so night can light it by the moon */

.fur { fill: var(--fur); }
.fur-shade { fill: var(--fur-shade); }
.ear { fill: var(--ear); }
.drift { fill: var(--drift); }
.line { stroke: var(--line); }
.dot { fill: var(--line); }
.glint { fill: #ffffff; }
.collar { stroke: var(--mitten); }
.tongue { fill: var(--mitten); }
.moon-shadow { display: var(--by-night); fill: #0f1a2b; opacity: .55; }

/* The hero */

.hero {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 72px 0 120px;
}

.hero-words { flex: 1 1 0; min-width: 0; }

h1 {
  font-weight: 800;
  font-size: 96px;
  line-height: .98;
  letter-spacing: -2px;
  font-variation-settings: "INFM" 60;
}

.lede {
  margin-top: 32px;
  max-width: 30em;
  font-size: 22px;
  line-height: 1.55;
  color: var(--slate);
}

.hero-dog {
  position: relative;
  flex: 0 0 380px;
  display: flex;
  justify-content: center;
}

.dog { display: block; max-width: 100%; height: auto; }

.moon {
  display: var(--by-night);
  position: absolute;
  top: -44px;
  right: -28px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 40%, rgba(214, 208, 186, .7) 0 9px, transparent 10px),
    radial-gradient(circle at 62% 66%, rgba(214, 208, 186, .6) 0 13px, transparent 14px),
    radial-gradient(circle at 68% 30%, rgba(214, 208, 186, .5) 0 6px, transparent 7px),
    #f4f0e1;
  box-shadow: 0 0 34px 8px rgba(244, 240, 225, .32), 0 0 160px 60px rgba(176, 204, 240, .14);
}

/* The dog's paw prints, from under it down to Duelathon's card */

.trail {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 230px;
  pointer-events: none;
}

.paw {
  position: absolute;
  width: 34px;
  height: 34px;
  fill: var(--print);
  transform: rotate(225deg);
  animation: press .35s ease-out both;
}
.paw:nth-child(1) { left: 160px; top: -8px;  animation-delay: .40s; }
.paw:nth-child(2) { left: 156px; top: 17px;  animation-delay: .54s; }
.paw:nth-child(3) { left: 113px; top: 42px;  animation-delay: .68s; }
.paw:nth-child(4) { left: 109px; top: 67px;  animation-delay: .82s; }
.paw:nth-child(5) { left: 65px;  top: 92px;  animation-delay: .96s; }
.paw:nth-child(6) { left: 61px;  top: 117px; animation-delay: 1.10s; }
.paw:nth-child(7) { left: 18px;  top: 142px; animation-delay: 1.24s; }
.paw:nth-child(8) { left: 14px;  top: 167px; animation-delay: 1.38s; }
.paw:nth-child(9) { left: -30px; top: 192px; animation-delay: 1.52s; }

@keyframes press { from { opacity: 0; } to { opacity: 1; } }

/* The night's snowfall, over the top of the page */

.snow {
  display: var(--by-night);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1150px;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 65%, transparent);
  mask-image: linear-gradient(#000 65%, transparent);
}

.flake {
  position: absolute;
  top: -12px;
  border-radius: 50%;
  background: #eef3f8;
  animation: fall linear infinite;
}

@keyframes fall {
  from { transform: translate(0, 0); }
  to { transform: translate(var(--drift-x), 1170px); }
}

/* Sections */

.section { padding: 0 0 112px; }
#games { padding-top: 24px; }

h2 { font-weight: 800; font-size: 52px; letter-spacing: -1px; }

.game {
  display: flex;
  gap: 48px;
  align-items: center;
  margin-top: 36px;
  padding: 36px;
  background: var(--card);
  border-radius: 28px;
  box-shadow: 0 0 0 2.5px var(--card-edge), 0 10px 0 var(--card-lift);
}

.game-art { position: relative; flex: 0 1 460px; min-width: 0; }

.painting {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
}

.sprite {
  position: absolute;
  width: 144px;
  height: auto;
  image-rendering: pixelated;
}
.sprite.left { left: -24px; bottom: -22px; }
.sprite.right { right: -20px; bottom: -18px; transform: scaleX(-1); }

.game-words { flex: 1 1 0; min-width: 0; }
.game-words h3 { font-weight: 800; font-size: 64px; letter-spacing: -1.5px; }
.game-words p {
  margin-top: 18px;
  max-width: 28em;
  font-size: 21px;
  line-height: 1.6;
  color: var(--slate);
}

.actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 19px;
  text-decoration: none;
}
.btn-mitten { background: var(--mitten); color: var(--on-mitten); box-shadow: 0 4px 0 var(--mitten-deep); }
.btn-mitten:hover { background: var(--mitten-lit); color: var(--on-mitten); }
.btn-ink { color: var(--ink); box-shadow: inset 0 0 0 2.5px var(--ink); }
.btn-ink:hover { color: var(--ink); background: var(--soft); }

.trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin-top: 32px;
}
.trio h3 { font-size: 26px; font-weight: 700; }
.trio p { margin-top: 10px; font-size: 19px; line-height: 1.6; color: var(--slate); }
.handle { font-weight: 500; color: var(--slate); }

.hello { padding-bottom: 96px; }
.hello p { margin-top: 16px; font-size: 22px; line-height: 1.55; color: var(--slate); }
.hello p + p { margin-top: 18px; }
.hello .small { font-size: 19px; }

.mail {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -.5px;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: var(--mitten);
  text-decoration-thickness: 4px;
  text-underline-offset: 8px;
}

.site-footer {
  padding: 28px 0 40px;
  border-top: 2.5px dashed var(--rule);
  font-size: 17px;
  color: var(--slate);
}

/* The page that isn't there */

.lost { padding: 72px 0 120px; }
.lost p { margin-top: 24px; max-width: 30em; font-size: 22px; line-height: 1.55; color: var(--slate); }
.lost .actions { margin-top: 32px; }

/* Phones and narrow windows */

@media (max-width: 820px) {
  .wrap { padding: 0 16px; }
  .site-header { padding: 18px 0; gap: 14px; }
  .wordmark { font-size: 22px; }
  .wordmark .mark { width: 42px; height: 42px; }
  .header-end { width: 100%; justify-content: space-between; gap: 16px; }
  .site-nav { gap: 20px; }
  .site-nav a { font-size: 17px; }
  .hero { flex-direction: column; align-items: stretch; gap: 24px; padding: 32px 0 72px; }
  h1 { font-size: 58px; letter-spacing: -1.2px; }
  .lede { margin-top: 20px; font-size: 19px; }
  .hero-dog { flex: none; width: 260px; align-self: center; }
  .moon { width: 80px; height: 80px; top: -24px; right: -40px; }
  .trail { display: none; }
  .section { padding-bottom: 72px; }
  #games { padding-top: 0; }
  h2 { font-size: 38px; }
  .game { flex-direction: column; align-items: stretch; gap: 32px; padding: 20px 20px 28px; border-radius: 22px; }
  .game-art { flex: none; }
  .sprite { width: 104px; }
  .sprite.left { left: -10px; bottom: -16px; }
  .sprite.right { right: -8px; bottom: -14px; }
  .game-words h3 { font-size: 46px; }
  .game-words p { font-size: 18px; }
  .trio { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 24px; }
  .hello p { font-size: 19px; }
  .mail { font-size: min(22px, 5.6vw); text-underline-offset: 6px; text-decoration-thickness: 3px; }
  .lost { padding: 32px 0 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .paw { animation: none; }
  .flake { animation: none; transform: translateY(var(--rest-y)); }
}
