@charset "utf-8";

/* =========================================================
   トークン
   ========================================================= */
:root {
    --paper:      #f7f7f7;
    --ink:        #333333;
    --ink-soft:   #707070;
    --line:       #e0e0e0;
    --accent:     #a7aefb;
    --overlay:    rgba(22, 22, 26, 0.95);

    --rail:       104px;
    --gutter:     clamp(20px, 5vw, 72px);
    --radius-lg:  clamp(28px, 4vw, 56px);
    --radius-sm:  10px;

    --font-jp:    "Noto Sans JP", "Yu Gothic", "游ゴシック", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    --font-en:    "Dosis", var(--font-jp);

    --ease:       cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* =========================================================
   ベース
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    background-color: var(--paper);
    /* スクロールバーの分の幅を常に確保しておく。
       モーダルを開いてスクロールバーが消えたときに、
       背後のページが横にずれるのを防ぎます */
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    padding-left: var(--rail);
    font-family: var(--font-jp);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.9;
    color: var(--ink);
    overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.3; }
p  { margin: 0 0 1.4em; }
ul { margin: 0; padding: 0; list-style: none; }

a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: color .25s var(--ease), border-color .25s var(--ease);
}

a:hover { color: var(--ink-soft); border-color: var(--ink-soft); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* =========================================================
   言語切り替え（JA / EN）
   class="t-ja" / "t-en" を付けた要素が、表示中の言語で出し分けられます
   ========================================================= */
[data-lang="ja"] .t-en { display: none; }
[data-lang="en"] .t-ja { display: none; }

.rail__lang {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 0;
    margin-top: 6px;
}

.lang-btn {
    padding: 2px 0;
    border: 0;
    background: none;
    font-family: var(--font-en);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .1em;
    color: var(--line);
    cursor: pointer;
    transition: color .25s var(--ease);
}

.lang-btn:hover { color: var(--ink-soft); }

.lang-sep {
    font-family: var(--font-en);
    font-size: 12px;
    color: var(--line);
}

[data-lang="ja"] .lang-btn[data-set-lang="ja"],
[data-lang="en"] .lang-btn[data-set-lang="en"] {
    color: var(--ink);
    cursor: default;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid var(--line);
}
.skip-link:focus { left: 8px; top: 8px; }

/* =========================================================
   背景キャンバス
   ========================================================= */
/* ---- 文字の周りだけ紙色をにじませて、足跡が字画に入り込むのを防ぎます ----
   全体を暗くするのと違い、足跡の濃さはそのままで文字だけ浮きます。
   不要なら、このブロックごと消してください */
.eyebrow,
.about__name,
.about__role,
.about__statement,
.block__title,
.timeline,
.pub-list,
.meta,
.section__title,
.page-title,
.work__name,
.work__summary,
.work__year {
    text-shadow:
        0 0 3px var(--paper),
        0 0 9px var(--paper);
}

#canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* 背景色は html に持たせています。ここを塗ると軌跡が隠れます */
    background: transparent;
    pointer-events: none;
}

/* ---- 背景に敷く軌跡（JS が3枚だけ選んで置きます） ---- */
.trail-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.trail {
    /* 書き出したときの画面比率のまま、画面いっぱいに敷きます */
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: .2;
}

/* =========================================================
   ナビゲーション（PC：左レール）
   ========================================================= */
.rail {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
    width: var(--rail);
    height: 100vh;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.rail__nav { pointer-events: auto; }

.rail__nav ul {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.rail__link {
    display: inline-block;
    position: relative;
    padding-left: 22px;
    font-family: var(--font-en);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .1em;
    color: var(--ink-soft);
    border-bottom: 0;
    background: none;
}

.rail__link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 12px;
    height: 1px;
    background: currentColor;
    transform-origin: left center;
    transform: scaleX(.5);
    transition: transform .3s var(--ease);
}

.rail__link:hover { color: var(--ink); }
.rail__link:hover::before { transform: scaleX(1); }

.rail__link.is-active { color: var(--ink); }
.rail__link.is-active::before { transform: scaleX(1.6); background: var(--accent); }

/* =========================================================
   レイアウト
   ========================================================= */
.section {
    display: flex;
    align-items: center;
    min-height: 100svh;
    padding: clamp(88px, 12vh, 140px) var(--gutter);
}

.inner {
    width: min(1120px, 100%);
    margin-inline: auto;
}

.eyebrow {
    margin: 0 0 14px;
    font-family: var(--font-en);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.section__title {
    margin-bottom: clamp(28px, 4vw, 48px);
    font-size: clamp(24px, 3.2vw, 34px);
}

/* =========================================================
   About（サイトの入口）
   ========================================================= */
.section--about {
    align-items: flex-start;
    padding-top: clamp(96px, 16vh, 172px);
    padding-bottom: clamp(72px, 10vh, 120px);
}

.section--works {
    align-items: flex-start;
    min-height: auto;
    padding-top: 0;
}

.about { display: block; }

/* 文章とプロフィール写真を横に並べます。
   写真は .inner の右端に寄せて、下の WORKS と同じ幅で終わらせます */
.about__main {
    display: flex;
    align-items: flex-start;
    gap: clamp(28px, 4vw, 60px);
    max-width: none;
}

.about__intro {
    flex: 1 1 auto;
    min-width: 0;
    /* 下の Bio・Achievements と同じ幅にそろえます */
    max-width: none;
}

.about__photo {
    flex: 0 0 auto;
    width: clamp(160px, 19vw, 250px);
    /* 「ABOUT」の行ぶん下げて、写真の上端を名前とそろえます */
    margin: 34px 0 0;
    margin-left: auto;
}

.about__photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 0;
    background: #e6e6e6;
}

.about__detail {
    max-width: none;
    margin-top: clamp(48px, 7vw, 88px);
}

/* ---- 広い画面では、下段の4ブロックを2列に振り分けます ----
   氏名・ステートメントは上に置いたまま、Bio 以下だけを横に広げる形です。
   1列に戻したいときは、この @media ごと消してください */


/* 欧文表示の氏名。和文と見た目の大きさがそろうよう、以前より控えめです */
.about__name {
    margin-bottom: 18px;
    font-size: clamp(30px, 4.2vw, 46px);
    font-weight: 500;
    line-height: 1.25;
}

/* 和文は字面が枠いっぱいなので、同じ級数だと欧文より大きく見えます。
   太さも 500 → 400 に落として、添えるローマ字との差を詰めています */
[data-lang="ja"] .about__name {
    font-size: clamp(24px, 2.9vw, 31px);
    font-weight: 400;
    letter-spacing: .08em;
}

/* ローマ字は改行せず、氏名の右にベースラインをそろえて添えます */
.about__name-en {
    display: inline-block;
    margin-left: .9em;
    font-family: var(--font-en);
    font-size: .44em;
    font-weight: 500;
    letter-spacing: .14em;
    color: var(--ink-soft);
    vertical-align: baseline;
}

/* 和文の氏名を小さくしたぶん、ローマ字の比率を上げて対等に近づけます */
[data-lang="ja"] .about__name-en {
    margin-left: 1em;
    font-size: .58em;
}

.about__role {
    margin-bottom: 26px;
    padding-bottom: 1.1em;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-en);
    font-size: clamp(14px, 1.6vw, 17px);
    font-weight: 500;
    letter-spacing: .04em;
    color: var(--ink-soft);
}

.about__statement {
    margin-bottom: 0;
    font-size: clamp(14px, 1.5vw, 16px);
    line-height: 2.1;
}

.meta {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px 24px;
    margin: 32px 0 0;
    font-size: 14px;
}

.meta dt {
    font-family: var(--font-en);
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--ink-soft);
    white-space: nowrap;
}

.meta dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ---- About 右側のブロック ---- */
.block { margin-bottom: clamp(34px, 4vw, 52px); }
.block:last-child { margin-bottom: 0; }

.block__title {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-en);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

/* 年表（Bio / Achievements） */
.timeline {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 12px 28px;
    margin: 0;
    font-size: 14px;
}

.timeline dt {
    font-family: var(--font-en);
    font-weight: 500;
    letter-spacing: .06em;
    color: var(--ink-soft);
    white-space: nowrap;
    line-height: 1.9;
}

.timeline dd {
    margin: 0;
    line-height: 1.9;
}

.timeline__sub {
    display: inline-block;
    margin-top: 2px;
    font-size: 13px;
    color: var(--ink-soft);
}

/* 論文リスト */
.pub-list {
    display: grid;
    gap: 18px;
    font-size: 14px;
}

.pub-list li { line-height: 1.9; }

.pub-list a {
    border-bottom-color: var(--line);
}

.pub-list__source {
    display: block;
    margin-top: 4px;
    font-family: var(--font-en);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

/* =========================================================
   作品一覧
   ========================================================= */
.works-grid {
    display: grid;
    /* 列数を固定するので、作品が1件でも4件並んだときと同じ大きさになります */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(22px, 3vw, 40px);
}

@media (max-width: 1180px) {
    .works-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
    .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.work {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.work__thumb {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: #ddd;
    background-size: cover;
    background-position: center;
    transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}

.work:hover .work__thumb,
.work:focus-visible .work__thumb {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .16);
}

.work__tags {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px;
    font-size: 14px;
    color: #fff;
    text-align: center;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    transition: opacity .3s var(--ease);
}

.work:hover .work__tags,
.work:focus-visible .work__tags { opacity: 1; }

/* 写真がない作品のカード */
.work__thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background-color: rgba(255, 255, 255, .45);
}

.work__mark {
    font-family: var(--font-en);
    font-size: 26px;
    font-weight: 500;
    color: var(--ink-soft);
}

/* 外部サイトへ飛ぶカード */
.work--link { border-bottom: 0; }

.work__name {
    display: block;
    margin-top: 14px;
    font-family: var(--font-en);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .06em;
}

.work__year {
    display: block;
    margin-top: 2px;
    font-family: var(--font-en);
    font-size: 12px;
    letter-spacing: .1em;
    color: var(--ink-soft);
}

.work__summary {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--ink-soft);
}

/* タッチ端末はホバーが無いのでタグを常時表示 */
@media (hover: none) {
    .work__tags {
        opacity: 1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-end;
        justify-content: flex-start;
        gap: 4px 10px;
        font-size: 12px;
        background: linear-gradient(to top, rgba(0, 0, 0, .62) 0%, rgba(0, 0, 0, 0) 45%);
    }
}



/* ---- セクション見出し行 ---- */
.section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.section__head .section__title { margin-bottom: clamp(28px, 4vw, 48px); }

.link-more {
    margin-bottom: clamp(28px, 4vw, 48px);
    font-family: var(--font-en);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .08em;
    white-space: nowrap;
    border-bottom-color: var(--ink);
}

.link-more::after { content: " \2192"; }
.link-more:hover { color: var(--accent); border-color: var(--accent); }

/* ---- Works ページ ---- */
.section--page-head {
    min-height: auto;
    align-items: flex-end;
    padding-top: clamp(96px, 16vh, 180px);
    padding-bottom: clamp(24px, 4vh, 48px);
}

.page-title {
    margin-bottom: 20px;
    font-size: clamp(30px, 5vw, 52px);
}

.page-lead {
    max-width: 46em;
    margin-bottom: 28px;
    color: var(--ink-soft);
}

.cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cat-nav__link {
    padding: 7px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    line-height: 1.6;
}

.cat-nav__link:hover { border-color: var(--accent); color: var(--ink); }

.section--cat {
    min-height: auto;
    align-items: flex-start;
    padding-top: clamp(32px, 5vh, 56px);
    padding-bottom: clamp(32px, 5vh, 56px);
}

.cat__head { margin-bottom: clamp(24px, 3.5vw, 40px); }
.cat__head .section__title { margin-bottom: 10px; }

.cat__note {
    max-width: 42em;
    margin: 0;
    font-size: 14px;
    color: var(--ink-soft);
}

.modal__year {
    margin: -18px 0 22px;
    font-family: var(--font-en);
    font-size: 13px;
    letter-spacing: .12em;
    color: rgba(255, 255, 255, .7);
}

/* ---- モーダル：基本情報 ---- */
.detail {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px 24px;
    margin: 0 0 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, .22);
    font-size: 13px;
}

/* ラベルと値でフォントサイズが違うため、行の高さは倍率ではなく
   固定値でそろえます。こうすると1行目の中心位置が一致します */
.detail dt,
.detail dd {
    line-height: 26px;
}

.detail dt {
    font-family: var(--font-en);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .6);
    white-space: nowrap;
}

.detail dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ---- モーダル：本文ブロック ---- */
.modal-block { margin-bottom: 34px; }
.modal-block:last-child { margin-bottom: 0; }

.modal-block__title {
    margin-bottom: 14px;
    font-family: var(--font-en);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .6);
}

.modal-block p { margin-bottom: 1.2em; }
.modal-block p:last-child { margin-bottom: 0; }

.modal-block p.is-en {
    font-size: 13px;
    line-height: 1.9;
    color: rgba(255, 255, 255, .72);
}

/* 英文は見出しを置かず、区切り線だけで分ける */
.modal-block--en {
    margin-top: -12px;
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, .2);
}

.link-list {
    display: grid;
    gap: 8px;
    font-size: 13px;
}

/* URL をそのまま出すので、長くても折り返す */
.link-list a {
    overflow-wrap: anywhere;
    line-height: 1.8;
}

.footer a { border-bottom-color: transparent; }
.footer a:hover { border-bottom-color: currentColor; }

/* =========================================================
   フッター
   ========================================================= */
.footer {
    padding: 40px var(--gutter) 56px;
    font-family: var(--font-en);
    font-size: 12px;
    letter-spacing: .1em;
    color: var(--ink-soft);
    text-align: center;
}

.footer p { margin: 0; }

/* =========================================================
   モーダル
   ========================================================= */
.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 48px);
    background: var(--overlay);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    transition: opacity .3s var(--ease);
}

.modal[hidden] { display: none; }
.modal.is-open { opacity: 1; }

.modal__panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(32px, 5vw, 56px);
    align-items: start;
    width: min(1120px, 100%);
    margin: auto;
    padding-top: 52px;
    color: #fff;
}

/* 文章 → 写真・動画 の順に並べる。文章の幅は写真とそろえる */
.modal__body { order: 1; }
.modal__gallery { order: 2; }

.modal__close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 6px 2px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .5);
    background: none;
    font-family: var(--font-en);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .08em;
    color: #fff;
    cursor: pointer;
    transition: color .25s var(--ease), border-color .25s var(--ease);
}

.modal__close:hover { color: var(--accent); border-color: var(--accent); }

/* ---- モーダルのギャラリー（複数枚対応） ---- */
.modal__gallery {
    display: grid;
    gap: 18px;
}

.gallery__item { margin: 0; }

.gallery__item img {
    display: block;
    width: 100%;
    height: auto;
    /*border-radius: var(--radius-lg);*/
    background: #222;
}

.gallery__video iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--radius-lg);
    background: #000;
}

.gallery__video figcaption a {
    color: rgba(255, 255, 255, .68);
    border-bottom-color: rgba(255, 255, 255, .3);
}

.gallery__video figcaption a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.gallery__item figcaption {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.8;
    color: rgba(255, 255, 255, .68);
}

.modal__title {
    margin-bottom: 28px;
    font-size: clamp(26px, 3.6vw, 38px);
}

.modal__body { font-size: 15px; }
.modal__body a { color: #fff; border-bottom-color: rgba(255, 255, 255, .5); }
.modal__body a:hover { color: var(--accent); border-color: var(--accent); }

.meta--light { border-top: 1px solid rgba(255, 255, 255, .25); padding-top: 24px; }
.meta--light dt { color: rgba(255, 255, 255, .7); }

/* =========================================================
   レスポンシブ
   ========================================================= */
@media (max-width: 900px) {
    .modal__panel { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
    :root { --rail: 0px; }

    body { padding-left: 0; padding-bottom: 86px; }

    /* ナビは下部のバーへ */
    .rail {
        top: auto;
        bottom: 0;
        width: 100%;
        height: auto;
        padding: 10px var(--gutter) max(10px, env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .92);
        backdrop-filter: blur(8px);
        border-top: 1px solid var(--line);
    }

    .rail__nav { width: 100%; }

    .rail__nav ul {
        flex-direction: row;
        justify-content: space-between;
        gap: 4px;
    }

    .rail__link { padding: 6px 4px 6px 0; font-size: 13px; }
    .rail__lang { margin-top: 0; padding: 6px 0; }
    .rail__link::before { display: none; }
    .rail__link.is-active { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }

    .section {
        align-items: flex-start;
        min-height: auto;
        padding: clamp(64px, 12vh, 96px) var(--gutter);
    }

    .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* 写真は名前の上へ。小さめに置いて、文章の幅は画面いっぱいに使います */
    .about__main { flex-direction: column; }
    .about__intro { max-width: none; }
    .about__photo {
        order: -1;
        width: 140px;
        margin: 0 0 22px;
    }

    /* 幅が足りず中途半端に折り返すので、ローマ字は名前の下に置きます */
    .about__name-en {
        display: block;
        margin-left: 0;
        margin-top: 8px;
        font-size: .5em;
    }

    .meta { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .meta dd { margin-bottom: 14px; }

    .timeline { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .timeline dt { margin-top: 12px; }
    .timeline dt:first-child { margin-top: 0; }

    .detail { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .detail dt,
    .detail dd { line-height: 1.8; }
    .detail dt { margin-top: 12px; }
    .detail dt:first-child { margin-top: 0; }
}

@media (max-width: 420px) {
    .works-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

/* =========================================================
   アクセシビリティ
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}