/* ===================================
   Global Styles & Variables
   =================================== */
:root {
    --navy-primary: #0C4579;
    --navy-dark: #0a3660;
    --navy-light: #1a5490;
    --white: #ffffff;
    --gray-light: #f8f9fa;
    --gray-medium: #e9ecef;
    --gray-dark: #6c757d;
    --text-dark: #212529;
    --text-light: #495057;

    --shadow-sm: 0 2px 4px rgba(12, 69, 121, 0.08);
    --shadow-md: 0 4px 12px rgba(12, 69, 121, 0.12);
    --shadow-lg: 0 8px 24px rgba(12, 69, 121, 0.15);
    --shadow-xl: 0 12px 48px rgba(12, 69, 121, 0.2);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 8px;
    --border-radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

/* ===================================
   Typography
   =================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-dark);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

/* ===================================
   Navigation
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy-primary);
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    font-weight: 500;
    color: var(--text-dark);
    padding: 0.5rem 0;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--navy-primary);
    transition: var(--transition);
}

.nav-menu a:not(.btn-nav):hover::after {
    width: 100%;
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--navy-primary);
    color: var(--white) !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: var(--border-radius);
    border: 2px solid var(--navy-primary); /* Base border to maintain consistent size */
    cursor: pointer; /* Pointer cursor on hover */
    transition: var(--transition);
    line-height: 1;
}

.btn-nav:hover {
    background: var(--navy-dark);
    border-color: var(--navy-dark);
    transform: translateY(-2px);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem 0.5rem; /* Increased padding to prevent icon clipping */
    z-index: 1001;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--navy-primary);
    margin: 3px 0;
    transition: var(--transition);
}

.nav-menu a.active:not(.btn-nav) {
    color: var(--navy-primary);
}

.nav-menu a.active:not(.btn-nav)::after {
    width: 100%;
}

.btn-nav.active {
    background: var(--white) !important;
    color: var(--navy-primary) !important;
    border: 2px solid var(--navy-primary);
}

/* ===================================
   Hero Section
   =================================== */
.hero {
    margin-top: 60px; /* Reduced margin to eliminate gap with fixed navbar */
    padding: 100px 0;
    background: linear-gradient(135deg, var(--white) 0%, var(--gray-light) 100%);
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--navy-primary);
    min-height: 2.4em; /* Ensure height stability during typing animation */
}

.hero-highlight {
    background: linear-gradient(135deg, var(--navy-primary), var(--navy-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1.1rem; /* Slightly larger font size */
    cursor: pointer; /* Pointer cursor on hover */
    border: none;
    transition: var(--transition);
    text-align: center;
    line-height: 1; /* Reset line-height to help with vertical centering */
}

.btn-primary {
    background: var(--navy-primary);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary {
    background: var(--white);
    color: var(--navy-primary);
    border: 2px solid var(--navy-primary);
}

.btn-secondary:hover {
    background: var(--navy-primary);
    color: var(--white);
    transform: translateY(-2px);
}

.hero-visual {
    position: absolute;
    top: 50%;
    right: -100px;
    transform: translateY(-50%);
    width: 600px;
    height: 600px;
}

.hero-shapes {
    position: relative;
    width: 100%;
    height: 100%;
    animation: float 20s ease-in-out infinite;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--navy-primary);
    top: 0;
    right: 0;
    animation: rotate 25s linear infinite;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: var(--navy-light);
    bottom: 50px;
    left: 100px;
    animation: rotate -20s linear infinite;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: var(--navy-dark);
    top: 200px;
    left: 50px;
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

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

/* ===================================
   Sections
   =================================== */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-label {
    display: inline-block;
    color: var(--navy-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.section-title {
    color: var(--text-dark);
}

/* ===================================
   About Section
   =================================== */
.about {
    padding: 100px 0;
    background: var(--white);
}

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

.about-text {
    max-width: 800px;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    line-height: 1.8;
}

.about-stats {
    display: grid;
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: var(--gray-light);
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===================================
   Services Section
   =================================== */
.services {
    padding: 100px 0;
    background: var(--gray-light);
}

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

.service-card {
    background: var(--white);
    padding: 3rem 2rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    /* overflow: hidden; */ /* Removed to prevent shadow clipping */
    z-index: 1;
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.service-card:hover {
    transform: translateY(-10px);
}

.service-card:hover::after {
    opacity: 1;
}

.service-icon {
    display: inline-flex;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: 50%;
    color: var(--navy-primary);
    margin-bottom: 1.5rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); /* Slightly slower transition */
}

.service-card:hover .service-icon {
    background: var(--navy-primary);
    color: var(--white);
}

.service-title {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.service-description {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    text-align: left;
}

.service-link {
    color: var(--navy-primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.service-link:hover {
    gap: 1rem;
}

/* ===================================
   Works Section
   =================================== */
.works {
    padding: 100px 0;
    background: var(--white);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.work-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: var(--transition);
}

.work-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-xl);
}

.work-image {
    position: relative;
    overflow: hidden;
}

.work-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: var(--transition);
}

.work-item:hover .work-image img {
    transform: scale(1.1);
}

.work-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(12, 69, 121, 0.9), transparent);
    color: var(--white);
    padding: 2rem;
    transform: translateY(100%);
    transition: var(--transition);
}

.work-item:hover .work-overlay {
    transform: translateY(0);
}

.work-title {
    color: var(--white);
    margin-bottom: 0.5rem;
}

.work-category {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ===================================
   Products Section
   =================================== */
.products {
    padding: 100px 0;
    background: var(--white);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    justify-content: center;
}

.product-card {
    background: var(--gray-light);
    padding: 3rem 2rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.product-card:hover {
    transform: translateY(-10px);
}

.product-card:hover::after {
    opacity: 1;
}

.product-icon {
    display: inline-flex;
    padding: 0; /* Removed padding for image icon */
    background: transparent; /* Changed to transparent for image icon */
    border-radius: 50%;
    color: var(--navy-primary);
    margin-bottom: 1.5rem;
}

.product-title {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.product-description {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    text-align: left;
}

/* ===================================
   Profile Section
   =================================== */
.profile {
    padding: 100px 0;
    background: var(--gray-light);
}

.profile-content {
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    padding: 4rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.profile-main {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.profile-name {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-medium);
    padding-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1rem;
}

.profile-name h3 {
    font-size: 2rem;
    color: var(--navy-primary);
}

.profile-location {
    color: var(--text-light);
    font-weight: 500;
}

.profile-bio p {
    color: var(--text-dark);
    line-height: 2;
    font-size: 1.05rem;
}

.profile-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.detail-item h4 {
    color: var(--navy-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-item h4::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--navy-primary);
    border-radius: 2px;
}

.detail-item p {
    color: var(--text-light);
    line-height: 1.8;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tags span {
    background: var(--gray-light);
    color: var(--navy-primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--gray-medium);
}

/* ===================================
   Contact Section
   =================================== */
.contact {
    padding: 100px 0;
    background: var(--gray-light);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info h3 {
    margin-bottom: 1rem;
    color: var(--navy-primary);
}

.contact-info p {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.contact-features {
    list-style: none;
    margin-bottom: 3rem;
}

.contact-features li {
    padding: 0.75rem 0;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-features li::before {
    content: '✓';
    display: inline-flex;
    width: 24px;
    height: 24px;
    background: var(--navy-primary);
    color: var(--white);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.contact-methods {
    display: grid;
    gap: 1.5rem;
}

.contact-method-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.contact-method-item svg {
    color: var(--navy-primary);
}

.contact-form-container {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--gray-medium);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--navy-primary);
    box-shadow: 0 0 0 3px rgba(12, 69, 121, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.btn-block {
    width: 100%;
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--navy-primary);
    color: var(--white);
    padding: 40px 0 20px; /* Reduced top padding */
}

.footer-content {
    display: flex;
    justify-content: center; /* Center logo area */
    text-align: center;
    margin-bottom: 2rem;
}

.footer-brand .footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.footer-brand p {
    opacity: 0.8;
    margin-bottom: 0;
}

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    opacity: 0.8;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 4rem 2rem; /* Reduced top padding */
        gap: 0; /* Reset gap to avoid double spacing with li margins */
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
        transform: translateX(100%);
        opacity: 1;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-menu li {
        width: 100%;
        margin: 0.25rem 0; /* Further reduced margin for even tighter top-alignment */
        text-align: center;
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.4s ease;
    }

    .nav-menu.active li {
        opacity: 1;
        transform: translateX(0);
    }

    /* Staggered entry for menu items */
    .nav-menu.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-menu.active li:nth-child(2) { transition-delay: 0.15s; }
    .nav-menu.active li:nth-child(3) { transition-delay: 0.2s; }
    .nav-menu.active li:nth-child(4) { transition-delay: 0.25s; }
    .nav-menu.active li:nth-child(5) { transition-delay: 0.3s; }

    .nav-menu a {
        font-size: 1.25rem;
        display: block;
        width: 100%;
        text-align: center;
    }

    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(12, 69, 121, 0.1);
        backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s ease;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .hero {
        padding: 60px 0;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .hero-actions .btn {
        width: 100%;
        max-width: 320px; /* Adjust as needed for a comfortable button width */
    }

    .hero-visual {
        display: none;
    }

    .about-content,
    .profile-content,
    .contact-content,
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-form-container {
        padding: 2rem 1.5rem;
    }

    .profile-content {
        padding: 2rem 1.5rem;
    }

    .profile-name h3 {
        font-size: 1.5rem;
    }

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

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