/* ==============================================
   DESIGN TOKENS
============================================== */
:root {
    --gold:         rgb(216, 175, 48);
    --dark:         rgb(24, 24, 26);
    --dark-2:       rgb(36, 37, 38);
    --white:        #ffffff;
    --off-white:    #f5f3f0;
    --gray:         rgb(153, 151, 166);
    --beige:        rgb(191, 172, 164);
    --light-beige:  rgb(242, 236, 233);

    --font-serif:   'Noto Serif JP', serif;
    --font-sans:    'Inter', sans-serif;

    --transition:      all 0.3s ease;
    --transition-slow: all 0.6s ease;
}

/* ==============================================
   RESET & BASE
============================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--white);
    opacity: 0;
    transition: opacity 0.4s ease;
}

body.loaded { opacity: 1; }

a { text-decoration: none; color: inherit; }
img { display: block; width: 100%; }

/* ==============================================
   UTILITY
============================================== */
.section-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.2rem;
}

/* ==============================================
   BUTTONS
============================================== */
.btn {
    display: inline-block;
    padding: 14px 36px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: 1.5px solid currentColor;
    transition: var(--transition);
    cursor: pointer;
}

.btn--light {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.6);
}
.btn--light:hover {
    background: var(--white);
    color: var(--dark);
    border-color: var(--white);
}

.btn--gold {
    color: var(--gold);
    border-color: var(--gold);
}
.btn--gold:hover {
    background: var(--gold);
    color: var(--dark);
}

.btn--dark {
    color: var(--dark);
    border-color: var(--dark);
}
.btn--dark:hover {
    background: var(--dark);
    color: var(--white);
}

/* ==============================================
   HEADER / NAV
============================================== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 24px 8%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.header.scrolled {
    background: rgba(24, 24, 26, 0.96);
    backdrop-filter: blur(8px);
    padding: 18px 8%;
}

.header.light-section {
    background: rgba(245, 243, 240, 0.97);
    backdrop-filter: blur(8px);
}

.nav-logo a {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--white);
    transition: var(--transition);
}
.header.light-section .nav-logo a { color: var(--dark); }

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links .nav__link {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
    position: relative;
}
.nav-links .nav__link::after {
    content: '';
    position: absolute;
    left: 0; bottom: -3px;
    width: 0; height: 1px;
    background: var(--gold);
    transition: width 0.3s ease;
}
.nav-links .nav__link:hover { color: var(--white); }
.nav-links .nav__link:hover::after { width: 100%; }

.header.light-section .nav-links .nav__link { color: rgba(36, 37, 38, 0.5); }
.header.light-section .nav-links .nav__link:hover { color: var(--dark); }

/* ハンバーガー */
.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav__toggle span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--white);
    transition: var(--transition);
}
.header.light-section .nav__toggle span { background: var(--dark); }

.nav__toggle.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle.active span:nth-child(2) { opacity: 0; }
.nav__toggle.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ==============================================
   HERO
============================================== */
.hero {
    min-height: 100vh;
    background-color: var(--dark);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 8% 7%;
    position: relative;
    overflow: hidden;
}

/* スライドショー背景レイヤー */
.hero__slides {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.hero__slide.active { opacity: 1; }

.hero__slide video,
.hero__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 暗色オーバーレイ（動画・写真を薄暗く） */
.hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    z-index: 1;
}

/* サブトルなゴールドグラデーション */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 20%, rgba(216, 175, 48, 0.06) 0%, transparent 60%);
    pointer-events: none;
    z-index: 2;
}

/* テキストコンテンツラッパー（slides/overlay より上） */
.hero__body {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
}

.hero__label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(16px);
    animation: fadeUp 0.8s ease 0.3s forwards;
}

.hero__name {
    font-family: var(--font-serif);
    font-size: clamp(4.5rem, 11vw, 9.5rem);
    font-weight: 700;
    line-height: 0.88;
    letter-spacing: -0.02em;
    color: var(--white);
    margin-bottom: 2.8rem;
    opacity: 0;
    transform: translateY(24px);
    animation: fadeUp 0.9s ease 0.5s forwards;
}
.hero__name span { display: block; }

.hero__divider {
    width: 60px;
    height: 1.5px;
    background: var(--gold);
    margin-bottom: 2.2rem;
    opacity: 0;
    animation: fadeIn 0.6s ease 0.85s forwards;
}

.hero__tags {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeIn 0.6s ease 1.05s forwards;
}
.hero__tag {
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.42);
    text-transform: uppercase;
}
.hero__tag::before {
    content: '— ';
    color: var(--gold);
}

.hero .btn--light {
    opacity: 0;
    animation: fadeIn 0.6s ease 1.25s forwards;
}

.hero__scroll {
    position: absolute;
    right: 8%;
    bottom: 6%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.22);
    opacity: 0;
    animation: fadeIn 0.6s ease 1.6s forwards;
}
.hero__scroll::after {
    content: '';
    width: 1px;
    height: 52px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.18), transparent);
    display: block;
}

/* ==============================================
   STATS BAR
============================================== */
.stats {
    background: var(--dark-2);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0 8%;
}

.stats__inner {
    display: flex;
    align-items: stretch;
}

.stats__item {
    flex: 1;
    padding: 36px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
}
.stats__item:last-child { border-right: none; }
.stats__item + .stats__item { padding-left: 5%; }

.stats__num {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}

.stats__label {
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.32);
    text-transform: uppercase;
}

/* ==============================================
   SERVICES
============================================== */
.services {
    background: var(--off-white);
    padding: 100px 8%;
}

.services__head { margin-bottom: 60px; }

.services__title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark);
}

.services__list {
    border-top: 1px solid var(--beige);
}

.service-row {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    gap: 0 3rem;
    align-items: center;
    padding: 28px 0;
    border-bottom: 1px solid var(--beige);
    transition: var(--transition);
}
.service-row:hover {
    padding-inline: 2%;
    margin-inline: -2%;
    background: rgba(216, 175, 48, 0.05);
}

.service__num {
    font-family: var(--font-serif);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.05em;
}

.service__name {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.service__desc {
    font-size: 0.82rem;
    color: var(--gray);
    line-height: 1.5;
}

.service__tools {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--beige);
    white-space: nowrap;
    text-align: right;
}

/* ==============================================
   PORTFOLIO
============================================== */
.portfolio {
    background: var(--white);
    padding: 100px 8%;
}

.portfolio__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 60px;
}

.portfolio__section-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--dark);
}

.portfolio__more {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray);
    border-bottom: 1px solid var(--beige);
    padding-bottom: 2px;
    transition: var(--transition);
}
.portfolio__more:hover {
    color: var(--dark);
    border-color: var(--dark);
}

.portfolio__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
}

.portfolio__item {
    position: relative;
    background: var(--dark);
    cursor: pointer;
}
.portfolio__item:first-child {
    grid-column: span 2;
}

/* サムネイル比率コンテナ */
.portfolio__thumb-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.portfolio__bg {
    position: absolute;
    inset: 0;
    transition: transform 0.6s ease;
}
.portfolio__bg--1 { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
.portfolio__bg--2 { background: linear-gradient(135deg, #0f3460 0%, #533483 100%); }
.portfolio__bg--3 { background: linear-gradient(135deg, #1b262c 0%, #0a3d62 100%); }
.portfolio__bg--4 { background: linear-gradient(135deg, #2d3436 0%, #636e72 100%); }

.portfolio__item:hover .portfolio__thumb-wrap .portfolio__bg { transform: scale(1.05); }

.portfolio__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.1) 50%, transparent 100%);
    transition: var(--transition);
}
.portfolio__item:hover .portfolio__thumb-wrap .portfolio__overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(216,175,48,0.1) 100%);
}

.portfolio__info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 28px 32px;
}

.portfolio__cat {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 8px;
}

.portfolio__client {
    font-family: var(--font-serif);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 6px;
}

.portfolio__work-title {
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.03em;
}

.portfolio__arrow {
    position: absolute;
    top: 28px; right: 32px;
    font-size: 1.2rem;
    color: transparent;
    transition: var(--transition);
}
.portfolio__item:hover .portfolio__thumb-wrap .portfolio__arrow { color: var(--gold); }

/* ==============================================
   ABOUT
============================================== */
.about {
    background: var(--dark);
    padding: 100px 8%;
}

.about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
}

.about .section-label { color: rgba(216, 175, 48, 0.85); }

.about__title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 3rem;
}

.timeline {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
}

.timeline__year {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.timeline__company {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
}

.timeline__role {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.38);
    line-height: 1.5;
}

.software__group { margin-bottom: 2rem; }

.software__group-name {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.22);
    margin-bottom: 1rem;
}

.software__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.52);
    letter-spacing: 0.03em;
    transition: var(--transition);
}
.badge:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* ==============================================
   CONTACT
============================================== */
.contact {
    background: var(--dark-2);
    padding: 120px 8%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.contact .section-label { color: rgba(216, 175, 48, 0.85); }

.contact__inner { max-width: 640px; }

.contact__headline {
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 1.5rem;
}
.contact__headline em {
    font-style: normal;
    color: var(--gold);
}

.contact__desc {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.38);
    line-height: 1.9;
    margin-bottom: 3rem;
}

/* ==============================================
   PORTFOLIO — 追加スタイル
============================================== */

/* トップページ セクションヘッダー（カテゴリー区切り） */
.portfolio__section-head {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 3rem 0 1.2rem;
}
.portfolio__section-head:first-child { margin-top: 0; }

.portfolio__section-cat {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    white-space: nowrap;
}
.portfolio__section-head::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--beige);
    opacity: 0.4;
}

/* カテゴリーバッジ（カード左上） */
.portfolio__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    transition: var(--transition);
}
.portfolio__badge--video    { border-color: rgba(216, 175, 48, 0.35); color: var(--gold); }
.portfolio__badge--animation { border-color: rgba(255, 255, 255, 0.18); }
.portfolio__badge--photo    { border-color: rgba(255, 255, 255, 0.18); }

/* ホバー時バッジ強調 */
.portfolio__item:hover .portfolio__badge {
    background: rgba(0, 0, 0, 0.78);
}

/* departmentフィールド */
.portfolio__dept {
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.38);
    margin-bottom: 4px;
}

/* サムネイル画像 */
.portfolio__thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.portfolio__item:hover .portfolio__thumb-wrap .portfolio__thumb { transform: scale(1.05); }

/* リンクラッパー */
.portfolio__link {
    display: block;
    position: absolute;
    inset: 0;
}
.portfolio__link--no-link { cursor: default; }

/* カテゴリーページ：均等2カラムグリッド */
.portfolio__grid--equal {
    grid-template-columns: repeat(2, 1fr);
}
.portfolio__grid--equal .portfolio__item {
    grid-column: span 1;
}

/* ==============================================
   PORTFOLIO-PAGE（カテゴリーページ共通）
============================================== */
.portfolio-page {
    min-height: 100vh;
    background: var(--white);
    padding: 140px 8% 100px;
}

.portfolio-page__head {
    margin-bottom: 60px;
}

.portfolio-page__back {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 2rem;
    transition: var(--transition);
}
.portfolio-page__back:hover { color: var(--dark); }

.portfolio-page__title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--dark);
    line-height: 1.1;
}

/* 掲載メディアリンク */
.portfolio__media-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.portfolio__media-label {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    margin-right: 4px;
    white-space: nowrap;
}
.portfolio__media-link {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: opacity 0.2s;
}
.portfolio__media-link:hover { opacity: 0.7; }

/* ==============================================
   WORK MODAL
============================================== */
.work-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 5%;
}
.work-modal.active { display: flex; }

.work-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
    opacity: 0;
}
.work-modal.active .work-modal__backdrop {
    animation: backdropIn 0.5s ease forwards;
}

.work-modal__box {
    position: relative;
    background: var(--dark-2);
    opacity: 0;
    transform: translateY(20px);
    max-width: 760px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.work-modal.active .work-modal__box {
    animation: modalSlideIn 0.5s ease forwards;
}

.work-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    z-index: 2;
}
.work-modal__close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.work-modal__thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--dark);
    position: relative;
}
.work-modal__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-modal__body { padding: 32px 36px 36px; }

.work-modal__cat {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 10px;
}

.work-modal__title {
    font-family: var(--font-serif);
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 6px;
    line-height: 1.2;
}

.work-modal__client-text {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.38);
    margin-bottom: 20px;
}

.work-modal__desc {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.85;
    margin-bottom: 22px;
}

.work-modal__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 28px;
}
.work-modal__tag {
    padding: 3px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.04em;
}

.work-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 20px;
}

.work-modal__media-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}
.work-modal__media-label {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.22);
}
.work-modal__media-link {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gold);
    transition: opacity 0.2s;
}
.work-modal__media-link:hover { opacity: 0.7; }

.work-modal__link-btn {
    font-size: 0.75rem;
    padding: 10px 24px;
    white-space: nowrap;
}

/* ==============================================
   SOFTWARE POPUP
============================================== */
.software__hint {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.18);
    margin-bottom: 1.4rem;
    margin-top: -0.6rem;
}

.badge { cursor: pointer; }

.software-popup {
    display: none;
    position: fixed;
    z-index: 400;
    width: 240px;
    background: var(--dark);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 18px 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.software-popup.active { display: block; }

.software-popup__name {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 3px;
}

.software-popup__years {
    font-size: 0.7rem;
    color: var(--gold);
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}

.software-popup__skills-title {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.22);
    margin-bottom: 7px;
}

.software-popup__skills {
    list-style: none;
    margin-bottom: 14px;
}
.software-popup__skills li {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.48);
    padding: 2px 0;
    line-height: 1.5;
}
.software-popup__skills li::before {
    content: '— ';
    color: var(--gold);
}

.software-popup__works {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.6;
}

/* ==============================================
   FOOTER
============================================== */
.footer {
    background: var(--dark);
    padding: 28px 8%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer__copy {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.06em;
}

.footer__logo {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.22);
}

/* ==============================================
   ANIMATIONS
============================================== */
@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes backdropIn {
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ==============================================
   SERVICE MODAL
============================================== */
.service-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 5%;
}
.service-modal.active { display: flex; }

.service-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
    opacity: 0;
}
.service-modal.active .service-modal__backdrop {
    animation: backdropIn 0.5s ease forwards;
}

.service-modal__box {
    position: relative;
    background: var(--dark-2);
    opacity: 0;
    transform: translateY(20px);
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.service-modal.active .service-modal__box {
    animation: modalSlideIn 0.5s ease forwards;
}

.service-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    z-index: 2;
}
.service-modal__close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.service-modal__body {
    padding: 40px 36px 36px;
}

.service-modal__num {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--gold);
    margin-bottom: 10px;
}

.service-modal__title {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.2;
}

.service-modal__detail {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.9;
    margin-bottom: 28px;
}

.service-modal__tools-wrap {
    margin-bottom: 32px;
}
.service-modal__tools-label {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.22);
    margin-bottom: 10px;
}
.service-modal__tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.service-modal__tool {
    padding: 4px 12px;
    border: 1px solid rgba(216, 175, 48, 0.35);
    font-size: 0.72rem;
    color: var(--gold);
    letter-spacing: 0.04em;
}

.service-modal__related {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 24px;
}
.service-modal__related-label {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.22);
    margin-bottom: 14px;
}
.service-modal__related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.service-modal__related-card {
    cursor: default;
}
.service-modal__related-thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--dark);
    margin-bottom: 6px;
}
.service-modal__related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}
.service-modal__related-nothumb {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.04);
}
.service-modal__related-name {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.4;
}

/* service-row クリック可能スタイル */
.service-row[data-service-id] {
    cursor: pointer;
    transition: background 0.25s;
}
.service-row[data-service-id]:hover {
    background: rgba(255, 255, 255, 0.03);
}

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==============================================
   RESPONSIVE — TABLET (max 1023px)
============================================== */
@media (max-width: 1023px) {
    .header        { padding: 20px 6%; }
    .header.scrolled { padding: 16px 6%; }
    .hero          { padding: 0 6% 8%; }
    .stats         { padding: 0 6%; }
    .services      { padding: 80px 6%; }
    .portfolio     { padding: 80px 6%; }
    .about         { padding: 80px 6%; }
    .contact       { padding: 100px 6%; }
    .footer        { padding: 24px 6%; }

    .about__grid   { gap: 4rem; }

    .service-row {
        grid-template-columns: 2.5rem 1fr;
        gap: 0 1.5rem;
    }
    .service__tools { display: none; }
}

/* ==============================================
   RESPONSIVE — MOBILE (max 767px)
============================================== */
@media (max-width: 767px) {
    .header        { padding: 18px 5%; }
    .nav-links     { display: none; }
    .nav__toggle   { display: flex; }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: fixed;
        inset: 0;
        background: rgba(24, 24, 26, 0.98);
        align-items: center;
        justify-content: center;
        gap: 2.5rem;
        z-index: 99;
    }
    .nav-links.active .nav__link {
        font-size: 1.1rem;
        color: rgba(255,255,255,0.65);
        letter-spacing: 0.15em;
    }

    .hero          { padding: 0 5% 10%; }
    .hero__scroll  { display: none; }
    .hero__tags    { gap: 1rem; }

    .stats         { padding: 0 5%; }
    .stats__inner  { flex-wrap: wrap; }
    .stats__item   { flex: 1 1 calc(50% - 1px); padding: 24px 0; min-width: 0; }
    .stats__item + .stats__item { padding-left: 5%; }
    .stats__item:nth-child(2)   { border-right: none; }
    .stats__item:nth-child(3)   { border-top: 1px solid rgba(255,255,255,0.07); }

    .services      { padding: 70px 5%; }
    .services__head { margin-bottom: 40px; }
    .service-row   {
        grid-template-columns: 2.2rem 1fr;
        gap: 0 1.2rem;
        padding: 22px 0;
    }

    .portfolio     { padding: 70px 5%; }
    .portfolio__grid { grid-template-columns: 1fr; }
    .portfolio__item:first-child { grid-column: span 1; }
    .portfolio__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 40px;
    }

    /* モーダル モバイル */
    .work-modal { padding: 0; align-items: flex-end; }
    .work-modal__box { max-height: 92vh; border-radius: 0; }
    .work-modal__body { padding: 24px 20px 28px; }
    .work-modal__footer { flex-direction: column; align-items: flex-start; }

    /* サービスモーダル モバイル */
    .service-modal { padding: 0; align-items: flex-end; }
    .service-modal__box { max-height: 92vh; border-radius: 0; }
    .service-modal__body { padding: 32px 20px 28px; }
    .service-modal__related-grid { grid-template-columns: repeat(2, 1fr); }

    /* ソフトポップアップ モバイル */
    .software-popup { width: calc(100vw - 32px); }

    .about         { padding: 70px 5%; }
    .about__grid   { grid-template-columns: 1fr; gap: 3.5rem; }

    .contact       { padding: 80px 5%; }

    .footer {
        padding: 22px 5%;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
