:root {
  --sky: #a9d2ec;
  --ink: #17263f;
  --cream: #fff8e9;
  --red: #ff6247;
  --line: rgba(23, 38, 63, 0.22);
  --body: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Arial Rounded MT Bold", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  width: calc(100% - clamp(36px, 6vw, 92px));
  height: 82px;
  align-items: center;
  justify-content: space-between;
  margin-inline: auto;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: inherit;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark span {
  opacity: 0.48;
}

.open-status {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 650;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.open-status i {
  width: 8px;
  height: 8px;
  background: #2a9453;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(42, 148, 83, 0.13);
}

.language-switch {
  min-width: 36px;
  padding: 0.35rem 0.45rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 800;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.language-switch:hover {
  background: rgba(255, 248, 233, 0.48);
  border-color: var(--ink);
}

main {
  position: absolute;
  inset: 82px 0 0;
}

.hello {
  position: relative;
  z-index: 5;
  width: 40%;
  margin: clamp(72px, 12vh, 130px) 0 0 clamp(18px, 3vw, 46px);
  pointer-events: none;
}

.kicker {
  margin: 0 0 1.15rem 0.3rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(5rem, 10vw, 9.5rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.095em;
}

html[lang="en"] h1 {
  max-width: 5.5em;
  font-size: clamp(4.5rem, 8.5vw, 8.2rem);
  letter-spacing: -0.075em;
}

.subline {
  margin: 2rem 0 0 0.3rem;
  font-size: clamp(1.05rem, 1.45vw, 1.35rem);
  font-weight: 600;
  line-height: 1.6;
}

.dog-scene {
  position: absolute;
  inset: 0 0 0 36%;
  overflow: hidden;
}

.dog-button {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ctext y='24' font-size='24'%3E%F0%9F%91%8B%3C/text%3E%3C/svg%3E") 12 12, pointer;
}

.dog-button picture,
.dog-button img {
  display: block;
  width: 100%;
  height: 100%;
}

.dog-button img {
  object-fit: cover;
  object-position: center 54%;
  user-select: none;
  transition: transform 380ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dog-button:hover img {
  transform: scale(1.018);
}

.dog-button.is-patted img {
  animation: happy-dog 480ms ease;
}

@keyframes happy-dog {
  0% { transform: scale(1.018) rotate(0); }
  24% { transform: scale(1.035) rotate(-1.2deg); }
  48% { transform: scale(1.035) rotate(1.2deg); }
  74% { transform: scale(1.028) rotate(-0.5deg); }
  100% { transform: scale(1.018) rotate(0); }
}

.pat-hint {
  position: absolute;
  right: clamp(24px, 5vw, 72px);
  bottom: clamp(62px, 9vh, 105px);
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.8rem 1rem 0.8rem 1.15rem;
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 5px 0 var(--ink);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 200ms ease;
}

.pat-hint i {
  font-style: normal;
}

.pat-hint b {
  font-weight: inherit;
}

.dog-button:hover .pat-hint {
  box-shadow: 2px 3px 0 var(--ink);
  transform: translate(2px, 2px);
}

.pat-hint.is-used {
  opacity: 0;
}

.dog-says {
  position: absolute;
  z-index: 4;
  top: clamp(22px, 9vh, 88px);
  right: clamp(28px, 8vw, 125px);
  max-width: min(240px, 36vw);
  margin: 0;
  pointer-events: none;
  transform: rotate(2deg);
}

.dog-says span {
  display: block;
  padding: 0.85rem 1.05rem;
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 17px 17px 4px 17px;
  box-shadow: 4px 5px 0 rgba(23, 38, 63, 0.92);
  font-size: clamp(0.82rem, 1.3vw, 1rem);
  font-weight: 750;
  line-height: 1.45;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.dog-says.is-changing span {
  opacity: 0;
  transform: translateY(5px);
}

.floating-heart {
  position: absolute;
  z-index: 8;
  left: var(--heart-x);
  top: var(--heart-y);
  color: var(--red);
  font-size: var(--heart-size);
  pointer-events: none;
  animation: heart-float 1.15s ease-out forwards;
}

@keyframes heart-float {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.45) rotate(-12deg);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -110px) scale(1.1) rotate(13deg);
  }
}

footer {
  position: fixed;
  z-index: 10;
  bottom: 26px;
  left: clamp(18px, 3vw, 46px);
  display: flex;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  pointer-events: none;
}

footer p {
  margin: 0;
}

footer p + p {
  opacity: 0.48;
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: -6px;
}

@media (max-width: 760px) {
  body {
    overflow: hidden;
  }

  .site-header {
    width: calc(100% - 32px);
    height: 68px;
  }

  .open-status {
    font-size: 0;
  }

  .open-status span {
    display: none;
  }

  main {
    inset: 68px 0 0;
  }

  .hello {
    width: auto;
    margin: 44px 16px 0;
  }

  .kicker {
    margin-bottom: 0.8rem;
    font-size: 0.62rem;
  }

  h1 {
    font-size: clamp(4rem, 20vw, 6.2rem);
    white-space: nowrap;
  }

  html[lang="en"] h1 {
    max-width: 7em;
    font-size: clamp(3.65rem, 16vw, 5.2rem);
    line-height: 0.92;
    white-space: normal;
  }

  .subline {
    margin-top: 1rem;
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .dog-scene {
    inset: 26% 0 0;
  }

  .dog-button img {
    object-position: center 48%;
  }

  .dog-says {
    top: 9%;
    right: 18px;
    max-width: 175px;
  }

  .dog-says span {
    padding: 0.7rem 0.85rem;
    border-radius: 14px 14px 4px 14px;
    font-size: 0.76rem;
  }

  .pat-hint {
    right: 18px;
    bottom: 44px;
    padding: 0.72rem 0.9rem 0.72rem 1rem;
    font-size: 0.74rem;
  }

  footer {
    bottom: 18px;
    left: 16px;
    font-size: 0.58rem;
  }
}

@media (max-height: 650px) and (min-width: 761px) {
  .hello {
    margin-top: 54px;
  }

  .dog-says {
    top: 26px;
  }
}

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