* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#0b1120 0%, #101a33 55%, #16224a 100%);
  color: #e8ecf4;
  padding: 24px;
  overflow: hidden;
}

/* ---------- night sky ---------- */
.sky-night {
  position: fixed; inset: 0; z-index: 0;
  transition: opacity 1.2s ease;
}
body.day .sky-night { opacity: 0; }

.stars span {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #cfe0ff;
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: 0.25; } }

.moon {
  position: absolute;
  top: 8%; right: 10%;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fdf6e3, #e8dcc0 70%);
  box-shadow: 0 0 40px 12px rgba(253, 246, 227, 0.18);
  cursor: pointer;
}
.moon.wink { animation: wink 0.6s ease; }
@keyframes wink { 40% { transform: scaleY(0.12); } }

.cloud {
  position: absolute;
  height: 26px;
  border-radius: 999px;
  background: rgba(160, 180, 220, 0.10);
  filter: blur(6px);
  animation: drift 46s linear infinite;
}
.cloud-1 { top: 16%; left: -200px; width: 180px; }
.cloud-2 { top: 31%; left: -300px; width: 260px; animation-duration: 70s; animation-delay: -24s; }
@keyframes drift { to { transform: translateX(135vw); } }

.shooting-star {
  position: absolute;
  width: 130px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #ffffff, rgba(255, 255, 255, 0));
  transform: rotate(-24deg);
  transform-origin: right center;
  animation: shoot 0.9s ease-out forwards;
  pointer-events: none;
}
@keyframes shoot {
  0%   { opacity: 1; transform: rotate(-24deg) translateX(0); }
  100% { opacity: 0; transform: rotate(-24deg) translateX(-280px); }
}

/* ---------- day sky ---------- */
.sky-day {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(#5aa9dd 0%, #9fd4f2 45%, #fdeed3 100%);
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
body.day .sky-day { opacity: 1; }
.sky-day .sun { pointer-events: auto; }

.sun {
  position: absolute;
  top: 8%; right: 10%;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff7d6, #ffd94d 65%, #ffb52e);
  box-shadow: 0 0 60px 24px rgba(255, 200, 80, 0.35);
  cursor: pointer;
}
.sun::before {
  content: "";
  position: absolute; inset: -24px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 200, 80, 0.35) 0 8deg, transparent 8deg 24deg);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%);
  mask: radial-gradient(circle, transparent 58%, #000 60%);
  animation: slowspin 26s linear infinite;
}
@keyframes slowspin { to { transform: rotate(360deg); } }
.sun.spin { animation: sunspin 0.8s ease; }
@keyframes sunspin {
  50%  { transform: scale(1.18) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

.cloud-day {
  position: absolute;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  filter: blur(8px);
  animation: drift 55s linear infinite;
}
.cloud-day-1 { top: 14%; left: -220px; width: 200px; }
.cloud-day-2 { top: 28%; left: -340px; width: 280px; animation-duration: 80s; animation-delay: -30s; }
.cloud-day-3 { top: 42%; left: -180px; width: 150px; animation-duration: 65s; animation-delay: -12s; }

.birds {
  position: absolute;
  top: 22%; left: -240px;
  width: 220px;
  animation: drift 75s linear infinite;
}
.birds path {
  stroke: #41617e;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
}
.bird-bob { animation: birdbob 3.2s ease-in-out infinite; }
@keyframes birdbob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* ---------- theme toggle ---------- */
.theme-toggle {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 20;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(16, 24, 48, 0.6);
  border: 1px solid rgba(160, 180, 220, 0.35);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.25s ease, background 0.8s ease, border-color 0.8s ease;
}
.theme-toggle:hover { transform: scale(1.1); }
.theme-toggle svg { width: 24px; height: 24px; }
.icon-moon { fill: #f4eedd; }
.icon-sun { fill: #ffcf4d; display: none; }
.icon-sun g { stroke: #ffcf4d; stroke-width: 2; stroke-linecap: round; }
body.day .icon-moon { display: none; }
body.day .icon-sun { display: block; }
body.day .theme-toggle {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.7);
}

/* ---------- ground ---------- */
.ground-night {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 16vh; z-index: 1;
  background: linear-gradient(#131c36, #0a0f22);
  border-top: 1px solid rgba(140, 160, 200, 0.12);
  pointer-events: none;
  transition: opacity 1.2s ease;
}
body.day .ground-night { opacity: 0; }
.ground-day {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 16vh; z-index: 1;
  background: linear-gradient(#8fce7a 0%, #69b45c 45%, #4f9247 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
body.day .ground-day { opacity: 1; }

/* ---------- the doxie ---------- */
.doxie-runner {
  position: fixed;
  bottom: 8.5vh; left: 0;
  z-index: 2;
  width: clamp(280px, 36vw, 440px);
  animation: trot-across 18s linear infinite;
}
@keyframes trot-across {
  from { transform: translateX(-45vw); }
  to   { transform: translateX(115vw); }
}

.doxie { width: 100%; height: auto; display: block; cursor: pointer; transition: transform 0.6s ease; }

.dog-bob { animation: bob 0.55s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

.leg {
  transform-box: fill-box;
  transform-origin: 50% 8%;
  animation: leg-swing 0.55s ease-in-out infinite alternate;
  transition: transform 0.4s ease;
}
.leg-a { animation-delay: 0s; }
.leg-b { animation-delay: -0.275s; }
@keyframes leg-swing {
  from { transform: rotate(-22deg); }
  to   { transform: rotate(22deg); }
}

.tail {
  transform-box: fill-box;
  transform-origin: 90% 90%;
  animation: wag 0.38s ease-in-out infinite alternate;
}
@keyframes wag {
  from { transform: rotate(-16deg); }
  to   { transform: rotate(20deg); }
}

.dog-head {
  transform-box: fill-box;
  transform-origin: 18% 82%;
  transition: transform 0.45s ease;
}

.doxie.boop { animation: hop 0.55s ease; }
@keyframes hop {
  30% { transform: translateY(-34px) rotate(-4deg); }
  60% { transform: translateY(0); }
  75% { transform: translateY(-12px); }
}

/* napping */
.doxie-runner.napping,
.doxie-runner.napping .dog-bob,
.doxie-runner.napping .leg { animation-play-state: paused; }
.doxie-runner.napping .leg { animation: none; transform: rotate(72deg); }
.doxie-runner.napping .tail { animation-duration: 1.8s; }
.doxie-runner.napping .doxie { transform: rotate(-6deg) translateY(14px); }

.zzz {
  position: absolute;
  right: 14%; top: -8px;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.zzz span {
  display: inline-block;
  color: #bcd2ff;
  font-weight: 700;
  font-size: 22px;
  animation: zfloat 2.6s ease-in infinite;
}
.zzz span:nth-child(2) { animation-delay: 0.5s; font-size: 26px; }
.zzz span:nth-child(3) { animation-delay: 1s; font-size: 30px; }
.doxie-runner.napping .zzz { opacity: 1; }
@keyframes zfloat {
  0%   { transform: translateY(6px) scale(0.7); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(-52px) scale(1.2); opacity: 0; }
}

/* sniffing */
.doxie-runner.sniffing,
.doxie-runner.sniffing .dog-bob,
.doxie-runner.sniffing .leg,
.doxie-runner.sniffing .tail { animation-play-state: paused; }
.doxie-runner.sniffing .dog-head { transform: rotate(20deg) translateY(10px); }

/* zoomies */
.doxie-runner.zoomies { animation-duration: 4.5s; }
.doxie-runner.zoomies .leg { animation-duration: 0.22s; }
.doxie-runner.zoomies .dog-bob { animation-duration: 0.22s; }
.doxie-runner.zoomies .tail { animation-duration: 0.14s; }
.zoom-label {
  position: absolute;
  top: -36px; left: 50%;
  transform: translateX(-50%) rotate(-6deg);
  background: #ffd94d;
  color: #4a2f0b;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 2px;
  padding: 4px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  white-space: nowrap;
}
.doxie-runner.zoomies .zoom-label { opacity: 1; }

/* ---------- content ---------- */
.card {
  text-align: center;
  max-width: 520px;
  position: relative;
  z-index: 3;
  transition: background 0.8s ease, padding 0.8s ease, border-color 0.8s ease, box-shadow 0.8s ease;
}
body.day .card {
  background: rgba(10, 16, 34, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  padding: 38px 44px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(30, 60, 120, 0.25);
  text-shadow: 0 1px 12px rgba(10, 16, 34, 0.45);
}

.badge {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #9fb3d9;
  border: 1px solid #2b3a5c;
  border-radius: 999px;
  padding: 8px 20px;
  margin-bottom: 28px;
}

h1 {
  font-size: clamp(40px, 8vw, 64px);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.sub {
  font-size: 17px;
  line-height: 1.6;
  color: #a9b8d4;
  margin-bottom: 32px;
}

.contact {
  display: inline-block;
  color: #e8ecf4;
  text-decoration: none;
  border: 1px solid #3b507c;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  transition: background 0.2s, border-color 0.2s;
}

.contact:hover {
  background: #16223c;
  border-color: #5a739f;
}

footer {
  position: fixed;
  bottom: 20px;
  font-size: 13px;
  color: #5c6f93;
  z-index: 3;
}
body.day footer { color: #3d5a3a; }

@media (prefers-reduced-motion: reduce) {
  .doxie-runner { animation: none; left: 50%; transform: translateX(-50%); bottom: 12vh; }
  .dog-bob, .leg, .tail, .stars span, .cloud, .cloud-day, .birds, .bird-bob, .sun::before { animation: none; }
  .sky-night, .sky-day, .ground-night, .ground-day { transition: none; }
}
