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;
}
a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-color: currentColor;
}
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 {
  margin: 0;
}
.heading p {
  margin: 0;
  color: var(--inconspicuous-color);
}
.heading2 {
  margin-bottom: 10px;
  border-bottom: 1px solid;
  padding-bottom: 10px;
  border-image-source: var(--gradient);
  border-image-slice: 1;
}
.heading2 h2 {
  margin: 0;
}
.heading2 p {
  margin: 0;
  color: var(--inconspicuous-color);
}
.heading3 {
  margin: 10px 0;
}
.heading3 h3 {
  margin: 0;
  font-weight: normal;
}
.heading3 p {
  margin: 0;
  color: var(--inconspicuous-color);
  font-size: 0.8em;
}

:root {
  --hue: 120;
  color-scheme: light dark;
}
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}
:root {
  --inconspicuous-color: light-dark(hsl(0, 0%, 30%), hsl(0, 0%, 70%));
  --page-background: light-dark(#fff, #000);
  --page-color: light-dark(#000, #fff);
  --border-color: light-dark(#d9d9d9, #262626);
  --attention-color: light-dark(hsl(0, 75%, 50%), hsl(0, 75%, 65%));
  --theme-mode-base-rgb-color: light-dark(#fff, #000);
  --theme-mode-accent-rgb-color: light-dark(#000, #fff);
  --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: light-dark(
    hsl(var(--hue), 75%, 88%),
    hsl(var(--hue), 75%, 16%)
  );
  --theme-background-2-hsl-color: light-dark(
    hsl(var(--hue), 75%, 94%),
    hsl(var(--hue), 75%, 10%)
  );
  --theme-background-3-hsl-color: light-dark(
    hsl(var(--hue), 75%, 96%),
    hsl(var(--hue), 75%, 8%)
  );
  --link-color: light-dark(
    hsl(var(--hue), 75%, 45%),
    hsl(var(--hue), 75%, 70%)
  );
  --gradient: linear-gradient(
    to right,
    light-dark(hsl(0, 75%, 60%), hsl(0, 75%, 70%)),
    light-dark(hsl(60, 75%, 60%), hsl(60, 75%, 70%)),
    light-dark(hsl(120, 75%, 60%), hsl(120, 75%, 70%)),
    light-dark(hsl(180, 75%, 60%), hsl(180, 75%, 70%)),
    light-dark(hsl(240, 75%, 60%), hsl(240, 75%, 70%)),
    light-dark(hsl(300, 75%, 60%), hsl(300, 75%, 70%)),
    light-dark(hsl(360, 75%, 60%), hsl(360, 75%, 70%))
  );
}
html {
  background-color: var(--page-background);
  color: var(--page-color);
}
a {
  color: var(--link-color);
}

/* ---- 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 ---- */

html {
  scroll-padding-top: 54px;
}

.site-header {
  width: 100%;
  height: 44px;
  padding: 3px;
  top: 0;
  position: fixed;
  box-sizing: border-box;
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: space-between;
  z-index: 100;
  transition: backdrop-filter 0.4s ease;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    0deg,
    color-mix(in srgb, var(--theme-mode-base-rgb-color) 30%, transparent) 0%,
    color-mix(in srgb, var(--theme-mode-base-rgb-color) 50%, transparent) 40%,
    color-mix(in srgb, var(--theme-mode-base-rgb-color) 80%, transparent) 100%
  );
  transition: opacity 0.4s ease;
}
.site-header.is-top {
  backdrop-filter: blur(0);
}
.site-header.is-top::before {
  opacity: 0;
}
.site-header-logo,
.site-header-link,
.menu-link {
  padding: 10px;
  color: var(--theme-mode-accent-rgb-color);
  text-decoration: none;
}
.site-header-logo,
.site-header-link {
  display: flex;
  align-items: center;
  padding: 0 10px;
}
.site-header nav {
  display: flex;
  margin-right: 20px;
}
.site-header-links {
  display: none;
  padding: 0;
  justify-content: space-around;
}
.site-header-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  padding: 0;
  border: none;
  background: none;
  color: var(--theme-mode-accent-rgb-color);
  cursor: pointer;
}
.site-header-menu svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.site-header-menu[aria-expanded="true"] .site-header-menu-open,
.site-header-menu:not([aria-expanded="true"]) .site-header-menu-close {
  display: none;
}
.site-header.is-menu-open {
  backdrop-filter: none;
}
.site-header.is-menu-open::before {
  opacity: 0;
}
@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: color-mix(
    in srgb,
    var(--theme-mode-base-rgb-color) 90%,
    transparent
  );
  text-align: center;
  padding: 80px 0;
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 99;
}
.menu[hidden] {
  display: none;
}
.menu-links {
  margin: 2em 0;
}
.menu-group {
  margin: 2em 0;
}
.menu-themes {
  display: flex;
  justify-content: center;
  gap: 0.3em;
  margin-top: 0.3em;
}
.menu-theme {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.8em;
  height: 1.8em;
  padding: 0;
  font-size: 1.1em;
  line-height: 1;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  opacity: 0.45;
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease;
}
.menu-theme:hover {
  opacity: 0.8;
}
.menu-theme[aria-pressed="true"] {
  opacity: 1;
  border-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(--border-color);
  border-radius: 20px 20px 0 0;
  font-size: small;
}
.site-footer-logo {
  align-self: flex-start;
  margin: 0 20px;
  padding: 10px 0;
  font-size: medium;
  color: var(--theme-mode-accent-rgb-color);
  text-decoration: none;
}
.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;
  color: var(--inconspicuous-color);
}
.site-footer ul {
  margin: 0;
  padding-left: 0;
  list-style-type: none;
}
.site-footer-link {
  display: inline;
  color: var(--inconspicuous-color);
}
.site-footer-link[target="_blank"]::after {
  content: "\00a0↗";
}
.site-footer-bottom {
  padding: 10px;
  border-top: 1px solid var(--border-color);
  color: var(--inconspicuous-color);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
@media (min-width: 700px) {
  .site-footer-top {
    display: grid;
    grid-template-columns: repeat(var(--groups), auto);
    justify-content: space-evenly;
  }
  .site-footer-logo {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* ---- スクロールバー ---- */

.global-scrollbar {
  position: fixed;
  top: 0;
  right: 4px;
  width: 4px;
  border-radius: 2px;
  background-color: color-mix(
    in srgb,
    var(--theme-mode-accent-rgb-color) 20%,
    transparent
  );
  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: color-mix(
    in srgb,
    var(--theme-mode-accent-rgb-color) 30%,
    transparent
  );
}
@media (pointer: coarse) {
  html {
    scrollbar-width: thin;
  }
  .global-scrollbar {
    display: none;
  }
}
@media (pointer: fine) {
  html {
    scrollbar-width: none;
  }
}

/* ---- 横スクロールバー ---- */

.hscrollbar {
  height: 12px;
  display: none;
  align-items: center;
  cursor: pointer;
}
.hscrollbar-thumb {
  height: 4px;
  border-radius: 2px;
  background-color: color-mix(
    in srgb,
    var(--theme-mode-accent-rgb-color) 20%,
    transparent
  );
  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: color-mix(
    in srgb,
    var(--theme-mode-accent-rgb-color) 30%,
    transparent
  );
}
@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(--border-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: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 10px;
}
.card-list-item {
  min-width: 0;
}

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

.card {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: hsla(var(--theme-hsl-value), 0.14);
  box-sizing: border-box;
  display: inline-block;
  color: var(--theme-mode-accent-rgb-color);
  text-decoration: none;
  transition: background-color 0.2s;
}
.card:hover,
.card:focus-visible {
  background: hsla(var(--theme-hsl-value), 0.22);
}
.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(--border-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(--border-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-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.inquiry-form .form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: bold;
}
.inquiry-form .form-badge-required,
.inquiry-form .form-badge-optional {
  font-size: 0.75rem;
}
.inquiry-form .form-badge-required {
  color: var(--attention-color);
}
.inquiry-form .form-badge-optional {
  color: var(--inconspicuous-color);
}
.inquiry-form .form-input {
  width: 100%;
  padding: 0.2rem 0.4rem;
  box-sizing: border-box;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
}
.inquiry-form .form-input:focus {
  border-color: var(--link-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--link-color) 10%, transparent);
}
.inquiry-form .form-input::placeholder {
  color: var(--inconspicuous-color);
}
.inquiry-form .form-textarea {
  min-height: 100px;
  line-height: 1.6;
  resize: vertical;
}
.inquiry-form .form-meta {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.inquiry-form .form-hint {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--inconspicuous-color);
}
.inquiry-form .form-counter {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--inconspicuous-color);
}
.inquiry-form .form-counter.is-full {
  color: var(--attention-color);
}
.inquiry-form .form-note {
  margin: 0;
  text-align: center;
  color: var(--inconspicuous-color);
  font-size: 0.8rem;
}
.inquiry-form .form-turnstile {
  min-height: 65px;
  display: flex;
  justify-content: center;
}
.inquiry-form button {
  width: 100%;
  padding: 0.4rem;
  box-sizing: border-box;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}
.inquiry-form button:hover:not(:disabled),
.inquiry-form button:focus-visible {
  border-color: var(--link-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--link-color) 10%, transparent);
}
.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: color-mix(
    in srgb,
    var(--theme-mode-base-rgb-color) 55%,
    transparent
  );
  --edge: color-mix(
    in srgb,
    var(--theme-mode-accent-rgb-color) 10%,
    transparent
  );
  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 var(--border-color);
  border-radius: 999px;
  background: color-mix(
    in srgb,
    var(--theme-mode-base-rgb-color) 50%,
    transparent
  );
  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: var(--link-color);
  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;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, currentColor 35%, transparent);
}
.profile-2 a:hover {
  border-bottom-color: currentColor;
}
.profile-2 a img {
  width: 1.2em;
  height: 1.2em;
  margin-right: 0.3em;
  vertical-align: -0.25em;
  border-radius: 3px;
}
.profile-icon {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow:
    0 0 7px 3px light-dark(hsla(var(--theme-hsl-value), 50%), transparent),
    0 0 14px 7px light-dark(transparent, 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-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;
}

/* ---- activities / links ---- */

.activities > p,
.links > p {
  color: var(--inconspicuous-color);
  font-size: 0.8em;
}

/* ---- accounts ---- */

.account-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.account {
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: color-mix(
    in srgb,
    var(--theme-mode-base-rgb-color) 50%,
    transparent
  );
  color: var(--theme-mode-accent-rgb-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  transition:
    border-color 0.3s,
    background-color 0.3s;
}
.account:hover,
.account:focus-visible {
  border-color: hsla(var(--theme-hsl-value), 0.6);
  background: var(--theme-background-3-hsl-color);
}
.account-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
}
.account-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.account-name,
.account-handle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-name {
  font-weight: bold;
}
.account-handle {
  font-size: 0.8em;
  color: var(--inconspicuous-color);
}
.account-arrow {
  font-size: 0.85em;
  color: var(--inconspicuous-color);
  transition:
    transform 0.3s,
    color 0.3s;
}
.account:hover .account-arrow,
.account:focus-visible .account-arrow {
  color: hsl(var(--theme-hsl-value));
  transform: translate(2px, -2px);
}

/*
 * 初めて画面に入ったときに、ふわっと出す。
 * `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;
  }
}
