/*
    Enakat Corporate Design System
    Neo-Brutalism x Pop
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Noto+Sans+JP:wght@300;400;700;900&family=Outfit:wght@300;400;600;800&display=swap');

:root {
    /* Colors: 背景は#000、文字は#FFFに統一。ピンク(#ff2f87)は使わない */
    --primary: #fff;
    --primary-light: #fff;
    --accent: #fff;
    --accent-glow: rgba(255, 255, 255, 0.35);
    --accent2: #fff;
    --text-main: #fff;
    --text-muted: #fff;
    --bg-main: #000;
    --bg-card: #000;
    --bg-alt: #000;
    --bg-alt2: #000;
    --glass: #000;
    --glass-border: #fff;

    /* Brutalist tokens */
    --border-width: 3px;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-hard: 7px 7px 0 var(--glass-border);
    --shadow-hard-sm: 4px 4px 0 var(--glass-border);
    --shadow-hard-lg: 10px 10px 0 var(--glass-border);

    /* Spacing */
    --section-padding: 100px 5%;
    --container-max: 1200px;

    /* Transitions */
    --transition-smooth: all 0.18s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

body {
    font-family: 'Noto Sans JP', 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
    text-align: center;
}

.hero-text {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

/* Layout */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    width: 100%;
    min-width: 0;
    padding-top: 0;
}

section {
    padding: var(--section-padding);
    position: relative;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 5%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
    min-width: 0;
    background: var(--bg-main);
    border-bottom: var(--border-width) solid var(--glass-border);
}

header.scrolled {
    padding: 15px 5%;
}

header h1 img {
    height: 60px;
    width: auto;
    filter: invert(1);
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 40px;
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    transition: var(--transition-smooth);
}

nav a:hover {
    text-decoration: underline;
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    overflow: hidden;
    margin-bottom: 50px;
}

.hero-people {
    position: absolute;
    bottom: 0;
    right: 10%;
    width: 15%;
    max-width: 500px;
    pointer-events: none;
}

.hero-content {
    position: absolute;
    top: 28%;
    left: 6%;
}

.hero-cta {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hero .hero-cta:hover {
    transform: translate(calc(-50% + 4px), calc(-50% + 4px));
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--primary);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.cta-button {
    display: inline-block;
    padding: 16px 32px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: var(--border-width) solid var(--glass-border);
    border-radius: var(--radius);
    transition: var(--transition-smooth);
}

.cta-button:hover {
    transform: translate(4px, 4px);
}

.cta-button:active {
    transform: translate(7px, 7px);
}

/* About Section */
.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 50px;
    text-align: start;
    color: var(--accent);
}

.section-title a {
    color: inherit;
    text-decoration: none;
}

.section-title span {
    color: var(--primary);

    padding: 2px 14px;

}

.about-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.about-inner > * {
    min-width: 0;
}

.about-lead {
    position: static;
}

.about-section-title {
    text-align: left;
    margin-bottom: 24px;
}

.about-tagline {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--accent);
    padding-bottom: 30px;
    text-align: left;
}

.about-desc {
    color: var(--text-muted);
    line-height: 2;
    font-size: 0.95rem;
    margin-bottom: 20px;
    text-align: left;
}

.about-pillars {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 40px;
}

.about-pillar {
    flex: 1 1 150px;
    border: var(--border-width) solid var(--glass-border);
    padding: 20px 16px;
    border-radius: var(--radius);
    background: #fff;
    color: #000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition-smooth);
}

.about-pillar:hover {
    transform: translate(-3px, -3px);
}

.pillar-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: none;
    display: inline-block;
    align-self: flex-start;
    padding: 4px 10px;
    border: 2px solid #000;
    border-radius: 4px;
    color: #000;
}

.pillar-text {
    font-size: 0.85rem;
    font-weight: 700;
}

/* Portfolio List */
.portfolio-grid {
    display: flex;
    flex-direction: column;
    gap: 34px;
    padding-top: 14px;
}

.portfolio-loading,
.portfolio-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px;
    border: var(--border-width) dashed var(--glass-border);
    border-radius: var(--radius);
}

.portfolio-row {
    position: relative;
    background: var(--bg-card);
    border: var(--border-width) solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard-sm);
    padding: 24px 24px 20px;
    transition: var(--transition-smooth);
}

.portfolio-row:hover {
    transform: translate(-3px, -3px);
    box-shadow: 7px 7px 0 var(--glass-border);
}

.portfolio-row-category {
    position: absolute;
    top: -14px;
    left: 20px;
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #fff;
    background: #000;
    padding: 4px 14px;
    border: 2px solid var(--glass-border);
    border-radius: 999px;
    box-shadow: var(--shadow-hard-sm);
}

.portfolio-row-title {
    font-size: 1.2rem;
    font-weight: 800;
    text-align: left;
    color: var(--text-main);
    margin-top: 10px;
    margin-bottom: 10px;
}

.portfolio-row-desc {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 16px;
}

.portfolio-row-more {
    display: block;
    width: fit-content;
    margin-left: auto;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent2);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.portfolio-row-more::after {
    content: ' \2192';
}

.portfolio-row-more:hover {
    text-decoration: underline;
}

/* Portfolio Modal */
.portfolio-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.portfolio-modal.open {
    display: flex;
}

.portfolio-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 13, 13, 0.6);
}

.portfolio-modal-content {
    position: relative;
    width: 95vw;
    max-width: 1400px;
    height: 90vh;
    max-height: 90vh;
    background: var(--bg-card);
    border: var(--border-width) solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard-lg);
    overflow: hidden;
}

.portfolio-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.portfolio-modal-close:hover {
    transform: translate(-2px, -2px);
}

.portfolio-modal-body {
    display: flex;
    height: 100%;
}

.portfolio-modal-image {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-main);
    border-right: var(--border-width) solid var(--glass-border);
}

.portfolio-modal-image img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.portfolio-modal-info {
    flex: 1;
    min-width: 0;
    padding: 48px;
    overflow-y: auto;
}

.portfolio-modal-content h3 {
    text-align: left;
    color: var(--accent);
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.portfolio-modal-content p {
    text-align: left;
    color: var(--text-muted);
    line-height: 1.8;
}

.portfolio-modal-content #portfolioModalLinkWrap {
    margin-top: 16px;
}

.portfolio-modal-meta {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid var(--glass-border);
}

.portfolio-modal-meta-row dt {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    background: #000;
    display: inline-block;
    padding: 3px 10px;
    border: 2px solid var(--glass-border);
    border-radius: 4px;
    margin-bottom: 8px;
}

.portfolio-modal-meta-row dd {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.8;
}

@media (max-width: 768px) {
    .portfolio-modal-content {
        width: 92vw;
        height: 90vh;
    }

    .portfolio-modal-body {
        flex-direction: column;
        overflow-y: auto;
    }

    .portfolio-modal-image {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
        max-height: 38vh;
        border-right: none;
        border-bottom: var(--border-width) solid var(--glass-border);
    }

    .portfolio-modal-info {
        padding: 24px;
        overflow-y: visible;
    }
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    min-width: 0;
}

.service-card {
    background: #fff;
    color: #000;
    border: var(--border-width) solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.service-card:hover {
    transform: translate(-4px, -4px);
}

.service-image-wrap {
    position: relative;
    overflow: hidden;
    height: 180px;
    border-bottom: var(--border-width) solid var(--glass-border);
}

.service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.service-card:hover .service-image {
    transform: scale(1.06);
}

.service-info {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-number {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #000;
    background: none;
    align-self: flex-start;
    padding: 3px 10px;
    border: 2px solid #000;
    border-radius: 4px;
}

.service-info h3 {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.02em;
    text-align: left;
    color: #000;
}

.service-info p {
    font-size: 0.85rem;
    color: #000;
    line-height: 1.8;
    flex: 1;
}

/* Company Table */
.company-info {
    max-width: 900px;
    margin: 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: var(--border-width) solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard);
    background: var(--bg-card);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
}

.info-table tr {
    border-bottom: 2px solid var(--glass-border);
}

.info-table tr:last-child {
    border-bottom: none;
}

.info-table th, .info-table td {
    padding: 20px;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
}

.info-table th {
    width: 30%;
    color: var(--primary);
    background: var(--bg-alt);
    font-weight: 700;
    white-space: nowrap;
    border-right: 2px solid var(--glass-border);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    padding: 15px 5%;
    border-top: var(--border-width) solid var(--glass-border);
    text-align: center;
    color: #fff;
    background: #000;
    font-size: 0.9rem;
}

/* Form Styles */
.contact-form {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    border: var(--border-width) solid var(--glass-border);
    box-shadow: var(--shadow-hard);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8rem;
    color: var(--primary);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-main);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    transition: var(--transition-smooth);
    text-align: left;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-hard-sm);
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: #000;
    color: #fff;
    border: var(--border-width) solid var(--glass-border);
    border-radius: var(--radius);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.submit-btn:hover {
    transform: translate(4px, 4px);
}

/* ハンバーガーボタン */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(-45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Company message card */
.message-card {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 60px 40px;
    border-radius: var(--radius);
    border: var(--border-width) solid var(--glass-border);
    box-shadow: var(--shadow-hard-lg);
}

/* =====================
   Scrollytelling Split Layout (index.php専用)
   左:ヘッダー・ヒーロー・フッター固定 / 右:コンテンツのみスクロール
   ===================== */
@media (min-width: 769px) {
    .left-panel {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 60px;
        width: 42%;
        display: flex;
        flex-direction: column;
        background: var(--bg-main);
        border-right: var(--border-width) solid var(--glass-border);
        z-index: 500;
        overflow: hidden;
    }

    .left-panel header {
        position: static;
        width: 100%;
        height: auto !important;
        flex-shrink: 0;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        row-gap: 12px;
    }

    /* ヘッダー内側の余白をスクロール状態に関わらず固定し、
       hero(flex:1)の高さが変動して拡大表示されるのを防ぐ */
    .left-panel header.scrolled {
        padding: 20px 5%;
    }

    .left-panel .hero {
        flex: 1;
        height: auto;
        min-height: 0;
        margin-bottom: 0;
    }

    .left-panel .hero-text {
        font-size: clamp(1.05rem, 1.9vw, 1.7rem);
    }

    .left-panel .hero-people {
        width: 24%;
    }

    .left-panel .hero-content {
        top: 24%;
        left: 8%;
    }

    /* サイドパネル内に常時表示するチップ型ナビ(トグル操作なし) */
    .left-panel .hamburger {
        display: none;
    }

    .left-panel nav {
        display: block;
        position: static;
        width: auto;
        max-height: none;
        overflow: visible;
        background: none;
        border: none;
    }

    .left-panel nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .left-panel nav a {
        display: inline-block;
        padding: 5px 10px;
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0;
        white-space: nowrap;
        color: var(--primary);
        background: var(--bg-card);
        border: 2px solid var(--glass-border);
        border-radius: var(--radius-sm);
        box-shadow: 3px 3px 0 var(--glass-border);
        transition: var(--transition-smooth);
    }

    .left-panel nav a:hover {
        color: var(--accent);
        transform: translate(-3px, -3px);
        box-shadow: 6px 6px 0 var(--glass-border);
    }

    .right-panel {
        margin-left: 42%;
        width: 58%;
        min-width: 0;
    }

    /* #aboutは.containerのpadding-top:0が効いて右パネル最上部に
       詰まってしまうため、先頭セクションにだけ上余白を戻す */
    .right-panel #about {
        padding-top: 100px;
    }

    /* 右パネル自体が58%幅と狭いため、About内部をさらに左右分割せず
       見出し→本文の縦積みにして見出しが極端に細くなるのを防ぐ */
    .right-panel .about-inner {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .right-panel .about-lead {
        position: static;
    }

    footer.split-footer {
        position: fixed;
        left: 0;
        bottom: 0;
        width: 42%;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        /* footerはposition:fixedでビューポート基準%になるため、
           左パネル(42%幅)基準のheaderのpadding-left(5%)と揃うよう
           5% * 42% = 2.1% で換算する */
        padding: 0 2.1%;
        border-right: var(--border-width) solid var(--glass-border);
        z-index: 500;
    }
}

/* =====================
   index.php 1カラムレイアウト
   ヘッダーは画面幅の80%、ヒーロー画像・各セクションのコンテンツは画面幅の70%(769px以上)
   ===================== */
/* 見出し(h2)のグリッチノイズ。data-text(index.jsで付与)を疑似要素に複製して重ね、
   赤(::before)・青(::after)の縁取りを付けた白文字のスライスを、
   黒背景で元の文字を隠しながら左右に数pxずらして短時間だけ走らせる */
.page-home h2 {
    position: relative;
}

/* 疑似要素と行の折り返しを一致させるため、見出し内のspanの左右余白は無くす */
.page-home h2 span {
    padding: 0;
}

.page-home h2::before,
.page-home h2::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    text-align: inherit;
    color: #fff;
    background: #000;
    pointer-events: none;
    clip-path: inset(0 0 100% 0);
}

.page-home h2::before {
    text-shadow: -2px 0 #f00;
}

.page-home h2::after {
    text-shadow: 2px 0 #00f;
}

@media (prefers-reduced-motion: no-preference) {
    .page-home h2::before {
        animation: glitch-noise-a 2.4s steps(1, end) infinite;
        animation-delay: var(--glitch-delay, 0s);
    }

    .page-home h2::after {
        animation: glitch-noise-b 3.1s steps(1, end) infinite;
        animation-delay: var(--glitch-delay, 0s);
    }
}

/* 約0.3秒のバーストを5コマで切り替え、残りの時間は非表示(clip-pathで全面カット) */
@keyframes glitch-noise-a {
    0%, 22%, 100% { clip-path: inset(0 0 100% 0); transform: translateX(0); }
    4%  { clip-path: inset(0 0 60% 0); transform: translateX(3px); }
    8%  { clip-path: inset(0 0 25% 0); transform: translateX(-3px); }
    12% { clip-path: inset(35% 0 30% 0); transform: translateX(4px); }
    16% { clip-path: inset(0 0 50% 0); transform: translateX(-2px); }
    20% { clip-path: inset(60% 0 0 0); transform: translateX(3px); }
}

@keyframes glitch-noise-b {
    0%, 18%, 100% { clip-path: inset(0 0 100% 0); transform: translateX(0); }
    3%  { clip-path: inset(40% 0 20% 0); transform: translateX(-3px); }
    6%  { clip-path: inset(0 0 70% 0); transform: translateX(3px); }
    10% { clip-path: inset(55% 0 0 0); transform: translateX(-4px); }
    13% { clip-path: inset(0 0 35% 0); transform: translateX(2px); }
    16% { clip-path: inset(20% 0 40% 0); transform: translateX(-3px); }
}

.page-home .hero {
    background: url('/images/lp/hero-section.png') center / cover no-repeat;
    border-radius: 24px;
}

/* ヒーロー文字は画像の上下中央・左揃え(斜めマーキーより前面) */
.page-home .hero-text {
    position: absolute;
    top: 50%;
    left: 6%;
    transform: translateY(-50%);
    z-index: 2;
    margin: 0;
    text-align: left;
}

/* ヒーロー画像内の斜めマーキー(-20°・右上から左下へ流れる)。装飾のため文字より背面に置く */
.page-home .hero-marquee {
    position: absolute;
    top: 84%;
    left: 85%;
    width: 250%;
    transform: translate(-50%, -50%) rotate(-20deg);
    background: #000;
    border-top: 3px solid #000;
    border-bottom: 3px solid #000;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.page-home .hero-marquee-track {
    display: flex;
    width: max-content;
    animation: hero-marquee-flow 30s linear infinite;
}

.page-home .hero-marquee-group {
    display: flex;
    flex-shrink: 0;
}

.page-home .hero-marquee-group span {
    padding: 8px 32px;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.5rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
    color: #fff;
}

/* 2グループが同一内容のため、0→-50%で継ぎ目なく左方向へループする */
@keyframes hero-marquee-flow {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .page-home .hero-marquee-track { animation: none; }
}

@media (min-width: 769px) {
    .page-home header {
        padding-left: 10%;
        padding-right: 10%;
    }

    /* 各セクションのコンテンツ幅は画面幅の70%(左右余白15%ずつ) */
    .page-home section {
        padding-left: 15%;
        padding-right: 15%;
    }

    .page-home .container {
        max-width: none;
    }

    /* ヒーロー画像は画面幅の70%・中央配置。高さは画像の縦横比(497:268)に合わせる。
       固定ヘッダー(80px)と重ならないよう上余白を100px取る */
    .page-home .hero {
        width: 70%;
        height: auto;
        aspect-ratio: 497 / 268;
        margin: 100px auto 50px;
        padding: 0;
    }

    .page-home .hero-text {
        left: 8%;
    }

    /* 枠が画面幅に連動して狭くなるため、文字も幅に合わせて縮める */
    .page-home .hero-text {
        font-size: clamp(1.1rem, 3vw, 2.5rem);
    }
}

/* スマホ: ヒーロー画像を全画面の高さ(100vh)にせず、画面幅の90%・固定ヘッダー(80px)の下に収める。
   横長の画像なので、縦を少し確保するため16:10で切り抜く */
@media (max-width: 768px) {
    .page-home .hero {
        width: 90%;
        height: auto;
        aspect-ratio: 16 / 10;
        margin: 96px auto 16px;
        padding: 0;
    }
}

/* =====================
   サブページ(Company / Works / Sitemap / Contact)のカード
   Homeのカードと同じく、白背景・黒文字・影なし。カード内では色トークンを黒系に切り替え、
   インラインの var(--accent) 等で指定した文字も黒で表示する
   ===================== */
.page-home .message-card,
.page-home .company-info,
.page-home .contact-form,
.page-home .portfolio-row,
.page-home .sitemap-card,
.page-home #successMessage {
    --primary: #000;
    --text-main: #000;
    --text-muted: #000;
    --accent: #000;
    --accent2: #000;
    --bg-main: #fff;
    --bg-alt: #fff;
    --glass-border: #000;
    background: #fff;
    color: #000;
    max-width: none;
    box-shadow: none;
}

.page-home .portfolio-row:hover {
    box-shadow: none;
}

/* ヒーローの無いサブページは、固定ヘッダー(80px)の下から本文を始める */
.page-home header + main {
    padding-top: 80px;
}

/* .container の padding-top:0 だと見出しがヘッダーに詰まるため、先頭セクションだけ上余白を戻す */
.page-home header + main > section:first-child {
    padding-top: 60px;
}

/* 見出し行(資格名 / 取得日)の右端の罫線はカードの枠と重なるため消す */
.page-home .info-table th:last-child {
    border-right: none;
}

.page-home .sitemap-card {
    padding: 40px;
    border: var(--border-width) solid #000;
    border-radius: var(--radius);
}

.page-home .sitemap-card + .sitemap-card {
    margin-top: 40px;
}

.page-home #successMessage {
    margin-top: 20px;
    padding: 40px;
    text-align: center;
    border: var(--border-width) solid #000;
    border-radius: var(--radius);
}

/* =====================
   Works: 実績カードのスパイラル(らせん)カルーセル
   円筒面にカードをらせん状に並べて回す。参考: https://tane-be.co.jp/animation/slider/11/
   ===================== */
.page-home .portfolio-grid.portfolio-spiral {
    display: block;
    padding-top: 0;
}

.spiral-frame {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 24px;
}

.spiral-viewport {
    position: relative;
    height: 640px;
    perspective: 1600px;
    overflow: hidden;
    touch-action: pan-y;
    cursor: grab;
    user-select: none;
}

.spiral-viewport.is-dragging {
    cursor: grabbing;
}

.spiral-viewport:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}

.spiral-stage {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

.page-home .portfolio-row.spiral-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(380px, 72vw);
    height: 380px;
    display: flex;
    flex-direction: column;
    backface-visibility: hidden;
    will-change: transform, opacity;
    transition: none;
}

.spiral-card-thumb {
    width: 100%;
    height: 150px;
    margin-top: 6px;
    object-fit: cover;
    border: 2px solid #000;
    border-radius: var(--radius-sm);
    pointer-events: none;
}

.spiral-card .portfolio-row-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.spiral-card .portfolio-row-more {
    margin-top: auto;
}

/* 右側のゲージ(現在位置の目盛り)。クリックでその実績へ移動 */
.spiral-gauge {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spiral-gauge button {
    width: 32px;
    height: 16px;
    padding: 6px 0;
    border: none;
    background: rgba(255, 255, 255, 0.35);
    background-clip: content-box;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.spiral-gauge button.is-active {
    width: 52px;
    margin-left: -20px;
    background-color: #fff;
}

.spiral-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 12px;
}

.spiral-btn {
    width: 48px;
    height: 48px;
    border: var(--border-width) solid #fff;
    border-radius: 50%;
    background: #000;
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.spiral-btn:hover {
    background: #fff;
    color: #000;
}

.spiral-counter {
    min-width: 5em;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: 0.08em;
}

@media (max-width: 768px) {
    .spiral-frame {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .spiral-viewport {
        height: 520px;
    }

    .page-home .portfolio-row.spiral-card {
        height: 360px;
    }

    .spiral-gauge {
        flex-direction: row;
        justify-content: center;
    }

    .spiral-gauge button {
        width: 16px;
        height: 32px;
        padding: 0 6px;
    }

    .spiral-gauge button.is-active {
        width: 16px;
        height: 52px;
        margin: -10px 0;
    }
}

/* =====================
   実績の詳細モーダル: 背景#FFF・文字#000・影なし
   モーダル内では色トークンを黒系に切り替え、インライン指定(var(--accent)等)の文字も黒にする
   ===================== */
.page-home .portfolio-modal-content {
    --primary: #000;
    --text-main: #000;
    --text-muted: #000;
    --accent: #000;
    --accent2: #000;
    --bg-main: #fff;
    --glass-border: #000;
    background: #fff;
    color: #000;
    box-shadow: none;
}

.page-home .portfolio-modal-close:hover {
    box-shadow: none;
}

.page-home .portfolio-modal-meta-row dt {
    background: none;
    color: #000;
}

/* =====================
   Responsive - Tablet (1024px)
   ===================== */
@media (max-width: 1024px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =====================
   Responsive - Mobile (768px)
   ===================== */
@media (max-width: 768px) {
    :root { --section-padding: 70px 5%; }

    .hero h1 { font-size: 3rem; }
    .hero-text { font-size: 2rem; }
    .hero-people { width: 22%; }

    .about-inner { grid-template-columns: 1fr; gap: 40px; }
    .about-lead { position: static; }
    .about-tagline { font-size: 1.8rem; }
    .about-pillars { flex-direction: column; }

    .services-grid { grid-template-columns: 1fr; }

    .section-title { font-size: 2rem; }

    .message-card { padding: 40px 28px; border-radius: var(--radius); }

    /* テーブルをブロック表示 */
    .info-table,
    .info-table thead,
    .info-table tbody,
    .info-table tr { display: block; }

    .info-table thead tr {
        border-bottom: 2px solid var(--glass-border);
        padding-bottom: 4px;
        margin-bottom: 4px;
    }

    .info-table tr {
        padding: 12px 0;
        border-bottom: 2px solid var(--glass-border);
    }

    .info-table th,
    .info-table td {
        display: block;
        width: 100%;
        padding: 8px 14px;
        white-space: normal;
        border-right: none;
    }

    .info-table th {
        font-size: 0.78rem;
        padding-bottom: 6px;
    }

    header h1 { flex-shrink: 1; min-width: 0; overflow: hidden; }
    header h1 img { height: 48px !important; width: auto !important; }

    .hamburger { display: flex; }

    nav {
        display: block;
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--bg-main);
        border-bottom: var(--border-width) solid var(--glass-border);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease;
        z-index: 999;
    }

    nav.open { max-height: 320px; padding: 8px 0; }

    nav ul { flex-direction: column; gap: 0; }

    nav a {
        display: block;
        padding: 16px 5%;
        font-size: 1.05rem;
        border-bottom: 2px solid var(--glass-border);
    }

    nav ul li:last-child a { border-bottom: none; }
}

/* =====================
   Responsive - Small phones (480px)
   ===================== */
@media (max-width: 480px) {
    :root { --section-padding: 56px 5%; }

    .section-title { font-size: 1.7rem; margin-bottom: 32px; }

    .hero-text { font-size: 1.6rem; }
    .hero-content { top: 24%; left: 5%; }
    .hero-people { width: 28%; }

    .about-tagline { font-size: 1.5rem; }
    .about-section-title { font-size: 1.7rem; }
    .about-inner { gap: 28px; }
    .about-pillar { padding: 16px 12px; }
    .about-desc { font-size: 0.9rem; }

    .service-image-wrap { height: 150px; }
    .service-info { padding: 16px; }
    .service-info h3 { font-size: 0.88rem; }

    .info-table th, .info-table td { padding: 14px 10px; font-size: 0.9rem; }

    .message-card { padding: 28px 20px; border-radius: var(--radius-sm); }

    .contact-form { padding: 28px 20px; border-radius: var(--radius-sm); }

    .cta-button { padding: 14px 26px; font-size: 0.9rem; }

    footer { padding: 40px 5%; font-size: 0.85rem; }
}

/* =====================
   Responsive - Very small (320px / 270px対応)
   ===================== */
@media (max-width: 320px) {
    :root { --section-padding: 44px 4%; }

    header { padding: 14px 4%; }
    header h1 img { height: 44px; }

    .section-title { font-size: 1.4rem; margin-bottom: 24px; }

    .hero-text { font-size: 1.1rem; }
    .hero-content { top: 20%; left: 4%; }
    .hero-people { display: block; width: 40%; right: 0; }

    .about-tagline { font-size: 1.2rem; }
    .about-section-title { font-size: 1.4rem; }
    .about-pillars { gap: 8px; }
    .about-pillar { padding: 12px 10px; }
    .pillar-text { font-size: 0.8rem; }

    .service-image-wrap { height: 130px; }
    .service-info { padding: 12px; gap: 8px; }
    .service-info h3 { font-size: 0.82rem; }
    .service-info p { font-size: 0.8rem; }

    .info-table {
        display: block;
    }
    .info-table tbody { display: block; }
    .info-table tr {
        display: block;
        padding: 10px 0;
        border-bottom: 2px solid var(--glass-border);
    }
    .info-table th, .info-table td {
        display: block;
        width: 100%;
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    .info-table th { padding-bottom: 4px; }
    .info-table tr th:only-child { padding-bottom: 6px; }

    .message-card { padding: 20px 14px; border-radius: var(--radius-sm); }
    .message-card h3 { font-size: 1.3rem !important; }

    .contact-form { padding: 20px 14px; border-radius: var(--radius-sm); }
    .form-group input, .form-group textarea { padding: 10px 12px; font-size: 0.9rem; }

    .cta-button { padding: 12px 20px; font-size: 0.85rem; }

    nav a { padding: 14px 4%; font-size: 1rem; }

    footer { padding: 30px 4%; font-size: 0.8rem; }
}

/* =====================
   スマホ表示の調整(768px以下)
   ===================== */
@media (max-width: 768px) {
    /* Home: ピラーは縦積みのため、横並び用の flex-basis(150px)が高さとして効かないようにする */
    .about-pillar {
        flex: 0 0 auto;
    }

    /* 保有資格の表は2列(資格名 / 取得日)のまま表示する。項目名+値の縦積みだと長くなるため */
    .info-table.info-table-2col {
        display: table;
        width: 100%;
    }

    .info-table.info-table-2col tbody {
        display: table-row-group;
    }

    .info-table.info-table-2col tr {
        display: table-row;
        padding: 0;
    }

    .info-table.info-table-2col th,
    .info-table.info-table-2col td {
        display: table-cell;
        width: auto;
        padding: 12px 10px;
        vertical-align: middle;
        font-size: 0.85rem;
    }

    .info-table.info-table-2col th:last-child,
    .info-table.info-table-2col td:last-child {
        width: 34%;
        white-space: nowrap;
    }

    .info-table.info-table-2col tr {
        border-bottom: 2px solid var(--glass-border);
    }

    .page-home .sitemap-card {
        padding: 28px 22px;
    }

    /* Works: スパイラルの円周を大きめにして中央カードと横のカードの重なりを減らし、
       カード内の文字が切れないよう画像を低くする */
    .page-home .portfolio-row.spiral-card {
        height: 370px;
    }

    .spiral-card-thumb {
        height: 120px;
    }

    .spiral-card .portfolio-row-desc {
        flex-shrink: 0;
        font-size: 0.9rem;
    }
}

