/* ========== 基本 ========== */
:root {
  --paper: #e3e0de;   /* アイコンの背景のようなグレー */
  --paper2: #d8d4d2;
  --ink: #1d1c1a;
  --sub: #58544e;
  --line: #c7c2bf;
  --yellow: #e5ef3f;  /* アイコンのマフラーの黄色 */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .34 -.06'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --serif: "Newsreader", serif;
  --jp: "Zen Kaku Gothic New", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--jp); color: var(--ink); background-color: var(--paper); font-size: 15px; line-height: 1.95; letter-spacing: .04em; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; }
em { font-style: italic; }

.wrap { width: min(1200px, 100% - 64px); margin-inline: auto; }
.nw { display: inline-block; }


/* ========== ざらっとした質感（紙のノイズ） ========== */
body, .hd, .works, .contact, .ft { background-image: var(--grain); background-size: 200px; }

/* ========== ヘッダー ========== */
.hd { position: sticky; top: 0; z-index: 10; background-color: rgb(227 224 222 / 92%); backdrop-filter: blur(10px); transition: background-color 1.6s ease; }
.hd.is-on { background-color: var(--yellow); }
.hd.is-on .hd__in { border-bottom-color: rgb(29 28 26 / 15%); }
.hd.is-on .logo em { color: var(--ink); }
.hd__in { display: flex; align-items: center; justify-content: space-between; height: 72px; border-bottom: 1px solid var(--line); }
.logo { font-family: var(--serif); font-size: 26px; letter-spacing: 0; line-height: 1; }
.logo em { color: var(--sub); }
.gnav { display: flex; gap: 36px; font-size: 13px; letter-spacing: .1em; }
.gnav a { position: relative; }
.gnav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.gnav a:hover::after { transform: scaleX(1); }

/* ========== ファーストビュー（デカ文字） ========== */
.hero { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-height: calc(100svh - 72px); padding: 36px 0 44px; }
.hero__top { display: flex; justify-content: space-between; font-size: 13px; line-height: 1.7; letter-spacing: .08em; }
.hero__top span { color: var(--sub); }
.hero__right { text-align: right; }

.big { font-family: var(--serif); font-weight: 400; font-optical-sizing: none; font-variation-settings: "opsz" 16; font-size: min(15vw, 30vh, 220px); line-height: .92; letter-spacing: -.035em; }
.big em { position: relative; z-index: 0; padding: 0 .06em; }
/* マーカー：ふだんは平ら。数秒に1回、左から波がひとつ寄せてきて右へ抜ける */
.big em::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: .14em; height: .44em; background: var(--yellow);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10' preserveAspectRatio='none'%3E%3Cpath d='M0 10 C8 10 10 1 18 1 S28 10 34 10 C38 10 40 6 45 6 S51 10 60 10Z'/%3E%3C/svg%3E") -2em 0 / 1.9em .12em no-repeat, linear-gradient(#000 0 0) 0 100% / 100% calc(100% - .11em) no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10' preserveAspectRatio='none'%3E%3Cpath d='M0 10 C8 10 10 1 18 1 S28 10 34 10 C38 10 40 6 45 6 S51 10 60 10Z'/%3E%3C/svg%3E") -2em 0 / 1.9em .12em no-repeat, linear-gradient(#000 0 0) 0 100% / 100% calc(100% - .11em) no-repeat;
  animation: yoseru 4.5s cubic-bezier(.45,.05,.4,1) 1.6s infinite; }
@keyframes yoseru {
  0%, 52% { -webkit-mask-position: -2em 0, 0 100%; mask-position: -2em 0, 0 100%; }
  86%, 100% { -webkit-mask-position: calc(100% + 2em) 0, 0 100%; mask-position: calc(100% + 2em) 0, 0 100%; }
}
.hero.is-away .big em::before { animation-play-state: paused; }
.big__line { display: flex; align-items: flex-end; overflow: hidden; padding: .16em .04em .05em; margin: -.16em -.04em 0; }
.big__line--2 { justify-content: flex-end; }
.w { display: inline-block; animation: rise 1.1s cubic-bezier(.2,.75,.2,1) both; }
.big__line--2 .w { animation-delay: .12s; }
@keyframes rise { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.hero__lead { margin-right: auto; align-self: center; padding-right: 24px; font-family: var(--jp); font-size: clamp(16px, 1.5vw, 20px); font-weight: 500; line-height: 1.8; letter-spacing: .08em; }

.hero__foot { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 22px; border-top: 1px solid var(--ink); font-size: 13px; color: var(--sub); }
.arrow-link { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; color: var(--ink); white-space: nowrap; }
.arrow-link span { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--ink); border-radius: 50%; font-family: var(--jp); font-size: 15px; transition: background .25s, color .25s; }
.arrow-link:hover span { background: var(--ink); color: var(--paper); }

/* ========== セクション共通 ========== */
.sec { padding: 140px 0; }
.sec--tight { padding-top: 0; }
.sec__hd { margin-bottom: 56px; }
.en { display: inline-flex; align-items: baseline; gap: 12px; font-family: var(--serif); font-size: 22px; font-style: italic; color: var(--ink); letter-spacing: .01em; }
.en::before { content: ""; align-self: center; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); }
.ttl { margin-top: 6px; font-size: clamp(24px, 2.6vw, 32px); font-weight: 500; line-height: 1.5; letter-spacing: .1em; }
.col__num { font-family: var(--serif); font-size: 34px; line-height: 1; color: var(--ink); }

/* ========== できること ========== */
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.col { padding: 36px 36px 8px 0; }
.col + .col { padding-left: 36px; border-left: 1px solid var(--line); }
.col h3 { margin: 22px 0 14px; font-size: 19px; font-weight: 700; line-height: 1.6; letter-spacing: .08em; }
.col p:last-child { font-size: 14px; color: var(--sub); }

/* ========== 作品 ========== */
.works { background-color: var(--paper); transition: background-color 1.2s ease; }
.works.is-on { background-color: var(--paper2); }
.works__hd { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.works__hd .sec__hd { margin-bottom: 0; }
.works__hint { margin-bottom: 40px; font-size: 13px; color: var(--sub); }
.filter { display: flex; flex-wrap: wrap; gap: 6px; }
.filter button { height: 38px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 13px; cursor: pointer; transition: .2s; }
.filter button:hover { border-color: var(--ink); }
.filter button.is-on { background: var(--yellow); border-color: var(--ink); color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px 32px; }
.card { cursor: pointer; }
.card[hidden] { display: none; }
.card__img { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #fff; border-radius: 4px; }
.card__img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s cubic-bezier(.2,.75,.2,1); }
.card:hover .card__img img { transform: scale(1.04); }
.card__body { padding-top: 16px; }
.card h3 { font-size: 16px; font-weight: 700; line-height: 1.6; letter-spacing: .06em; transition: color .2s; }
.card:hover h3 { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: .4em; text-underline-offset: -.15em; text-decoration-skip-ink: none; }
.card .tag { margin-top: 4px; font-size: 13px; color: var(--sub); }
.card .role { display: none; }
.card .tag { order: 2; }
.card__body { display: flex; flex-direction: column; }
.card h3 { order: 1; }
/* 一覧では説明を隠して、ポップアップで見せる */
.grid .desc, .grid .meta, .grid .note, .grid .more { display: none; }

/* ========== 作品の詳細（ポップアップ） ========== */
.modal { width: min(1040px, 100% - 32px); max-height: min(86vh, 760px); padding: 0; border: 0; border-radius: 6px; background: var(--paper); color: var(--ink); overflow: hidden; }
.modal::backdrop { background: rgb(29 28 26 / 55%); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .35s cubic-bezier(.2,.75,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(12px); } }
.modal__in { display: grid; grid-template-columns: 1.15fr 1fr; max-height: inherit; }
.modal__img { overflow-y: auto; background: #fff; }
.modal__img img { width: 100%; }
.modal__body { overflow-y: auto; padding: 48px 44px 44px; }
.modal__body .tag { font-size: 13px; color: var(--sub); letter-spacing: .08em; }
.modal__body h3 { margin-top: 6px; font-size: 22px; font-weight: 700; line-height: 1.5; }
.modal__body .desc { margin-top: 18px; font-size: 14px; color: var(--sub); }
.modal__body .meta { margin-top: 24px; border-top: 1px solid var(--ink); font-size: 13px; }
.modal__body .meta div { display: grid; grid-template-columns: 5.6em 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.modal__body .meta dt { color: var(--sub); }
.modal__body .note { margin-top: 14px; font-size: 13px; color: var(--sub); }
.modal__body .more { display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; height: 50px; padding: 0 26px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 14px; transition: background .2s; }
.modal__body .more:hover { background: var(--yellow); color: var(--ink); }
.modal__body .more i { width: 12px; height: 12px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3h7v7'/%3E%3Cpath d='M21 3l-9 9'/%3E%3Cpath d='M19 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3h7v7'/%3E%3Cpath d='M21 3l-9 9'/%3E%3Cpath d='M19 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5'/%3E%3C/svg%3E") center/contain no-repeat; }
.modal__close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--paper); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgb(0 0 0 / 10%); }
.modal__close:hover { background: var(--ink); color: var(--paper); }

/* ========== スキル ========== */
.skills__in { display: grid; grid-template-columns: 300px 1fr; gap: 48px; }
.skills { border-top: 1px solid var(--ink); }
.skills div { display: grid; grid-template-columns: 10em 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.skills dt { font-weight: 700; }
.skills dd { color: var(--sub); }

/* ========== 進め方 ========== */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.flow li { padding: 32px 28px 8px 0; }
.flow li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.flow h3 { margin: 18px 0 8px; font-size: 17px; font-weight: 700; letter-spacing: .08em; }
.flow p:last-child { font-size: 13.5px; color: var(--sub); }

/* ========== 自己紹介 ========== */
.about { padding-top: 0; }
.about__in { display: grid; grid-template-columns: 1fr 1.15fr; gap: 88px; align-items: center; }
.about__img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }
.about__name { margin-top: 4px; font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 5vw, 72px); line-height: 1; letter-spacing: -.01em; }
.about__role { margin: 14px 0 30px; font-size: 13px; color: var(--sub); }
.about__txt > p + p { margin-top: 14px; }
.career { margin-top: 36px; border-top: 1px solid var(--ink); font-size: 13.5px; }
.career div { display: grid; grid-template-columns: 6em 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.career dt { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink); line-height: 1.6; }

/* ========== お問い合わせ ========== */
/* お問い合わせ＋フッターで、ヘッダーの下がちょうど1画面ぶんになる高さ */
.contact { display: flex; align-items: center; min-height: calc(100svh - 72px - 88px); padding: 48px 0; color: var(--ink); background-color: var(--paper); transition: background-color 1.6s ease; }
.contact.is-on { background-color: var(--yellow); }
.contact__in { display: grid; grid-template-columns: 1fr minmax(0, 520px); gap: 72px; align-items: center; }
.en--light { color: var(--ink); }
.en--light::before { background: var(--ink); }
.contact__ttl { margin-top: 10px; font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 6.4vw, 104px); line-height: 1; letter-spacing: -.02em; }
.contact__lead { margin: 28px 0 0; font-size: 15px; letter-spacing: .08em; }
.contact__note { margin-top: 14px; font-size: 13px; }
.contact__mail { margin-top: 28px; font-size: 13px; }
.contact__mail a { border-bottom: 1px solid currentColor; }

/* フォーム */
.form { display: grid; gap: 14px; }
.form__row { display: grid; gap: 6px; }
.form label { font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.form .req, .form .opt { margin-left: 8px; padding: 1px 7px; border-radius: 3px; font-size: 11px; font-weight: 500; vertical-align: 1px; }
.form .req { background: var(--ink); color: var(--yellow); }
.form .opt { border: 1px solid rgb(29 28 26 / 40%); }
.form input, .form textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--ink); border-radius: 4px; background: rgb(255 255 255 / 55%); font: inherit; font-size: 15px; color: var(--ink); }
.form textarea { resize: vertical; min-height: 112px; line-height: 1.8; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; background: #fff; }
.form ::placeholder { color: #8a867f; }
.form [aria-invalid="true"] { border-color: #b3261e; outline-color: #b3261e; }
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__btn { justify-self: start; display: inline-flex; align-items: center; gap: 12px; height: 52px; margin-top: 4px; padding: 0 32px; border: 0; border-radius: 999px; background: var(--ink); color: var(--yellow); font-size: 15px; font-weight: 700; letter-spacing: .1em; cursor: pointer; transition: transform .2s; }
.form__btn i { font-style: normal; transition: transform .25s; }
.form__btn:hover i { transform: translateX(4px); }
.form__btn:disabled { opacity: .6; cursor: wait; }
.form__msg { min-height: 1.5em; font-size: 14px; font-weight: 700; }
.form__msg.is-error { color: #b3261e; }
.form.is-sent { display: block; padding: 40px 32px; border: 1px solid var(--ink); border-radius: 6px; }


/* ========== フッター ========== */
.ft { display: flex; align-items: center; height: 88px; border-top: 1px solid rgb(29 28 26 / 15%); background-color: var(--paper); transition: background-color 1.6s ease; }
.ft.is-on { background-color: var(--yellow); }
.ft__in { display: flex; justify-content: space-between; align-items: center; }
.ft.is-on small, .ft.is-on .logo em { color: var(--ink); }
.ft small { font-size: 13px; color: var(--sub); }



/* ========== スクロールでふわっと出る ========== */
.card { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.75,.2,1); }
.card.is-in { opacity: 1; transform: none; }


/* ========== トップへ戻る ========== */
.totop { position: fixed; right: 28px; bottom: 28px; z-index: 20; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--paper); color: var(--ink); overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none; transition: opacity .4s, transform .4s cubic-bezier(.2,.75,.2,1), background-color .4s; }
.totop.is-show { opacity: 1; transform: none; pointer-events: auto; }
.totop__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.totop__ring circle { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: var(--p, 0) 100; stroke-linecap: round; }
.totop::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1px solid var(--line); }
.totop__arrow { display: block; width: 20px; height: 20px; transition: transform .35s cubic-bezier(.5,0,.2,1); }
.totop__arrow svg { display: block; width: 100%; height: 100%; }
.totop__label { position: absolute; bottom: 9px; font-family: var(--serif); font-style: italic; font-size: 12px; opacity: 0; transform: translateY(6px); transition: .3s; }
/* マウスをのせると、矢印がぴょんと上へ抜けて下から戻ってくる */
.totop:hover .totop__arrow { animation: hop .6s cubic-bezier(.5,0,.2,1); transform: translateY(-5px); }
.totop:hover .totop__label { opacity: 1; transform: none; }
@keyframes hop { 0% { transform: none; } 45% { transform: translateY(-40px); } 46% { transform: translateY(40px); } 100% { transform: translateY(-5px); } }
/* 押したら、矢印がロケットのように飛んでいく */
.totop.is-fly .totop__arrow { animation: fly .7s cubic-bezier(.6,0,.4,1); }
@keyframes fly { 0% { transform: none; } 30% { transform: translateY(6px); } 60% { transform: translateY(-60px); } 61% { transform: translateY(40px); } 100% { transform: none; } }
/* 黄色の画面では、黒い丸に黄色の矢印 */
.totop.is-dark { background: var(--ink); color: var(--yellow); }
.totop.is-dark .totop__ring circle { stroke: var(--yellow); }
.totop.is-dark::before { border-color: rgb(229 239 63 / 25%); }

@media (prefers-reduced-motion: reduce) {
  .totop, .totop__arrow, .totop__label { animation: none !important; transition: none; }
  .works, .contact, .ft, .hd { transition: none; }
  .card { opacity: 1; transform: none; transition: none; }
  .w, .modal[open], .big em::before { animation: none; }
}

/* ========== タブレット ========== */
@media (max-width: 960px) {
  .hero { min-height: auto; gap: 64px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .skills__in { grid-template-columns: 1fr; gap: 0; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow li:nth-child(3) { padding-left: 0; border-left: 0; }
  .about__in { grid-template-columns: 1fr; gap: 48px; }
  .about__img { max-width: 440px; }
  .modal__in { grid-template-columns: 1fr; overflow-y: auto; }
  .modal__img { max-height: 46vh; }
  .modal__body { overflow: visible; }
}

/* ========== スマホ ========== */
@media (max-width: 640px) {
  body { font-size: 14px; }
  .wrap { width: calc(100% - 40px); }
  .gnav { gap: 18px; font-size: 13px; }
  .gnav a:nth-child(2), .gnav a:nth-child(3) { display: none; }
  .hero { padding: 24px 0 36px; gap: 44px; }
  .hero__top { flex-direction: column; gap: 10px; }
  .hero__right { text-align: right; align-self: flex-end; }
  .big { font-size: 21vw; }
  .big__line:first-child em { font-size: .86em; }
  .big__line--2 { flex-wrap: wrap; justify-content: flex-end; }
  .big__line--2 .w { font-size: 1.32em; line-height: .9; }
  .big__line--2 .hero__lead { order: 3; flex-basis: 100%; margin: 28px 0 0; padding: 0; }
  .hero__foot { flex-direction: column; align-items: flex-start; }
  .hero__foot .arrow-link { align-self: flex-end; }
  .totop { right: 16px; bottom: 16px; width: 54px; height: 54px; }
  .sec { padding: 96px 0; }
  .sec--tight, .about { padding-top: 0; }
  .cols3 { grid-template-columns: 1fr; }
  .col, .col + .col { padding: 28px 0; border-left: 0; }
  .col + .col { border-top: 1px solid var(--line); }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 14px; }
  .card h3 { font-size: 13.5px; }
  .card .tag { font-size: 12px; }
  .skills div { grid-template-columns: 1fr; gap: 4px; }
  .flow { grid-template-columns: 1fr; }
  .flow li, .flow li + li { padding: 24px 0; border-left: 0; }
  .flow li + li { border-top: 1px solid var(--line); }
  .modal__body { padding: 32px 24px 32px; }
  .contact { padding: 96px 0; }
  .contact__in { grid-template-columns: 1fr; gap: 44px; }
  .ft__in { padding-right: 64px; }
}

/* 画面の高さが低いパソコンでも、お問い合わせが1画面に収まるように */
@media (min-width: 641px) and (max-height: 780px) {
  .contact { padding: 28px 0; }
  .contact__ttl { font-size: clamp(48px, 5.4vw, 84px); }
  .form { gap: 10px; }
  .form textarea { min-height: 88px; }
}
