:root {
    --primary-navy: #0B1E36;
    /* Deep sophisticated navy */
    --accent-orange: #FF5A00;
    /* Energetic Orange (B-Cargo benchmark) */
    --accent-yellow: #FFB800;
    /* Energetic Yellow */
    --bg-white: #FFFFFF;
    --bg-soft: #F4F7F9;
    --text-main: #1A202C;
    --text-muted: #4A5568;
    --border-color: #E2E8F0;
    --shadow-premium: 0 20px 40px rgba(11, 30, 54, 0.08);
    /* Updated with new navy RGB */
    --shadow-hover: 0 30px 60px rgba(255, 90, 0, 0.15);
    /* Orange glow on hover */
    --border-radius: 12px;
    --border-radius-lg: 24px;
    --font-main: 'Inter', 'Noto Sans JP', sans-serif;
    --font-heading: 'Outfit', 'Noto Sans JP', sans-serif;
}

*, *:before, *:after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: hidden !important;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

#app-wrapper {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    font-family: var(--font-main);
    line-height: 1.8;
    color: var(--text-main);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

html {
    overflow-x: hidden;
    width: 100%;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
    font-weight: 800;
    color: var(--primary-navy);
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2rem, 8vw, 4.5rem);
}

h2 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
}

h3 {
    font-size: 1.5rem;
}

/* 共通パーツ */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        margin: 0 auto !important;
    }
}

.section-padding {
    padding: 100px 0;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 60px 0 !important;
    }
    body {
        font-size: 15px !important;
        line-height: 1.9 !important;
    }
}

/* アニメーション */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform, opacity;
}

.reveal.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Ensure no elements stick out during animation */
#app-wrapper {
    overflow: hidden;
    width: 100%;
}

/* Fallback for when JS is disabled or fails to load */
.no-js .reveal {
    opacity: 1;
    transform: translateY(0);
}

/* ボタン */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: var(--primary-navy);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 26, 53, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    background: var(--accent-orange);
}

.btn-gold {
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-yellow) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(255, 90, 0, 0.2);
}

.btn-gold:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    opacity: 0.95;
}

.btn-dark {
    background: var(--primary-navy);
    color: white;
}

.btn-dark:hover {
    background: #001a35;
    transform: translateY(-2px);
}

.btn-large {
    padding: 20px 48px;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .btn {
        width: 100% !important;
        min-height: 48px !important;
        padding: 12px 24px !important;
        font-size: 1rem !important;
        border-radius: 8px !important;
    }
}

/* ヘッダー */
header {
    height: 90px;
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 900;
    color: var(--primary-navy);
    letter-spacing: -0.05em;
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .logo {
        font-size: 1.3rem;
    }
    header {
        height: 70px;
    }
    .header-container {
        padding: 0 15px !important;
    }
}

nav ul {
    display: flex;
    gap: 48px;
}

nav ul a {
    font-weight: 700;
    color: var(--primary-navy);
    position: relative;
}

nav ul a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-orange);
    transition: width 0.3s;
}

nav ul a:hover::after {
    width: 100%;
}

@media (max-width: 992px) {
    nav,
    .header-btn {
        display: none;
    }

    .hamburger {
        display: block;
        cursor: pointer;
        z-index: 3000 !important;
        background: transparent;
        border: none;
        padding: 10px;
    }

    .hamburger span {
        display: block;
        width: 28px;
        height: 2px;
        background: var(--primary-navy);
        margin-bottom: 6px;
        transition: all 0.3s ease;
    }

    .hamburger span:last-child {
        margin-bottom: 0;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* Mobile Menu Overlay */
.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: var(--primary-navy);
    z-index: 2000;
    padding: 120px 40px 40px;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav.active {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    opacity: 1;
}

.mobile-nav ul {
    list-style: none;
    padding: 0 40px;
}

.mobile-nav ul li {
    margin-bottom: 32px;
}

.mobile-nav ul li a {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s;
}

.mobile-nav ul li a:hover {
    color: var(--accent-orange);
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* ヒーロー */
.hero {
    padding-top: 180px;
    padding-bottom: 120px;
    background: var(--bg-soft);
}

main {
    overflow-x: hidden;
    width: 100%;
}

/* Hero Section Styles */
.hero-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 140px;
    background-color: var(--primary-navy);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 8vw, 4.5rem);
    line-height: 1.2;
    margin-bottom: 24px;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: clamp(20px, 6vw, 24px) !important;
        line-height: 1.3;
        white-space: normal;
    }
    .hero-section {
        padding-top: 100px;
        min-height: 40vh;
    }
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 48px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* カード系 */
.card {
    background: white;
    padding: 48px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all 0.4s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
    border-color: transparent;
    position: relative;
}

.card:hover::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-yellow));
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* バッジ */
.badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    background: rgba(255, 90, 0, 0.1);
    /* Soft orange background */
    color: var(--accent-orange);
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 90, 0, 0.2);
    /* Subtle border */
}

@media (max-width: 768px) {
    .section-padding {
        padding: 60px 0 !important;
    }
    .card {
        padding: 32px 20px !important;
        border-radius: 8px !important;
    }
    h2 {
        font-size: 1.6rem !important;
        line-height: 1.4 !important;
        margin-bottom: 24px !important;
        text-align: center;
    }
    h3 {
        font-size: 1.3rem !important;
        line-height: 1.4 !important;
        margin-bottom: 16px !important;
    }
    p {
        text-align: left !important;
    }
    .badge {
        margin-bottom: 12px !important;
    }
}

/* Recruitment Flow Steps */
.step-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 60px 0;
}

.step-container::before {
    content: "";
    position: absolute;
    top: 40px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #E2E8F0;
    z-index: 1;
}

.step-item {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 18%;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--accent-orange);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    margin: 0 auto 20px;
    box-shadow: 0 10px 20px rgba(255, 90, 0, 0.2);
}

.step-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-navy);
}

.step-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.4;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

@media (max-width: 992px) {
    .grid-4, .grid-3, .grid-2 {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 992px) {

    .grid-4,
    .grid-3,
    .grid-2,
    .grid-2-responsive {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

.grid-2-responsive {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

@media (max-width: 768px) {
    .grid-2-responsive {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    /* SP Optimization: Image first, Text second */
    .grid-2-responsive {
        display: flex;
        flex-direction: column;
    }
    .grid-2-responsive > div {
        width: 100% !important;
    }
    .grid-2-responsive img {
        width: 100% !important;
        height: auto !important;
        max-height: 60vh !important;
        object-fit: cover !important;
        border-radius: 8px !important;
        margin-bottom: 16px !important;
    }
    .mobile-reverse {
        flex-direction: column; /* Force normal order: Image -> Text if HTML is Image then Text */
        /* If HTML is Text then Image, we use column-reverse to make it Image -> Text */
    }
}

/* Case Card Decoration */
.card-case {
    border-top: 4px solid var(--accent-orange);
}

.card-recruit-benefit {
    text-align: center;
    padding: 40px 30px;
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group label span {
    color: var(--accent-orange);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-orange);
}

/* Typography Helpers */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-40 {
    margin-bottom: 40px;
}

.mb-60 {
    margin-bottom: 60px;
}

/* Emphasis & Layout Helpers */
.text-emphasize {
    font-weight: 900;
    color: var(--primary-navy);
    display: inline-block;
    position: relative;
}

.text-emphasize::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 0.4em;
    background: var(--accent-orange);
    opacity: 0.3;
    z-index: -1;
}

.phrase {
    display: inline-block;
    white-space: nowrap;
}

.no-orphan {
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.pc-only-br {
    display: inline;
}

.mobile-only-br {
    display: none;
}

@media (max-width: 768px) {
    .pc-only-br {
        display: none;
    }

    .mobile-only-br {
        display: inline;
    }
    
    /* Mobile button full width */
    .hero-section .btn-primary,
    .hero-section .btn-outline,
    .cta-minimal .btn-cta {
        width: 100%;
        margin-bottom: 12px;
    }
    .hero-section .btn-primary,
    .hero-section .btn-outline {
        display: block;
    }

    /* Mobile Table Fix */
    table {
        display: block;
        width: 100% !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile table stack */
    .company-info-table th,
    .company-info-table td {
        display: block !important;
        width: 100% !important;
        padding: 12px 0 !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    .company-info-table th {
        padding-top: 24px !important;
        color: var(--primary-navy) !important;
        font-weight: 700 !important;
    }

    /* Mobile Step Flow */
    .step-container {
        flex-direction: column;
        gap: 48px;
        align-items: center;
    }

    .step-container::before {
        display: none;
    }

    .step-item {
        width: 100%;
        max-width: 400px;
    }

    .step-number {
        margin-bottom: 12px;
    }
}

/* フッター */
footer {
    background: var(--primary-navy);
    color: white;
    padding: 60px 0 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 900;
    color: var(--primary-navy);
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-navy);
}

.footer-info p {
    opacity: 0.6;
    font-size: 0.85rem;
    margin-top: 4px;
}

.footer-minimal-links {
    display: flex;
    gap: 24px;
    list-style: none;
    padding: 0;
    flex-wrap: wrap;
}

.footer-minimal-links li a {
    font-size: 0.85rem;
    color: #ffffff;
    opacity: 0.7;
    transition: opacity 0.3s, color 0.3s;
}

.footer-minimal-links li a:hover {
    opacity: 1;
    color: var(--accent-orange);
}

.copyright {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0.4;
    font-size: 0.75rem;
    text-align: left;
}

.cta-minimal {
    padding: 60px 0;
    text-align: center;
    background: var(--primary-navy);
    color: white;
}

.cta-minimal h2 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.cta-minimal p {
    margin-bottom: 30px;
    opacity: 0.8;
    font-size: 1rem;
}

.cta-minimal .btn-cta {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
}

.cta-minimal .btn-cta:hover {
    background: white;
    color: var(--primary-navy);
    border-color: white;
}

.cta-minimal .btn-cta-primary {
    background: white;
    border-color: white;
    color: var(--primary-navy);
}

.cta-minimal .btn-cta-primary:hover {
    background: transparent;
    color: white;
}

.footer-info p {
    opacity: 0.7;
    margin-bottom: 8px;
}

.footer-links h4 {
    color: white;
    margin-bottom: 24px;
}

.footer-links ul li {
    list-style: none;
    margin-bottom: 16px;
}

.footer-links a {
    opacity: 0.7;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
}

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 40px;
    font-size: 0.875rem;
    opacity: 0.5;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: var(--accent-orange);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(255, 90, 0, 0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    border: none;
    cursor: pointer;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-5px);
    background: var(--primary-navy);
    box-shadow: var(--shadow-hover);
}

#back-to-top svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

html {
    scroll-behavior: smooth;
}

/* ===== SP最適化（追加） ===== */
@media (max-width: 768px) {

    /* ヒーローエリアのボタン群を縦積みに */
    .hero-content div[style*="display: flex"],
    section div[style*="display: flex"][style*="gap: 20px"] {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
    }

    /* CTA セクション内ボタン全幅化 */
    .cta-minimal div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 12px !important;
    }
    .cta-minimal .btn-cta {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        box-sizing: border-box !important;
        padding: 14px 20px !important;
    }

    /* フッターを縦積みに */
    .footer-content {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 20px !important;
    }
    .footer-minimal-links {
        gap: 16px !important;
        flex-wrap: wrap !important;
    }

    /* テーブルをSPで縦積みに - 強化版 */
    .company-info-table,
    .company-info-table tbody,
    .company-info-table tr,
    .company-info-table th,
    .company-info-table td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .company-info-table tr {
        padding: 20px 0 !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    .company-info-table th {
        padding: 0 0 8px 0 !important;
        border: none !important;
        font-size: 0.85rem !important;
        color: var(--text-muted) !important;
        text-align: left !important;
    }
    .company-info-table td {
        padding: 0 !important;
        border: none !important;
        font-weight: 700 !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    /* 代表写真の縦長を抑制 */
    div[style*="aspect-ratio: 3/4"] {
        aspect-ratio: auto !important;
        max-height: 70vw !important;
    }

    /* ソリューションカード内パディング調整 */
    .card > .grid-2-responsive > div[style*="padding: 40px"] {
        padding: 24px 20px !important;
    }

    /* service.htmlのSolutionカード：画像を上に */
    .card .grid-2-responsive > div:first-child img {
        max-height: 250px !important;
        object-fit: cover !important;
    }

    /* page-headerセクションのpaddingをSPに合わせる */
    section[style*="padding-top: 180px"] {
        padding-top: 100px !important;
    }

    /* recruit.htmlの募集中バナーのフォントサイズ調整 */
    .text-center p[style*="font-size: 1.1rem"][style*="font-weight: 700"] {
        font-size: 0.95rem !important;
        line-height: 1.8 !important;
    }
}