/* =========================
   1. ページ全体
========================= */

* {
    box-sizing: border-box;
}

:root {
    --color-food: #e6c84f;
    --color-design: #40577a;
    --color-art: #d95c72;
    --color-research: #668c68;
}

body {
    margin: 0;
    padding: 48px;
    background-color: #ffffff;
    color: #555555;
}

main {
    padding-bottom: 50vh;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 1px solid #999999;
    outline-offset: 2px;
}


/* =========================
   2. ヘッダー
========================= */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    display: flex;
    flex-direction: column;
    width: fit-content;
    margin: 0;

    color: #555555;
    text-decoration: none;

    font-family: "Source Serif 4", serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.05;
}


/* =========================
   3. ハンバーガーメニューボタン
========================= */

.menu-button {
    position: fixed;
    top: 48px;
    right: 48px;
    z-index: 2;
    width: 32px;
    padding: 0;
    border: 0;
    background: none;
}

.menu-button span {
    display: block;
    height: 1px;
    margin-bottom: 6px;
    background-color: #000000;
}

.menu-button.is-open span:first-child {
    transform: translateY(7px) rotate(45deg);
}

.menu-button.is-open span:nth-child(2) {
    opacity: 0;
}

.menu-button.is-open span:last-child {
    transform: translateY(-7px) rotate(-45deg);
}


/* =========================
   4. HOME
========================= */

.home-page {
    padding-top: 0;
}


/* ---------- Card layout ---------- */

.home-card {
    position: relative;

    width: min(100%, 910px);
    aspect-ratio: 91 / 55;
}


/* ---------- Site title ---------- */

.home-card .site-title {
    position: absolute;
    top: 0;
    left: 0;

    display: flex;
    flex-direction: column;

    color: #555555;
    text-decoration: none;

    font-family: "Source Serif 4", serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.05;
}


/* ---------- Card faces ---------- */

.card-face {
    position: absolute;

    /* 実物名刺の情報配置を参考にした位置 */
    top: 35%;
    left: 0;

    width: 100%;

    color: #555555;
}

.card-face-ja {
    display: none;
}


/* ---------- Role ---------- */

.home-role {
    margin: 0 0 10px 0;

    font-family: "Source Serif 4", serif;
    font-size: 18px;
    font-weight: 400;
}


/* ---------- Name ---------- */

.card-face h1 {
    margin: 0 0 10px 0;

    font-family: "Source Serif 4", serif;
    font-size: 46px;
    font-weight: 600;
    line-height: 1.05;
}

.card-face-ja h1 {
    font-family: "dnp-shuei-mincho-pr6n", serif;
    font-size: 42px;
    font-weight: 500;
}

.card-face-ja .home-role,
.card-face-ja .home-projects-link {
    font-family: "source-han-serif-jp-subset", serif;
    font-weight: 400;
}


/* ---------- Projects ---------- */

.home-projects-link {
    display: inline-flex;
    gap: 0.35em;

    color: #555555;
    text-decoration: none;

    font-family: "Source Serif 4", serif;
    font-size: 18px;
    font-weight: 400;
}

.home-category {
    transition: color 0.2s ease;
}

.home-category.food:hover {
    color: var(--color-food);
}

.home-category.design:hover {
    color: var(--color-design);
}

.home-category.art:hover {
    color: var(--color-art);
}

.home-category.research:hover {
    color: var(--color-research);
}

/* ---------- Page turn ---------- */

.card-page-turn {
    position: absolute;

    right: 0;
    bottom: 0;

    width: calc(100% + 48px);
    height: calc(100% + 48px);

    background: #ffffff;

    transform-origin: right bottom;
    transform: scale(0);

    pointer-events: none;
    z-index: 1;
}

.card-page-turn.is-turning {
    animation: page-turn 2s cubic-bezier(0.45, 0, 0.55, 1);
}

@keyframes page-turn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1);
    }

    100% {
        transform: scale(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .card-page-turn.is-turning {
        animation-duration: 0.01ms;
    }
}


/* ---------- Flip button ---------- */

.card-flip-button {
    position: absolute;

    right: 2%;
    bottom: 6%;

    width: 44px;
    height: 44px;
    padding: 0;

    border: none;
    background: transparent;

    cursor: pointer;
}

.card-flip-button span {
    position: absolute;
    right: 0;
    bottom: 0;

    width: 20px;
    height: 20px;

    background: #555555;

    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}


/* =========================
   5. ナビゲーション
========================= */

nav {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1;
}

nav.is-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;

    width: max(320px, 30vw);
    height: 100vh;
    padding: 120px 48px 48px;
    background-color: #ffffff;
    border-left: 1px solid #e5e5e5;
}

nav a {
    font-family: "Source Serif 4", serif;
    font-size: 18px;
    font-weight: 400;
    color: #555555;
    text-decoration: none;
}

nav a:hover,
nav a:focus-visible {
    opacity: 0.5;
}

/* =========================
   6. PROJECT詳細
========================= */

.project-detail {
    display: flex;
    gap: 40px;
}

.project-info {
    flex: 25;
    padding-top: 40px;
}

/* PROJECT基本情報 */

.project-info {
    color: #555555;
}

/* CATEGORY */
.project-info .categories {
    margin: 0 0 4px 0;

    font-family: "Source Serif 4", serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.2;
}

/* PROJECT名 */
.project-info h1 {
    margin: 0 0 4px 0;

    font-family: "dnp-shuei-mincho-pr6n", serif;
    font-size: 42px;
    font-weight: 500;
    line-height: 1.05;
}

/* PROJECT英字名 */
.project-info .intro {
    margin: 0 0 48px 0;

    font-family: "Source Serif 4", serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.2;
}

.project-gallery {
    flex: 75;
    display: flex;
    gap: 6px;
    padding-top: 40px;
}

.gallery-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.project-gallery img {
    display: block;
    width: 100%;
    height: auto;
}

/* ギャラリー画像のボタン */
.gallery-image-button {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: zoom-in;
    text-align: left;
}

/* キーボードで選択したときの枠 */
.gallery-image-button:focus-visible {
    outline: 2px solid #555;
    outline-offset: 4px;
}

.project-detail-item summary {
    display: grid;
    grid-template-columns: 270px 18px;
    align-items: center;
    column-gap: 8px;
    width: fit-content;

    cursor: pointer;
    list-style: none;

    font-family: "dnp-shuei-mincho-pr6n", serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    color: #555555;
}

.project-detail-item summary::after {
    content: "+";
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
}

.project-detail-item[open] summary::after {
    content: "×";
}

.project-detail-item p {
    margin: 12px 0 0 0;

    font-family: "source-han-serif-japanese", serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.8;
    color: #555555;
}

.project-detail-item {
    margin-bottom: 12px;
}

.project-title-en {
    margin-bottom: 40px;
}

/* =========================
   IMAGE LIGHTBOX
   写真の拡大表示
========================= */

/* 拡大表示するウィンドウ */
.image-lightbox {
    position: fixed;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: auto;
    padding: 24px;
    border: none;
    background: transparent;
}

.image-lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 背景の半透明ブラック */
.image-lightbox::backdrop {
    background: rgba(255, 255, 255, 0.70);
}

/* 拡大画像 */
.lightbox-image {
    display: block;
    width: 60vw;
    height: auto;
    max-height: calc(100dvh - 48px);
    object-fit: contain;
}

/* 閉じるボタン */
.lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    z-index: 1;

    padding: 8px;
    border: none;
    background: transparent;

    color: #555555;
    font-size: 32px;
    line-height: 1;

    cursor: pointer;
}

.lightbox-close:focus:not(:focus-visible) {
    outline: none;
}

/* 一覧の写真がクリック可能だと伝える */
.project-gallery img {
    cursor: zoom-in;
}



/* =========================
   7. PROJECTS一覧
========================= */

.projects-page {
    padding-top: 40px;
}

.projects-page > h1 {
    margin: 0 0 24px 0;

    font-family: "Source Serif 4", serif;
    font-size: 46px;
    font-weight: 600;
    line-height: 1.05;

    color: #555555;
}

/* ---------- 共通 ---------- */

.project-grid {
    display: block;
    min-height: 100vh;
}

.project-icon {
    position: relative;

    width: 64px;
    aspect-ratio: 1 / 1;

    transition: transform 0.2s ease;
}

/* カテゴリー色のぼかし：奥 */
.project-icon::before {
    content: "";
    position: absolute;

    top: 50%;
    left: 50%;

    width: 90%;
    height: 90%;

    background-color: var(--project-color);
    border-radius: 50%;

    opacity: 0;
    filter: blur(10px);

    transform: translate(-50%, -50%) scale(0.7);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

/* 仮アイコン：手前 */
.project-icon::after {
    content: "";
    position: absolute;
    inset: 0;

    background-color: #f2f2f2;
}

.project a:hover .project-icon::before,
.project a:focus-visible .project-icon::before {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1.3);
}

.project[data-category="food"] {
    --project-color: var(--color-food);
}

.project[data-category="design"] {
    --project-color: var(--color-design);
}

.project[data-category="art"] {
    --project-color: var(--color-art);
}

.project[data-category="research"] {
    --project-color: var(--color-research);
}

.project a:hover .project-icon,
.project a:focus-visible .project-icon {
    transform: scale(1.15);
}

.project a {
    color: #000000;
    text-decoration: none;
}

.project h3 {
    position: relative;
    z-index: 0;

    margin: 0;
    font-family: "Source Serif 4", "source-han-serif-jp-subset", serif;
    font-size: 16px;
    font-weight: 400;
    color: #555555;

    opacity: 0;
    transition: opacity 0.2s ease;
}


.project a:hover h3,
.project a:focus-visible h3 {
    opacity: 1;
}



/* ---------- CATEGORY / TIMELINE 切り替え ---------- */

.view-switch {
    display: flex;
    gap: 24px;
}

.view-button {
    padding: 0;
    border: 0;
    background: none;

    font-family: "Source Serif 4", serif;
    font-size: 18px;
    font-weight: 400;
    color: #999999;

    cursor: pointer;
}

.view-button.is-active {
    font-weight: 600;
    color: #555555;
}

.view-button.is-active {
    font-weight: 600;
}


/* ---------- CATEGORY表示 ---------- */

.category-layout {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.category-group {
    margin-top: 64px;
}

.category-group h2 {
    margin: 0 0 24px 0;
    font-family: "Source Serif 4", serif;
    font-size: 16px;
    font-weight: 600;
    color: #555555;
}

.category-projects {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.category-projects .project a {
    display: flex;
    align-items: center;
    gap: 16px;
}

.category-projects .project h3 {
    margin: 0;
}


/* ---------- TIMELINE表示 ---------- */

.timeline-view {
    display: block;
    margin-top: 64px;
}

/* 4年分だけが見える「窓」 */
.timeline-window {
    width: calc(100% + 96px);
    margin-left: -48px;
    padding-left: 48px;
    padding-right: 48px;

    overflow: hidden;
}

/* 全ての年を横一列に並べる「レール」 */
.timeline-track {
    display: flex;
    gap: 24px;

    transition: transform 0.6s ease;
}

/* 1年 = 画面幅の4分の1 */
.timeline-year-group {
    flex: 0 0 calc((100% - 72px) / 4);
    min-width: 0;
}

.timeline-year {
    margin: 0;

    font-family: "Source Serif 4", serif;
    font-size: 16px;
    font-weight: 600;
    color: #555555;
}

.timeline-year-projects {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;

    padding-top: 24px;
}

.timeline-view .project {
    margin: 0;
}

.timeline-view .project a {
    display: flex;
    align-items: center;
    gap: 16px;
}

.timeline-view .project-icon {
    width: 64px;
    flex-shrink: 0;
}

.timeline-view .project-date {
    display: none;
}

.timeline-navigation {
    display: flex;
    justify-content: center;
    align-items: center;

    margin-top: 24px;
}

.timeline-arrow {
    width: 44px;
    height: 44px;
    padding: 0;

    border: none;
    background: transparent;

    font-family: "Source Serif 4", serif;
    font-size: 20px;
    font-weight: 400;
    color: #555555;

    cursor: pointer;
}

.timeline-arrow:disabled {
    color: #cccccc;
    cursor: default;
}


/* =========================
   8. ABOUT
========================= */

.about-page {
    width: calc(100% - max(320px, 30vw) - 48px);
    padding-top: 40px;
}

.about-intro > h1 {
    margin: 0 0 10px 0;

    font-family: "Source Serif 4", serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.2;

    color: #555555;
}

.about-section {
    margin-top: 24px;
}

.about-hero {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
    align-items: start;
}

.about-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;

    background-color: #f5f5f5;
    color: #999999;
}

.about-basic {
    margin-bottom: 0;
}

.about-name {
    margin: 0 0 4px 0;

    font-family: "dnp-shuei-mincho-pr6n", serif;
    font-size: 42px;
    font-weight: 500;
    line-height: 1.05;

    color: #555555;
}

.about-name-mobile {
    display: none;
}

.about-basic p:not(.about-name) {
    margin: 0 0 4px 0;
    font-size: 16px;
}

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

.about-detail[open] {
    margin-bottom: 32px;
}


/* ---------- PROFILE ---------- */

.about-detail summary {
    display: grid;
    grid-template-columns: 140px 18px;
    align-items: center;
    column-gap: 8px;
    width: fit-content;

    cursor: pointer;
    list-style: none;

    font-size: 16px;
    line-height: 1.5;
    color: #555555;
    font-family: "Source Serif 4", serif;
}

.about-detail summary::after {
    content: "+";

    font-size: 18px;
    font-weight: 400;
    line-height: 1;
}

.about-detail[open] summary::after {
    content: "×";
}

.profile-text {
    width: 100%;
    max-width: none;
    margin-top: 12px;
}

.profile-text p {
    margin: 0 0 16px 0;

    font-family: "source-han-serif-jp-subset", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;
}

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


/* ---------- CAREER / BIOGRAPHY ---------- */

.career-list,
.biography-list {
    margin-top: 24px;
}

.career-item,
.biography-item {
    display: grid;
    grid-template-columns: 160px 1fr;
    column-gap: 24px;
}

.career-item p,
.biography-item p {
    margin: 0 0 8px 0;

    font-family: "source-han-serif-jp-subset", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;
}

.career-date,
.biography-date {
    font-family: "Source Serif 4", serif;
}

/* ---------- SNS ---------- */

.sns-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;

    margin-top: 24px;
}

.sns-list a {
    font-size: 14px;
    color: #555555;
    text-decoration: none;
}


/* =========================
   9. CONTACT
========================= */

.contact-page {
    padding-top: 40px;
}

.contact-page > h1 {
    margin: 0 0 40px 0;

    font-family: "Source Serif 4", serif;
    font-size: 46px;
    font-weight: 600;
    line-height: 1.05;

    color: #555555;
}

.contact-form {
    max-width: 700px;
}


/* ---------- Form fields ---------- */

.form-field {
    margin-bottom: 32px;
}

.form-field label {
    display: block;
    margin-bottom: 8px;

    font-family: "Source Serif 4", serif;
    font-size: 14px;
    font-weight: 400;
}

.form-field input,
.form-field textarea {
    display: block;
    width: 100%;
    padding: 4px 0;

    border: none;
    border-bottom: 1px solid #000000;
    border-radius: 0;
    outline: none;

    background: transparent;
    color: #555555;

    font-family: "Source Serif 4", "source-han-serif-jp-subset", serif;
    font-size: 16px;

}

.form-field textarea {
    min-height: 72px;
    resize: vertical;
}


/* ---------- Message counter ---------- */

.message-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.message-label label {
    margin-bottom: 0;
}

#message-count {
    font-family: "Source Serif 4", serif;
    font-size: 12px;
    font-weight: 400;
}


/* ---------- Actions ---------- */

.contact-form button,
.contact-home-link {
    font-family: "Source Serif 4", serif;
    font-size: 14px;
    font-weight: 400;

    transition:
        font-size 0.2s ease,
        font-weight 0.2s ease;
}

.contact-form button:hover,
.contact-form button:focus-visible,
.contact-home-link:hover,
.contact-home-link:focus-visible {
    font-size: 16px;
    font-weight: 600;
}


/* ---------- Send button ---------- */

.contact-form button {
    display: block;
    margin-left: auto;
    padding: 8px 0;

    border: none;
    background: transparent;

    color: #000000;
    cursor: pointer;
}


/* ---------- Thank you ---------- */

.contact-home-link {
    display: block;
    width: fit-content;
    margin-top: 32px;

    color: #555555;
    text-decoration: none;
}


/* =========================
   11. Responsive
========================= */

@media (max-width: 900px) {

    body {
        padding: 32px;
    }

    .menu-button {
        top: 32px;
        right: 32px;
    }

    .home-card {
        width: 100%;
        aspect-ratio: 55 / 91;
        height: auto;
    }

    .card-face h1 {
        font-size: 36px;
    }

    .card-face-ja h1 {
        font-size: 34px;
    }

    .home-role,
    .home-projects-link {
        font-size: 14px;
    }

    .card-flip-button {
        right: 6%;
        bottom: 10%;
    }

    /* CONTACT */
    .contact-page > h1 {
        margin-bottom: 24px;
        font-size: 34px;
    }

    .form-field {
        margin-bottom: 24px;
    }

    .form-field input {
        height: 24px;
    }

    .form-field textarea {
        min-height: 96px;
    }

    /* PROJECTS */
    .projects-page > h1 {
        font-size: 34px;
    }

    /* CATEGORY：縦1列 */
    .category-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* CATEGORY / YEAR 共通のグループ間隔 */
    .category-group {
        margin-top: 32px;
    }

    .category-group + .category-group {
        margin-top: 32px;
    }

    /* 見出し → 最初のPROJECT */
    .category-group h2 {
        margin-bottom: 24px;
    }

    /* PROJECT共通 */
    .project-icon,
    .timeline-view .project-icon {
        width: 48px;
    }

    /* CATEGORY内のPROJECT */
    .category-projects {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .category-projects .project a {
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }

    .category-layout .category-projects .project h3 {
        display: block;
        opacity: 1;
    }


    /* TIMELINE */

    .timeline-view {
        margin-top: 32px;
    }

    .timeline-window {
        width: 100%;
        margin-left: 0;
        padding-left: 0;
        padding-right: 0;
        overflow: visible;
    }

    .timeline-track {
        flex-direction: column-reverse;
        gap: 32px;
        transform: none !important;
    }

    .timeline-year-group {
        flex: none;
        width: 100%;
    }

    /* 年 → 最初のPROJECT */
    .timeline-year-projects {
        gap: 16px;
        padding-top: 24px;
    }

    /* TIMELINE内のPROJECT */
    .timeline-view .project a {
        gap: 16px;
    }

    .timeline-view .project h3 {
        display: block;
        opacity: 1;
    }

    /* PROJECT詳細 */

    .project-detail {
        flex-direction: column;
        gap: 24px;
    }

    .project-info {
        flex: none;
        width: 100%;
    }

    .project-info h1 {
        font-size: 34px;
    }

    .project-info .categories,
    .project-info .intro {
        font-size: 14px;
    }

    .project-info .intro {
        margin-bottom: 24px;
    }

    .project-gallery {
        flex: none;
        width: 100%;
        padding-top: 0;
    }

    /* ABOUT */

    .about-page {
        width: 100%;
    }

    .about-hero {
        grid-template-columns: 1fr 30%;
        gap: 24px;
        align-items: stretch;
    }

    .about-photo {
        height: auto;
        align-self: stretch;
    }

    .about-name {
        font-size: 34px;
    }

    .about-basic p:not(.about-name) {
        font-size: 14px;
        line-height: 1.2;
        margin-bottom: 0;
    }

    .about-name-pc {
        display: none;
    }

    .about-name-mobile {
        display: block;
    }

    .about-hero + .about-section {
        margin-top: 24px;
    }

    .about-section + .about-section {
        margin-top: 12px;
    }

    .career-item,
    .biography-item {
        grid-template-columns: 140px 1fr;
        column-gap: 16px;
    }

}

/* ABOUT：タブレット表示 */
@media (min-width: 901px) and (max-width: 1100px) {
    .about-page {
        width: 100%;
        max-width: 100%;
    }

    .about-hero {
        grid-template-columns: minmax(0, 1fr) 30%;
        gap: 24px;
    }

    .about-name-pc {
        display: none;
    }

    .about-name-mobile {
        display: block;
    }

    .contact-page {
        min-height: 110vh;
    }
}

