/* @font-face は <head> に直に書いている（src/layout.mjs）。ファイル名にハッシュが付くため */
body {
  font-family: 'MPLUS1', 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  margin: 0;
}
h1 {
  font-size: 24px;
}
h2,
h3 {
  font-weight: normal;
}
img {
  vertical-align: middle;
}
table {
  border-collapse: collapse;
}
table,
th,
td {
  border: 1px solid var(--theme-hsl-color);
}
th,
td {
  padding: 10px;
}
thead {
  background: var(--theme-background-1-hsl-color);
}
tbody tr:nth-child(even) {
  background: var(--theme-background-2-hsl-color);
}
tbody tr:nth-child(odd) {
  background: var(--theme-background-3-hsl-color);
}

dl dt {
  font-weight: bold;
}
dl dd {
  margin: 0 0 8px 1.5em;
}
abbr[title] {
  cursor: help;
  text-decoration: underline dotted;
}
.heading {
  margin-bottom: 10px;
  border-bottom: 1px solid;
  padding-bottom: 10px;
  border-image-source: var(--gradient);
  border-image-slice: 1;
}
.heading h1,
.heading h2,
.heading h3 {
  margin: 0;
}
.heading p {
  margin: 0;
  color: var(--inconspicuous-color);
}

/*
 * テーマ。色相は `--hue`、明暗は <html data-theme="light|dark">（無ければOSに従う）。
 * どちらも <head> のインラインスクリプトが描画前に当て、メニューで変えられる（src/client/site.js）。
 *
 * **暗いときの値は2か所に同じものを書く**（OSがダークで未指定のとき／ダークを選んだとき）。
 * 片方だけ直すと、選び方によって色が変わる。
 */
:root {
  --hue: 120;
  color-scheme: light;
  --bg1-lightness: 88%;
  --bg2-lightness: 94%;
  --bg3-lightness: 96%;
  --link-lightness: 45%;
  --gradient-lightness: 60%;
  --theme-mode-base-rgb-value: 255, 255, 255;
  --theme-mode-accent-rgb-value: 0, 0, 0;
  --inconspicuous-color: hsl(0, 0%, 30%);
  --page-background: #fff;
  --page-color: #000;
  --profile-glow: 7px 3px;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg1-lightness: 16%;
  --bg2-lightness: 10%;
  --bg3-lightness: 8%;
  --link-lightness: 70%;
  --gradient-lightness: 70%;
  --theme-mode-base-rgb-value: 0, 0, 0;
  --theme-mode-accent-rgb-value: 255, 255, 255;
  --inconspicuous-color: hsl(0, 0%, 70%);
  --page-background: #000;
  --page-color: #fff;
  --profile-glow: 14px 7px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg1-lightness: 16%;
    --bg2-lightness: 10%;
    --bg3-lightness: 8%;
    --link-lightness: 70%;
    --gradient-lightness: 70%;
    --theme-mode-base-rgb-value: 0, 0, 0;
    --theme-mode-accent-rgb-value: 255, 255, 255;
    --inconspicuous-color: hsl(0, 0%, 70%);
    --page-background: #000;
    --page-color: #fff;
    --profile-glow: 14px 7px;
  }
}
/* 上の値から組み立てる。ここは明暗で変わらない */
:root {
  --theme-hue-value: var(--hue);
  --theme-hsl-value: var(--hue), 75%, 70%;
  --theme-hsl-color: hsl(var(--hue), 75%, 70%);
  --theme-background-1-hsl-color: hsl(var(--hue), 75%, var(--bg1-lightness));
  --theme-background-2-hsl-color: hsl(var(--hue), 75%, var(--bg2-lightness));
  --theme-background-3-hsl-color: hsl(var(--hue), 75%, var(--bg3-lightness));
  --theme-mode-base-rgb-color: rgb(var(--theme-mode-base-rgb-value));
  --theme-mode-accent-rgb-color: rgb(var(--theme-mode-accent-rgb-value));
  --gradient: linear-gradient(
    to right,
    hsl(0, 75%, var(--gradient-lightness)),
    hsl(60, 75%, var(--gradient-lightness)),
    hsl(120, 75%, var(--gradient-lightness)),
    hsl(180, 75%, var(--gradient-lightness)),
    hsl(240, 75%, var(--gradient-lightness)),
    hsl(300, 75%, var(--gradient-lightness)),
    hsl(360, 75%, var(--gradient-lightness))
  );
}
html {
  background-color: var(--page-background);
  color: var(--page-color);
}
a {
  color: hsl(var(--hue), 75%, var(--link-lightness));
}

/* ---- main ---- */

main {
  display: block;
  width: 100%;
  min-height: calc(100svh - 150px);
  padding: 50px 20px 0;
  max-width: 1500px;
  box-sizing: border-box;
}
main.full-main {
  padding: 0;
  max-width: 100%;
}
@media screen and (min-width: 800px) {
  main {
    width: 90%;
    padding: 50px 0 0;
    margin: 0 auto;
  }
  main.full-main {
    width: 100%;
  }
}

/* ---- header ---- */

.site-header {
  width: 100%;
  height: 44px;
  padding: 3px;
  top: 0;
  position: fixed;
  box-sizing: border-box;
  background: linear-gradient(
    0deg,
    rgba(var(--theme-mode-base-rgb-value), 0.3) 0%,
    rgba(var(--theme-mode-base-rgb-value), 0.5) 40%,
    rgba(var(--theme-mode-base-rgb-value), 0.8) 100%
  );
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: space-between;
  z-index: 100;
}
.site-header-logo,
.site-header-link,
.menu-link {
  padding: 10px;
  color: var(--theme-mode-accent-rgb-color);
  text-decoration: none;
}
.site-header nav {
  display: flex;
  margin-right: 20px;
}
.site-header-links {
  display: none;
  padding: 0;
  justify-content: space-around;
}
.site-header-menu {
  border: none;
  background: none;
  color: var(--theme-mode-accent-rgb-color);
  font-size: 14px;
  cursor: pointer;
}
@media screen and (min-width: 600px) {
  .site-header {
    justify-content: space-around;
  }
  .site-header-links {
    display: flex;
  }
}

/* ---- menu ---- */

.menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100svh;
  color: var(--theme-mode-accent-rgb-color);
  background-color: rgba(var(--theme-mode-base-rgb-value), 0.9);
  text-align: center;
  padding: 80px 0;
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 102;
}
.menu[hidden] {
  display: none;
}
.menu-close {
  background: none;
  color: var(--theme-mode-accent-rgb-color);
  border: none;
  font-size: 14px;
  cursor: pointer;
}
.menu-links {
  margin: 2em 0;
}
.menu-group {
  margin: 2em 0;
}
.menu-hue-sample {
  color: var(--theme-hsl-color);
}
.menu-hue {
  appearance: none;
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    hsl(0, 75%, 70%),
    hsl(60, 75%, 70%),
    hsl(120, 75%, 70%),
    hsl(180, 75%, 70%),
    hsl(240, 75%, 70%),
    hsl(300, 75%, 70%),
    hsl(360, 75%, 70%)
  );
  cursor: pointer;
}
.menu-hue::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 20px;
  background: var(--theme-hsl-color);
  border-radius: 2px;
  transition: transform 0.2s ease;
  border: 0 solid var(--theme-hsl-color);
  box-shadow: 0px 4px 5px -2px var(--theme-hsl-color);
}
.menu-hue::-moz-range-thumb {
  appearance: none;
  width: 12px;
  height: 20px;
  background: var(--theme-hsl-color);
  border-radius: 2px;
  transition: transform 0.2s ease;
  border: 0 solid var(--theme-hsl-color);
  box-shadow: 0px 4px 5px -2px var(--theme-hsl-color);
}
.menu-hue:hover::-webkit-slider-thumb,
.menu-hue:active::-webkit-slider-thumb {
  transform: scale(1.15);
}
.menu-hue:hover::-moz-range-thumb,
.menu-hue:active::-moz-range-thumb {
  transform: scale(1.15);
}

/* ---- footer ---- */

.site-footer {
  margin: 50px 0 0;
  padding: 20px;
  border-top: 1px solid var(--inconspicuous-color);
  border-radius: 20px 20px 0 0;
  font-size: small;
}
.site-footer-top {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  flex-wrap: wrap;
}
.site-footer-group {
  margin: 20px;
}
.site-footer-group-name {
  font-weight: bold;
}
.site-footer ul {
  margin: 0;
  padding-left: 0;
  list-style-type: none;
}
.site-footer-link {
  display: inline;
  color: var(--inconspicuous-color);
  text-decoration: none;
}
.site-footer-link:hover {
  text-decoration: underline;
}
.site-footer-bottom {
  padding: 10px;
  border-top: 1px solid var(--inconspicuous-color);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.site-footer-made-by {
  color: var(--inconspicuous-color);
}
@media (min-width: 700px) {
  .site-footer-top {
    flex-direction: row;
  }
}

/* ---- スクロールバー（マウスのときだけ自前のものに差し替える）---- */

.global-scrollbar {
  position: fixed;
  top: 0;
  right: 4px;
  width: 4px;
  border-radius: 2px;
  background-color: rgba(var(--theme-mode-accent-rgb-value), 0.2);
  opacity: 0;
  transition: opacity 0.3s, width 0.2s, right 0.2s;
  cursor: pointer;
  z-index: 101;
}
.global-scrollbar.visible {
  opacity: 1;
}
.global-scrollbar.visible:hover,
.global-scrollbar.dragging {
  width: 8px;
  border-radius: 4px;
  right: 2px;
  background-color: rgba(var(--theme-mode-accent-rgb-value), 0.3);
}
@media (pointer: coarse) {
  html {
    scrollbar-width: thin;
  }
  .global-scrollbar {
    display: none;
  }
}
@media (pointer: fine) {
  html {
    scrollbar-width: none;
  }
}

/* ---- 横スクロールバー（src/components/hscrollbar.mjs）。上の縦のものの横版 ---- */

.hscrollbar {
  height: 12px;
  display: none;
  align-items: center;
  cursor: pointer;
}
.hscrollbar-thumb {
  height: 4px;
  border-radius: 2px;
  background-color: rgba(var(--theme-mode-accent-rgb-value), 0.2);
  opacity: 0;
  transition: opacity 0.3s, height 0.2s, background-color 0.2s;
}
.hscrollbar.visible .hscrollbar-thumb {
  opacity: 1;
}
.hscrollbar.visible:hover .hscrollbar-thumb,
.hscrollbar.dragging .hscrollbar-thumb {
  height: 8px;
  border-radius: 4px;
  background-color: rgba(var(--theme-mode-accent-rgb-value), 0.3);
}
@media (pointer: fine) {
  .hscrollbar:not([hidden]) {
    display: flex;
  }
}

/* ここから下は @ivecolor/markdown が出す要素。CMS の本文はこちらを通る */

/* 言語指定なし・知らない言語のコードブロックは Shiki を通らず素の <pre> になるので、
   .shiki だけでなく pre 全体に当てる。長い行は折り返さず横にスクロールさせる */
pre {
  max-width: 100%;
  margin: 10px 0;
  padding: 10px;
  border-radius: 7px;
  overflow-x: auto;
  box-sizing: border-box;
}

/* 列の多い表は、ページではなく表の中だけを横にスクロールさせる。
   table のままだと overflow が効かないので block にし、幅は中身に合わせて 100% で止める。
   外枠は block 側に付くと二重になるので、セルの線だけで囲む */
table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border: none;
}

.markdown-callout {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 7px;
  border-left: 4px solid var(--inconspicuous-color);
  background: #8080801f;
}
.markdown-callout-title {
  font-weight: bold;
  margin-bottom: 4px;
}
.markdown-callout--info {
  border-left-color: #4a7dff;
  background: #0000ff2e;
}
.markdown-callout--success {
  border-left-color: #3fae5a;
  background: #00ff002e;
}
.markdown-callout--warning {
  border-left-color: #e0a020;
  background: #ffaa002e;
}
.markdown-callout--danger {
  border-left-color: #e05252;
  background: #ff00002e;
}

.markdown-image-slider {
  display: flex;
  flex-direction: row;
  align-items: center;
  overflow-x: auto;
  gap: 10px;
}
.markdown-image-figure {
  width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
  margin: 10px 0;
}
.markdown-image-figure figcaption {
  text-align: center;
  font-size: 0.75em;
  color: var(--inconspicuous-color);
  margin-top: 4px;
}

/* 解決できなかったメディア参照・記事参照 */
.markdown-missing {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #e05252;
  border-radius: 5px;
  color: #e05252;
  font-size: 13px;
}

.markdown-player {
  width: 100%;
}
.markdown-player-figure {
  margin: 10px 0;
}
.markdown-player-figure figcaption {
  text-align: center;
  font-size: 0.75em;
  color: var(--inconspicuous-color);
  margin-top: 4px;
}

/* ---- 一覧（Posts / Works）---- */

.card-list {
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.card-list-item {
  width: 100%;
  flex: 1 1 285px;
}
@media screen and (min-width: 600px) {
  .card-list {
    justify-content: space-evenly;
  }
  .card-list-item {
    flex: 0 0 400px;
  }
}

/* ---- card ---- */

.card {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--inconspicuous-color);
  box-sizing: border-box;
  display: inline-block;
  color: var(--theme-mode-accent-rgb-color);
  text-decoration: none;
}
.card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: var(--inconspicuous-color);
  display: flex;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.card-plate {
  margin: 6px 0 0;
  display: flex;
}
.card-icon {
  width: 50px;
  height: 50px;
  margin: 0 4px 0 0;
  flex-shrink: 0;
  border-radius: 4px;
}
.card-text {
  margin: 0 0 0 4px;
  overflow: hidden;
}
.card-title,
.card-summary {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.card-summary {
  color: var(--inconspicuous-color);
}

/* ---- mini card ---- */

.mini-card {
  width: 100%;
  max-width: 400px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--inconspicuous-color);
  box-sizing: border-box;
  display: flex;
  color: var(--theme-mode-accent-rgb-color);
  text-decoration: none;
}
.mini-card-image {
  width: 160px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: var(--inconspicuous-color);
  display: flex;
  flex-shrink: 0;
}
.mini-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.mini-card-text {
  height: 90px;
  margin: 0 0 0 10px;
  overflow: hidden;
}
.mini-card-title {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.mini-card-summary {
  overflow: hidden;
  color: var(--inconspicuous-color);
}

/* ---- 記事ページ（Posts / Works）---- */

.article {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}
.article-main {
  width: 100%;
  max-width: 700px;
  padding: 10px;
  box-sizing: border-box;
}
.article-main img {
  max-width: 100%;
}
.article-image {
  width: 100%;
}
.article-icon {
  width: 50px;
  height: 50px;
}
.article-aside {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media screen and (min-width: 1000px) {
  .article {
    flex-direction: row;
  }
  .article-aside {
    max-width: 400px;
  }
}

/* ---- 固定ページ ---- */

.static-page {
  width: 100%;
  max-width: 700px;
  padding: 10px;
  box-sizing: border-box;
}
.static-page img {
  max-width: 100%;
}

/* ---- 目次 ---- */

.toc {
  margin: 20px 0;
  padding: 10px 16px;
  border: 1px solid var(--inconspicuous-color);
  border-radius: 8px;
  font-size: small;
}
.toc-header {
  font-weight: bold;
}
.toc ul {
  margin: 8px 0 0;
  padding-left: 0;
  list-style-type: none;
}
.toc li {
  margin: 2px 0;
}

/* ---- お問い合わせフォーム ---- */

.inquiry-form {
  width: 100%;
  max-width: 700px;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.inquiry-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inquiry-form label {
  font-weight: bold;
  font-size: small;
}
.inquiry-form input,
.inquiry-form textarea {
  width: 100%;
  padding: 8px 10px;
  box-sizing: border-box;
  border: 1px solid var(--inconspicuous-color);
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font: inherit;
}
.inquiry-form textarea {
  resize: vertical;
}
.inquiry-form .form-required {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e05252;
  color: #fff;
  font-size: x-small;
}
.inquiry-form .form-hint,
.inquiry-form .form-note {
  margin: 0;
  color: var(--inconspicuous-color);
  font-size: x-small;
}
.inquiry-form .form-turnstile {
  min-height: 65px;
}
.inquiry-form button {
  align-self: flex-start;
  padding: 8px 20px;
  border: 1px solid var(--inconspicuous-color);
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.inquiry-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.inquiry-form .form-message {
  margin: 0;
  font-size: small;
}
.inquiry-form .form-message:empty {
  display: none;
}

.home-hero h1,
.home-hero h3,
.home-hero p,
.home-sections h2,
.home-sections h3,
.home-sections p {
  margin: 0;
}

/* ---- hero ---- */

.home-hero {
  padding: 100px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: radial-gradient(ellipse at 50% 0%, hsla(var(--theme-hsl-value), 0.35), transparent 70%);
}
.name-plate {
  align-self: center;
  display: flex;
  flex-direction: column;
}
.name-plate h1 {
  font-size: clamp(44px, 12vw, 104px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.name-plate span:last-child {
  text-align: right;
}
/*
 * 展示カード。マウスの方へ傾き、指した所に光が当たり、入った瞬間にキラッと光る。
 * 動きは src/client/home.js が CSS 変数で渡す:
 *   --px --py  指している位置（カード内の %）
 *   --rx --ry  傾き（deg）
 *   --sx --sy  影のずれ（px）
 * タッチ端末と「視差効果を減らす」設定では傾けない（JS が何もしない）。
 */
.exhibits {
  margin: 0;
  padding: 28px 20px 24px;
  list-style: none;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 20px;
  scrollbar-width: none;
  /* 端を溶かす */
  mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 20px), transparent);
}
.exhibits li {
  flex: 0 0 196px;
  scroll-snap-align: start;
}
/* 最初に開いたページだけ（motion.css と同じ条件）*/
html.motion .exhibits li {
  /* backwards: 終わったあとは li の opacity（スマホの両隣を薄くする）に任せる */
  animation: exhibit-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: calc(var(--i) * 70ms);
}
@keyframes exhibit-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
}

.exhibit {
  --px: 50%;
  --py: 50%;
  --rx: 0deg;
  --ry: 0deg;
  --sx: 0px;
  --sy: 0px;
  --surface: rgba(var(--theme-mode-base-rgb-value), 0.55);
  --edge: rgba(var(--theme-mode-accent-rgb-value), 0.1);
  position: relative;
  height: 268px;
  padding: 26px 18px 20px;
  box-sizing: border-box;
  border-radius: 10px;
  color: var(--theme-mode-accent-rgb-color);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  outline: none;
}
.exhibit.is-active {
  transition-duration: 0.3s;
}

/* 背景。ロゴをぼかして敷き、ガラス越しに見せる。はみ出しを切るのはこの層だけ（preserve-3d を壊さないため） */
.exhibit-surface {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--edge);
  box-shadow:
    calc(var(--sx) * -1) calc(12px + var(--sy) * -1) 32px -12px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.4s;
}
.exhibit-surface::before {
  content: '';
  position: absolute;
  inset: -30%;
  background: var(--exhibit-image) center / cover;
  filter: blur(36px) saturate(1.8);
  opacity: 0.55;
  z-index: -1;
  transition: opacity 0.4s;
}
.exhibit.is-active .exhibit-surface::before,
.exhibit:focus-visible .exhibit-surface::before {
  opacity: 0.8;
}

/* 指した所に当たる光 */
.exhibit-glare {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--px) var(--py), rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.05) 35%, transparent 65%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.3s;
}
/* 角度で色の変わる箔 */
.exhibit-foil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    125deg,
    transparent 20%,
    hsla(0, 100%, 70%, 0.5) 30%,
    hsla(60, 100%, 70%, 0.5) 38%,
    hsla(150, 100%, 70%, 0.5) 46%,
    hsla(220, 100%, 70%, 0.5) 54%,
    hsla(290, 100%, 70%, 0.5) 62%,
    transparent 72%
  );
  background-size: 300% 300%;
  /*
   * --foil-shift はスマホで画面の上で回したときだけ入る。
   * **0〜100% に収める。** 越えると模様（幅 300%）の繰り返しの継ぎ目がカードに入り、縦の境目が見える
   */
  background-position: clamp(0%, calc(var(--px) + var(--foil-shift, 0%)), 100%) var(--py);
  mix-blend-mode: color-dodge;
  opacity: 0;
  transition: opacity 0.3s;
}
.exhibit.is-active .exhibit-glare {
  opacity: 1;
}
.exhibit.is-active .exhibit-foil {
  opacity: 0.4;
}

/* 入った瞬間に横切る光 */
.exhibit-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.25) 46%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0.25) 54%, transparent 62%);
  mix-blend-mode: screen;
  transform: translateX(-120%);
}
.exhibit.is-shining .exhibit-shine {
  animation: exhibit-shine 0.9s cubic-bezier(0.3, 0.6, 0.2, 1);
}
@keyframes exhibit-shine {
  to {
    transform: translateX(120%);
  }
}

/* 縁の光。指した所だけテーマ色で光る */
.exhibit-edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: radial-gradient(circle at var(--px) var(--py), hsl(var(--theme-hsl-value)), transparent 45%);
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.exhibit.is-active .exhibit-edge,
.exhibit:focus-visible .exhibit-edge {
  opacity: 1;
}

/* キラッ（四芒星）*/
.exhibit-sparkle {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 22px;
  height: 22px;
  background: #fff;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 10px hsl(var(--theme-hsl-value)));
  transform: translateZ(24px) scale(0);
  pointer-events: none;
}
.exhibit.is-shining .exhibit-sparkle {
  animation: exhibit-sparkle 0.9s ease-out;
}
@keyframes exhibit-sparkle {
  40% {
    transform: translateZ(24px) scale(1) rotate(45deg);
  }
  to {
    transform: translateZ(24px) scale(0) rotate(90deg);
  }
}

/* 手前に浮かぶもの */
.exhibit-icon {
  width: 104px;
  height: 104px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.5);
  transform: translateZ(20px);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.exhibit.is-active .exhibit-icon {
  transform: translateZ(26px);
}
.exhibit-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateZ(12px);
}
.exhibit-title {
  font-weight: bold;
  letter-spacing: 0.02em;
}
.exhibit-description {
  font-size: 0.78em;
  color: var(--inconspicuous-color);
}
.exhibit-arrow {
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-size: 0.85em;
  color: var(--inconspicuous-color);
  transform: translateZ(12px);
  transition: transform 0.3s, color 0.3s;
}
.exhibit.is-active .exhibit-arrow,
.exhibit:focus-visible .exhibit-arrow {
  color: hsl(var(--theme-hsl-value));
  transform: translateZ(12px) translate(2px, -2px);
}

.exhibit:active {
  scale: 0.98;
}

@media (prefers-reduced-motion: reduce) {
  .exhibit,
  .exhibit-icon {
    transition: none;
  }
}

/* 横スクロールバーは端の余白を揃える */
.home-hero > .hscrollbar {
  margin: -12px 20px 0;
}
@media screen and (min-width: 800px) {
  .exhibits {
    padding-inline: 5%;
    scroll-padding-inline: 5%;
  }
  .home-hero > .hscrollbar {
    margin-inline: 5%;
  }
}

/*
 * スマホ（hover できない端末）。カードを1枚ずつ真ん中に吸着させ、真ん中の1枚にフォーカスを当てる。
 * 左右に「半分 − カード半分」の余白を足すので、最初と最後のカードも真ん中に来る。
 * どれがフォーカスかは src/client/home.js が `is-focused` で渡す。
 */
@media (hover: none) {
  .exhibits {
    --exhibit-width: 196px;
    padding-inline: calc(50% - var(--exhibit-width) / 2);
    scroll-padding-inline: 0;
    gap: 12px;
  }
  /*
   * 両隣を薄くするのは li でやる。**カード（.exhibit）に opacity を付けない。**
   * opacity が 1 未満だと、ブラウザが中の立体（アイコンと文字の translateZ）を平面につぶすので、
   * フォーカスが移って 1 に戻り切った瞬間に、アイコンと文字がガクッと手前（大きく）に出てしまう
   */
  .exhibits li {
    flex-basis: var(--exhibit-width);
    scroll-snap-align: center;
    scroll-snap-stop: always;
    opacity: 0.55;
    transition: opacity 0.35s ease;
  }
  .exhibits li:has(.exhibit.is-focused) {
    opacity: 1;
  }
  .exhibit {
    scale: 0.9;
    transition:
      transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
      scale 0.35s ease;
  }
  .exhibit.is-focused {
    scale: 1;
  }
  /* センサーの値と指の位置に毎フレーム追従するので、傾きは遅らせない */
  .exhibit.is-focused.is-active,
  .exhibit.is-touched {
    transition: scale 0.35s ease;
  }
}

/* iPhone でセンサーの許可を取るボタン（src/client/home.js が必要なときだけ出す）*/
.exhibits-motion {
  align-self: center;
  padding: 6px 14px;
  border: 1px solid rgba(var(--theme-mode-accent-rgb-value), 0.15);
  border-radius: 999px;
  background: rgba(var(--theme-mode-base-rgb-value), 0.5);
  color: var(--inconspicuous-color);
  font: inherit;
  font-size: 0.75em;
  cursor: pointer;
}
.exhibits-motion[hidden] {
  display: none;
}
.exhibits-motion:disabled {
  cursor: default;
  opacity: 0.7;
}
/* センサーが使えているとき。押すものではなく状態の表示 */
.exhibits-motion.is-on {
  opacity: 1;
  color: hsl(var(--hue), 75%, var(--link-lightness));
  border-color: hsla(var(--theme-hsl-value), 0.4);
}

/* ---- sections ---- */

.home-sections {
  width: 100%;
  max-width: 1500px;
  padding: 0 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
@media screen and (min-width: 800px) {
  .home-sections {
    width: 90%;
    padding: 0;
    margin: 0 auto;
  }
}

/* ---- profile ---- */

.profile-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  gap: 10px;
}
.profile-content p {
  color: var(--inconspicuous-color);
  font-size: 0.8em;
}
.profile-1 {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.profile-1 h3 {
  margin-bottom: 6px;
  font-weight: normal;
}
.profile-1 dl {
  margin: 8px 0 0 0;
  color: var(--inconspicuous-color);
  font-size: 0.8em;
}
.profile-1 dd {
  margin-left: 20px;
}
.profile-2 {
  width: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.profile-2 ul {
  padding: 0;
  margin: 14px 0;
  list-style: none;
  text-align: center;
}
.profile-2 a {
  color: var(--inconspicuous-color);
  font-size: 0.8em;
}
.profile-icon {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0px 0px var(--profile-glow) hsla(var(--theme-hsl-value), 50%);
}
@media screen and (min-width: 600px) {
  .profile-content {
    flex-direction: row;
  }
  .profile-1,
  .profile-2 {
    width: auto;
  }
}

/* ---- projects ---- */

.projects-category h3 {
  margin-top: 10px;
  font-weight: normal;
}
.projects-category p {
  color: var(--inconspicuous-color);
  font-size: 0.8em;
}
.projects-cards {
  margin: 10px 0;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.projects-card {
  flex: 0 0 200px;
  border-radius: 8px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
.projects-card-image {
  aspect-ratio: 16 / 9;
  background: #888888;
  overflow: hidden;
}
.projects-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.projects-card:hover .projects-card-image img {
  transform: scale(1.1);
}
.projects-card-info {
  width: 100%;
  background: linear-gradient(135deg, #22d3ee45, #8b5cf694);
  padding: 4px;
  box-sizing: border-box;
}
.projects-card-title {
  font-size: 0.9em;
}
.projects-card-summary {
  font-size: 0.8em;
  color: var(--inconspicuous-color);
}
.projects-card:hover .projects-card-title,
.projects-card:hover .projects-card-summary {
  text-decoration: underline;
}
.projects-card-title,
.projects-card-summary {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/*
 * 初めて画面に入ったときに、ふわっと出す。
 * `html.motion` は <head> のインラインスクリプトが付ける。**そのタブで最初に開いたページだけ**で、
 * 「視差効果を減らす」設定なら付かない。
 * `is-shown` は src/client/site.js が付ける。対象を変えるときは site.js の REVEAL も揃える。
 */
html.motion :is(main > *, .home-sections > *, .projects-category, .card-list-item, .article-aside > *, .site-footer) {
  transition:
    opacity 0.9s ease,
    transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
html.motion :is(main > *, .home-sections > *, .projects-category, .card-list-item, .article-aside > *, .site-footer):not(.is-shown) {
  opacity: 0;
  transform: translateY(18px);
}

html.motion .site-header {
  animation: header-in 0.8s ease both;
}
@keyframes header-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/*
 * サイト内のページ移動。ページ全体を短くクロスフェードし、ヘッダーは別に扱って動かさない
 * （両ページで同じなので、止まって見える）。対応していないブラウザでは普通に切り替わる
 */
@view-transition {
  navigation: auto;
}
.site-header {
  view-transition-name: site-header;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.18s;
}
::view-transition-group(site-header),
::view-transition-new(site-header) {
  animation: none;
}
::view-transition-old(site-header) {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}
