body {
    font-family: 'Roboto', 'Noto Sans SC', 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.8; /* Improved readability */
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); /* Enhanced background */
    color: #2c3e50; /* Improved contrast */
    scroll-behavior: smooth; /* Smooth scrolling */
}
.container {
    width: 90%;
    max-width: 1200px; /* Slightly wider */
    margin: 40px auto;
    overflow: hidden;
    padding: 40px 50px; /* More generous padding */
    background-color: #ffffff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1), 0 8px 20px rgba(0,0,0,0.06); /* Layered shadows */
    border-radius: 16px; /* More rounded */

    border: 1px solid rgba(255,255,255,0.2); /* Subtle border */
}
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Modern gradient */
    color: #fff;
    padding: 4rem 0; /* More generous padding */
    text-align: center;
    border-radius: 16px 16px 0 0;
    position: relative;
    overflow: hidden;
}
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}
header h1 {
    margin: 0;
    font-size: 3em; /* Larger and more impactful */
    font-weight: 700; /* Bolder */
    text-shadow: 0 2px 4px rgba(0,0,0,0.3); /* Text shadow for depth */
    letter-spacing: -0.02em; /* Tighter letter spacing */
    position: relative;
    z-index: 1;
}
header p {
    margin: 1em 0 0;
    font-size: 1.3em; /* Larger subtitle */
    opacity: 0.95;
    font-weight: 300;
    position: relative;
    z-index: 1;
}
section {
    padding: 30px 0; /* Increased padding */
    margin-bottom: 40px; /* More spacing */
    border-bottom: 1px solid #f1f3f4; /* Lighter border */
}
section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

h2 {
    color: #2c3e50;
    border-bottom: 4px solid transparent; /* Transparent initially */
    background: linear-gradient(90deg, #667eea, #764ba2) bottom / 100% 4px no-repeat; /* Gradient underline */
    padding-bottom: 15px;
    margin-top: 30px;
    margin-bottom: 35px;
    font-size: 2.4em; /* Larger */
    font-weight: 700; /* Bolder */
    position: relative;
    letter-spacing: -0.01em;
}
h2::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}
h2:hover::after {
    width: 100%;
}
h3 { /* Work Experience内のタイトルなど */
    color: #2c3e50; /* Consistent dark color */
    font-size: 1.6em; /* Adjusted */
    margin-top: 15px; /* Adjusted */
    margin-bottom: 18px; /* Adjusted */
    font-weight: 600;
}
h4 { /* Project Item内の小見出し */
    color: #3498db; /* Updated Accent */
    font-size: 1.3em; /* Adjusted */
    margin-top: 20px;
    margin-bottom: 12px; /* Adjusted */
    font-weight: 600;
}
p, li {
    font-size: 1.05em; /* Slightly larger for better readability */
    color: #4a5568; /* Better contrast */
    margin-bottom: 1em; /* More spacing */
    line-height: 1.8; /* Improved line height */
}
ul {
    padding-left: 20px;
    list-style-position: outside;
}
#skills ul {
    list-style-type: none;
    padding-left: 0;
}
#skills li {
    padding-left: 35px;
    position: relative;
    margin-bottom: 15px;
    font-size: 1.1em;
}
#skills li:hover {
    color: #667eea;
}
#skills li::before {
    content: '✨';
    position: absolute;
    left: 0;
    top: 2px;
    color: #667eea;
    font-weight: bold;
    font-size: 1.3em;
}

/* Work Experience and Project Styling */
#work-experience .company-block,
.project-item {
    margin-bottom: 40px;
    padding: 35px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%); /* Subtle gradient */
    border: 1px solid #e2e8f0;
    border-left: 6px solid #667eea; /* Thicker accent */
    border-radius: 16px; /* More rounded */
    box-shadow: 0 8px 25px rgba(0,0,0,0.08), 0 3px 10px rgba(0,0,0,0.04); /* Layered shadows */
    transition: box-shadow 0.2s ease; /* Simplified transition */
    position: relative;
    overflow: hidden;
}
#work-experience .company-block::before,
.project-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.project-item:hover,
#work-experience .company-block:hover {
    box-shadow: 0 12px 25px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
}
.project-item:hover::before,
#work-experience .company-block:hover::before {
    transform: scaleX(1);
}
#work-experience .company-block h3,
.project-item > h3 { /* プロジェクトタイトル */
    margin-top: 0;
    color: #2980b9; /* Updated color (darker accent) */
    font-size: 1.7em; /* Slightly larger */
    border-bottom: none;
    padding-bottom: 8px; /* Increased padding */
}

.project-meta {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #ced4da;
}
.project-meta p {
    margin-bottom: 8px;
    font-size: 0.95em;
}
.project-meta strong {
    color: #343a40;
    margin-right: 5px;
    min-width: 70px; /* ラベル幅の統一 */
    display: inline-block;
}
.project-meta a {
    color: #3498db; /* Updated Accent */
    text-decoration: none;
    font-weight: 500;
}
.project-meta a:hover {
    text-decoration: underline;
    color: #2980b9; /* Darken on hover */
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Larger cards */
    gap: 30px;
    margin-top: 30px;
}
.project-gallery figure {
    margin: 0;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}
.project-gallery figure::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.project-gallery figure:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
}
.project-gallery figure:hover::before {
    transform: scaleX(1);
}
.project-image {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: border-color 0.2s ease;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    filter: brightness(0.98) saturate(0.95);
}
.project-image:hover {
    border-color: #667eea;
}
.project-image.app-screenshot { /* Style for tall app screenshots */
    max-height: 450px;
    object-fit: contain; /* Ensures the whole image is visible */
    background-color: #f0f0f0; /* Optional: background for letterboxing */
}
.project-gallery figcaption {
    font-size: 0.9em;
    color: #555;
    padding-top: 5px;
}
footer {
    text-align: center;
    padding: 35px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    margin-top: 40px;
    border-radius: 0 0 16px 16px;
    position: relative;
    overflow: hidden;
}
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}
footer p {
    margin: 0;
    font-size: 1.1em;
    font-weight: 300;
    color: #ecf0f1;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: linear-gradient(135deg, rgba(0,0,0,0.9) 0%, rgba(44,62,80,0.95) 100%); /* Enhanced overlay */
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;

}
.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;

    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    border: 3px solid rgba(255,255,255,0.1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #ecf0f1;
    font-size: 50px;
    font-weight: bold;
    transition: background-color 0.2s ease;
    cursor: pointer;
    line-height: 1;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;

}
.lightbox-close:hover,
.lightbox-close:focus {
    color: #fff;
    background: rgba(231,76,60,0.8);
    text-decoration: none;
}
.lightbox-caption {
    margin: 20px auto 0;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ecf0f1;
    font-size: 1.2em;
    font-weight: 300;
    background: rgba(0,0,0,0.3);
    padding: 15px 25px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Responsive Adjustments for Lightbox on smaller screens */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 85vh;
    }
    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 35px;
    }
    .lightbox-caption {
        font-size: 1em;
    }
}

/* 导航目录样式 */
.navigation-menu {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
    margin-bottom: 20px;
    position: relative;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);

}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navigation-menu h3 {
    color: #2c3e50;
    font-size: 1.1em;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-list li {
    margin: 0;
}

.nav-link {
    display: inline-block;
    padding: 6px 12px;
    color: #34495e;
    text-decoration: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.6);

    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background-color 0.2s ease;
    font-weight: 500;
    font-size: 0.85em;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: left 0.3s ease;
    z-index: -1;
}

.nav-link:hover {
    color: white;
}

.nav-link:hover::before {
    left: 0;
}

.nav-link:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navigation-menu {
        padding: 8px 0;
        margin-bottom: 15px;
    }

    .nav-container {
        padding: 0 10px;
    }

    .navigation-menu h3 {
        font-size: 1em;
        margin-bottom: 8px;
    }

    .nav-list {
        gap: 6px;
    }

    .nav-link {
        padding: 4px 8px;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .navigation-menu {
        padding: 6px 0;
        margin-bottom: 10px;
    }

    .navigation-menu h3 {
        font-size: 0.9em;
        margin-bottom: 6px;
    }

    .nav-list {
        justify-content: center;
        gap: 4px;
    }

    .nav-link {
        padding: 3px 6px;
        font-size: 0.75em;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 20px 15px; /* Adjusted padding */
        margin: 20px auto; /* Adjusted margin */
    }
    header {
        padding: 2rem 0;
    }
    header h1 {
        font-size: 2em;
    }
    h2 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    h3 {
        font-size: 1.4em; /* Slightly adjusted */
        margin-bottom: 15px;
    }
    h4 {
        font-size: 1.2em;
    }
    .project-gallery {
        grid-template-columns: 1fr; /* Single column on smaller screens */
        gap: 20px;
    }
    #work-experience .company-block,
    .project-item {
        padding: 20px; /* Reduced padding for mobile */
    }
}
@media print {
    body * {
        visibility: hidden;
    }
    #printable-area, #printable-area * {
        visibility: visible;
    }
    #printable-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .no-print {
        display: none !important;
    }
    nav.navigation-menu {
        display: none !important;
    }
}
