:root {
    --primary-color: #0b2149; /* Navy */
    --secondary-color: #1a498b;
    --accent-color: #ff6b6b; /* Action color */
    --accent-hover: #ff4757;
    --text-color: #333333;
    --text-light: #666666;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --border-color: #eaeaea;
    --transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1); /* Snappier, more pronounced easing */
}

/* Reset and Base */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body { 
    font-family: 'Noto Sans JP', sans-serif; 
    color: var(--text-color); 
    background: var(--bg-color); 
    line-height: 1.6; 
    
    /* Page Load Fade-in Animation */
    opacity: 0;
    animation: pageLoad 1s cubic-bezier(0.25, 1, 0.25, 1) forwards;
}

/* Page Transition Out Class (added via JS) */
body.page-leaving {
    opacity: 0;
    transform: scale(0.98) translateY(-20px);
    transition: opacity 0.5s ease-in, transform 0.5s ease-in;
}

@keyframes pageLoad {
    0% { opacity: 0; transform: scale(1.02) translateY(20px); filter: blur(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

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

li { 
    list-style: none; 
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

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

.section-title { 
    text-align: center; 
    font-size: 2.5rem; 
    color: var(--primary-color); 
    margin-bottom: 4rem; 
    font-weight: 700;
    letter-spacing: 0.05em;
}

.section-title::after { 
    content: ''; 
    display: block; 
    width: 60px; 
    height: 4px; 
    background: var(--accent-color);
    margin: 20px auto 0; 
    border-radius: 2px;
    transition: width 0.6s ease;
}

.section-title:hover::after {
    width: 120px;
}

section { 
    padding: 7rem 0; 
}

.btn-wrap-center {
    text-align: center;
    margin-top: 3.5rem;
}

.view-more-btn {
    display: inline-block;
    padding: 1rem 3rem;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
    border-radius: 50px;
    transition: var(--transition);
    background: transparent;
}

.view-more-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(11, 33, 73, 0.2);
}

/* Header */
.header { 
    position: fixed; 
    top: 0; 
    left: 0;
    width: 100%; 
    height: 80px; 
    background: rgba(255,255,255,0.9); 
    backdrop-filter: blur(15px); 
    box-shadow: 0 5px 25px rgba(0,0,0,0.08); 
    z-index: 1000; 
    transition: transform 0.4s ease, height 0.4s ease; 
}

.header-inner { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 4%; 
    height: 100%; 
}

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

.logo img { 
    height: 40px; 
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo:hover img {
    transform: scale(1.1) rotate(2deg);
}

.nav-list { 
    display: flex; 
    align-items: center; 
    gap: 3rem; 
}

.nav-list a { 
    font-weight: 600; 
    color: var(--primary-color); 
    font-size: 1.05rem;
    position: relative;
    padding: 5px 0;
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

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

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

.btn-contact { 
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); 
    color: #fff !important; 
    padding: 0.9rem 2.2rem; 
    border-radius: 50px; 
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(11, 33, 73, 0.25);
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
    border: none !important;
}

.btn-contact::after { display: none !important; }

.btn-contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

.btn-contact:hover { 
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(11, 33, 73, 0.4);
}

.btn-contact:hover::before {
    left: 100%;
}

/* Hamburger */
.hamburger { 
    display: none; 
    background: none; 
    border: none; 
    cursor: pointer; 
    width: 30px; 
    height: 22px; 
    position: relative; 
    z-index: 1001; 
}

.hamburger span { 
    position: absolute; 
    width: 100%; 
    height: 2px; 
    background: var(--primary-color); 
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); 
    left: 0; 
    border-radius: 2px;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger span:nth-child(3) { bottom: 0; }

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

/* Hero Section */
.hero { 
    height: 100vh; 
    position: relative; 
    overflow: hidden; 
    padding: 0; 
}

.hero::after { 
    content: ''; 
    position: absolute; 
    inset: 0; 
    background: linear-gradient(135deg, rgba(11,33,73,0.8) 0%, rgba(26,73,139,0.4) 100%); 
    z-index: 1; 
}

.hero-slides { 
    position: absolute; 
    inset: 0; 
    width: 100%; 
    height: 100%; 
}

.slide { 
    position: absolute; 
    inset: 0; 
    background-size: cover; 
    background-position: center; 
    opacity: 0; 
    transition: opacity 2s ease-in-out, transform 8s ease-out; 
    transform: scale(1.15) rotate(1deg);
}

.slide.active { 
    opacity: 1; 
    transform: scale(1) rotate(0deg);
}

.hero-content { 
    position: relative; 
    z-index: 2; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    height: 100%; 
    text-align: center; 
    color: #fff; 
    padding: 0 4%; 
}

.hero-catchphrase { 
    font-size: 4rem; 
    font-weight: 800; 
    margin-bottom: 3rem; 
    line-height: 1.4; 
    text-shadow: 0 4px 20px rgba(0,0,0,0.6); 
    animation: textPopUp 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    transform: translateY(50px) scale(0.9);
    animation-delay: 0.3s;
}

.hero-btn { 
    background: linear-gradient(135deg, var(--accent-color), #ff8a8a); 
    color: #fff; 
    font-size: 1.4rem; 
    font-weight: 800; 
    padding: 1.5rem 4rem; 
    border-radius: 50px; 
    box-shadow: 0 10px 30px rgba(255,107,107,0.5); 
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); 
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
    animation: floatUp 1s ease-out forwards;
    animation-delay: 0.8s;
}

.hero-btn:hover { 
    background: linear-gradient(135deg, var(--accent-hover), #ff6b6b);
    transform: translateY(-8px) scale(1.08); 
    box-shadow: 0 20px 40px rgba(255,107,107,0.8); 
    color: #fff;
    letter-spacing: 0.05em;
}

@keyframes textPopUp {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes floatUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Services Section (Cards) */
.services {
    background: var(--bg-color);
}

.services-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 3rem; 
    row-gap: 4.5rem; 
}

.service-card { 
    display: block; 
    background: #fff; 
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.06); 
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); 
    border: 1px solid var(--border-color); 
    transform-origin: center bottom;
}

.service-card:hover { 
    transform: translateY(-20px) scale(1.05); 
    box-shadow: 0 30px 60px rgba(11, 33, 73, 0.2); 
    border-color: transparent;
    z-index: 10;
}

.service-img-wrapper {
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
}

.service-img-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(11,33,73,0);
    transition: background 0.5s ease;
    z-index: 1;
}

.service-card:hover .service-img-wrapper::after {
    background: rgba(11,33,73,0.2);
}

.service-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1); 
}

.service-card:hover .service-img { 
    transform: scale(1.15) rotate(2deg); 
}

.service-info { 
    padding: 2.2rem; 
    background: #fff; 
    position: relative; 
    z-index: 2; 
    transition: background 0.5s ease;
}

.service-title { 
    font-size: 1.4rem; 
    color: var(--primary-color); 
    margin-bottom: 1rem; 
    font-weight: 800; 
    transition: color 0.3s;
}

.service-card:hover .service-title {
    color: var(--accent-color);
}

.service-desc { 
    font-size: 1rem; 
    color: var(--text-light); 
    line-height: 1.7;
}

/* Page Header and Detail (For Child Pages) */
.page-header {
    padding: 180px 0 100px;
    background: linear-gradient(135deg, var(--bg-light) 0%, #e0e6ed 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,107,107,0.05) 0%, transparent 60%);
    animation: rotateGradient 20s linear infinite;
}

@keyframes rotateGradient {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.page-header h1 {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
    text-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.page-header p {
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

.service-detail-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 6rem 0;
}
.service-detail-container {
    display: flex;
    gap: 3.5rem;
    align-items: flex-start;
    margin-bottom: 3.5rem;
}
.service-detail-container img {
    flex: 0 0 20%;      /* Image size reduced to 20% of max width */
    max-width: 200px;   /* Adding an absolute max width capping */
    border-radius: 20px;
    width: 100%;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.service-detail-container img:hover {
    transform: scale(1.02) translateY(-10px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
}
.service-detail-container .service-text {
    flex: 1;
}
.service-detail-container p {
    font-size: 1.15rem;
    line-height: 2;
    color: var(--text-color);
    text-align: left;
}
@media (max-width: 768px) {
    .service-detail-container {
        flex-direction: column;
        gap: 2rem;
    }
    .service-detail-container img {
        width: 100%;
    }
}
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 3rem;
    background: var(--bg-light);
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-color);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.back-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(11,33,73,0.3);
}

/* Strengths Section */
.strengths { 
    background: var(--bg-light); 
}

.strengths-grid { 
    display: flex;
    flex-direction: column; 
    gap: 3rem; 
}

.strength-card { 
    background: #fff; 
    padding: 3.5rem 4rem; 
    border-radius: 20px; 
    box-shadow: 0 8px 30px rgba(0,0,0,0.04); 
    text-align: left; 
    border-left: 10px solid var(--primary-color); 
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.strength-card:hover {
    transform: translateX(15px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); 
    border-left-width: 15px;
}

.strength-number {
    font-size: 8rem;
    font-weight: 900;
    color: var(--primary-color);
    opacity: 0.1;
    position: absolute;
    top: -20px;
    right: 40px;
    line-height: 1;
    user-select: none;
    transition: all 0.5s ease;
}

.strength-card:hover .strength-number {
    transform: scale(1.1);
    opacity: 0.15;
    color: var(--accent-color);
}

.strength-title { 
    color: var(--primary-color); 
    margin-bottom: 1.5rem; 
    font-size: 1.4rem; 
    font-weight: 800;
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

.strength-desc {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.8;
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .strength-card {
        padding: 2.5rem 1.5rem;
    }
    .strength-number {
        font-size: 5rem;
        top: -10px;
        right: 15px;
    }
}

.emphasis {
    font-weight: 800;
    color: var(--accent-color);
    text-emphasis: filled dot;
    text-emphasis-position: over;
    -webkit-text-emphasis: filled dot;
    -webkit-text-emphasis-position: over;
    padding: 0 0.1em;
}

/* Ruby Furigana Styling */
ruby {
    font-family: inherit;
}
ruby rt {
    font-size: 0.55em;
    letter-spacing: 0.05em;
    color: inherit;
    font-weight: normal;
}

/* News & Blog Section */
.news {
    background: var(--bg-color);
}

.news-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.news-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.news-item:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 45px rgba(11, 33, 73, 0.15);
    border-color: transparent;
}

.news-thumb {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.news-item:hover .news-thumb img {
    transform: scale(1.1) rotate(1deg);
}

.news-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.news-date {
    color: var(--text-light);
    font-weight: 500;
}

.news-category {
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}

.tag-news { background: var(--primary-color); }
.tag-blog { background: var(--accent-color); }
.tag-case { background: #2ed573; }

.news-title {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-weight: 700;
    transition: color 0.3s;
}

.news-item:hover .news-title {
    color: var(--accent-color);
}

.news-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* About Section */
.about { 
    background: var(--bg-light); 
}

.about-content { 
    display: flex; 
    gap: 6rem; 
    align-items: center; 
}

.about-text { 
    flex: 1; 
}

.about-text p { 
    margin-bottom: 1.8rem; 
    font-size: 1.1rem; 
    line-height: 1.8;
}

.about-tagline {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 2.5rem 0;
    padding: 1.5rem;
    background: #fff;
    border-left: 5px solid var(--accent-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    display: inline-block;
}

.company-info { 
    display: grid; 
    grid-template-columns: 100px 1fr; 
    gap: 1.5rem; 
    margin-top: 3rem; 
    border-top: 2px solid #ddd; 
    padding-top: 2.5rem; 
}

.company-info dt { 
    font-weight: 800; 
    color: var(--primary-color); 
}

.about-img { 
    flex: 1; 
    border-radius: 20px; 
    overflow: hidden; 
    /* removed box-shadow to emphasize the logo itself if transparent */
    position: relative;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    background: rgba(255,255,255,0.5); /* subtle backdrop */
}

.about-img:hover {
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg) scale(1.03);
}

.about-img img { 
    width: auto; 
    max-width: 100%;
    max-height: 400px; /* Prevent over-stretching */
    height: auto; 
    display: block; 
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1)); /* Add depth instead of container shadow */
}

/* Footer */
.footer { 
    background: var(--primary-color); 
    color: #fff; 
    padding: 6rem 0 3rem; 
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 5px;
    background: linear-gradient(90deg, var(--accent-color), #ffb8b8);
}

.footer-top { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 4rem; 
    border-bottom: 1px solid rgba(255,255,255,0.15); 
    padding-bottom: 4rem; 
}

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

.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.footer-logo-link .logo-text {
    color: #fff;
    font-size: 1.8rem;
}

.footer-logo img {
    height: 60px;
    opacity: 0.95;
    transition: opacity 0.3s;
}

.footer-logo:hover img {
    opacity: 1;
}

.footer-nav ul { 
    display: flex; 
    gap: 3rem; 
    font-weight: 600;
}

.footer-nav a {
    color: rgba(255,255,255,0.8);
    position: relative;
    padding-bottom: 5px;
}

.footer-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background: #fff;
    transition: width 0.3s ease;
}

.footer-nav a:hover { 
    color: #fff; 
}
.footer-nav a:hover::after {
    width: 100%;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.footer-info { 
    color: rgba(255,255,255,0.7); 
    font-size: 1.05rem;
}

.footer-info p {
    margin-bottom: 0.8rem;
}

.copyright { 
    font-size: 0.95rem; 
    color: rgba(255,255,255,0.5); 
}

/* Animated Scroll Class (Triggered by Intersection Observer) */
.animate-element {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
}

.animate-element.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .hero-catchphrase { font-size: 3.2rem; }
    .about-content { gap: 4rem; }
}

@media (max-width: 820px) {
    .strengths-grid, .services-grid { grid-template-columns: repeat(2, 1fr); }
    .about-content { flex-direction: column; }
    .hero-catchphrase { font-size: 2.8rem; }
    .page-header h1 { font-size: 2.8rem; }
    
    /* New addition for news responsive */
    .news-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .header { height: 75px; }
    html { scroll-padding-top: 75px; }
    
    .hamburger { display: block; }
    
    .nav { 
        position: fixed; 
        top: 75px; 
        left: -100%; 
        width: 100%; 
        height: calc(100vh - 75px); 
        background: rgba(255,255,255,0.98); 
        backdrop-filter: blur(20px);
        transition: left 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); 
        display: flex; 
        justify-content: center; 
        align-items: center; 
        box-shadow: 5px 0 15px rgba(0,0,0,0.1) inset;
    }
    
    .nav.active { left: 0; }
    
    .nav-list { 
        flex-direction: column; 
        gap: 2.5rem; 
        font-size: 1.4rem; 
        text-align: center;
    }
    
    .strengths-grid, .services-grid { grid-template-columns: 1fr; }
    .about-img:hover { transform: none; }
    
    .hero-catchphrase { font-size: 2.2rem; }
    
    .news-list { grid-template-columns: 1fr; }
    
    .footer-top { 
        flex-direction: column; 
        align-items: center;
        gap: 3rem; 
    }
    
    .footer-nav ul { 
        flex-direction: column; 
        gap: 1.5rem; 
        text-align: center; 
    }
    
    .footer-bottom {
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
        text-align: center;
    }
}
