/* 作品の絵が主役。UI は静かに、角の大きなカードで包む */
:root {
  --bg: #F4F3EF;
  --panel: #FFFFFF;
  --text: #141317;
  --sub: #67646E;   /* --chip の上でも 4.5:1 を保つ */
  --chip: #E9E7E1;
  --accent: #3A2BFF;
  --shadow: 0 1px 2px rgba(20, 19, 23, .04), 0 8px 24px rgba(20, 19, 23, .06);
  --shadow-hover: 0 2px 4px rgba(20, 19, 23, .06), 0 18px 40px rgba(20, 19, 23, .12);
  --radius: 24px;
  --gutter: clamp(16px, 4vw, 40px);
  --display: "Fraunces", "Hiragino Mincho ProN", serif;   /* 見出しとカードの題 */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0F12;
    --panel: #1A1A1F;
    --text: #F2F1EE;
    --sub: #8F8C97;
    --chip: #2A2A31;   /* フッターの区切り線にも使うので、背景から少し浮かせる */
    --accent: #A9A2FF;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .06);
    --shadow-hover: 0 0 0 1px rgba(255, 255, 255, .14), 0 18px 40px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", "IBM Plex Sans JP", "Hiragino Sans", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site-header,
main,
.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
}

.logo {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.01em;
}
/* ハイフンがマイナスに見えないよう、短い線を自前で引く */
.logo-dash {
  display: inline-block;
  width: .3em;
  height: .12em;
  margin: 0 .08em;
  border-radius: 1px;
  vertical-align: .3em;
  background: var(--accent);
}

/* ユニットの名乗り。ボタンに見えないよう地は敷かず、文字だけにする */
.badge {
  color: var(--sub);
  font-size: 13px;
  font-weight: 500;
}
.badge-x { color: var(--accent); }

.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(28px, 4vw, 44px); }

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: -.025em;
}

/* 作品：PC では2列、狭い幅では縦積み（実験が増えたら3つ目以降は次の行へ） */
.works {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 2vw, 24px);
}
@media (min-width: 760px) {
  .works { grid-template-columns: repeat(2, 1fr); }
}

.work {
  position: relative;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s;
}
/* 持ち上げはマウスのときだけ（タッチで残らないように）。キーボードで選んだときも同じに動かす */
@media (hover: hover) {
  .work:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
  }
}
.work:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* リンクは見出しの文字だが、透明な層をカード全体に広げてどこを押しても飛べるようにする */
.work-card {
  color: inherit;
  text-decoration: none;
}
.work-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: var(--radius);
}
.work-card:focus-visible { outline: none; }
.work-card:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* 絵の比率は 4:3 にそろえる（画像が読めなくても形が崩れないように） */
.work-visual {
  aspect-ratio: 4 / 3;
  border-radius: calc(var(--radius) - 10px);
  background: var(--chip);
  overflow: hidden;
}
.work-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.work-visual img[src$="pixel.webp"] { image-rendering: pixelated; }

/* ジャケットの列：正方形を縦に並べ、1枚 12.5 秒の速さで流れる（--n は列の枚数。covers.js が曲数に合わせて変える）。
   真ん中の列は逆向き、少しずらして始める */
.covers {
  background: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  /* 列の上下の端で絵がぷつりと切れないよう、端だけ薄くする */
  -webkit-mask-image: linear-gradient(transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(transparent, #000 6%, #000 94%, transparent);
}
.col { overflow: hidden; }
.track {
  display: flex;
  flex-direction: column;
  gap: 6px;
  --n: 4;
  animation: scroll-up linear infinite;
  animation-duration: calc(var(--n) * 12.5s);
}
.col.down .track {
  animation-direction: reverse;
  animation-delay: -18s;
}
.dup { display: contents; }
/* 流れ続けるものには止める手段を置く（カードにマウスを乗せるか、選んでいる間は止まる） */
.work:hover .track,
.work:focus-within .track { animation-play-state: paused; }
.covers img {
  aspect-ratio: 1;
  height: auto;
  border-radius: 8px;
}
/* 1周目の枚数と隙間ぶん（全体の半分＋隙間の半分）上げると、2周目の先頭が1周目の先頭の位置に来る */
@keyframes scroll-up {
  to { transform: translateY(calc(-50% - 3px)); }
}

/* 作品をそのまま動かす枠。作品は 16:9 で描かれるので、4:3 のカードを覆うように
   16:9 の枠をカードと同じ高さで置き、左右を少し切り落とす。
   拡大して描かせて縮めると canvas が大きくなりすぎ、長く動かすと Chrome が背景の絵を捨てるので等倍で描かせる */
.live { position: relative; }
.live iframe {
  position: absolute;
  top: 0;
  left: -16.667%;
  width: 133.333%;
  height: 100%;
  border: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}
/* 入れ替えのとき、上にある今の作品を消して下の次の作品を見せる（live.js） */
.live iframe.is-leaving { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .track { animation: none; }
  .live iframe { display: none; }
  .work, .work:hover, .work:focus-within { transition: none; transform: none; }
}

/* カードの下：実験の番号・題・ひとこと、その下に「いまの作品」とドメインを1行で */
.work-body { padding: 18px 14px 12px; }
.work-no {
  display: block;
  margin-bottom: 6px;
  color: var(--sub);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.work-body h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.2;
  letter-spacing: -.02em;
}
/* ひとことは和文なので、明朝に落ちる --display ではなくゴシックで組む */
.work-lead {
  margin: 6px 0 0;
  font-family: "IBM Plex Sans JP", sans-serif;
  font-weight: 500;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.6;
}
/* 2行になるときは読点の後で折る（「AI と／いっしょに」のように途中で折らない）。1つが幅に収まらないときだけ中で折れる */
.work-lead span { display: inline-block; }
.work-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 14px;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.4;
}
/* 最新曲・いま流れている作品（covers.js / live.js が書き換える）。長い曲名は1行で切る */
.work-now {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity .4s;
}
.work-now.is-changing { opacity: 0; }
.work-domain { flex: none; margin-left: auto; }
.work-domain::after {
  content: "↗";
  display: inline-block;
  margin-left: .3em;
  transition: transform .2s, color .2s;
}
.work:hover .work-domain,
.work:focus-within .work-domain { color: var(--text); }
.work:hover .work-domain::after,
.work:focus-within .work-domain::after {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* カードの下に置く短い名乗り。1行目を一番大きく、カードの「番号・題・ひとこと」と同じ組み方にそろえる */
.about {
  max-width: 36em;
  margin-top: clamp(56px, 8vw, 96px);
  word-break: auto-phrase;   /* 「ユニッ／トです」のように単語の途中で折り返さず、文節で折る */
}
.about-no {
  margin: 0 0 10px;
  color: var(--sub);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.about-q {
  margin: 0;
  font-family: "IBM Plex Sans JP", sans-serif;
  font-weight: 500;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.5;
  letter-spacing: .01em;
}
.about-text {
  margin: 12px 0 0;
  color: var(--sub);
  font-family: "IBM Plex Sans JP", sans-serif;
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.9;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(56px, 7vw, 88px);
  padding-top: 20px;
  padding-bottom: 32px;
  /* 区切り線は本文の幅に合わせる（border だと左右の余白まで伸びるので、余白の内側に1本描く） */
  background: linear-gradient(var(--chip), var(--chip)) var(--gutter) 0 / calc(100% - 2 * var(--gutter)) 1px no-repeat;
  color: var(--sub);
  font-size: 13px;
}
.site-footer small { font-size: inherit; }

@media (max-width: 480px) {
  .work { padding: 8px; }
  .works { gap: 14px; }
}
