:root {
  color-scheme: light;
  --white: #ffffff;
  --ink: #1c1d21;
  --sub: #63666e;
  --line: #e7e6e1;
  --soft: #f6f6f3;
  --ai: #2b3a67;
  --ai-soft: #eceff6;
  --chat: #eef0f4;
  --ok: #2c6e55;
  --ok-soft: #e3f0ea;
  --r-l: 32px;
  --r-m: 24px;
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
/* JavaScriptが動かないときの止まる位置：セクション上の余白を差し引いて、見出しをヘッダーの近くに */
section[id]:not(#top) { scroll-margin-top: -88px; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--font); font-size: 16px; font-weight: 500; line-height: 1.9; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
h2, h3 { text-wrap: balance; }
/* 本文は日本語の組み方どおり各行を端まで詰め、行末をそろえる（最後の行だけ短くてよい）。
   行末が途中で空く書き方（文末を固定でまとめる・言葉の区切りで折り返す）はしない。中央寄せの文には使わない */
.section-lead, .concept-body, .card > p, .work-body > p, .feature p, .tech-grid p, .profile p:not(.profile-name), .contact-lead, .company-list dd:not(:has(.ib)) { text-align: justify; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--ai); outline-offset: 3px; }
body:has(.menu[open]) { overflow: hidden; }

.container { width: min(100% - 48px, 1120px); margin-inline: auto; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 8px 16px; background: var(--ink); color: #fff; border-radius: 999px; transform: translateY(-200%); }
.skip:focus { transform: none; }
.muted { color: var(--sub); }
.sp-only { display: none; }
.ib { display: inline-block; }

/* Header */
.header { position: sticky; top: 0; z-index: 20; background: rgb(255 255 255 / .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { width: min(100% - 48px, 1200px); margin-inline: auto; height: 76px; display: flex; align-items: center; gap: 32px; }
.logo { font-size: 22px; font-weight: 800; letter-spacing: -.01em; text-decoration: none; color: var(--ai); }
.nav { display: flex; gap: 28px; margin-left: auto; font-size: 14px; font-weight: 700; }
.nav a { text-decoration: none; padding-block: 8px; background: linear-gradient(var(--ai), var(--ai)) no-repeat left calc(100% - 2px) / 0 2px; transition: color .2s, background-size .25s; }
.nav a:hover { color: var(--ai); background-size: 100% 2px; }
.menu-btn, .menu-close { position: relative; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--soft); cursor: pointer; }
.menu-btn { display: none; margin-left: auto; }
.menu-btn span, .menu-close span { position: absolute; left: 13px; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); }
.menu-btn span:nth-child(1) { top: 15px; } .menu-btn span:nth-child(2) { top: 21px; } .menu-btn span:nth-child(3) { top: 27px; }
.menu-close span { top: 21px; } .menu-close span:nth-child(1) { transform: rotate(45deg); } .menu-close span:nth-child(2) { transform: rotate(-45deg); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 32px; border: 0; border-radius: 999px; background: var(--ai); color: #fff; font-size: 16px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .2s, opacity .15s, box-shadow .2s; box-shadow: 0 10px 24px -14px rgb(43 58 103 / .8); }
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn-small { min-height: 40px; padding: 0 20px; font-size: 13px; box-shadow: none; }

/* Menu */
.menu { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0 16px; border: 0; background: var(--white); }
.menu[open] { display: flex; flex-direction: column; }
.menu::backdrop { background: transparent; }
.menu-head { height: 64px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--sub); }
.menu nav { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding-bottom: 64px; }
.menu nav a { padding: 12px 24px; font-size: 20px; font-weight: 800; text-decoration: none; }
.menu nav a:last-child { margin-top: 18px; padding: 14px 40px; border-radius: 999px; background: var(--ai); color: #fff; font-size: 16px; }
/* 開くとき：全体をふわっと出し、項目を上から順に。≡ の位置で × に回る。閉じるときは薄く消す（site.js） */
@keyframes menu-in { from { opacity: 0; } }
@keyframes menu-out { to { opacity: 0; } }
@keyframes menu-item-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes menu-x-in { from { transform: rotate(0); } }
.menu[open] { animation: menu-in .25s ease; }
.menu.is-closing { animation: menu-out .2s ease forwards; }
.menu[open] nav a { animation: menu-item-in .5s cubic-bezier(.2, .7, .2, 1) backwards; }
.menu[open] nav a:nth-child(1) { animation-delay: .06s; } .menu[open] nav a:nth-child(2) { animation-delay: .1s; }
.menu[open] nav a:nth-child(3) { animation-delay: .14s; } .menu[open] nav a:nth-child(4) { animation-delay: .18s; }
.menu[open] nav a:nth-child(5) { animation-delay: .22s; } .menu[open] nav a:nth-child(6) { animation-delay: .28s; }
.menu[open] .menu-close span { animation: menu-x-in .4s cubic-bezier(.2, .7, .2, 1) backwards; }

/* Hero */
.hero { padding-block: 72px 96px; }
.hero-inner { display: grid; justify-items: center; text-align: center; }
.hero-copy { width: 100%; container-type: inline-size; display: grid; justify-items: center; }
.hero h1 { font-size: clamp(26px, 7cqi, 60px); line-height: 1.42; letter-spacing: -.01em; font-weight: 800; }
.h1-line { display: block; white-space: nowrap; }
.hero-lead { margin-top: 24px; max-width: 36em; color: var(--sub); font-size: 17px; line-height: 2; }
.hero-after { margin-top: 56px; display: grid; justify-items: center; gap: 18px; }
.hero-after p { color: var(--sub); font-size: 15px; }

/* Sections */
.section { padding-block: 112px; }
.section-soft { background: var(--soft); }
.section-head { max-width: 760px; }
.section h2 { font-size: clamp(24px, 3vw, 36px); line-height: 1.5; font-weight: 800; }
.section-head h2::before, .contact h2::before { content: ""; display: block; width: 32px; height: 4px; margin-bottom: 18px; border-radius: 4px; background: var(--ai); }
.concept h2::before { content: ""; display: block; width: 32px; height: 4px; margin: 0 auto 22px; border-radius: 4px; background: var(--ai); }
.section-lead { margin-top: 20px; color: var(--sub); }

/* Concept */
.concept { max-width: 820px; text-align: center; }
.concept h2 { font-size: clamp(28px, 4vw, 48px); }
.concept-lead { margin-top: 28px; font-size: clamp(18px, 2vw, 22px); font-weight: 700; line-height: 1.8; }
.concept-lead strong { color: var(--ai); background: linear-gradient(#dfe5f3, #dfe5f3) no-repeat left bottom / 100% 36%; }
.concept-body { margin: 24px auto 0; max-width: 40em; color: var(--sub); text-align: justify; }

/* Services */
.cards { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; align-content: start; padding: 36px 30px; border-radius: var(--r-l); background: var(--soft); }
/* 説明文の行数がカードごとに違っても、区切り線とチェックの一覧を3枚でそろえる */
.card-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ai); color: #fff; font-size: 15px; font-weight: 800; }
.card h3 { margin-top: 20px; font-size: 21px; line-height: 1.5; font-weight: 800; }
.card > p:not(.card-num) { margin-top: 12px; color: var(--sub); font-size: 15px; }
.checks { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; align-content: start; gap: 6px; font-size: 14px; }
.checks li { position: relative; padding-left: 22px; }
.checks li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 10px; height: 6px; border-left: 2px solid var(--ai); border-bottom: 2px solid var(--ai); transform: rotate(-45deg); }

/* Works */
.works-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.works-nav { display: flex; gap: 10px; flex: none; }
.works-btn { display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--white); color: var(--ai); font-size: 18px; font-weight: 800; cursor: pointer; box-shadow: 0 6px 18px -10px rgb(28 29 33 / .35); transition: opacity .15s, background .15s; }
.works-btn:hover:not(:disabled) { background: var(--ai); color: #fff; }
.works-btn:disabled { opacity: .35; cursor: default; }
.works { margin-top: 48px; display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: 16px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.works:focus-visible { outline: 2px solid var(--ai); outline-offset: 4px; border-radius: var(--r-m); }
.work { flex: 0 0 calc((100% - 40px) / 3); scroll-snap-align: start; display: flex; flex-direction: column; border-radius: var(--r-m); background: var(--white); overflow: hidden; transition: box-shadow .3s; }
.work-img { display: block; overflow: hidden; }
.work-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
/* 実績の絵は、土台の上に部品（透明な背景の画像）を重ねている。カードが見えたら部品を順に出す */
.work-art { position: relative; display: block; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.work-art .part { position: absolute; inset: 0; height: 100%; }
.work-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 26px; }
.work-client { font-size: 12px; color: var(--sub); }
.work h3 { margin-top: 2px; font-size: 18px; font-weight: 800; line-height: 1.5; }
.work h3 a { text-decoration: none; }
.work h3 a:hover { color: var(--ai); }
.work-body > p:not(.work-client):not(.work-role) { margin-top: 8px; font-size: 14px; color: var(--sub); }
.work-role { margin-top: auto; padding-top: 14px; font-size: 12px; font-weight: 700; color: var(--ai); }
.work-role::before { content: "担当："; color: var(--sub); font-weight: 500; }

/* Features */
.features { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; padding: 34px 30px; border-radius: var(--r-l); background: var(--soft); }
/* 見出しが2行になるカードがあっても、3枚の本文の書き出しをそろえる */
.feature h3 { font-size: 20px; line-height: 1.5; font-weight: 800; }
.feature p { margin-top: 12px; font-size: 15px; color: var(--sub); }

/* Technology */
.tech { margin-top: 36px; border-radius: var(--r-m); background: var(--white); }
.tech-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding: 32px 28px; }
.tech-grid h3 { font-size: 16px; font-weight: 800; }
.tech-grid p { margin-top: 6px; font-size: 13px; color: var(--sub); }
.tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 2px 12px; border-radius: 999px; background: var(--soft); font-size: 12px; color: var(--sub); }

/* Profile */
.profile { margin-top: 48px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 64px; align-items: start; }
.portrait { width: 100%; max-width: 260px; justify-self: center; aspect-ratio: 1; object-fit: cover; object-position: 50% 30%; border-radius: 50%; }
.profile-name { margin-top: 4px; font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; line-height: 1.4; }
.profile-name span { display: block; margin-bottom: 2px; font-size: 14px; font-weight: 500; color: var(--sub); }
.profile p:not(.profile-name) { margin-top: 14px; max-width: 40em; font-size: 15px; line-height: 1.95; }

/* Company */
.company { display: grid; gap: 40px; }
.company .company-list { max-width: 820px; }
.company-list { padding: 12px 32px; border-radius: var(--r-l); background: var(--white); }
.company-list div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.company-list div:last-child { border-bottom: 0; }
.company-list dt { font-size: 14px; color: var(--sub); }

/* Contact */
.contact { padding-block: 112px; }
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding: 64px; border-radius: 40px; background: var(--ai); color: #fff; }
.contact h2::before { background: rgb(255 255 255 / .6); }
.contact h2 { font-size: clamp(24px, 3vw, 36px); line-height: 1.5; font-weight: 800; }
.contact-lead { margin-top: 20px; color: rgb(255 255 255 / .82); }
.form { display: grid; gap: 18px; padding: 32px; border-radius: var(--r-m); background: #fff; color: var(--ink); }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.req { margin-left: 8px; font-size: 11px; font-weight: 700; color: #b4232f; }
.form input, .form textarea { width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); font-size: 16px; }
.form input:focus, .form textarea:focus { background: #fff; border-color: var(--ai); outline: none; }
.form textarea { resize: vertical; }
/* 迷惑な送信を防ぐ入力欄。人には見せない */
.form .trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form .btn { justify-self: start; }
.form-note { color: var(--sub); font-size: 13px; }
.form-note a { color: var(--ai); }
.form-message { font-size: 14px; min-height: 0; }
.form-message.success { color: var(--ok); }
.form-message.error { color: #b4232f; }

/* Footer */
.footer { padding-block: 40px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--sub); }
.footer .logo { font-size: 18px; }

/* Tablet */
@media (max-width: 1000px) {
  .cards, .features { grid-template-columns: 1fr; }
  .work { flex-basis: calc((100% - 20px) / 2); }
  .tech-grid { grid-template-columns: 1fr; }
  .contact-inner { grid-template-columns: 1fr; gap: 40px; }
  .contact-inner { padding: 48px 32px; }
}

/* Mobile */
@media (max-width: 760px) {
  .pc-only { display: none; }
  .nav, .header .btn-small { display: none; }
  .menu-btn { display: block; }
  .header-inner, .container { width: calc(100% - 32px); }
  .header-inner { height: 64px; }
  .logo { font-size: 20px; }
  .hero { padding-block: 40px 64px; }
  .hero-lead { font-size: 15px; margin-top: 18px; text-align: justify; }
  .hero-after { margin-top: 40px; gap: 14px; }
  .hero-after p { font-size: 14px; }
  .hero-after .btn { justify-self: stretch; }
  .section { padding-block: 80px; }
  .section h2 { font-size: clamp(21px, 6vw, 25px); }
  .concept h2 { font-size: clamp(24px, 7vw, 30px); }
  .concept-lead { font-size: 17px; }
  .cards, .features { margin-top: 36px; grid-template-columns: 1fr; }
  .works-head { flex-direction: column; align-items: stretch; gap: 16px; }
  .works-nav { justify-content: flex-end; }
  .works { margin-top: 16px; gap: 14px; }
  .work { flex-basis: 84%; }
  .works-btn { width: 40px; height: 40px; font-size: 15px; }
  .card, .feature { padding: 28px 22px; border-radius: var(--r-m); }
  .tech-grid { padding: 24px 20px; }
  .profile { margin-top: 32px; grid-template-columns: 1fr; gap: 24px; }
  .profile p:not(.profile-name) { font-size: 14.5px; margin-top: 12px; }
  .portrait { max-width: 180px; justify-self: start; }
  .company-list { padding: 4px 20px; border-radius: var(--r-m); }
  .company-list div { grid-template-columns: 1fr; gap: 2px; padding: 16px 0; }
  .company-list dt { font-size: 13px; }
  .contact { padding-block: 72px; }
  .contact-inner { padding: 40px 20px 20px; border-radius: 28px; width: calc(100% - 24px); }
  .form { padding: 24px 18px; }
  .form .btn { justify-self: stretch; }
  .footer-inner { flex-direction: column; gap: 8px; }
}

/* 動き：控えめに。位置と透明度だけを動かし、ページの高さは変えない。
   .motion は <head> で付ける（JavaScriptが動かない・動きを減らす設定のときは付かず、すべて最初から表示）。 */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.motion .h1-line, .motion .hero-lead, .motion .pairs, .motion .hero-after { animation: rise .8s cubic-bezier(.2, .7, .2, 1) backwards; }
.motion .h1-line + .h1-line { animation-delay: .08s; }
.motion .hero-lead { animation-delay: .18s; }
.motion .pairs { animation-delay: .3s; }
.motion .hero-after { animation-delay: .42s; }
/* スクロールして見えたところから、少し下からふわっと出す（site.js が .rv → .in を付ける） */
.motion .rv { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1) var(--d, 0s), transform .7s cubic-bezier(.2, .7, .2, 1) var(--d, 0s); }
.motion .rv.in { opacity: 1; transform: none; }
/* 見出しの上の線を伸ばす */
.motion .rv h2::before, .motion h2.rv::before { transform: scaleX(0); transform-origin: left; transition: transform .6s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0s) + .2s); }
.motion .concept h2.rv::before { transform-origin: center; }
.motion .rv.in h2::before, .motion h2.rv.in::before { transform: none; }
/* 「なぜ作るのか」のマーカーを左から引く */
.motion .concept-lead.rv strong { background-size: 0 36%; transition: background-size .9s cubic-bezier(.2, .7, .2, 1) .35s; }
.motion .concept-lead.rv.in strong { background-size: 100% 36%; }

/* 実績の絵の部品：ファーストビューより短く、2秒ほどで出し終える（site.js が .play を付ける） */
@keyframes part-rise { from { opacity: 0; transform: translateY(6%); } }
@keyframes part-drop { from { opacity: 0; transform: translateY(-5%); } }
@keyframes part-slide { from { opacity: 0; transform: translateX(6%); } }
@keyframes part-pop { from { opacity: 0; transform: scale(.6); } }
@keyframes part-fade { from { opacity: 0; } }
.motion .work-art .part { opacity: 0; }
.motion .work-art.play .part { opacity: 1; animation: part-rise .7s cubic-bezier(.2, .7, .2, 1) calc(var(--base, 0s) + var(--at, 0s)) backwards; }
.motion .work-art.play .part[data-fx="drop"] { animation-name: part-drop; }
.motion .work-art.play .part[data-fx="slide"] { animation-name: part-slide; }
.motion .work-art.play .part[data-fx="fade"] { animation-name: part-fade; animation-duration: .9s; }
.motion .work-art.play .part[data-fx="pop"] { animation-name: part-pop; animation-timing-function: cubic-bezier(.3, 1.5, .5, 1); }

/* マウスで触れたとき：押せるものだけ反応させる */
@media (hover: hover) {
  .work:has(a[href]):hover { box-shadow: 0 22px 40px -28px rgb(28 29 33 / .4); }
  .work:has(a[href]):hover .work-art { transform: scale(1.03); }
  .btn:hover { box-shadow: 0 14px 28px -14px rgb(43 58 103 / .85); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
