/*
  ホームページの共通部品。**build のたびに上書きされる**（型を問わず同じもの）。

  ここにあるのは、どの型でも同じ働きをするもの —— 動き（data-anim ほか）・
  下の階層の部品（ページの見出し・パンくず・概要の表・沿革・お知らせの一覧・
  事例の格子・問い合わせのフォーム・よくある質問・締めの帯）・日本語の折り返し。

  **見た目の個性は型の style.css が持つ**（style.css はこのファイルの後に読む）。
  ここでは色も書体も直書きせず、型が配るトークンだけを使う:
    色と書体  --bg --surface --ink --ink-dim --accent --accent-ink --line --font（variant.yml から）
    寸法      --maxw（本文の幅）--gutter（左右の余白）--radius（角）
    見出し    --head-font --head-weight --head-tracking --eyebrow-font
*/

:root {
  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --radius: 6px;
  --head-font: var(--font);
  --head-weight: 700;
  --head-tracking: 0.02em;
  --eyebrow-font: var(--font);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 72px;
}

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

/* hidden を付けたものは必ず隠す（.form などの display: grid が hidden に勝って出たままになった） */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.85;
  letter-spacing: 0.02em;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--head-font);
  font-weight: var(--head-weight);
  letter-spacing: var(--head-tracking);
  line-height: 1.4;
}

/* CTA やページ内の飛び先が、固定ヘッダーの下に隠れないようにする */
[id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.container {
  width: min(100% - var(--gutter) * 2, var(--maxw));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}

/* 読み上げにだけ渡す（見出しの無い節に見出しを置くときなど） */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--bg);
  padding: 8px 12px;
}

/* 英字の小見出し（ABOUT / SERVICE など）。日本の企業サイトで定番の 2 段の見出し */
.eyebrow {
  display: block;
  font-family: var(--eyebrow-font);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

/* ボタン。型の style.css で形を変える（角・太さ・矢印） */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  min-height: 48px;
  padding: 12px 28px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.3s var(--ease),
    color 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.button:hover {
  background: transparent;
  color: var(--accent);
}

.button.is-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button.is-ghost:hover {
  border-color: var(--ink);
}

/* 矢印つきの文字リンク（「詳しく見る →」）。押せるのが一目で分かる */
.more {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 600;
  text-decoration: none;
}

.more::after {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  transition: width 0.35s var(--ease);
}

@media (hover: hover) {
  .more:hover::after {
    width: 44px;
  }
}

/* ---------------------------------------------------------- ヘッダー（共通の働き） */

/*
  ナビの畳み方は lp.js が受け持つ（`[data-nav-toggle]` と `aria-controls`）。
  ここでは「いまのページ」の印だけ —— 写すときに `aria-current` が付く。
*/
.site-nav a[aria-current="page"]:not(.button) {
  color: var(--accent);
}

/* 三本線のメニューを開いている間は、後ろの本文を動かさない */
body:has([data-nav-toggle][aria-expanded="true"]) {
  overflow: hidden;
}

[data-header] {
  transition:
    transform 0.4s var(--ease),
    background-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

[data-header].is-hidden {
  transform: translateY(-100%);
}

/* ---------------------------------------------------------- 下の階層の部品 */

.page-hero {
  padding: calc(var(--header-h) + clamp(40px, 8vw, 96px)) 0 clamp(32px, 6vw, 64px);
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
  margin: 0;
}

.page-hero .lead {
  max-width: 40em;
  color: var(--ink-dim);
  margin: 20px 0 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--ink-dim);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5em;
  opacity: 0.6;
}

.breadcrumb a {
  text-decoration: none;
}

.block {
  padding: clamp(56px, 9vw, 120px) 0;
}

.block + .block {
  border-top: 1px solid var(--line);
}

.block-head {
  margin: 0 0 clamp(28px, 4vw, 48px);
}

.block-head h2 {
  font-size: clamp(1.375rem, 1.05rem + 1.3vw, 2rem);
  margin: 0;
}

/* 2 段（左に見出し・右に本文）。広い画面だけ */
.split {
  display: grid;
  gap: 32px;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 64px;
  }
}

.prose p {
  margin: 0 0 1.4em;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* 理念の一文。本文より大きく、見出しの書体で */
.statement {
  font-family: var(--head-font);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  font-weight: var(--head-weight);
  line-height: 1.6;
}

/* 代表挨拶 */
.message {
  display: grid;
  gap: 32px;
  align-items: start;
}

.message figure {
  margin: 0;
}

.message img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--surface);
}

.signature {
  margin-top: 28px;
  text-align: right;
}

.signature small {
  display: block;
  color: var(--ink-dim);
}

@media (min-width: 900px) {
  .message {
    grid-template-columns: 2fr 3fr;
    gap: 64px;
  }
}

/* 概要の表。**表で組む**（定義リストを横に並べると、狭い画面で項目と値が離れる） */
.facts {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--line);
}

.facts th,
.facts td {
  text-align: left;
  vertical-align: top;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.facts th {
  width: 9em;
  padding-right: 24px;
  font-weight: 600;
  color: var(--ink-dim);
}

@media (max-width: 599px) {
  /* 狭い画面では項目を値の上に置く（横に並べると値が 1 字ずつ折れる） */
  .facts th,
  .facts td {
    display: block;
    width: auto;
  }

  .facts th {
    padding-bottom: 0;
    border-bottom: 0;
    font-size: 0.8125rem;
  }

  .facts td {
    padding-top: 4px;
  }
}

/* 沿革 */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.timeline li {
  position: relative;
  display: grid;
  gap: 4px 24px;
  padding: 0 0 28px 28px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.65em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline p {
  margin: 0;
}

.timeline time {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 700px) {
  .timeline li {
    grid-template-columns: 8em 1fr;
  }
}

/* 地図の場所。**地図は外から埋め込む**（Google マップの「地図を埋め込む」） */
.map {
  aspect-ratio: 16 / 9;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  font-size: 0.875rem;
}

.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* サービスの一覧（番号つき・写真と本文を交互） */
.service-list {
  display: grid;
  gap: clamp(56px, 8vw, 104px);
}

.service {
  display: grid;
  gap: 24px;
  align-items: center;
}

.service figure {
  margin: 0;
  overflow: hidden;
}

.service img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--surface);
}

.service-num {
  font-family: var(--eyebrow-font);
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.service h3 {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  margin: 4px 0 16px;
}

.checks {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.checks li {
  padding-left: 1.6em;
  position: relative;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0.2em;
  top: 0.65em;
  width: 0.7em;
  height: 0.38em;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

@media (min-width: 900px) {
  .service {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }

  .service:nth-child(even) figure {
    order: 2;
  }
}

/* 進め方（番号の付いた流れ） */
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  counter-reset: flow;
}

.flow li {
  counter-increment: flow;
  background: var(--bg);
  padding: 28px 24px;
}

.flow li::before {
  content: "STEP " counter(flow, decimal-leading-zero);
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 8px;
}

.flow h3 {
  font-size: 1.0625rem;
  margin: 0 0 8px;
}

.flow p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.9375rem;
}

@media (min-width: 900px) {
  .flow {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    grid-auto-flow: column;
  }
}

/* よくある質問。**開け閉めはブラウザの details に任せる**（JS が無くても動く） */
.faq {
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 40px 22px 0;
  position: relative;
  font-weight: 600;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "Q.";
  color: var(--accent);
  margin-right: 0.6em;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.3s var(--ease);
}

.faq details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.faq details > div {
  padding: 0 0 24px 1.9em;
  color: var(--ink-dim);
}

/* JS が無いと絞り込みは動かないので、ボタンを出さない（項目は全部出る） */
html:not(.js) [data-filter-group] [data-filter] {
  display: none;
}

/* 絞り込みのボタン（事例・お知らせ） */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

.filters button {
  font: inherit;
  font-size: 0.875rem;
  min-height: 40px;
  padding: 6px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.filters button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* 事例の格子 */
.works {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 40px 28px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

/* 事例の格子の中だけに効かせる（:where で詳細度は前のまま）。案の側の .work という節の名前とぶつかった */
:where(.works) .work a {
  display: block;
  text-decoration: none;
}

:where(.works) .work figure {
  margin: 0 0 16px;
  overflow: hidden;
  background: var(--surface);
}

:where(.works) .work img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}

@media (hover: hover) {
  .work a:hover img {
    transform: scale(1.04);
  }
}

:where(.works) .work .tag {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}

:where(.works) .work h3 {
  font-size: 1.0625rem;
  margin: 4px 0 0;
}

/* お知らせの一覧（日付・分類・題） */
.news {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.news li {
  border-bottom: 1px solid var(--line);
}

.news a {
  display: grid;
  gap: 6px 20px;
  padding: 22px 0;
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.news a:hover {
  color: var(--accent);
}

.news time {
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
  font-size: 0.875rem;
}

.news .tag {
  justify-self: start;
  font-size: 0.75rem;
  padding: 1px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
}

@media (min-width: 700px) {
  .news a {
    grid-template-columns: 7em 8em 1fr;
    align-items: baseline;
  }
}

.pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
}

.pager a,
.pager span {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  text-decoration: none;
}

.pager [aria-current="page"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* 問い合わせ。電話の窓口とフォームを並べる */
.contact-ways {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 0 0 56px;
}

.contact-ways > div {
  background: var(--surface);
  padding: 28px;
}

.contact-ways .tel {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  font-weight: 700;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.contact-ways small {
  display: block;
  color: var(--ink-dim);
}

@media (min-width: 800px) {
  .contact-ways {
    grid-template-columns: 1fr 1fr;
  }
}

.form {
  display: grid;
  gap: 24px;
  max-width: 44rem;
}

.form label,
.form fieldset {
  display: grid;
  gap: 8px;
  font-weight: 600;
  border: 0;
  margin: 0;
  padding: 0;
}

/* 項目名と「必須」の印は 1 行に（span.label で包む。grid の子が分かれて印だけ別の行に落ちた） */
.form .label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.form .req {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 1px 6px;
}

/* 入力欄は 16px 以上（iOS は小さい入力欄にフォーカスすると画面ごと拡大する） */
.form input:not([type="checkbox"]):not([type="radio"]),
.form select,
.form textarea {
  font: inherit;
  font-size: max(16px, 1rem);
  font-weight: 400;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: inherit;
  width: 100%;
}

.form input:focus-visible,
.form select:focus-visible,
.form textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form .agree {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 400;
}

.form-status {
  margin: 0;
  min-height: 1.75em;
}

.form-status[data-state="error"] {
  color: #b3261e;
}

/* 締めの帯（下の階層の終わりに置く問い合わせへの入口） */
.cta-band {
  background: var(--ink);
  color: var(--bg);
  padding: clamp(56px, 9vw, 112px) 0;
}

.cta-band .container {
  display: grid;
  gap: 28px;
  align-items: center;
}

.cta-band h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  margin: 0;
}

.cta-band p {
  margin: 8px 0 0;
  opacity: 0.8;
}

.cta-band .button {
  justify-self: start;
  background: var(--bg);
  color: var(--ink);
  border-color: var(--bg);
}

.cta-band .button:hover {
  background: transparent;
  color: var(--bg);
}

@media (min-width: 900px) {
  .cta-band .container {
    grid-template-columns: 1fr auto;
  }
}

/* ---------------------------------------------------------- スマホは中央が既定 */

/*
  **スマホ幅では見出し・短い導入・ボタン・締めの帯を中央に置く。** 見るのはスマホが多く、
  PC の慣習の左揃えのままだと右が空いて間延びする（「なぜいつも左寄せになるの？」）。
  **3 行を超える本文・一覧・表・フォームは左のまま**（行頭がそろわないと読めない）。
  型の style.css はこの後に読むので、型ごとに上書きしてよい。左に残したい所は .align-start
*/
@media (max-width: 767px) {
  .page-hero,
  .block-head,
  .cta-band .container,
  .statement,
  .message > div > .eyebrow,
  .message h2,
  .signature,
  .contact-ways > div {
    text-align: center;
  }

  .page-hero .lead {
    margin-inline: auto;
  }

  .breadcrumb {
    justify-content: center;
  }

  .cta-band .button {
    justify-self: center;
  }

  /* 2 段の見出し（左に見出し・右に本文）は、見出しだけ中央 */
  .split > .block-head {
    margin-bottom: 0;
  }

  .form .button {
    justify-self: center;
    min-width: 12em;
    justify-content: center;
  }

  .align-start {
    text-align: left;
  }
}

/* ---------------------------------------------------------- 動き（site.js と組む） */

/*
  **隠すのは `html.js` のときだけ。** JS が動かない環境では最初から見えている。
  出し方は data-anim の値で選ぶ。遅らせるのは --delay（data-anim-delay / data-stagger）。
*/
.js [data-anim] {
  transition:
    opacity 0.9s var(--ease-out) var(--delay, 0ms),
    transform 1.1s var(--ease-out) var(--delay, 0ms),
    filter 0.9s var(--ease-out) var(--delay, 0ms),
    clip-path 1.2s var(--ease-out) var(--delay, 0ms);
}

.js [data-anim="up"] {
  opacity: 0;
  transform: translateY(28px);
}

.js [data-anim="fade"] {
  opacity: 0;
}

.js [data-anim="left"] {
  opacity: 0;
  transform: translateX(-40px);
}

.js [data-anim="right"] {
  opacity: 0;
  transform: translateX(40px);
}

.js [data-anim="scale"] {
  opacity: 0;
  transform: scale(0.94);
}

.js [data-anim="blur"] {
  opacity: 0;
  filter: blur(12px);
}

/* 下から幕が上がるように現れる（見出し・写真） */
.js [data-anim="mask"] {
  clip-path: inset(0 0 100% 0);
  transform: translateY(16px);
}

/* 写真の枠に付ける。枠は動かさず、中の写真が寄った状態から引いていく */
[data-anim="zoom"] {
  overflow: hidden;
}

.js [data-anim="zoom"] > img,
.js [data-anim="zoom"] > picture img,
.js [data-anim="zoom"] > video {
  transform: scale(1.18);
  transition: transform 2.2s var(--ease-out) var(--delay, 0ms);
}

/* 1 行ずつ。行（.line）を枠にして、中身を下から持ち上げる */
[data-anim="lines"] .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}

.js [data-anim="lines"] .m-line {
  display: block;
  transform: translateY(110%);
  transition: transform 1s var(--ease-out);
  transition-delay: calc(var(--delay, 0ms) + var(--i, 0) * 120ms);
}

.js [data-anim="lines"].is-in .m-line {
  transform: none;
}

/* 1 字ずつ。字は inline の span（文節の折り返しを崩さない）で、透明度とぼかしだけ動かす */
.js [data-anim="chars"] .m-ch {
  opacity: 0;
  filter: blur(6px);
  transition:
    opacity 0.7s var(--ease-out),
    filter 0.7s var(--ease-out);
  transition-delay: calc(var(--delay, 0ms) + var(--i, 0) * 45ms);
}

.js [data-anim].is-in {
  opacity: 1;
  transform: none;
  filter: none;
  clip-path: inset(0 0 0 0);
}

.js [data-anim="zoom"].is-in > img,
.js [data-anim="zoom"].is-in > picture img,
.js [data-anim="zoom"].is-in > video {
  transform: none;
}

.js [data-anim="chars"].is-in .m-ch {
  opacity: 1;
  filter: none;
}

/* 流し続ける帯（取引先・キーワード） */
[data-marquee] {
  position: relative;
  display: flex;
  overflow: hidden;
  white-space: nowrap;
}

[data-marquee] > :not(.motion-pause) {
  flex: 0 0 auto;
  display: flex;
  gap: var(--marquee-gap, 3rem);
  padding-right: var(--marquee-gap, 3rem);
  animation: marquee var(--marquee-duration, 40s) linear infinite;
}

[data-marquee][data-marquee-reverse] > :not(.motion-pause) {
  animation-direction: reverse;
}

[data-marquee]:hover > :not(.motion-pause),
[data-marquee].is-paused > :not(.motion-pause) {
  animation-play-state: paused;
}

@keyframes marquee {
  to {
    transform: translateX(-100%);
  }
}

/* 重ねて切り替える写真（ファーストビュー）。切り替わりながらゆっくり寄る */
[data-slideshow] {
  position: relative;
  overflow: hidden;
}

[data-slideshow] > :not(.motion-pause) {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s var(--ease);
}

[data-slideshow] > * > img,
[data-slideshow] > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

[data-slideshow] > .is-current {
  opacity: 1;
}

/* JS が動かない環境では最初の 1 枚を出す（is-current は site.js が付けるので、無いと全部消える） */
html:not(.js) [data-slideshow] > :first-child {
  opacity: 1;
}

[data-slideshow] > .is-current img,
[data-slideshow] > img.is-current {
  animation: slow-zoom 9s linear both;
}

[data-slideshow].is-paused > .is-current img,
[data-slideshow].is-paused > img.is-current {
  animation-play-state: paused;
}

/* 止めるボタン（5 秒より長く動くものに site.js が付ける）。邪魔にならない隅に小さく */
.motion-pause {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  color: var(--ink);
  cursor: pointer;
  opacity: 0.75;
}

.motion-pause:hover,
.motion-pause:focus-visible {
  opacity: 1;
}

/* 指で押す的は 44px */
@media (pointer: coarse) {
  .motion-pause {
    width: 44px;
    height: 44px;
  }
}

.motion-pause svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.motion-pause .i-play,
.motion-pause[aria-pressed="true"] .i-pause {
  display: none;
}

.motion-pause[aria-pressed="true"] .i-play {
  display: inline;
  fill: currentColor;
}

@keyframes slow-zoom {
  from {
    transform: scale(1.08);
  }
  to {
    transform: scale(1);
  }
}

/* スクロールより遅く動く写真。枠からはみ出さないよう、少し大きく敷く */
[data-parallax] {
  will-change: transform;
}

/* 縦のスクロールで横に進む節。広い画面だけ固定して進め、狭い画面は指で横に送る */
[data-horizontal] {
  position: relative;
}

[data-horizontal] > .h-sticky {
  overflow: hidden;
}

[data-horizontal] [data-track] {
  display: flex;
  gap: 28px;
  will-change: transform;
}

/*
  右から左へ進む（data-horizontal="rtl"。縦書きの読む向き）。最初の項目を右端に置き、
  指で送る列（狭い画面・動かさない設定）も右端から始める。中の文の向きは変えない
*/
[data-horizontal="rtl"] [data-track] {
  flex-direction: row-reverse;
  width: max-content;
  direction: ltr;
}

[data-horizontal="rtl"] > .h-sticky {
  direction: rtl;
}

@media (min-width: 900px) {
  html.js:not(.still) [data-horizontal="rtl"] > .h-sticky {
    direction: ltr;
  }
}

/* 固定するのは**ヘッダーの下から**（top: 0 だと固定ヘッダーの下に潜る）。固定して進めるのは JS が動くときだけ */
@media (min-width: 900px) {
  html.js:not(.still) [data-horizontal] > .h-sticky {
    position: sticky;
    top: var(--header-h, 0px);
    height: calc(100vh - var(--header-h, 0px));
    display: flex;
    align-items: center;
  }
}

/*
  狭い画面と**動かさない設定**では、指で横に送る列にする。動かさない設定のまま固定の枠を
  残すと、列が画面の外で切れて届かなかった
*/
@media (max-width: 899px) {
  [data-horizontal] > .h-sticky {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  [data-horizontal] [data-track] > * {
    scroll-snap-align: start;
  }
}

/* JS が無いときも指で送る列にする（固定と切り抜きだけ効いて、画面の外の部分に届かなかった） */
.still [data-horizontal] > .h-sticky,
html:not(.js) [data-horizontal] > .h-sticky {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.still [data-horizontal] [data-track] > *,
html:not(.js) [data-horizontal] [data-track] > * {
  scroll-snap-align: start;
}

/* 固定して進む節。左の図を固定し、右の段が画面の中ほどに来たら切り替わる */
/* 薄くするのは JS が段を切り替えるときだけ（JS が無いと全部の段が薄いまま残る）。:where で詳細度は前のまま */
:where(.js) [data-steps] [data-step] {
  opacity: 0.35;
  transition: opacity 0.5s var(--ease);
}

[data-steps] [data-step][data-active] {
  opacity: 1;
}

.still [data-steps] [data-step] {
  opacity: 1;
}

/* カーソルに付いてくる丸（作品の型だけ。site.js の data-cursor） */
.m-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 90;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  pointer-events: none;
  opacity: 0;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  transition:
    opacity 0.25s var(--ease),
    width 0.3s var(--ease-out),
    height 0.3s var(--ease-out),
    margin 0.3s var(--ease-out);
}

.m-cursor.is-on {
  opacity: 1;
}

.m-cursor.has-label {
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
}

/* 送る前の確認（site.js の data-confirm） */
.confirm {
  max-width: 44rem;
  outline: none;
}

.confirm-list {
  display: grid;
  grid-template-columns: minmax(7em, auto) 1fr;
  margin: 24px 0 32px;
  border-top: 1px solid var(--line);
}

.confirm-list dt,
.confirm-list dd {
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.confirm-list dt {
  color: var(--ink-dim);
  padding-right: 20px;
}

.confirm-list dd {
  white-space: pre-wrap;
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* 最初の 1 回だけ出す幕 */
[data-opening] {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition:
    clip-path 0.9s var(--ease-out),
    opacity 0.9s var(--ease-out);
  clip-path: inset(0 0 0 0);
}

[data-opening].is-out {
  clip-path: inset(0 0 100% 0);
}

/* ページの移り変わり。**対応するブラウザだけ**静かに重ねて替わる（他は素通し） */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.45s;
  animation-timing-function: var(--ease);
}

/* 動かさない設定では、全部を最初から出し、流す・寄る・幕を止める */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js [data-anim],
  .js [data-anim] .m-ch,
  .js [data-anim="zoom"] > img {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
    transition: none !important;
  }

  [data-marquee] > :not(.motion-pause),
  [data-slideshow] img {
    animation: none !important;
  }

  .js [data-anim="lines"] .m-line {
    transform: none !important;
    transition: none !important;
  }

  .m-cursor {
    display: none;
  }

  [data-opening] {
    display: none;
  }

  @view-transition {
    navigation: none;
  }
}

/* ---------------------------------------------------------- 日本語の折り返し */
/* 見出しは文節で折り、行の長さをそろえる。効かない環境では素通しになるだけ */
h1,
h2,
h3,
.lead {
  word-break: auto-phrase;
  text-wrap: balance;
}

p,
li,
dd,
td,
figcaption {
  text-wrap: pretty;
}

/* 手で切るときの道具。意味の切れ目が CSS 任せで決まらないときだけ使う */
.nb {
  display: inline-block;
}

.br-sp {
  display: inline;
}

@media (min-width: 760px) {
  .br-sp {
    display: none;
  }
}
