:root {
  color-scheme: light;
  --ink: #3c3650;
  --paper: #fffaf0;
  --cream: #fff2cf;
  --sun: #f7d774;
  --peach: #f39a78;
  --coral: #e97870;
  --mint: #8fbea1;
  --deep-mint: #527968;
  --sky: #b9dfe4;
  --line: #3c3650;
  --shadow: 6px 6px 0 var(--line);
  font-family: "Courier New", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(60, 54, 80, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 54, 80, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 18px 18px;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.brand-mark,
.icon-button,
.day-pill {
  border: 3px solid var(--line);
  box-shadow: 3px 3px 0 var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #fff;
  background: var(--coral);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.day-pill {
  padding: 8px 12px;
  background: var(--sun);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.icon-button {
  width: 38px;
  height: 38px;
  cursor: pointer;
  background: #fff;
  font-weight: 900;
}

.icon-button[aria-pressed="true"] {
  color: #fff;
  background: var(--deep-mint);
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

.intro {
  padding: 74px 0 48px;
  text-align: center;
}

.eyebrow,
.pet-kind {
  margin: 0 0 12px;
  color: var(--deep-mint);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.intro h1 {
  max-width: 820px;
  margin: 0 auto;
  font-size: clamp(2.25rem, 7vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.intro h1 span {
  color: var(--coral);
}

.intro-copy {
  max-width: 650px;
  margin: 26px auto 0;
  font-family: system-ui, sans-serif;
  font-size: 1.04rem;
  line-height: 1.7;
}

.garden {
  position: relative;
  overflow: hidden;
  min-height: 660px;
  padding: 42px 40px 88px;
  border: 4px solid var(--line);
  background: linear-gradient(var(--sky) 0 58%, #9bc985 58% 100%);
  box-shadow: 10px 10px 0 var(--line);
}

.sky,
.ground {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sun {
  position: absolute;
  top: 34px;
  right: 54px;
  width: 60px;
  height: 60px;
  border: 4px solid var(--line);
  background: var(--sun);
  box-shadow: 8px 0 0 -3px var(--sun), -8px 0 0 -3px var(--sun), 0 8px 0 -3px var(--sun), 0 -8px 0 -3px var(--sun);
}

.cloud {
  position: absolute;
  width: 78px;
  height: 22px;
  border: 3px solid var(--line);
  background: #f8f1df;
  box-shadow: 22px -18px 0 -3px #f8f1df, 22px -18px 0 0 var(--line), 46px -8px 0 -3px #f8f1df, 46px -8px 0 0 var(--line);
}

.cloud-one {
  top: 72px;
  left: 7%;
}

.cloud-two {
  top: 150px;
  right: 18%;
  transform: scale(0.72);
  opacity: 0.75;
}

.garden-status {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  max-width: 90%;
  margin: 0 auto 34px;
  padding: 10px 16px;
  border: 3px solid var(--line);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--line);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.status-spark {
  color: var(--coral);
}

.pet-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
  max-width: 900px;
  margin: 0 auto;
}

.pet-card {
  padding: 24px;
  border: 4px solid var(--line);
  background: rgba(255, 250, 240, 0.96);
  box-shadow: var(--shadow);
}

.pet-heading,
.meter-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pet-heading h2 {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: -0.05em;
}

.pet-heading .pet-kind {
  margin-bottom: 4px;
}

.mood-badge {
  padding: 7px 9px;
  border: 2px solid var(--line);
  background: var(--cream);
  font-size: 0.68rem;
  font-weight: 900;
}

.pet-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 232px;
  margin: 16px 0 18px;
  padding: 8px;
  border: 3px dashed rgba(60, 54, 80, 0.35);
  background: transparent;
  cursor: pointer;
}

.pet-stage:focus-visible,
.feed-button:focus-visible,
.reset-button:focus-visible,
.icon-button:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 3px;
}

.pixel-pet {
  position: relative;
  z-index: 2;
  width: min(190px, 72%);
  image-rendering: pixelated;
  transition: transform 160ms steps(2, end);
}

.pet-stage:hover .pixel-pet {
  transform: translateY(-5px) rotate(-1deg);
}

.pet-stage.is-happy .pixel-pet {
  animation: happy-hop 520ms steps(4, end);
}

.pet-shadow {
  position: absolute;
  z-index: 1;
  bottom: 33px;
  width: 150px;
  height: 20px;
  background: rgba(60, 54, 80, 0.24);
  transform: skewX(-18deg);
}

.pat-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 7px;
  color: rgba(60, 54, 80, 0.72);
  background: rgba(255, 250, 240, 0.75);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.heart-burst::before,
.heart-burst::after {
  position: absolute;
  z-index: 4;
  top: 38%;
  content: "♥";
  color: var(--coral);
  font-size: 1.35rem;
  opacity: 0;
}

.heart-burst::before {
  left: 31%;
}

.heart-burst::after {
  right: 31%;
}

.pet-stage.is-happy .heart-burst::before {
  animation: float-heart 700ms steps(5, end);
}

.pet-stage.is-happy .heart-burst::after {
  animation: float-heart 700ms 80ms steps(5, end);
}

.meter-copy {
  margin-bottom: 7px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.meter {
  height: 18px;
  padding: 3px;
  border: 3px solid var(--line);
  background: #fff;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--peach);
  transition: width 320ms steps(8, end), background-color 200ms linear;
}

.dog-card .meter span {
  background: var(--mint);
}

.feed-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
  padding: 13px 14px;
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 900;
  transition: transform 100ms linear, box-shadow 100ms linear;
}

.feed-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--line);
}

.feed-button:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--line);
}

.feed-button.warm {
  background: var(--sun);
}

.feed-button.cool {
  background: var(--mint);
}

.food-icon {
  font-weight: 900;
}

.biscuit {
  color: #855135;
}

.button-plus {
  margin-left: auto;
  padding: 2px 5px;
  border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  font-size: 0.68rem;
}

.ground {
  top: auto;
  height: 42%;
  border-top: 4px solid var(--line);
  background-image:
    linear-gradient(90deg, transparent 48%, rgba(60, 54, 80, 0.12) 48% 52%, transparent 52%),
    linear-gradient(transparent 48%, rgba(60, 54, 80, 0.12) 48% 52%, transparent 52%);
  background-size: 34px 34px;
}

.flower {
  position: absolute;
  color: #fff6d8;
  text-shadow: 2px 2px 0 var(--line);
  font-size: 1.5rem;
}

.flower-one { left: 5%; bottom: 22px; }
.flower-two { right: 7%; bottom: 70px; color: var(--sun); }
.flower-three { right: 40%; bottom: 14px; color: var(--coral); }

.daily-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  align-items: center;
  gap: 34px;
  margin: 64px 0;
  padding: 30px;
  border: 4px solid var(--line);
  background: var(--cream);
  box-shadow: 8px 8px 0 var(--line);
}

.daily-copy h2 {
  margin: 0 0 8px;
  font-size: 1.55rem;
}

.daily-copy p:last-child {
  margin: 0;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

.stat-list {
  display: flex;
  gap: 26px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid var(--line);
  background: var(--paper);
}

.stat strong,
.stat small {
  display: block;
}

.stat strong {
  font-size: 1.45rem;
}

.stat small {
  font-size: 0.65rem;
  font-weight: 700;
}

.reset-button {
  padding: 12px 14px;
  border: 3px solid var(--line);
  background: #fff;
  box-shadow: 4px 4px 0 var(--line);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 900;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 22px 0 36px;
  border-top: 3px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
}

.footer-paw {
  letter-spacing: 0.18em;
}

@keyframes happy-hop {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(-16px) rotate(-2deg); }
  65% { transform: translateY(-7px) rotate(2deg); }
}

@keyframes float-heart {
  0% { opacity: 0; transform: translateY(8px) scale(0.5); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-46px) scale(1.2); }
}

@media (max-width: 820px) {
  .garden {
    padding-inline: 22px;
  }

  .pet-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .daily-card {
    grid-template-columns: 1fr;
  }

  .reset-button {
    width: fit-content;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
  }

  .site-header {
    min-height: 70px;
  }

  .brand {
    font-size: 0.86rem;
  }

  .day-pill {
    display: none;
  }

  .intro {
    padding-top: 52px;
  }

  .garden {
    padding: 28px 13px 64px;
    box-shadow: 6px 6px 0 var(--line);
  }

  .pet-card {
    padding: 16px;
    box-shadow: 4px 4px 0 var(--line);
  }

  .pet-stage {
    min-height: 205px;
  }

  .stat-list {
    flex-direction: column;
    gap: 14px;
  }

  footer {
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
