.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    margin: 8px 0 20px 0;
}

.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
/* Google Drive 埋め込み */
.drive-embed-auto {
    position: relative;
    width: 100%;
    padding-top: 62.5%; /* 16:10 に少し余裕を持たせる */
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #e9e9e9;
    margin-top: 16px;
}

.drive-embed-auto iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 埋め込みエラー等のポップアップは使用しないため削除 */
/* 基本スタイル */
body {
    background-color: #fff;
    color: #222;
    font-family: 'Shippori Mincho B1', serif; /* 大正風明朝体 */
    margin: 0;
    padding: 0;
    line-height: 1.8;
}

a {
    color: #1e90ff; /* 明るい青 */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    font-weight: normal;
}

header {
    background-color: #fff;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e5e5e5;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-title {
    margin: 0;
    font-size: 1.6em;
    color: #111;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    padding: 6px;
    cursor: pointer;
}

.nav-toggle .bar {
    display: block;
    width: 100%;
    height: 2px;
    background: #111;
    margin: 6px 0;
}

.nav {
    display: block;
}

.nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

.nav ul li a {
    color: #333;
    font-size: 0.95em;
    text-decoration: none;
}

.nav ul li a:hover {
    color: #000;
}

main {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

/* 背景グラフィックと本文の間に半透明レイヤー */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 auto;
    width: calc(900px + 40px); /* mainの最大幅 + 左右padding */
    max-width: calc(100% - 40px);
    background: rgba(116, 122, 172, 0.1); /* 30%のグレー（黒） */
    z-index: 0; /* 背景SVG(-1)の上、本文(>0)の下 */
    pointer-events: none;
}

section {
    padding: 60px 0;
    border-bottom: 1px solid #f0f0f0;
}

section:last-child {
    border-bottom: none;
}

section h2 {
    font-size: 2.5em;
    color: #373737;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 2px solid #111;
    display: inline-block;
    padding-bottom: 10px;
}

.hero-section {
    text-align: center;
    padding-top: 80px; 
    padding-bottom: 80px;
    position: relative;
    overflow: visible;
    min-height: 50vh;
}

.hero-content h2 {
    font-size: 3em;
    margin-bottom: 20px;
    border-bottom: none; /* 通常のセクションh2とスタイルを分ける */
}

.hero-logo {
    display: block;           /* 行頭でブロック表示（h2の上に来る） */
    width: 33.333%;           /* メインのコンテンツ幅の1/3 */
    height: auto;             /* 等倍縮小（アスペクト比維持） */
    margin: 0 auto 12px auto; /* 中央寄せ + 下に余白 */
}

.hero-content p {
    font-size: 1.2em;
    color: #444;
}

/* 回転図形アニメーションコンテナだったが、Canvasコンテナとして再利用 */
.perlin-noise-animation {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; 
    overflow: hidden; 
}

/* Canvas用のスタイルはコメントアウト */
/* 
.perlin-noise-animation canvas {
    display: block; 
    width: 100%;
    height: 100%;
}
*/

/* 回転図形アニメーション関連のスタイルを有効に戻す */
.perlin-noise-animation svg {
    position: absolute; 
    overflow: visible; 
}
/* ４Dグラフィックの線の色と太さ */
.rotating-shape path {
    stroke: #868686; 
    stroke-width: 0.4; 
    fill: none; 
    vector-effect: non-scaling-stroke; 
}

/* @keyframes rotateShape は不要になったためコメントアウト */
/*
@keyframes rotateShape {
  0% {
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) rotateZ(var(--rz, 0deg));
  }
  100% {
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) rotateZ(calc(var(--rz, 0deg) + 360deg));
  }
}
*/

/* スクロールアニメーション: 右から左 */
.content-box {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.content-box.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.service-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.service-item, .works-category, #surround div, #clients ul, #contact div {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e9e9e9;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

/* 事業内容: 見出し上の任意画像 */
.service-item .service-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain; /* 詳細を残す */
    margin: 0 auto 10px auto; /* センター配置 + 下に10pxのgap */
}

/* 汎用コンテンツ画像（テーブル/ボックス内で収まる） */
.content-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    object-fit: contain;
    margin: 8px 0 14px 0;
}

.service-item h3, .works-category h3 {
    font-size: 1.5em;
    color: #559cdf;
    margin-top: 0;
    margin-bottom: 15px;
}

.client-list {
    list-style: none;
    padding: 0;
}

.client-list li {
    background-color: #fafafa;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 3px solid #111;
}

.small-text {
    font-size: 0.8em;
    color: #aaa;
    margin-top: 10px;
}

.contact-note {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 3px;
    padding: 10px 12px;
    color: #515050;
    margin-bottom: 14px;
    line-height: 1.7;
}

footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
    border-top: 1px solid #e5e5e5;
    color: #666;
    font-size: 0.9em;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav { display: none; }
    .nav.is-open { display: block; }
    .nav ul { display: block; }
    .nav ul li { margin: 10px 0; }

    section h2 {
        font-size: 2em;
    }

    .hero-content h2 {
        font-size: 2.5em;
    }
}

main > section:not(.hero-section) {
    position: relative;
    z-index: 1;
}

/* お問い合わせフォーム */
#contact form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

#contact form .form-row-full {
    grid-column: 1 / -1;
}

label {
    font-size: 0.95em;
    color: #333;
}

input[type="text"], input[type="email"], textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #222;
    font-size: inherit;
    line-height: 1.5;
    box-sizing: border-box;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

button[type="submit"] {
    padding: 10px 16px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
}

button[type="submit"]:hover {
    background: #000;
}

/* iPhone12以降の画角を意識した最適化 */
@media (max-width: 430px) {
    main {
        margin: 20px auto;
        padding: 0 16px;
    }
    .hero-content h2 {
        font-size: 2em;
    }
    section h2 {
        font-size: 1.8em;
    }
    #contact form { grid-template-columns: 1fr; gap: 16px; }
    input[type="text"], input[type="email"], textarea { font-size: inherit; padding: 9px 11px; }
    button[type="submit"] { padding: 9px 14px; font-size: 0.9rem; }
}