:root {
    --primary-color: #00a885;
    /* メインの緑 */
    --accent-color: #66ffff;
    /* 差し色の水色 */
    --hover-color: #005f3c;
    /* ホバー時の濃い緑 */
    --text-shadow-color: #cbffe1;
    /* ホバー時の文字の縁色 */
    --nav-bg-color: rgba(0, 0, 0, 0.4);
    --footer-bg-color: #225533;
    --btn-bg-color: var(--primary-color);
    --btn-text-color: white;
    --btn-hover-bg-color: var(--accent-color);
    --btn-hover-text-color: black;
}

html,
body {
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    color: white;
    background-image: url('../image/Kappa_Lab_background.jpg'), linear-gradient(to bottom, #a8e6cf, #dcedc1);
    background-size: cover;
    background-position: center;
    text-align: center;
    overflow-x: hidden;
}

body {
    opacity: 0;
    transition: opacity 0.8s ease;
}

body.loaded {
    opacity: 1;
}

/*　泡効果　*/
.floating-element {
    position: absolute;
    top: -50px;
    width: 30px;
    height: 30px;
    background-image: url('../image/leaf.png');
    background-size: contain;
    background-repeat: no-repeat;
    animation: floatElement 10s ease-in-out forwards;
    pointer-events: none;
    z-index: 1;
    opacity: 0.8;
}

@keyframes floatElement {
    0% {
        transform: translateX(0px) translateY(0px) rotate(0deg);
        opacity: 1;
    }

    10% {
        transform: translateX(-100px) translateY(100px) rotate(45deg);
    }

    25% {
        transform: translateX(150px) translateY(200px) rotate(-65deg);
    }

    40% {
        transform: translateX(-200px) translateY(300px) rotate(90deg);
    }

    55% {
        transform: translateX(250px) translateY(450px) rotate(-50deg);
    }

    70% {
        transform: translateX(-150px) translateY(600px) rotate(60deg);
    }

    85% {
        transform: translateX(100px) translateY(750px) rotate(-85deg);
    }

    100% {
        transform: translateX(0px) translateY(900px) rotate(0deg);
        opacity: 0;
    }
}

/*　泡効果ここまで　*/
/*　効果中断　*/

body.no-effects .floating-element,
body.no-effects .bubble {
    display: none !important;
}

/*　効果中断ここまで　*/

header {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 10px 0;
    z-index: 1000;
    position: relative;
    height: 90px;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    flex-wrap: wrap;
    position: relative;
}

/* ロゴが隠れないように */
.logo {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
}

.logo img {
    margin-right: 10px;
    width: 150px;
    /* お好みのサイズに変更可 */
    height: auto;
    /* 縦横比を維持 */
    image-rendering: auto;
}

.logo span {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

/* ナビ背景は透明感を調整しつつ、ロゴ下にとどめる */
nav {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    padding: 0em 2em;
    border-radius: 12px;
    z-index: 5;
    position: relative;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

nav li {
    position: relative;
}

nav li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
    padding: 10px 20px;
    display: inline-block;
}

nav li a:hover {
    color: var(--hover-color);
    text-shadow:
        -1px -1px 0 var(--text-shadow-color),
        1px -1px 0 var(--text-shadow-color),
        -1px 1px 0 var(--text-shadow-color),
        1px 1px 0 var(--text-shadow-color);
    transform: scale(1.2);
}

/* ハンバーガーメニュー */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 24px;
    cursor: pointer;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1001;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 2px;
    margin: 3px 0;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 5.5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -5.5px);
}

/* 演出ボタン設定 */
.effectbutton {
    background-color: var(--btn-bg-color);
    color: var(--btn-text-color);
    border: none;
    padding: 10px 20px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.effectbutton:hover {
    background-color: var(--btn-hover-bg-color);
    color: var(--btn-hover-text-color);
    transform: scale(1.05);
    box-shadow: 0 0 10px var(--accent-color);
}

main {
    flex: 1;
    max-height: calc(100vh - 130px);
}

/* セクション */
.section {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: opacity 0.4s ease;
    z-index: 0;
    overflow-y: auto;
    box-sizing: border-box;
}

.section.active {
    opacity: 1;
    transition: opacity 0.6s ease;
    pointer-events: auto;
    z-index: 2;
    position: relative;
}

.section.fade-out {
    opacity: 0;
    transition: opacity 0s ease;
    pointer-events: auto;
    z-index: 1;
}

/* ホーム画面 */
.home-section {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.home-section p {
    margin: 0;
}

.home-section h2 {
    margin: 10px 0 0 0;
}

/* スライダーコンテナが画面に収まるように制限 */
.slider-container {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* スライドの画像を縮小して収める */
.slide {
    display: none;
    flex-shrink: 1;
    animation: fadeSlide 0.8s ease-in-out;
}

.slide.active {
    display: block;
    max-height: 70vh;
}

.slide img {
    padding: 10px 0;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 16px 16px 0 0;
    max-height: 50vh;
    /* 画像が大きすぎるときに縮小 */
}

/* キャプション */
.slide-caption {
    padding: 20px;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    text-shadow: 0 0 5px #000;
    overflow: auto;
    max-height: 30vh;
}

/* ナビボタン */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: 2px solid transparent;
    font-size: 1.5rem;
    border-radius: 50%;
    transition: background 0.3s;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    padding: 0;
}

.slider-btn:hover {
    background: var(--accent-color);
    color: black;
}

.slider-btn.prev {
    left: 10px;
}

.slider-btn.next {
    right: 10px;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ホーム画面ここまで */
/* 会社概要 */
.about-section {
    background: rgba(255, 255, 255, 0.6);
    /* ← 明るく柔らかい透明背景 */
    backdrop-filter: blur(12px);
    /* ← 背景を軽くぼかしてラボっぽさ演出 */
    -webkit-backdrop-filter: blur(12px);
    /* Safari対応 */
    border-radius: 16px;
    padding: 40px 24px;
    max-width: 800px;
    margin: 0px auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    color: #2a2a2a;
    font-size: 1.1rem;
    line-height: 1.8;
    max-height: 100%;
    width: 100%;
    left: 0;
    top: 0;
    overflow: auto;
}

/* タイトルだけ中央揃え */
.about-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 24px;
    color: #111;
    border-bottom: 2px solid #ccc;
    padding-bottom: 8px;
}

.about-section .aboutP p {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    text-align: left;
}

/* リストは中央寄せされたブロック内で左揃え */
.about-section ul {
    list-style: none;
    padding-left: 0;
    margin: 0 auto;
    text-align: left;
    max-width: 480px;
    /* 情報が間延びしすぎないように */
}

/* アイコン付きリスト */
.about-section ul li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 1.4em;
}

.about-section ul li::before {
    content: "🧪";
    position: absolute;
    left: 0;
    top: 0;
    line-height: 1.4;
}

.section.about-section.fade-out {
    opacity: 0;
    width: 100%;
    pointer-events: none;
    transition: opacity 0s ease;
    position: relative;
    z-index: 1;
}

/* 会社概要ここまで */
/* サービス案内 */
.service-section {
    max-width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #0e2a1b, #081810);
    background-color: #0e2a1b;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    overflow: hidden;
}

.service-section .section {
    overflow-y: hidden !important;
}

/* サービス全体レイアウト */
.service-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    padding: 2rem;
    max-width: 100%;
    /* ← ここ重要 */
    box-sizing: border-box;
    /* ← パディング分含める */
    margin: 0 auto;
    flex-wrap: wrap;
}

/* 左側のボタン群 */
.service-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 160px;
}

.service-buttons button {
    font-family: 'PixelMplus10', sans-serif;
    font-size: 16px;
    padding: 0.5rem 1rem;
    border: 2px solid #00ff00;
    background: transparent;
    color: #00ff00;
    cursor: pointer;
    transition: background 0.3s;
}

.service-buttons button:hover {
    background-color: #003300;
}

.service-buttons button.active {
    background-color: #00ff00;
    color: #000;
    animation: blink 1s steps(2, start) infinite;
    box-shadow: 0 0 8px #00ff00;
}

/* 仮のビジュアル表示枠（後で画像など追加） */
.service-visual {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #002200;
    border: 2px solid #00ff00;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    overflow: hidden;
}

.service-visual img {
    width: 100%;
    height: auto;
}

/* 中央のビジュアル＋ログ表示 */
.service-display {
    flex: 1;
    min-width: 300px;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes blink {
    50% {
        opacity: 0.4;
    }
}

/* ログ表示 */
.service-log {
    font-family: 'DotGothic16', monospace;
    color: #00ff00;
    font-size: 1rem;
    margin-top: 1rem;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid #00ff00;
    padding: 1rem;
    border-radius: 8px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* サービス案内ここまで */
/* フッター */
footer {
    text-align: center;
    padding: 15px;
    background: #225533;
    color: white;
    height: 40px;
}

/* 背景の泡（粒子） */
.bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bubble {
    position: absolute;
    bottom: -50px;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: floatAndSway 12s linear forwards;
}

@keyframes floatAndSway {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    50% {
        transform: translate(50px, -50vh) scale(0.5);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50px, -100vh) scale(0);
        opacity: 0;
    }
}


/* モバイル対応 */
@media (max-width: 768px) {
    .bubble {
        background-color: rgba(255, 255, 255, 0.3);
        opacity: 0.5;
        animation-duration: 6s;
    }

    .hamburger {
        display: flex;
    }

    nav {
        backdrop-filter: none;
    }

    /* 初期状態 */
    nav ul {
        visibility: hidden;
        opacity: 0;
        transform: translateY(-20px);
        position: fixed;
        gap: 0;
        top: 0;
        left: 0;
        width: 100vw;
        background-color: rgba(0, 0, 0, 0.95);
        padding: 60px 0 0 0;
        z-index: 999;
        flex-direction: column;
        align-items: flex-start;
        transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s;
        pointer-events: none;
    }

    /* 開いた状態 */
    nav ul.open {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        display: flex;
    }

    nav li {
        width: 100%;
    }

    nav li a {
        display: block;
        width: 100%;
        padding: 15px 20px;
        font-size: 1.2rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        box-sizing: border-box;
    }

    .logo span {
        font-size: 20px;
    }

    /* ホームセクション */
    .home-section h2 {
        margin: 0;
    }

    .slider-btn {
        top: 100px;
        bottom: 10px;
        transform: none;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .slider-btn.prev {
        left: 10px;
    }

    .slider-btn.next {
        right: 10px;
    }

    .slide img {
        max-height: 40vh;
        /* スマホでは画像の高さを抑える */
    }

    .slide-caption {
        max-height: none;
        padding: 12px;
        font-size: 0.9rem;
    }

    /* 会社概要 */
    .about-section {
        max-width: 100%;
        padding: 24px 16px;
        font-size: 1rem;
        box-sizing: border-box;
        border-radius: 12px;
        overflow-wrap: break-word;
    }

    .about-section h2 {
        font-size: 1.4rem;
        text-align: center;
    }

    .about-section ul {
        padding-left: 1.2em;
        margin: 1em 0;
    }

    .about-section li {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* 会社概要ここまで */
    /* サービス案内 */
    .service-layout {
        flex-direction: column;
        align-items: center;
        padding: 0;
        gap: 0;
    }

    .service-buttons {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
        padding: 0.5rem;
    }

    .service-buttons button {
        flex: 0 1 calc(50% - 1rem);
        box-sizing: border-box;
        text-align: center;
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    .service-display {
        width: 100%;
        max-width: 500px;
    }


    .service-visual {
        width: 100%;
        aspect-ratio: 16/9;
        margin-top: 1rem;
    }

    .service-visual img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .service-log {
        margin-top: 1rem;
        text-align: center;
    }

    /* サービス案内ここまで */
}

@media (prefers-reduced-motion: reduce) {

    .floating-element,
    .bubble {
        display: none !important;
    }
}