:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #6D28D9;
    --light-gray: #f3f4f6;
    --border-color: #e5e7eb;
}

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    font-family: 'Work Sans', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* --- Loading --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.8s ease, visibility 0.8s;
    visibility: visible;
}
.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loading-logo {
    font-size: 2.5rem;
    font-weight: 900;
    background-image: linear-gradient(90deg, #8B5CF6, #6D28D9, #8B5CF6);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient-pan 2s linear infinite;
}
@keyframes gradient-pan {
    0% { background-position: 200% center; }
    100% { background-position: 0% center; }
}

/* --- Layout & Common --- */
.l-main {
    position: relative;
    z-index: 2;
}
.content-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
}
.l-section {
    padding-top: 120px;
    padding-bottom: 120px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* コンタクトセクションは特別な調整 */
#contact {
    min-height: calc(100vh - 120px); /* フッターの分を引く */
    padding-bottom: 60px; /* フッターとの間隔を調整 */
}

.l-title-h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 80px;
    color: #6b7280;
}
.l-title-h3 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: .05em;
    margin-bottom: 40px;
}
.l-title-h3-description {
    font-size: 1rem;
    line-height: 2;
    color: #4b5563;
}

/* --- Header --- */
.c-header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    color: var(--text-color);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
}
.c-header.is-scrolled {
    color: #1a1a1a;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.1);
}
.c-header-left {
    font-size: 1.25rem;
    font-weight: 800;
}

/* PC用ナビゲーション */
.c-header-nav {
    display: flex;
    align-items: center;
}
.c-header-nav ul {
    display: flex;
    gap: 40px;
    align-items: center;
    font-weight: 600;
    letter-spacing: .1em;
}
.c-header-nav li span {
    cursor: pointer;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s ease;
}
.c-header-nav li span:hover {
    color: var(--accent-color);
}
.c-header-nav li span::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}
.c-header-nav li span:hover::after, 
.c-header-nav li.active span::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.c-header-right {
    display: flex;
    align-items: center;
}
.c-header-right a {
    padding: 10px 20px;
    border: 1px solid var(--text-color);
    border-radius: 999px;
    font-weight: 600;
    transition: background-color 0.3s, color 0.3s;
}
.c-header-right a:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}
.c-header.is-scrolled .c-header-right a {
    border-color: #1a1a1a;
}

/* --- ハンバーガーメニュー --- */
.hamburger-menu {
    display: none;
    z-index: 1001;
    cursor: pointer;
    position: relative;
    width: 24px;
    height: 20px;
    border: none;
    background: transparent;
}
.hamburger-menu span {
    display: block;
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease-in-out;
}
.c-header.is-scrolled .hamburger-menu span {
    background-color: #1a1a1a;
}
.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-menu span:nth-child(3) { bottom: 0; }

.mobile-menu-open .hamburger-menu span:nth-child(1) { 
    top: 50%; 
    transform: translateY(-50%) rotate(45deg); 
}
.mobile-menu-open .hamburger-menu span:nth-child(2) { 
    opacity: 0; 
}
.mobile-menu-open .hamburger-menu span:nth-child(3) { 
    bottom: 50%; 
    transform: translateY(50%) rotate(-45deg); 
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mobile-menu-open .mobile-nav {
    opacity: 1;
    pointer-events: auto;
}
.mobile-nav ul {
    list-style: none;
    padding: 0;
    text-align: center;
}
.mobile-nav li {
    margin: 24px 0;
}
.mobile-nav a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    padding: 10px;
}
.mobile-nav .contact-button {
    margin-top: 40px;
    padding: 12px 32px;
    border: 1px solid var(--accent-color);
    border-radius: 999px;
    color: var(--accent-color);
    font-weight: 700;
}

/* --- particles.js --- */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; 
    pointer-events: none;
}

/* --- First View --- */
.l-section-first {
    height: 100vh;
    min-height: 700px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
.l-title-h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: .05em;
}
.l-title-sub {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .3em;
    margin-top: 24px;
    color: #4b5563;
}
.l-title-h2 {
    margin-top: 15vh;
    font-size: 1.1rem;
    line-height: 2;
    font-weight: 500;
}
.gradient-text {
    background-image: linear-gradient(90deg, #8B5CF6, #6D28D9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* --- Grid (Services) --- */
.l-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background-color: var(--border-color);
    border: 1px solid var(--border-color);
    margin-top: 80px;
}
.l-grid-item {
    background-color: var(--bg-color);
    padding: 40px;
    text-align: center;
}
.l-grid-icon-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
}
.l-grid-business-service {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
}
.l-grid-business-desc {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #4b5563;
}

/* --- Project Gallery (Use Cases) --- */
.l-project-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.l-project-gallery-bg {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    margin-bottom: 24px;
    border-radius: 8px;
    background: #e5e7eb;
    display: block;
}
.l-project-gallery-item {
    background-color: var(--light-gray);
    border-radius: 16px;
    padding: 40px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}
.l-project-gallery-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.l-project-gallery-company,
.l-project-gallery-name {
    font-family: 'Noto Sans JP', 'Work Sans', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.l-project-gallery-company {
    font-size: 0.95rem;
    color: #6D28D9;
    margin-bottom: 0.5em;
}
.l-project-gallery-name {
    font-size: 1.15rem;
    color: #1a1a1a;
    margin-bottom: 0.7em;
}
.l-project-gallery-description {
    font-family: 'Noto Sans JP', 'Work Sans', sans-serif;
    font-size: 0.98rem;
    color: #374151;
    line-height: 1.8;
}

/* --- Contact --- */
.contact-form {
    max-width: 700px;
    margin: 80px auto 0;
}
.input-group {
    margin-bottom: 24px;
}
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}
.form-input, .form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}
.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.2);
}
.submit-button {
    width: 100%;
    padding: 16px;
    background-color: var(--accent-color);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
}
.submit-button:hover {
    background-color: #5B21B6;
}
.submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
#form-message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    display: none;
}
#form-message.success {
    background-color: #d1fae5;
    color: #065f46;
    display: block;
}
#form-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    display: block;
}

.phone-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

/* --- Footer --- */
.l-footer {
    padding: 40px;
    text-align: center;
    color: #6b7280;
    background-color: rgba(249, 250, 251, 0.8);
    border-top: 1px solid var(--border-color);
    scroll-snap-align: end; /* フッターもスナップポイントに */
}
.footer-logo {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-color);
}

/* --- Scroll Animation --- */
.scroll-animation {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s ease;
}
.scroll-animation.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Feature Cards --- */
.feature-card {
    border-radius: 0;
    box-shadow: 0 4px 16px rgba(109, 40, 217, 0.08);
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    color: #1a1a1a;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(237,233,254,0.85) 0%, rgba(243,244,246,0.85) 100%);
    z-index: 1;
}
.feature-card > * {
    position: relative;
    z-index: 2;
}
.ai-model-card { background-image: url('../img/cutting-edge.png'); }
.multi-ai-card { background-image: url('../img/diverse.png'); }
.customize-card { background-image: url('../img/customized.png'); }
.automation-card { background-image: url('../img/advanced.png'); }

/* --- Section Backgrounds --- */
#about,
#use-cases {
    position: relative;
}
#about::before,
#use-cases::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(249, 250, 251, 0.7);
    z-index: -1;
    pointer-events: none;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .l-project-gallery { 
        grid-template-columns: 1fr 1fr; 
    }
}

/* モバイルでのスクロールスナップ調整 */
@media (max-width: 768px) {
    .c-header-nav { 
        display: none; 
    }
    .c-header-right { 
        display: none; 
    }
    .hamburger-menu { 
        display: block; 
    }
    .content-wrap { 
        padding: 0 20px; 
    }
    .l-section { 
        padding-top: 80px; 
        padding-bottom: 80px;
        scroll-snap-align: start;
    }
    #contact {
        min-height: calc(100vh - 100px); /* モバイルでの調整 */
        padding-bottom: 40px;
    }
    .l-title-h3 { 
        font-size: 2rem; 
    }
    .l-project-gallery { 
        grid-template-columns: 1fr; 
    }
    .l-grid { 
        grid-template-columns: 1fr; 
    }
    .loading-logo { 
        font-size: 1.8rem; 
    }
}
