/* =========================
BASE
========================= */

:root {
    --text: #656565;
    --heading: #897193;
    --accent: #ca7ee7;
    --accent-strong: #b27ad8;
    --nav-active: #b06de0;
    --logo: #e98fab;
    --bg-white: #fafafa;
    --grad-from: #eac7f9;
    --grad-to: #f9cef1;
    --header-h: 72px;
    color-scheme: light;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}

body {
    color: var(--text);
    background-color: var(--bg-white);
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

a {
    color: var(--text);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

h2 {
    color: var(--heading);
    font-size: 42px;
    line-height: 1.2;
    letter-spacing: 0.04em;
    margin-bottom: 40px;
}

.bg-white {
    background-color: var(--bg-white);
}

.bg-color {
    background-image: linear-gradient(135deg, var(--grad-from) 0%, var(--grad-to) 100%);
}

.is-sp {
    display: none;
}

/* =========================
LOADING
========================= */

.loading {
    position: fixed;
    inset: 0;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity .6s ease, visibility .6s ease;
}

.loading img {
    width: min(30%, 320px);
}

.loading.fadeout {
    opacity: 0;
    visibility: hidden;
}

/* JSが動かない環境ではローディングを出さない */
html:not(.js) .loading {
    display: none;
}

/* =========================
HEADER
========================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    background-color: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-sizing: border-box;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    line-height: 1.3;
}

.logo a {
    color: var(--logo);
    text-decoration: none;
}

.nav-list {
    display: flex;
    gap: 20px;
}

.nav-list a {
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 0.05em;
    transition: color .3s;
}

.nav-list a:hover,
.nav-list a.active {
    color: var(--nav-active);
}

/* =========================
PANEL（各セクション共通）
========================= */

.panel {
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 120px 40px 100px;
    box-sizing: border-box;
}

/* フェードイン演出：JSが有効なときだけ、まだ画面に入っていないセクションに適用 */
.js .panel.is-hidden {
    opacity: 0;
    translate: 0 40px;
}

.js .panel {
    transition: opacity .6s ease, translate .6s ease;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .js .panel.is-hidden {
        opacity: 1;
        translate: none;
    }
}

/* =========================
ABOUT
========================= */

.panel.about {
    background-color: var(--grad-from);
    background-image: url(../img/PC_bg.webp);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.about h2 {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 80px;
    line-height: 1;
}

.about h2 .main {
    padding: 4px 30px;
    background-color: #fff;
}

.about h2 .sub {
    font-size: 25px;
}

.about-inner {
    width: 100%;
    max-width: 1200px;
}

.about-text p {
    font-size: 16px;
    margin-bottom: 1.2em;
}

.about-text .lead {
    color: var(--accent);
    font-size: 25px;
    font-weight: bold;
    line-height: 1.5;
}

.mdl-btn {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 10px 60px;
    border-radius: 50px;
    color: var(--text);
    font-size: 20px;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--accent);
    cursor: pointer;
    transition: background-color .2s ease;
}

.mdl-btn:hover {
    background-color: rgba(255, 255, 255, 0.85);
}

/* =========================
PROFILE
========================= */

.profile-inner {
    width: 100%;
    max-width: 1100px;
    display: flex;
    align-items: center;
    gap: 60px;
}

.profile-img {
    flex: 1;
}

.profile-img img {
    width: 100%;
    display: block;
    border-radius: 12px;
}

.profile-text {
    flex: 1;
}

.profile-text h2 {
    margin-bottom: 30px;
}

.profile-list {
    display: grid;
    gap: 14px;
}

.profile-list div {
    display: flex;
}

.profile-list dt::after {
    content: "：";
}

/* =========================
WORKS
========================= */

.works-list {
    width: 100%;
    max-width: 800px;
    padding: 10px 30px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-sizing: border-box;
}

.works-list li {
    display: flex;
    align-items: baseline;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(137, 113, 147, 0.15);
}

.works-list li:last-child {
    border-bottom: none;
}

.works-date {
    flex: 0 0 90px;
    color: var(--heading);
    font-variant-numeric: tabular-nums;
}

.works-list a {
    text-decoration: none;
    transition: color .2s;
}

.works-list a:hover {
    color: var(--accent-strong);
    text-decoration: underline;
}

/* =========================
GALLERY
========================= */

.gallery h2 {
    margin-bottom: 8px;
}

.gallery-hint {
    font-size: 13px;
    margin-bottom: 30px;
}

.gallery-grid {
    width: 100%;
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    cursor: grab;
    user-select: none;
    scrollbar-width: none;
}

.gallery-grid::-webkit-scrollbar {
    display: none;
}

.gallery-grid.dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}

.gallery-grid li {
    flex: 0 0 auto;
    scroll-snap-align: center;
}

.gallery-item {
    display: block;
    width: 320px;
    height: 480px;
    padding: 0;
    border: none;
    background: #eee;
    cursor: pointer;
    overflow: hidden;
    border-radius: 12px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
    -webkit-user-drag: none;
    pointer-events: none;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* =========================
FANTIA
========================= */

.fantia-text {
    text-align: center;
    margin-bottom: 20px;
}

.fantia-widget {
    width: 100%;
    max-width: 700px;
}

.fantia-widget:empty {
    display: none;
}

.fantia .container-title,
.fantia .container-heading {
    display: none;
}

.fantia .fantia-card {
    background-color: transparent;
}

.fantia .card-footer .btn {
    background-color: var(--grad-to) !important;
    color: var(--accent-strong) !important;
    transition: opacity .2s ease;
}

.fantia .card-footer .btn:hover {
    opacity: 0.8;
}

/* =========================
CONTACT / FOOTER
========================= */

.contact-text {
    text-align: center;
}

.contact-sns {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.contact-sns img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.footer {
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    font-size: 13px;
    background-color: var(--bg-white);
}

/* =========================
会社概要モーダル
========================= */

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity .35s ease;
    z-index: 10000;
}

.modal.is-open {
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.modal-content {
    position: relative;
    width: min(700px, 90%);
    max-height: 80vh;
    max-height: 80dvh;
    display: flex;
    background: #fff;
    border-radius: 20px;
    padding: 60px;
    box-sizing: border-box;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .25);
    transform: translateY(40px) scale(.95);
    transition: transform .4s ease;
}

.modal.is-open .modal-content {
    transform: none;
}

.modal-inner {
    width: 100%;
    overflow-y: auto;
}

.modal-x {
    position: absolute;
    top: 16px;
    right: 20px;
    border: none;
    background: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    transition: color .2s;
}

.modal-x:hover {
    color: #000;
}

.modal-content h2 {
    font-size: 32px;
    color: var(--accent-strong);
    margin-bottom: 30px;
}

.company-table {
    width: 100%;
    border-collapse: collapse;
}

.company-table th,
.company-table td {
    padding: 14px 8px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}

.company-table th {
    width: 8em;
    color: var(--heading);
    white-space: nowrap;
}

.company-table td {
    overflow-wrap: anywhere;
}

.company-table .pending {
    color: #b0a4b6;
}

.company-message {
    margin-top: 40px;
    color: var(--accent-strong);
    font-size: 22px;
    font-weight: bold;
    line-height: 1.6;
}

body.modal-open {
    overflow: hidden;
}

/* =========================
画像拡大モーダル
========================= */

.image-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 10001;
}

.image-modal.is-open {
    opacity: 1;
}

.image-modal__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 70px;
    box-sizing: border-box;
}

.image-modal__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 12px;
}

.image-modal__close {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
}

.image-modal__nav {
    position: absolute;
    top: 50%;
    translate: 0 -50%;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

.image-modal__nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.image-modal__nav.prev {
    left: 12px;
}

.image-modal__nav.next {
    right: 12px;
}

/* =========================
SP
========================= */

@media screen and (max-width: 768px) {
    :root {
        --header-h: 96px;
    }

    .is-sp {
        display: block;
    }

    h2 {
        font-size: 32px;
        margin-bottom: 30px;
    }

    .header {
        padding: 12px 16px;
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
        flex-direction: column;
        gap: 6px;
    }

    .logo {
        font-size: 20px;
    }

    .nav-list {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px 12px;
    }

    .nav-list a {
        font-size: 12px;
    }

    .loading img {
        width: 50%;
    }

    .panel {
        padding: 130px 20px 80px;
    }

    /* ABOUT */
    .panel.about {
        background-image: url(../img/SP_bg.webp);
    }

    .about h2 {
        font-size: 50px;
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 24px;
    }

    .about h2 .sub {
        font-size: 20px;
    }

    .about-text p {
        font-size: 15px;
    }

    .about-text .lead {
        font-size: 18px;
    }

    .mdl-btn {
        padding: 10px 30px;
        font-size: 16px;
        gap: 10px;
    }

    /* PROFILE */
    .profile-inner {
        flex-direction: column;
        gap: 30px;
    }

    .profile-text {
        width: 100%;
    }

    .profile-list {
        font-size: 14px;
    }

    /* WORKS */
    .works-list {
        padding: 10px 20px;
    }

    .works-list li {
        flex-direction: column;
        gap: 4px;
    }

    .works-date {
        flex-basis: auto;
    }

    /* GALLERY */
    .gallery-grid {
        gap: 12px;
    }

    .gallery-item {
        width: 70vw;
        height: 105vw;
        border-radius: 8px;
    }

    /* モーダル */
    .modal-content {
        padding: 50px 20px 24px;
    }

    .modal-content h2 {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .company-table th {
        width: 6em;
    }

    .company-message {
        font-size: 17px;
        margin-top: 24px;
    }

    .modal-x {
        top: 10px;
        right: 12px;
    }

    .image-modal__inner {
        padding: 60px 12px;
    }

    .image-modal__nav {
        top: auto;
        bottom: 12px;
        translate: none;
    }
}

/* 横向きスマホ（高さが低い画面） */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .panel {
        min-height: auto;
        padding-top: 110px;
    }

    .gallery-item {
        width: 200px;
        height: 300px;
    }
}

/* =========================
SP SMALL
========================= */

@media screen and (max-width: 480px) {
    .gallery-item {
        width: 78vw;
        height: 117vw;
    }
}
