@font-face {
  font-family: Fraunces;
  src: url("assets/fonts/fraunces-italic-latin.woff2") format("woff2");
  font-style: italic;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Lilita One";
  src: url("assets/fonts/lilita-one-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #faf7ed;
  --print: #fffaf1;
  --primary: #214fbc;
  --ink: #242524;
  --muted: #4d535d;
  --border: #d5ccc0;
  --amber: #f3d16a;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Lilita One", "Arial Black", var(--sans);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--sans); }
button { color: inherit; font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
h1, h2, p { margin: 0; }
::selection { background: var(--amber); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.shell { width: min(1350px, calc(100% - 9vw)); margin-inline: auto; }

.site-header, .site-footer { display: flex; justify-content: space-between; align-items: center; }
.site-header { min-height: 76px; border-bottom: 1px solid var(--border); }
.wordmark { font: italic 800 1.65rem/1 Fraunces, Georgia, serif; letter-spacing: -.07em; }
.wordmark span { margin-left: .08em; color: var(--primary); }
.header-nav { display: flex; align-items: center; gap: clamp(15px, 3vw, 40px); font-size: .93rem; font-weight: 700; }
.header-nav a, .site-footer a { text-decoration: underline solid transparent 2px; text-underline-offset: .36em; }
.header-nav a:hover, .site-footer a:hover { text-decoration-color: var(--primary); }
.language { min-width: 45px; min-height: 36px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--print); cursor: pointer; }
.language:hover { border-color: var(--primary); color: var(--primary); }

.poster { background-image: radial-gradient(circle, #6692cb42 1px, transparent 1.3px); background-size: 25px 25px; background-position: 12px 12px; }
.hero { display: grid; grid-template-columns: minmax(0, .91fr) minmax(0, 1.09fr); align-items: center; gap: clamp(20px, 4.3vw, 72px); padding-block: clamp(73px, 8.4vw, 122px) clamp(69px, 7.6vw, 110px); }
.intro { position: relative; padding-left: clamp(0px, 1vw, 16px); }
.hello { display: block; font: 900 clamp(2.5rem, 5.2vw, 4.8rem)/1.12 var(--sans); letter-spacing: -.07em; }
:lang(en) .hello { font-family: var(--display); font-weight: 400; letter-spacing: -.045em; }
.name { position: relative; isolation: isolate; display: inline-flex; align-items: baseline; margin-left: -.018em; padding-right: .03em; color: var(--primary); font: 400 clamp(7.9rem, 15.5vw, 15.3rem)/.92 var(--display); letter-spacing: -.018em; white-space: nowrap; }
.name::before { content: ""; position: absolute; z-index: -1; left: 4%; bottom: 7%; width: 94%; height: 17%; background: var(--amber); transform: rotate(-3deg); clip-path: polygon(0 23%, 7% 12%, 32% 15%, 51% 7%, 93% 0, 100% 18%, 98% 72%, 100% 91%, 51% 89%, 26% 99%, 3% 93%, 1% 65%); }
.name span { display: block; }
.name span:nth-child(1) { transform: rotate(-6deg); }
.name span:nth-child(2) { transform: translateY(-.015em) rotate(4deg); }
.name span:nth-child(3) { transform: translateY(.035em) rotate(-3deg); }
.name span:nth-child(4) { transform: rotate(7deg); }
.profile { margin-top: clamp(.8rem, 2vw, 1.95rem); }
.full-name { font-size: clamp(1.18rem, 2.3vw, 1.63rem); font-weight: 800; }
.bio { margin-top: .18em; color: var(--muted); font-size: clamp(.95rem, 1.26vw, 1.08rem); }
.visit { display: inline-flex; align-items: center; gap: 13px; min-height: 45px; margin-top: clamp(15px, 3vw, 37px); padding: 4px 10px 4px 12px; border-bottom: 2px solid var(--primary); background: var(--print); color: var(--primary); font-size: .91rem; font-weight: 750; }
.visit:hover { background: #f8e7a8; }
.visit span:last-child { font-size: 1.26em; }

.dog-room { min-width: 0; scroll-margin-top: 23px; }
.print { position: relative; padding: clamp(7px, 1vw, 14px); border: 1px solid #b9ad9c; background: var(--print); box-shadow: 5px 7px 0 #aa9b8640, 0 14px 22px #66574318; transform: rotate(2deg); }
.print::before { content: ""; position: absolute; z-index: 2; width: clamp(60px, 9vw, 114px); height: clamp(22px, 3vw, 34px); inset: -12px auto auto 4%; transform: rotate(-14deg); background: #f2d47e; clip-path: polygon(1% 7%, 23% 1%, 42% 7%, 98% 0, 95% 28%, 100% 39%, 96% 53%, 100% 74%, 97% 99%, 42% 97%, 0 100%, 3% 67%, 0% 42%); pointer-events: none; }
.yard { position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1236 / 941; background: #367ebc; }
.scene { position: absolute; top: 0; right: 0; width: calc(100% * 1672 / 1236); aspect-ratio: 1672 / 941; }
.scene img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.dog { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); min-width: 24px; min-height: 24px; border: 0; padding: 0; border-radius: 15px; background: transparent; cursor: pointer; touch-action: manipulation; }
.dog:focus-visible { outline-color: #fff5d4; outline-offset: -1px; }
.dog--cream { --x: 38.6%; --y: 46.7%; --w: 23.2%; --h: 19.3%; --mark: 76%; }
.dog--black { --x: 76%; --y: 38%; --w: 18.8%; --h: 30.4%; --mark: 23%; }
.dog--white { --x: 28.8%; --y: 66%; --w: 28.8%; --h: 22.8%; --mark: 74%; }
.dog--sable { --x: 61%; --y: 68.4%; --w: 31%; --h: 22%; --mark: 35%; }
.dog::before { content: ""; position: absolute; inset: 6%; border: 2px dashed #fff1bd; border-radius: 46% 53% 49% 47%; transform: rotate(-4deg); opacity: 0; pointer-events: none; }
.dog:hover::before, .dog:focus-visible::before { opacity: .85; }
.dog.is-reacting::before { animation: dog-ring .7s ease-out both; }
.dog-name { position: absolute; z-index: 1; bottom: 0; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(155px, 118%); padding: 3px 7px; color: var(--ink); background: var(--print); border: 1px solid #e1d4b9; border-radius: 4px; font-size: clamp(.66rem, 1vw, .8rem); line-height: 1.18; text-align: center; opacity: 0; pointer-events: none; }
.dog:hover .dog-name, .dog:focus-visible .dog-name { opacity: 1; }
.reaction { display: none; position: absolute; pointer-events: none; z-index: 2; top: -6%; left: var(--mark); width: 32px; height: 32px; }
.dog.is-reacting { z-index: 1; }
.dog.is-reacting .reaction { display: block; animation: reaction-rise .7s ease-out both; }
.dog[data-reaction="pet"] .reaction::before { content: "♥"; color: #e76263; text-shadow: 1px 1px #6a262b, -1px 0 #fff6da; font: 700 1.83rem/1 Georgia, serif; }
.dog[data-reaction="treat"] .reaction::before { content: ""; position: absolute; inset: 5px 1px 6px; border: 2px solid #755335; border-radius: 45%; transform: rotate(-18deg); background: radial-gradient(circle at 34% 40%, #87552d 0 1.5px, transparent 2px), radial-gradient(circle at 68% 60%, #87552d 0 1.5px, transparent 2px), #efd18e; }
@keyframes reaction-rise { 0% { transform: translateY(5px) scale(.72); opacity: .45; } 35%, 65% { opacity: 1; } 100% { transform: translateY(-18px) scale(1.04); opacity: 0; } }
@keyframes dog-ring { 0% { opacity: .9; transform: rotate(-4deg) scale(.96); } 100% { opacity: 0; transform: rotate(-4deg) scale(1.12); } }

.print-caption { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 7px 0 0; }
.dog-status { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); font-size: clamp(.79rem, 1vw, .88rem); }
.status-dot { flex: 0 0 8px; width: 8px; aspect-ratio: 1; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 1px #957532; }
.actions { display: flex; gap: 5px; }
.action { min-height: 44px; padding: 5px 11px; border: 1px solid var(--border); border-radius: 6px; background: var(--paper); white-space: nowrap; font-size: .82rem; font-weight: 740; cursor: pointer; }
.action:hover { border-color: var(--primary); }
.action[aria-pressed="true"] { background: var(--primary); color: var(--print); border-color: var(--primary); }
.site-footer { min-height: 57px; border-top: 1px solid var(--border); color: var(--muted); font-size: .83rem; }

@media (max-width: 910px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.17fr); padding-block: 70px; }
  .name { font-size: clamp(7.2rem, 15.7vw, 9.2rem); }
  .print-caption { grid-template-columns: minmax(0, 1fr); gap: 1px; }
  .actions { grid-row: 1; }
}

@media (max-width: 745px) {
  .shell { width: min(605px, calc(100% - 36px)); }
  .site-header { min-height: 62px; }
  .poster { background-size: 21px 21px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 35px; padding-block: 40px 37px; }
  .intro { padding-left: 2px; }
  .hello { font-size: clamp(2.3rem, 8.4vw, 3.9rem); }
  .name { font-size: clamp(6.5rem, 31vw, 12.9rem); }
  .profile { margin-top: 10px; }
  .visit { margin-top: 10px; min-height: 40px; }
  .print { transform: rotate(1deg); }
  .dog-room { margin-inline: 2px 6px; }
}

@media (max-width: 350px) {
  .shell { width: calc(100% - 28px); }
  .header-nav { gap: 12px; }
  .wordmark { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dog.is-reacting .reaction, .dog.is-reacting::before { animation: none; }
  .dog.is-reacting::before { opacity: .85; }
}
