@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;500;600&family=Shippori+Mincho:wght@400;500;600&display=swap");

:root {
  --paper: #faf9f5;
  --ink: #23221e;
  --muted: #57544e;
  --line: #c9c6bd;
  --footer: #efefee;
  --latin: "EB Garamond", Georgia;
  --japanese: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--latin), var(--japanese); }
.page { width: min(88%, 1320px); margin-inline: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
img { display: block; width: 100%; height: auto; }
.image-link { display: block; overflow: hidden; }
.image-link:focus-visible { outline-offset: 3px; }

.site-header { display: flex; align-items: center; justify-content: space-between; padding-block: clamp(15px, 2.7vw, 38px) clamp(12px, 1.9vw, 26px); }
.site-name { margin: 0; font-size: clamp(1rem, 1.45vw, 1.3rem); letter-spacing: .01em; font-weight: 400; }
.site-menu { position: relative; z-index: 1; }
.site-menu summary { display: grid; width: 44px; height: 44px; place-items: center; cursor: pointer; list-style: none; }
.site-menu summary::-webkit-details-marker { display: none; }
.menu-icon { display: grid; width: 20px; gap: 4px; }
.menu-icon span { height: 1px; background: currentColor; }
.site-menu[open] .menu-icon span:first-child { transform: translateY(5px) rotate(40deg); }
.site-menu[open] .menu-icon span:nth-child(2) { visibility: hidden; }
.site-menu[open] .menu-icon span:last-child { transform: translateY(-5px) rotate(-40deg); }
.site-menu nav { position: absolute; top: calc(100% + 4px); right: 0; display: grid; width: 10.5rem; padding: .55rem 1rem; border: 1px solid #d5dfe1; background: #e8edef; color: #344750; }
.site-menu:not([open]) nav { display: none; }
.site-menu nav a { padding: .53rem 0; font-size: .87rem; line-height: 1.4; letter-spacing: .03em; }
.site-menu nav a:hover, .site-menu nav a:focus-visible, .site-menu nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: .25em; }

.section-heading { font-family: var(--japanese); font-weight: 400; font-size: clamp(1.2rem, 2.55vw, 2.05rem); line-height: 1.4; letter-spacing: .035em; }
.heading-en { display: block; margin-top: .65rem; color: var(--muted); font: 400 clamp(.72rem, 1.1vw, .92rem) / 1.5 var(--latin), serif; letter-spacing: .055em; }

[data-character] { transform-origin: center bottom; }
[data-character] img { background: transparent; }

.page-character { display: block; flex: 0 0 auto; width: clamp(29px, 4.5vw, 52px); }
.page-character img { transform-origin: center bottom; }
.page-character--works { --page-character-motion: works-character-run 960ms ease-in-out; }
.page-character--personal { --page-character-motion: personal-character-float 1250ms ease-in-out; }
.page-character--profile { --page-character-motion: profile-character-bow 860ms ease-in-out; }

.site-footer { margin-bottom: clamp(18px, 3vw, 42px); }
.footer-panel { padding: clamp(22px, 4.6vw, 64px); background: var(--footer); }
.footer-contact { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: clamp(24px, 4vw, 52px); }
.footer-contact h2 { margin-bottom: 1.1rem; }
.footer-contact p { margin: 0; line-height: 1.6; }
.footer-contact .email-note { margin-top: .2rem; font-size: .78rem; color: var(--muted); }
.footer-character { width: clamp(39px, 5vw, 65px); flex-shrink: 0; }
.footer-bottom { border-top: 1px solid #cccac6; padding-top: 1.2rem; font-size: .85rem; }
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: .6rem clamp(.75rem, 2vw, 1.75rem); }
.footer-bottom a:hover, .footer-bottom a:focus-visible { text-decoration: underline; text-underline-offset: .25em; }
.footer-rights { margin: .85rem 0 0; color: var(--muted); font-size: .7rem; line-height: 1.8; }
.footer-rights p { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  .image-link img { transition: scale 320ms ease-out; }
  :is(.image-link, .project-image) img.image-arrived,
  [data-image-reveal].image-arrived { animation: image-arrive 620ms ease-out; }
  .image-link:focus-visible img { scale: 1.025; }
  .footer-character.has-arrived { animation: character-sway 820ms ease-in-out; }
  .page-character.has-arrived { animation: var(--page-character-motion); }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .image-link:hover img { scale: 1.025; }
  .page-character:hover img { animation: var(--page-character-motion); }
}

@keyframes image-arrive {
  from { opacity: .62; }
  to { opacity: 1; }
}

@keyframes character-sway {
  30% { transform: rotate(-8deg); }
  67% { transform: rotate(6deg); }
}

@keyframes works-character-run {
  18% { transform: translate(8px, -5px) rotate(9deg); }
  36% { transform: translateX(17px) rotate(-4deg); }
  54% { transform: translate(29px, -7px) rotate(9deg); }
  72% { transform: translateX(34px); }
  90% { transform: translate(6px, -4px) rotate(-8deg); }
}

@keyframes personal-character-float {
  36% { transform: translate(-3px, -14px) rotate(-10deg); }
  68% { transform: translate(5px, -10px) rotate(7deg); }
}

@keyframes profile-character-bow {
  36%, 52% { transform: rotate(14deg) scaleY(.72); }
  76% { transform: rotate(-4deg); }
}

@media (max-width: 620px) {
  .page { width: 90%; }
}
