/* リセット & ベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #005a87;
    --primary-dark: #004366;
    --primary-light: #0071a8;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", "Meiryo", "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--bg-white);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all 0.3s ease-in-out;
}

header.scrolled {
    box-shadow: var(--shadow-md);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

/* ロゴはナビの残り幅だけを使い、その中で縮小表示 */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 36px;
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
}

.logo a {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
    flex-shrink: 1;
    min-width: 0;
}

.logo-img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    flex-shrink: 1;
    min-width: 0;
}

.logo-text {
    font-size: clamp(0.65rem, 1.5vw, 1.1rem);
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    flex-shrink: 0;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease-in-out;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a:hover::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease-in-out;
}

/* ヒーローセクション */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 80px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 2;
    pointer-events: none;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.hero-image.active {
    opacity: 1;
    z-index: 1;
}

.hero-image:not(.active) {
    opacity: 0;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 2rem;
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--bg-white);
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--bg-white);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out 0.4s both;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: var(--primary-color);
    color: var(--bg-white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease-in-out;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 1s ease-out 0.6s both;
}

.cta-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.cta-button:active {
    transform: translateY(0);
}

/* セクション共通 */
section {
    padding: 5rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

section h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 1rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 2px;
}

/* 事業内容セクション */
.services {
    background-color: var(--bg-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.service-card {
    background-color: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s ease-in-out;
    opacity: 0;
    transform: translateY(30px);
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card:nth-child(1) {
    transition-delay: 0.1s;
}

.service-card:nth-child(2) {
    transition-delay: 0.2s;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.service-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.service-image .service-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, transform 0.5s ease-in-out;
}

.service-image .service-img.active {
    opacity: 1;
    z-index: 1;
}

.service-card:hover .service-image .service-img.active {
    transform: scale(1.05);
}

/* 画像ナビゲーション矢印 */
.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease-in-out;
    opacity: 0;
}

.service-image:hover .image-nav {
    opacity: 1;
}

.image-nav:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.image-nav-prev {
    left: 10px;
}

.image-nav-next {
    right: 10px;
}

/* 画像ドット */
.image-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.image-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.image-dot.active {
    background-color: white;
    border-color: white;
    transform: scale(1.2);
}

.image-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* 画像モーダル */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 48px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease-in-out;
    z-index: 10002;
}

.modal-close:hover {
    transform: scale(1.2) rotate(90deg);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 36px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease-in-out;
    z-index: 10002;
}

.modal-nav:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: translateY(-50%) scale(1.1);
}

.modal-nav-prev {
    left: -80px;
}

.modal-nav-next {
    right: -80px;
}

.modal-dots {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    z-index: 10002;
}

.modal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.modal-dot.active {
    background-color: white;
    border-color: white;
    transform: scale(1.3);
}

.modal-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* スマホ用の改行 */
.br-sp {
    display: none;
}

@media (max-width: 768px) {
    .br-sp {
        display: block;
    }
}

@media (max-width: 768px) {
    .service-image {
        height: 300px;
    }

    .image-nav {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .modal-nav {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }

    .modal-nav-prev {
        left: 10px;
    }

    .modal-nav-next {
        right: 10px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        font-size: 36px;
    }
}

.service-content {
    padding: 2rem;
}

.service-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.service-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background-color: var(--primary-color);
    color: var(--bg-white);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease-in-out;
}

.tag:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

/* 会社概要セクション */
.about {
    background-color: var(--bg-white);
}

.about-content {
    max-width: 700px;
    margin: 0 auto;
}

.company-info {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.company-info tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease-in-out;
}

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

.company-info tr:hover {
    background-color: var(--bg-light);
}

.company-info th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    width: 40%;
    background-color: var(--bg-light);
}

.company-info td {
    padding: 1.25rem 1.5rem;
    color: var(--text-secondary);
}

.company-info a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease-in-out;
}

.company-info a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* アクセスセクション */
.access {
    background-color: var(--bg-light);
}

.access-content {
    text-align: center;
    padding: 2rem;
}

.access-note {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* お問い合わせセクション */
.contact {
    background-color: var(--bg-white);
}

.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-email {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: var(--bg-white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease-in-out;
    box-shadow: var(--shadow-md);
}

.contact-email:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* フッター */
footer {
    background-color: var(--text-primary);
    color: var(--bg-white);
    padding: 2rem 0;
    text-align: center;
}

footer p {
    margin-bottom: 0.5rem;
}

.footer-contact a {
    color: var(--bg-white);
    text-decoration: none;
    transition: color 0.3s ease-in-out;
}

.footer-contact a:hover {
    color: var(--primary-light);
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: var(--bg-white);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease-in-out;
}

.footer-links a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* アニメーション */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-up {
    animation: fadeInUp 0.6s ease-out;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background-color: var(--bg-white);
        width: 100%;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        transition: left 0.3s ease-in-out;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    nav {
        padding: 1rem 15px;
    }

    .logo {
        height: 34px;
        max-width: calc(100% - 50px);
    }

    .logo-text {
        font-size: clamp(0.6rem, 2.5vw, 0.85rem);
    }

    .hero {
        min-height: 80vh;
        padding-top: 100px;
    }

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

    section {
        padding: 3rem 0;
    }

    .company-info th,
    .company-info td {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .company-info th {
        width: 35%;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 1rem 10px;
    }

    .logo {
        height: 32px;
        max-width: calc(100% - 45px);
        gap: 0.35rem;
    }

    .logo-text {
        font-size: clamp(0.55rem, 2.5vw, 0.75rem);
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .cta-button,
    .contact-email {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .service-content {
        padding: 1.5rem;
    }

    .company-info th,
    .company-info td {
        padding: 1rem;
        font-size: 0.9rem;
    }
}
