:root {
  color-scheme: light;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: #38372f;
  background: #f5f2ec;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 2px solid #938367; outline-offset: 6px; }
.home {
  min-height: 100svh;
  padding: 72px 0 112px;
  background: #f5f2ec radial-gradient(ellipse at 50% 15%, #fffdfa 0, #f5f2ec 65%) center top / 100% 100svh no-repeat;
}
.hero { text-align: center; margin-bottom: 40px; padding: 0 24px; }
.profile-image { display: block; width: 112px; height: 112px; margin: 0 auto 23px; border-radius: 50%; object-fit: cover; box-shadow: 0 3px 16px #51452e0d; }
.hero h1 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: .16em; line-height: 1.6; padding-left: .16em; }
/* リンク集は縦に伸ばさずグリッドにする。featured は1行を使って大きく、url の無い枠は押せない見た目にする */
.profile { width: min(100%, 600px); margin: 0 auto; padding: 0 16px; }
.link-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.link-grid .is-featured { grid-column: 1 / -1; }
.link-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  min-height: 76px;
  padding: 10px 4px;
  border: 1px solid #e4dfd6;
  border-radius: 13px;
  background: #fffdfa;
  box-shadow: 0 3px 8px #51452e03;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.link-tile .service-icon { width: 30px; height: 30px; }
.is-featured .link-tile { flex-direction: row; gap: 16px; min-height: 84px; border-color: #c4b496; font-size: 20px; letter-spacing: .04em; }
.is-featured .link-tile .service-icon { width: 48px; height: 48px; border-radius: 9px; }
.link-tile[aria-disabled="true"] { opacity: .45; box-shadow: none; }
.links { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 26px;
  border: 1px solid #e4dfd6;
  border-radius: 13px;
  background: #fffdfa;
  box-shadow: 0 3px 8px #51452e03;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .045em;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.link-arrow { flex: none; width: 19px; height: 19px; color: #a99a80; }
.link-name { display: flex; align-items: center; gap: 18px; min-width: 0; overflow-wrap: anywhere; }
.service-icon { display: block; flex: none; width: 36px; height: 36px; object-fit: contain; border-radius: 7px; }
.watch-icon { display: grid; place-items: center; background: #38372f; color: #fffdfa; }
.watch-icon svg { width: 20px; height: 20px; }
.section { margin: 80px 0 0; }
.section h2 { margin: 0 0 24px; text-align: center; font-size: 20px; font-weight: 500; letter-spacing: .16em; line-height: 1.6; padding-left: .16em; }
/* カードは画像が主役。名前は画像の上に重ねる。左右に余白を取らず、PCは4列・スマホは2列 */
.products, .tiles, .works { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0 12px; list-style: none; }
.tile, .work, .product { display: block; text-decoration: none; }
.tile-thumb, .work-thumb, .product-thumb {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 13px;
  background: #e4dfd6;
  box-shadow: 0 3px 10px #51452e14;
  transition: box-shadow .18s, transform .18s;
}
.product-thumb { aspect-ratio: 4 / 3; }
.tile-thumb img, .work-thumb img, .product-thumb img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; }
/* ジャンル・原作のカードは直下の作品の画像を4つグリッドに並べる。4件未満はある分で埋める */
.collage { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.collage-1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.collage-2 { grid-template-rows: 1fr; }
.collage-3 img:first-child { grid-row: span 2; }
.card-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 56px 18px 16px; background: linear-gradient(to bottom, #1a171200, #1a1712d1 72%); color: #fffdfa; text-shadow: 0 1px 3px #0000004d; }
.tile-name { display: block; font-size: 19px; font-weight: 600; line-height: 1.5; letter-spacing: .05em; overflow-wrap: anywhere; }
.site-header { padding: 18px 24px 0; text-align: left; }
.site-logo { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; max-width: 100%; border-radius: 24px; text-decoration: none; }
.site-logo img { display: block; flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.site-logo span { font-size: 19px; font-weight: 700; letter-spacing: .07em; line-height: 1.5; }
.page { margin: 0 auto; padding: 40px 0 112px; }
.page-heading { margin-bottom: 28px; padding: 0 24px; text-align: center; }
.page-heading h1 { margin: 0; font-size: 22px; font-weight: 500; line-height: 1.6; letter-spacing: .08em; overflow-wrap: anywhere; }
.work-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; font-size: 16px; font-weight: 600; line-height: 1.5; letter-spacing: .03em; overflow-wrap: anywhere; }
.work-detail { width: min(100%, 536px); padding-left: 24px; padding-right: 24px; }
.work-image { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 13px; background: #e4dfd6; box-shadow: 0 3px 10px #51452e14; }
.work-image.product-image { aspect-ratio: 4 / 3; }
.work-detail h1 { margin: 24px 0 28px; text-align: center; font-size: 20px; font-weight: 500; line-height: 1.6; letter-spacing: .04em; overflow-wrap: anywhere; }
/* PCの作品詳細は画像を左、タイトルと動線を右に並べる */
@media (min-width: 760px) {
  .work-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; width: min(100%, 1088px); }
  .work-detail h1 { margin: 0 0 28px; text-align: left; }
}
@media (hover: hover) {
  .link:hover, a.link-tile:hover { border-color: #c4b496; box-shadow: 0 5px 16px #51452e09; transform: translateY(-2px); }
  .tile:hover .tile-thumb, .work:hover .work-thumb, .product:hover .product-thumb { box-shadow: 0 8px 22px #51452e29; transform: translateY(-2px); }
}
.viewer { background: #0c0c0d; color: #fff; color-scheme: dark; overflow: hidden; }
.stage {
  position: relative;
  width: 100%;
  height: 100svh;
  height: 100dvh;
}
.media {
  display: grid;
  /* 原寸の画像でグリッドが画面外へ伸びないよう、縦横とも表示枠内に収める。 */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.media img, .media video { display: block; width: 100%; height: 100%; object-fit: contain; }
.navigate {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 48px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff18;
  border-radius: 12px;
  background: #0c0c0d80;
  color: #eee;
  text-decoration: none;
  transition: background .18s, border-color .18s;
}
.navigate.previous { left: max(16px, env(safe-area-inset-left)); }
.navigate.next { right: max(16px, env(safe-area-inset-right)); }
.navigate svg { width: 24px; height: 24px; }
.navigate[aria-disabled="true"] { opacity: .22; cursor: default; }
@media (hover: hover) {
  .navigate[href]:hover { background: #0c0c0dcc; border-color: #ffffff38; }
}
.media-error { padding: 24px; color: #f4cece; text-align: center; font-size: 14px; line-height: 1.8; }
.missing { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 22px; padding: 24px; }
.missing p { margin: 0; }
.missing a { text-underline-offset: 5px; }
@media (max-width: 600px) {
  .site-header { padding: 16px 16px 0; }
  .site-logo { gap: 10px; }
  .site-logo img { width: 38px; height: 38px; }
  .site-logo span { font-size: 17px; }
  .home { padding: 48px 0 80px; }
  .hero { margin-bottom: 35px; }
  .profile-image { width: 96px; height: 96px; }
  .hero h1 { font-size: 24px; }
  .link { min-height: 65px; padding: 0 23px; }
  .section { margin-top: 64px; }
  .page { padding: 32px 0 80px; }
  .products, .tiles, .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 8px; }
  .card-caption { padding: 36px 10px 9px; }
  .tile-name { font-size: 14px; }
  .work-title { font-size: 13px; }
  .link-tile { min-height: 68px; font-size: 11px; }
  .link-tile .service-icon { width: 26px; height: 26px; }
  .is-featured .link-tile { min-height: 72px; font-size: 18px; }
  .is-featured .link-tile .service-icon { width: 40px; height: 40px; }
  .navigate { width: 40px; height: 56px; border-radius: 9px; }
  .navigate.previous { left: max(8px, env(safe-area-inset-left)); }
  .navigate.next { right: max(8px, env(safe-area-inset-right)); }
  .navigate svg { width: 20px; height: 20px; }
}
@media (max-height: 760px) {
  .home { padding-top: 32px; }
  .hero { margin-bottom: 32px; }
  .profile-image { width: 76px; height: 76px; margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .link, .link-tile, .navigate, .tile-thumb, .work-thumb, .product-thumb { transition: none; }
  .link:hover, a.link-tile:hover, .tile:hover .tile-thumb, .work:hover .work-thumb, .product:hover .product-thumb { transform: none; }
}
