/* ==========================================================================
   Base Styles & Variables
   ========================================================================== */
:root {
    --primary-color: #FF8C00; /* オレンジ（アクセント） */
    --primary-hover: #e67d00;
    --text-main: #333333;
    --text-light: #666666;
    --bg-light: #fafafa;
    --bg-white: #ffffff;
    --border-color: #eaeaea;
    --font-ja: 'Noto Sans JP', sans-serif;
    --font-en: 'Outfit', sans-serif;
    --transition-speed: 0.4s;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-ja);
    color: var(--text-main);
    line-height: 1.8;
    background-color: var(--bg-light);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6, p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-speed);
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

img, video {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 4%;
}

.section {
    padding: 120px 0;
}

/* ==========================================================================
   Typography & Common Components
   ========================================================================== */
.section-title {
    font-family: var(--font-en);
    font-size: 3.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 60px;
    letter-spacing: 0.05em;
    color: #111;
    position: relative;
}

.section-title .ja {
    display: block;
    font-family: var(--font-ja);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 10px;
    letter-spacing: 0.1em;
}

.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 20px 60px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(255, 140, 0, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(255, 140, 0, 0.4);
    color: #fff;
}

.badge {
    display: inline-block;
    background-color: #fff3e0;
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-right: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--primary-color);
}

/* ==========================================================================
   Header
   ========================================================================== */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 20px 5%;
    transition: background 0.3s, padding 0.3s;
}

#header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 5%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.home-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 6px 16px;
    border-radius: 20px;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.home-link:hover {
    background: #fff;
    color: var(--text-color);
}

#header.scrolled .home-link {
    color: var(--text-color);
    border-color: var(--text-color);
}

#header.scrolled .home-link:hover {
    background: var(--text-color);
    color: #fff;
}

#header.scrolled .logo,
#header.scrolled .logo-text {
    color: #333;
}

.logo-img {
    height: 40px;
    /* max-width: 200px; */
    object-fit: contain;
}

.logo-text {
    font-size: 0.7rem;
    font-weight: normal;
    color: #fff;
    margin-top: 5px;
    opacity: 0.8;
}

.nav ul {
    display: flex;
    gap: 30px;
}

.nav a {
    font-family: var(--font-en);
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    text-transform: uppercase;
    transition: color 0.3s;
}

#header.scrolled .nav a {
    color: #333;
}

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

.entry-btn-header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 30px;
    border-radius: 30px;
    font-family: var(--font-en);
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.entry-btn-header:hover {
    background-color: var(--primary-hover);
    transform: scale(1.05);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #000;
}

.video-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.6));
}

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

/* iOS/Safariの大きな再生ボタンなどを強制的に非表示にする */
.hero-video::-webkit-media-controls,
.hero-video::-webkit-media-controls-start-playback-button {
    display: none !important;
    -webkit-appearance: none;
}

#hero-video-1 {
    opacity: 1; /* 第1動画は初期表示 */
}

.video-placeholder-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255,255,255,0.5);
    text-align: center;
    font-size: 0.9rem;
    border: 1px dashed rgba(255,255,255,0.3);
    padding: 20px;
    z-index: 1;
}

.hero-content {
    text-align: center;
    color: #fff;
    z-index: 1;
}

.hero-sub {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 0.1em;
    opacity: 0;
    animation: fadeIn 1s ease forwards 0.5s;
}

.hero-copy {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.4;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.fade-in-text {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
}

.scroll-prompt {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    font-family: var(--font-en);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    z-index: 1;
}

.scroll-prompt .line {
    width: 1px;
    height: 60px;
    background-color: rgba(255,255,255,0.3);
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.scroll-prompt .line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    animation: scrollLine 2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

@keyframes scrollLine {
    0% { transform: translateY(-100%); }
    50% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

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

/* ==========================================================================
   Vision Section
   ========================================================================== */
.vision {
    background-color: var(--bg-white);
}

.vision .container {
    display: flex;
    align-items: center;
    gap: 80px;
}

.vision-content {
    flex: 1;
}

.vision-content .section-title {
    text-align: left;
}

.vision-image {
    flex: 1;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 500px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    z-index: 1;
}

.vision-image img {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 120%;
    object-fit: cover;
    z-index: 2; /* プレースホルダーを隠す */
}

.lead-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 30px;
    line-height: 1.6;
}

.vision-content .desc {
    font-size: 1.05rem;
    color: var(--text-light);
}

/* ==========================================================================
   Culture Section
   ========================================================================== */
.culture {
    background-color: var(--bg-light);
    text-align: center;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 60px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    aspect-ratio: 16/9;
    background-color: #fff;
    cursor: pointer;
}

.gallery-item:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 21/9;
}

.gallery-item img,
.gallery-item .h-carousel-wrapper {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 2;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* Horizontal Carousel for Gallery */
.h-carousel-wrapper {
    background: #000;
    overflow: hidden;
}

.h-carousel-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.h-carousel-container {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.h-carousel-item {
    min-width: 100%;
    height: 100%;
}

.h-carousel-item video,
.h-carousel-item iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
}

.h-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    color: var(--primary-color);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.h-carousel-btn:hover {
    background: rgba(255, 255, 255, 1);
}

.h-carousel-btn.prev {
    left: 10px;
}

.h-carousel-btn.next {
    right: 10px;
}

.gallery-item .caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    font-weight: bold;
    text-align: left;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 3;
    pointer-events: none;
}

.gallery-item:hover .caption {
    transform: translateY(0);
    opacity: 1;
}

/* ==========================================================================
   Work Style Section
   ========================================================================== */
.workstyle {
    position: relative;
    background-color: #111;
    color: #fff;
    overflow: hidden;
}

.workstyle .section-title {
    color: #fff;
}

.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-bottom: 80px;
}

.feature-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 50px 40px;
    border-radius: 20px;
    position: relative;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, background 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    background: rgba(255,255,255,0.08);
    border-color: var(--primary-color);
}

.feature-icon {
    font-family: var(--font-en);
    font-size: 4rem;
    font-weight: 900;
    color: rgba(255, 140, 0, 0.2);
    position: absolute;
    top: 20px;
    right: 30px;
    line-height: 1;
    transition: color 0.3s ease;
}

.feature-card:hover .feature-icon {
    color: rgba(255, 140, 0, 0.5);
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.feature-desc {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.training-banner {
    background: linear-gradient(135deg, var(--primary-color), #ff6b00);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(255, 140, 0, 0.2);
}

.training-banner h3 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 20px;
    color: #fff;
}

.training-banner p {
    font-size: 1.1rem;
    font-weight: bold;
}

/* ==========================================================================
   Voice Section (Carousel)
   ========================================================================== */
.voice {
    background-color: var(--bg-white);
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 50px;
}

.carousel-track {
    overflow: hidden;
    width: 100%;
}

.carousel-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    min-width: 33.333%;
    padding: 0 10px;
}

.carousel-item iframe {
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    color: var(--primary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s, color 0.3s;
}

.carousel-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.carousel-btn.prev {
    left: 0;
}

.carousel-btn.next {
    right: 0;
}

/* ==========================================================================
   Requirements Section
   ========================================================================== */
.requirements {
    background-color: var(--bg-light);
}

.req-table {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-radius: 15px;
    overflow: hidden;
}

.req-table th, .req-table td {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.req-table tr:last-child th,
.req-table tr:last-child td {
    border-bottom: none;
}

.req-table th {
    width: 25%;
    background-color: #f8f9fa;
    font-weight: 700;
    color: #111;
}

.req-table td {
    width: 75%;
    color: var(--text-main);
    line-height: 1.8;
}

/* ==========================================================================
   Entry Section
   ========================================================================== */
.entry {
    background: linear-gradient(135deg, #111 0%, #333 100%);
    text-align: center;
    color: #fff;
    padding: 150px 0;
}

.entry-title {
    font-family: var(--font-en);
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 30px;
    letter-spacing: 0.1em;
}

.entry-message {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 50px;
    line-height: 1.6;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background-color: #000;
    color: #fff;
    text-align: center;
    padding: 60px 0;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 20px;
}

.copyright {
    font-family: var(--font-en);
    font-size: 0.9rem;
    color: #666;
    letter-spacing: 0.1em;
}

/* ==========================================================================
   Floating Action Button
   ========================================================================== */
.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.floating-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-btn a {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: #fff;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px rgba(255, 140, 0, 0.4);
    transition: all 0.3s ease;
}

.floating-btn a:hover {
    background-color: var(--primary-hover);
    transform: scale(1.05);
}

.floating-btn .icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

/* ==========================================================================
   Animations
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

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

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .vision .container {
        flex-direction: column;
        gap: 40px;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .gallery {
        grid-template-columns: 1fr;
    }
    
    .req-table th, .req-table td {
        display: block;
        width: 100%;
    }
    
    .req-table th {
        border-bottom: none;
        padding-bottom: 10px;
    }
    
    .req-table td {
        padding-top: 0;
    }
}

@media (max-width: 768px) {
    .hero-copy {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .nav {
        display: none; /* スマホではナビゲーションを隠すかハンバーガーメニューにする */
    }
    
    .lead-text {
        font-size: 1.3rem;
    }
    
    .entry-title {
        font-size: 3rem;
    }

    .trust-content {
        flex-direction: column;
        padding: 40px 20px;
    }
    
    .mile-content {
        flex-direction: column-reverse;
        padding: 40px 20px;
    }
    
    .carousel-item {
        min-width: 100%;
    }
    .carousel-wrapper {
        padding: 0 40px;
    }
}

/* ==========================================================================
   Mile Section
   ========================================================================== */
.mile {
    background: linear-gradient(135deg, #fff 0%, #FFFBED 100%);
}

.mile-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.mile-text {
    flex: 3;
}

.mile-image {
    flex: 2;
    display: flex;
    justify-content: center;
}

.mile-coin-img {
    width: 250px;
    height: 250px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

/* ==========================================================================
   Trust Section
   ========================================================================== */
.trust {
    background-color: #f0f4f8;
}

.trust-content {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 60px;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.05);
    gap: 50px;
}

.trust-text {
    flex: 2;
}

.trust-logo {
    flex: 1;
    text-align: center;
}

.casy-logo-img {
    max-width: 250px;
}

/* ==========================================================================
   Modal (Popup)
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
}

.modal-content iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--primary-color);
}

.h-carousel-item iframe {
    pointer-events: none; /* Let the container handle clicks to open modal */
}
