/* ==========================================================================
   Portfolio — style.css
   水色系のパステル × 大きめの角丸 × ぷにっと弾む動き
   ========================================================================== */

/* ---------- Fonts（指定クラス） ---------- */
.bebas-neue-regular {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.kosugi-regular {
  font-family: "Kosugi", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.walter-turncoat-regular {
  font-family: "Walter Turncoat", cursive;
  font-weight: 400;
  font-style: normal;
}

/* ---------- Tokens ---------- */
:root {
  /* やわらかい色：水色系のパステル。文字は真っ黒ではなく、紺がかった墨色 */
  --bg: #f6fbff;
  --surface: #ffffff;
  --fg: #33415c;
  --fg-muted: #66738c;
  --line: rgba(51, 65, 92, 0.12);
  --line-dot: rgba(51, 65, 92, 0.24);

  /* パステル（水色系） */
  --sky: #d6ecff;
  --sky-deep: #7cbcf0;
  --aqua: #d3f2f6;
  --ice: #eaf5ff;
  --periwinkle: #dfe5ff;
  --periwinkle-deep: #8d9ff0;
  --mint: #d3f3ec;
  --cloud: #e7eff7;

  --glass: rgba(255, 255, 255, 0.86);
  --on-glass: var(--fg);
  --tile-bg: #e9f1f8;
  --ring: #4a90d9;

  /* 影は黒ではなく、水色を薄く広く */
  --shadow-sm: 0 2px 10px rgba(50, 110, 180, 0.08);
  --shadow: 0 10px 30px rgba(50, 110, 180, 0.12);
  --shadow-lift: 0 18px 40px rgba(50, 110, 180, 0.2);

  --font-hand: "Walter Turncoat", "Kosugi", cursive;
  --font-display: "Bebas Neue", "Kosugi", sans-serif;
  --font-body: "Kosugi", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;

  /* 文字サイズ（本文は小さめ・字間広め） */
  --fs-body: 14px;
  --fs-small: 12px;
  --tracking: 0.1em;

  /* 動き：サクサク動いて、最後はぷにっと弾む */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-reveal: 0.8s; /* 文節フェードの長さ */
  --stagger: 40ms; /* 文節ごとの時間差 */
  --dur-hover: 0.45s;
  --dur-fast: 0.2s;
  --dur-exit: 0.25s;

  /* 角丸 */
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --gutter: clamp(16px, 2.2vw, 32px);
  --header-h: 44px;
  --grid-gap: 8px; /* 作品サムネイル同士のすき間 */
  --tile-radius: 16px; /* 作品サムネイルの角丸 */

  --z-tile-focus: 2;
  --z-header: 50;
  --z-modal: 100;
}

/* ---------- Lenis ---------- */
html.lenis,
html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  scrollbar-color: #c3dcf2 transparent;
}

body {
  margin: 0;
  /* ノートのような、ごく薄いドット地 */
  background-color: var(--bg);
  background-image: radial-gradient(rgba(110, 170, 230, 0.2) 1px, transparent 1.5px);
  background-size: 22px 22px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 2;
  letter-spacing: var(--tracking);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img,
video,
svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

ul { list-style: none; margin: 0; padding: 0; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

p,
h1,
h2,
h3,
dl,
dd { margin: 0; }

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

::selection { background: var(--sky); color: var(--fg); }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: calc(var(--z-modal) + 1);
  padding: 12px 20px;
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius-pill);
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

.noscript { padding: 120px var(--gutter); }

/* ---------- 文節リビール（不透明度 0 → 100 ＋ ふんわりピントが合う） ---------- */
.phrase {
  display: inline-block;
}

.js [data-reveal] .phrase {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(0.3em);
  transition-property: opacity, filter, transform;
  transition-duration: var(--dur-reveal);
  transition-timing-function: var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger) + var(--reveal-delay, 0s));
}

.js [data-reveal].is-revealed .phrase {
  opacity: 1;
  filter: none;
  transform: none;
}

/* ---------- Header ---------- */
.logo {
  position: fixed;
  top: var(--gutter);
  left: var(--gutter);
  z-index: var(--z-header);
  display: block;
  max-width: calc(100vw - var(--gutter) * 2 - 200px);
  height: var(--header-h);
  padding: 0 22px 0 8px;
  overflow: hidden;
  font-family: var(--font-hand);
  font-size: clamp(16px, 1.3vw, 20px);
  line-height: calc(var(--header-h) + 2px);
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--fg);
  background: var(--glass);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  transition: transform var(--dur-hover) var(--ease-spring);
}

.logo::before {
  content: "";
  display: inline-block;
  width: calc(var(--header-h) - 12px);
  height: calc(var(--header-h) - 12px);
  margin-right: 10px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  border-radius: 50%;
  background: url("../images/icon-96.png") center / cover;
}

.about__icon {
  display: block;
  width: 96px;
  height: 96px;
  margin-bottom: 20px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}

.logo:hover { transform: rotate(-2deg) scale(1.03); }

.header-actions {
  position: fixed;
  top: var(--gutter);
  right: var(--gutter);
  z-index: var(--z-header);
  display: flex;
  gap: 6px;
}

.hbtn {
  display: inline-grid;
  place-items: center;
  min-width: var(--header-h);
  height: var(--header-h);
  background: var(--glass);
  color: var(--on-glass);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform var(--dur-hover) var(--ease-spring),
    background-color var(--dur-fast) var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.hbtn:hover {
  background: var(--sky);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.hbtn:active { transform: scale(0.92); }
.hbtn:focus-visible { outline-offset: 2px; }

.hbtn svg { width: 17px; height: 17px; }

.hbtn--text {
  padding: 3px 20px 0;
  font-family: var(--font-hand);
  font-size: 16px;
  letter-spacing: 0.06em;
}

/* アイコンボタンの文字（PCでは読み上げ用にだけ使い、スマホのメニューで表示） */
.hbtn__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  font-family: var(--font-hand);
}

.hbtn--outline {
  background: var(--surface);
  color: var(--fg);
}
.hbtn--outline:hover { background: var(--periwinkle); }
.hbtn--outline:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* ハンバーガーボタン（スマホのみ表示） */
.menu-btn {
  display: none;
  position: fixed;
  top: var(--gutter);
  right: calc(var(--gutter) - 10px);
  z-index: calc(var(--z-header) + 1);
  width: 48px;
  height: var(--header-h);
  place-items: center;
  touch-action: manipulation;
}

.menu-btn__bars,
.menu-btn__bars::before,
.menu-btn__bars::after {
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.4s var(--ease-spring), background-color 0.2s var(--ease-out);
}

.menu-btn__bars { position: relative; }

.menu-btn__bars::before,
.menu-btn__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-btn__bars::before { transform: translateY(-7px); }
.menu-btn__bars::after { width: 16px; transform: translateY(7px); }

.is-menu-open .menu-btn__bars { background: transparent; }
.is-menu-open .menu-btn__bars::before { transform: rotate(45deg); }
.is-menu-open .menu-btn__bars::after { width: 24px; transform: rotate(-45deg); }

/* ---------- Works（16:9 のサムネイル一覧） ---------- */
.works {
  max-width: 1680px;
  margin: 0 auto;
  padding: calc(var(--gutter) + var(--header-h) + 20px) var(--gutter) 0;
  outline: none;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  min-width: 0;
  aspect-ratio: 16 / 9;
  background: var(--tile-bg);
  border-radius: var(--tile-radius);
  text-align: left;
  letter-spacing: normal;
  container-type: size;
  opacity: 0;
  transition:
    opacity var(--dur-exit) var(--ease-out),
    transform 0.5s var(--ease-spring),
    box-shadow 0.4s var(--ease-out);
}

/* ふわっと浮かび上がって、ぷにっと止まる */
.tile.is-in {
  opacity: 1;
  animation: tile-in 0.8s var(--ease-spring) var(--d, 0s) backwards;
}

@keyframes tile-in {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
}

button.tile { cursor: pointer; }

.tile:focus-visible {
  z-index: var(--z-tile-focus);
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

.tile__media,
.tile__art {
  position: absolute;
  inset: 0;
  transition: transform var(--dur-hover) var(--ease-out);
}

.tile__media img,
.tile__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile__media video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}
.tile.is-previewing .tile__media video { opacity: 1; }

/* 自動生成アート（サムネイル未設定時）：パステルのグラデーション */
.tile__art {
  background:
    radial-gradient(120% 90% at var(--x1) var(--y1), var(--c1), transparent 62%),
    radial-gradient(90% 80% at var(--x2) var(--y2), var(--c2), transparent 66%),
    linear-gradient(var(--ang), var(--c3), var(--c4));
}

.tile__art::after,
.modal__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.35;
  pointer-events: none;
}

.tile__art-label {
  position: absolute;
  right: 0.12em;
  bottom: 0.02em;
  font-family: var(--font-hand);
  font-size: 40cqh;
  line-height: 1;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 2px 16px rgba(80, 150, 220, 0.35);
  pointer-events: none;
}

/* タイトルカード：ホバーで白いカードがぷにっと出る */
.tile__info {
  position: absolute;
  left: clamp(8px, 3cqw, 14px);
  bottom: clamp(8px, 3cqw, 14px);
  max-width: calc(100% - clamp(16px, 6cqw, 28px));
  display: grid;
  gap: 1px;
  padding: 7px 14px 8px;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(8px) scale(0.94);
  transform-origin: left bottom;
  transition: opacity 0.25s var(--ease-out), transform var(--dur-hover) var(--ease-spring);
  pointer-events: none;
}

.tile__cat {
  font-family: var(--font-display);
  font-size: clamp(11px, 2.6cqw, 14px);
  line-height: 1.2;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
}

.tile__title {
  font-size: clamp(11px, 2.8cqw, 15px);
  line-height: 1.6;
  letter-spacing: 0.06em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tile__badge {
  position: absolute;
  top: clamp(8px, 3cqw, 12px);
  right: clamp(8px, 3cqw, 12px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 4px;
  font-family: var(--font-hand);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--fg);
  background: var(--sky);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.25s var(--ease-out), transform var(--dur-hover) var(--ease-spring);
  pointer-events: none;
}
.tile__badge svg { width: 9px; height: 9px; margin-top: -1px; }

.tile__info .phrase {
  opacity: 0;
  transition: opacity 0.18s ease;
}

@media (hover: hover) {
  button.tile:hover {
    z-index: var(--z-tile-focus);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lift);
  }
  button.tile:hover .tile__media,
  button.tile:hover .tile__art { transform: scale(1.05); }
}

button.tile:active { transform: scale(0.97); }

button.tile:is(:hover, :focus-visible) .tile__info,
button.tile:is(:hover, :focus-visible) .tile__badge {
  opacity: 1;
  transform: none;
}

button.tile:is(:hover, :focus-visible) .tile__info .phrase {
  opacity: 1;
  transition: opacity 0.4s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 30ms + 60ms);
}

/* タッチ端末：ホバーが無いのでタイトルを常に表示 */
@media (hover: none) {
  .tile__info,
  .tile__info .phrase {
    opacity: 1;
    transform: none;
  }
}

@container (max-width: 240px) {
  .tile__title { -webkit-line-clamp: 1; }
  .tile__info { padding: 5px 10px 6px; }
}

@container (max-height: 110px) {
  .tile__cat { display: none; }
}

/* ---------- Sections ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.eyebrow {
  font-family: var(--font-hand);
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}

/* 見出し：手書き文字＋蛍光ペンのマーカーがスッと引かれる */
.display-xl {
  padding: 0 0.14em;
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 80px);
  line-height: 1.15;
  letter-spacing: 0.02em;
  background: linear-gradient(transparent 58%, var(--marker, var(--sky)) 58%, var(--marker, var(--sky)) 90%, transparent 90%) no-repeat 0 0 / 0% 100%;
  transition: background-size 0.9s var(--ease-out) 0.25s;
}

.display-xl.is-revealed { background-size: 100% 100%; }

#contact-title { --marker: var(--aqua); }

/* ABOUT */
.about {
  padding: clamp(96px, 11vw, 176px) var(--gutter) clamp(80px, 9vw, 144px);
  outline: none;
}

.about__statement {
  max-width: 34em;
  margin-top: clamp(40px, 5vw, 72px);
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 2.2;
  letter-spacing: 0.16em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.about__grid {
  display: grid;
  /* 左：プロフィール／右：Services・Tools。カードは最大 1200px で中央に */
  grid-template-columns: minmax(0, 1fr) minmax(200px, 300px);
  gap: 40px clamp(48px, 6vw, 112px);
  width: min(100%, 1200px);
  margin: clamp(56px, 7vw, 104px) auto 0;
  padding: clamp(28px, 3vw, 44px);
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.about__lists { display: grid; gap: 32px; align-content: start; }

.about__name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
}

.about__name-ja {
  font-size: 17px;
  letter-spacing: 0.18em;
}

.about__name-en {
  font-family: var(--font-hand);
  font-size: 17px;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}

.about__role {
  margin-top: 4px;
  font-family: var(--font-hand);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}

.about__bio {
  display: grid;
  gap: 1.2em;
  max-width: 40em;
  margin-top: 28px;
  font-size: var(--fs-body);
  line-height: 2.2;
  letter-spacing: 0.12em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.about__list dt {
  margin-bottom: 10px;
  padding-bottom: 8px;
  font-family: var(--font-hand);
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  border-bottom: 2px dotted var(--line-dot);
}

.about__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-hand);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.03em;
}

/* パステルの丸いビュレット */
.about__list li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sky-deep);
}
.about__list li:nth-child(3n + 2)::before { background: var(--periwinkle-deep); }
.about__list li:nth-child(3n)::before { background: #6fcfc6; }

/* CONTACT */
.contact {
  padding: clamp(80px, 9vw, 144px) var(--gutter) calc(var(--gutter) + 8px);
  text-align: right;
  --contact-gap: clamp(28px, 3.4vw, 48px);
}

.contact .section-head { justify-content: flex-end; }

.contact__lead {
  max-width: 34em;
  margin: var(--contact-gap) 0 0 auto;
  font-size: var(--fs-body);
  line-height: 2.2;
  letter-spacing: 0.12em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.contact__mail {
  display: inline-block;
  margin-top: var(--contact-gap);
  font-family: var(--font-hand);
  font-size: clamp(22px, 3vw, 44px);
  line-height: 1.3;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

/* ホバーで、水色の波線アンダーライン */
.contact__mail .phrase {
  text-decoration: underline wavy;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.28em;
  transition: text-decoration-color 0.3s var(--ease-out);
}

.contact__mail:hover .phrase { text-decoration-color: var(--sky-deep); }

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  justify-content: flex-end;
  margin-top: var(--contact-gap);
  margin-right: -14px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 3px 14px 0;
  font-family: var(--font-hand);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  border-radius: var(--radius-pill);
  transition:
    color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    transform 0.4s var(--ease-spring);
}

.text-link:hover {
  color: var(--fg);
  background: var(--sky);
  transform: translateY(-2px);
}

.copyright {
  margin-top: var(--contact-gap, 32px);
  text-align: center;
  font-family: var(--font-hand);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
}

.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(246, 251, 255, 0.93);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  opacity: 0;
  transition: opacity var(--dur-exit) var(--ease-out);
}

.modal.is-open .modal__backdrop {
  opacity: 1;
  transition-duration: 0.35s;
}

.modal__dialog {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity var(--dur-exit) var(--ease-out), transform var(--dur-exit) var(--ease-out);
  pointer-events: none;
}

.modal.is-open .modal__dialog {
  opacity: 1;
  transform: none;
  transition: opacity 0.4s var(--ease-out) 0.05s, transform 0.6s var(--ease-spring) 0.05s;
  pointer-events: auto;
}

.modal__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: calc(var(--gutter) + var(--header-h) + 24px) var(--gutter) 120px;
}

.modal__player {
  position: relative;
  width: min(100%, calc((100svh - 300px) * 16 / 9));
  min-width: min(100%, 560px);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: #25324a;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
}

.modal__player iframe,
.modal__player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.modal__art {
  position: absolute;
  inset: 0;
}

.modal__soon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-hand);
  font-size: clamp(24px, 3.4vw, 44px);
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 2px 20px rgba(80, 150, 220, 0.45);
}

.modal__body {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 40px clamp(32px, 5vw, 80px);
  max-width: 1120px;
  margin: clamp(32px, 3.6vw, 52px) auto 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.modal__body.is-swapping { opacity: 0; }

.modal__meta {
  font-size: 15px;
  letter-spacing: 0.18em;
  color: var(--fg-muted);
}

.modal__title {
  margin-top: 6px;
  font-weight: 400;
  font-size: clamp(19px, 1.7vw, 25px);
  line-height: 1.6;
  letter-spacing: 0.1em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.modal__sub {
  margin-top: 4px;
  font-family: var(--font-hand);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}

.modal__sub:empty { display: none; }

.modal__desc {
  margin-top: 24px;
  font-size: var(--fs-body);
  line-height: 2.2;
  letter-spacing: 0.12em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.modal__details-title {
  justify-self: start;
  width: fit-content;
  margin: 0 0 14px;
  padding: 0 0.12em;
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  background: linear-gradient(transparent 60%, var(--periwinkle) 60%, var(--periwinkle) 92%, transparent 92%);
}

.modal__details-title[hidden] { display: none; }

.modal__credits {
  display: grid;
  gap: 0;
  border-top: 2px dotted var(--line-dot);
}

.modal__credits:empty { display: none; }

.modal__credits div {
  display: grid;
  grid-template-columns: minmax(88px, 0.8fr) minmax(0, 1.4fr);
  gap: 16px;
  padding: 10px 0;
  border-bottom: 2px dotted var(--line-dot);
}

.modal__credits dt {
  padding-top: 1px;
  font-family: var(--font-hand);
  font-size: 14px;
  letter-spacing: 0.03em;
  color: var(--fg-muted);
}

.modal__credits dd {
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

/* 作品ページのリンク：サービスごとのパステル色のボタン */
.modal__links {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.modal__links:empty { display: none; }

.link-btn {
  --tint: var(--periwinkle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 3px 22px 0;
  font-family: var(--font-hand);
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--fg);
  background: var(--tint);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.3s var(--ease-out), filter var(--dur-fast) var(--ease-out);
}

.link-btn--youtube { --tint: #d9ecff; }
.link-btn--x { --tint: #e3e9f4; }
.link-btn--vimeo { --tint: var(--aqua); }
.link-btn--instagram { --tint: var(--periwinkle); }
.link-btn--tiktok { --tint: var(--mint); }
.link-btn--niconico { --tint: var(--cloud); }

.link-btn svg { flex: none; width: 18px; height: 18px; margin-top: -3px; }

.link-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  filter: saturate(1.4);
}

.link-btn:active { transform: scale(0.96); }

.modal__bar {
  position: fixed;
  top: var(--gutter);
  left: var(--gutter);
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal__count {
  min-width: 80px;
  padding-top: 4px;
  font-size: 17px;
  letter-spacing: 0.14em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.modal__close {
  position: fixed;
  top: var(--gutter);
  right: var(--gutter);
}

/* ---------- 編集ボタン（ローカルで開いたときだけ表示） ---------- */
.edit-link {
  position: fixed;
  left: var(--gutter);
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: calc(var(--z-modal) + 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 3px 18px 0;
  font-family: var(--font-hand);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--fg);
  background: var(--cloud);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--ease-spring);
}

.edit-link svg { width: 15px; height: 15px; margin-top: -3px; }
.edit-link:hover { transform: translateY(-2px) rotate(-2deg); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about__grid { grid-template-columns: minmax(0, 1fr); width: auto; }
  .about__lists { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal__body { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- スマホ：ヘッダーバー＋メニュー、1列の作品一覧、縦に並ぶ作品ページ ---------- */
@media (max-width: 639px) {
  :root {
    --grid-gap: 12px;
    --radius: 18px;
    --bar-h: calc(var(--header-h) + var(--gutter) * 2);
  }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header);
    height: var(--bar-h);
    background: rgba(246, 251, 255, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(50, 110, 180, 0.06);
  }

  .logo {
    padding: 0;
    font-size: 19px;
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .menu-btn { display: grid; }

  .header-actions {
    top: var(--bar-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 4px calc(var(--gutter) + 4px) 20px;
    background: var(--bg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s var(--ease-out), transform 0.4s var(--ease-spring), visibility 0s linear 0.4s;
  }

  .is-menu-open .header-actions {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.25s var(--ease-out), transform 0.4s var(--ease-spring), visibility 0s;
  }

  .header-actions .hbtn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    width: 100%;
    height: 60px;
    padding: 0;
    font-size: 19px;
    background: none;
    box-shadow: none;
    border-bottom: 2px dotted var(--line-dot);
    border-radius: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .header-actions .hbtn[data-link="email"] { border-bottom: 0; }
  .header-actions .hbtn:hover { transform: none; }

  .header-actions .hbtn--text {
    order: -1;
    padding-top: 3px;
    border-bottom: 2px dotted var(--line-dot);
  }

  .header-actions .hbtn svg { width: 18px; height: 18px; }

  .hbtn__label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    padding-top: 3px;
    font-size: 19px;
  }

  /* 作品一覧：1列 */
  .works { padding: calc(var(--bar-h) + 4px) 12px 0; }
  .works-grid { grid-template-columns: minmax(0, 1fr); }

  /* 作品ページ：上部はヘッダーと同じバー、動画は画面幅に合わせて大きく */
  .modal__backdrop { background: var(--bg); }

  .modal__dialog::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
    height: var(--bar-h);
    background: var(--bg);
  }

  .modal__bar,
  .modal__close { z-index: 2; }

  .modal__inner { padding: calc(var(--bar-h) + 4px) 12px 96px; }

  .modal__player {
    width: 100%;
    min-width: 0;
    border-radius: var(--radius);
  }

  .modal__body {
    gap: 44px;
    margin-top: 28px;
    padding: 0 calc(var(--gutter) - 12px);
  }

  .modal__main {
    display: flex;
    flex-direction: column;
  }

  .modal__title {
    order: 0;
    margin-top: 0;
    font-size: 21px;
    line-height: 1.6;
  }

  .modal__sub { order: 1; }

  .modal__meta {
    order: 2;
    margin-top: 6px;
    font-size: 15px;
  }

  .modal__desc { order: 3; }

  .modal__details-title {
    margin-bottom: 20px;
    font-size: 28px;
  }

  .modal__credits {
    gap: 18px;
    border-top: 0;
  }

  .modal__credits div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    padding: 0;
    border-bottom: 0;
  }

  .modal__credits dt {
    font-size: 16px;
    color: var(--fg);
  }

  .modal__credits dd {
    font-size: 14px;
    color: var(--fg-muted);
  }
}

@media (max-width: 767px) {
  :root { --header-h: 42px; }
  .hbtn--text { padding-inline: 16px; }
  .about__lists { grid-template-columns: minmax(0, 1fr); }
  .modal__player { min-width: 0; }
  .edit-link { display: none; }
}

@media (hover: none) {
  .edit-link { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation: none !important;
  }
  .js [data-reveal] .phrase {
    opacity: 1;
    filter: none;
    transform: none;
  }
  .tile { opacity: 1; }
  .display-xl { background-size: 100% 100%; }
}
