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

:root {
    --primary-color: #000D71;
    --secondary-color: #4a90e2;
    --accent-color: #000D71;
    --text-dark: #333;
    --text-light: #666;
    --background-light: #EEF4FF;
    --white: #ffffff;
    --border-light: #e9ecef;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    font-size: 19.2px; /* 16px * 1.2 = 19.2px */
    visibility: hidden; /* Initially hide to prevent flash */
}

/* Ensure research and members pages have white background */
body:not([data-page="index"]) {
    background: var(--white) !important;
}

/* Force white background for all main content areas */
main, .container, section {
    background-color: transparent;
}

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

/* Header Styles */
.header {
    background: var(--background-light);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    transform: translateY(0);
}

.header.header-hidden {
    transform: translateY(-100%);
}

.nav-container {
    max-width: 850px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    gap: 20px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
    height: 100%;
    margin-left: -10px;
    margin-top: 10px;
}

.logo img {
    height: 60px;
    width: auto;
    max-height: 60px;
    object-fit: contain;
    transition: var(--transition);
}

.logo img:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
}

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

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

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

.language-toggle {
    display: flex;
    flex-direction: row;
    gap: 5px;
    background: var(--background-light);
    border-radius: 20px;
    padding: 5px;
    width: 140px;
    justify-content: center;
}

.lang-btn {
    padding: 5px 12px;
    border: none;
    background: transparent;
    border-radius: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-light);
    font-size: 0.9rem;
    min-width: 60px;
    text-align: center;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    height: 32px;
    box-sizing: border-box;
    -webkit-font-feature-settings: "kern";
    font-feature-settings: "kern";
    letter-spacing: 0;
    word-spacing: 0;
    font-variant-emoji: text;
}

/* Safari specific fixes */
@supports (-webkit-appearance: none) {
    .lang-btn {
        -webkit-appearance: none;
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
        -webkit-text-size-adjust: 100%;
    }

    /* Fix Safari grid and flex issues */
    .news-grid {
        -webkit-appearance: none;
    }

    .news-card {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .header {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    /* Fix Safari font rendering */
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* Additional Safari emoji fix */
    .lang-btn {
        -webkit-font-kerning: auto;
        font-kerning: auto;
        -webkit-text-decoration-skip: objects;
        text-decoration-skip-ink: auto;
        overflow: hidden;
    }
}

.lang-btn.active {
    background: var(--primary-color);
    color: var(--white);
}

.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--primary-color);
    z-index: 1001;
    position: relative;
}


/* Hero Section */
.hero {
    background: var(--white);
    padding: 20px 0;
    padding-top: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 250px;
}

.hero-media {
    max-width: 850px;
    width: 100%;
    margin: 0 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Animation Container */
.hero-animation-container {
    position: relative;
    width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Hero Slider */
.hero-slider {
    position: relative;
    width: 100%;
    height: 400px;
}

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

/* 1枚目の画像にズームイン効果 */
.hero-slide:first-child {
    animation: zoomIn 4s ease-out forwards;
}

@keyframes zoomIn {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

.hero-slide.active {
    opacity: 1;
}


/* Hero Dots */
.hero-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

/* Ensure dots are visible at all sizes including 744px */
@media (max-width: 850px) {
    .hero-dots {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

.hero-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: transparent;
    border: 3px solid var(--text-light);
    transition: var(--transition);
}

.hero-dot.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Media optimization and fallbacks */

/* Mobile optimization */
@media (max-width: 768px) {
    .hero-slider {
        height: auto;
        aspect-ratio: 2140/1008;
    }

    .hero-slide {
        object-fit: contain;
        object-position: center;
        width: 100%;
        height: 100%;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .hero-slider {
        height: auto;
        aspect-ratio: 2140/1008;
    }

    .hero-slide {
        object-fit: contain;
        object-position: center;
        width: 100%;
        height: 100%;
    }
}

/* Prefers reduced data usage */
@media (prefers-reduced-data: reduce) {
    .hero-slide video {
        display: none;
    }
}




/* Single Image (legacy) */
.hero-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: block;
}

/* Slideshow Styles */
.hero-slideshow {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.slide {
    display: none;
    width: 100%;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: auto;
    display: block;
}

.slideshow-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.prev-btn, .next-btn {
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    pointer-events: all;
    transition: var(--transition);
}

.prev-btn:hover, .next-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.slideshow-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: var(--white);
}

/* Video Styles */
.hero-video {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: block;
}

/* Section Styles */
section {
    padding: 80px 0;
}

/* Remove top padding for non-index pages */
body:not([data-page="index"]) section:first-of-type {
    padding-top: 160px;
    margin-top: 0;
}

/* Mobile adjustment for non-index pages */
@media (max-width: 768px) and (min-width: 441px) {
    body:not([data-page="index"]) section:first-of-type {
        padding-top: 140px;
    }
}

/* Very small screens adjustment for non-index pages */
@media (max-width: 440px) {
    body:not([data-page="index"]) section:first-of-type {
        padding-top: 80px;
    }
}

section h2 {
    text-align: center;
    font-size: 2.64rem; /* 2.2rem * 1.2 = 2.64rem */
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

/* Research Section */
.research {
    background: var(--background-light);
}

.research-intro {
    margin-bottom: 3rem;
    max-width: 900px;
    margin: 0 auto;
    margin-bottom: 3rem;
}

.research-intro h3 {
    font-size: 1.8rem; /* 1.5rem * 1.2 = 1.8rem */
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.3;
}

.research-text {
    font-size: 1.44rem; /* 1.2rem * 1.2 = 1.44rem */
    line-height: 1.5;
    color: var(--text-dark);
    text-align: left;
    max-width: 900px;
    margin: 0 auto;
}

.research-photos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.research-photo-item {
    aspect-ratio: 1643/1068;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
}

.research-photo-item:hover {
    animation: gentle-bounce 1s ease-in-out infinite;
    box-shadow: var(--shadow-hover);
}

.research-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.research-photo-item:hover img {
    transform: scale(1.02);
}

.photo-caption {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, rgba(0, 13, 113, 0.9) 0%, rgba(0, 13, 113, 0.7) 100%);
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--border-radius) 0 var(--border-radius) 0;
    backdrop-filter: blur(5px);
    transition: var(--transition);
    width: 140px;
    text-align: center;
    text-align: center;
}

.photo-caption h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.research-photo-item:hover .photo-caption {
    background: linear-gradient(135deg, rgba(0, 13, 113, 1) 0%, rgba(0, 13, 113, 0.9) 100%);
}

/* Staff Section */
.staff {
    background: var(--white);
}

.staff-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.staff-member {
    text-align: center;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.staff-member:hover {
    animation: gentle-bounce 1s ease-in-out infinite;
    box-shadow: var(--shadow-hover);
}

.staff-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.staff-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.4;
    white-space: pre-line;
}

.staff-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.staff-link {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid;
}

.staff-link.researchmap {
    background: #e8f4f8;
    color: #2c5aa0;
    border-color: #2c5aa0;
    width: 160px;
    text-align: center;
}

.staff-link.researchmap:hover {
    background: #2c5aa0;
    color: var(--white);
}

.staff-link.orcid {
    background: #e8f5e8;
    color: #16a085;
    border-color: #16a085;
    width: 160px;
    text-align: center;
}

.staff-link.orcid:hover {
    background: #16a085;
    color: var(--white);
}

/* Language-specific ordering for staff links */
.staff-link.researchmap {
    order: 1;
}

.staff-link.orcid {
    order: 2;
}

/* English language: ORCID first, researchmap second */
html[lang="en"] .staff-link.orcid {
    order: 1;
}

html[lang="en"] .staff-link.researchmap {
    order: 2;
}

/* Members Section */
.members {
    background: var(--white);
}

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

.member-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.member-image {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--background-light);
}

.member-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.member-card p {
    font-size: 1rem;
}

.member-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 1rem;
}

/* Photos Section */
.photos {
    background: var(--background-light);
}

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

.photos .photo-item {
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.photos .photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.photos .photo-item:hover img {
    transform: scale(1.05);
}

/* Publications Section */
.publications {
    background: var(--white);
}

.publications-list {
    max-width: 800px;
    margin: 0 auto;
}

.publication-item {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.publication-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.publication-item p {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.publication-links {
    display: flex;
    gap: 1rem;
}

.publication-link {
    padding: 5px 15px;
    background: var(--secondary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 15px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.publication-link:hover {
    background: var(--primary-color);
}

/* News Section */
.news {
    background: var(--background-light);
}

.news-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.tab-btn {
    padding: 10px 15px;
    background: var(--white);
    border: 3px solid var(--border-light);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    width: 130px;
    text-align: center;
}

.tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
    font-weight: 700;
}

.tab-btn.active[data-category="announcement"] {
    background: #28a745;
    border-color: #28a745;
}

.tab-btn.active[data-category="award"] {
    background: #ffc107;
    border-color: #ffc107;
    color: white;
}

.tab-btn.active[data-category="publication"] {
    background: #dc3545;
    border-color: #dc3545;
}

.tab-btn.active[data-category="conference"] {
    background: #17a2b8;
    border-color: #17a2b8;
}

.tab-btn.active[data-category="funding"] {
    background: #6f42c1;
    border-color: #6f42c1;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
    align-items: start;
}

.news-card.hidden {
    display: none;
}

.news-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    animation: gentle-bounce 1s ease-in-out infinite;
    box-shadow: var(--shadow-hover);
}

.news-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-card-link:hover {
    text-decoration: none;
    color: inherit;
}
.news-card a {
    text-decoration: none !important;
    color: inherit;
}
.news-card a:hover {
    text-decoration: none !important;
    color: inherit;
}

/* Photos page article links */
article a {
    text-decoration: none !important;
}
article a:hover {
    text-decoration: none !important;
}

.news-image {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    background-color: #f5f5f5;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

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

.news-more-section {
    padding: 40px 0 0 0;
}

.news-more-tab-center {
    text-align: center;
}

.news-more-tab-center a {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    width: 120px;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.news-more-tab-center a:hover {
    background: var(--secondary-color);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* Hide More tab in English mode */
body[data-current-lang="en"] .news-more-section {
    display: none;
}

.news-date {
    background: var(--primary-color);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.725rem;
    font-weight: 700;
    display: inline-block;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
}

.news-content h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.4;
    flex: 1;
}

.news-content p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 1rem;
}

.news-card {
    position: relative;
}

.news-date-category {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.news-category-tag {
    background: var(--primary-color);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.725rem;
    font-weight: 700;
    white-space: nowrap;
    width: 85px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: 24px;
}

.news-category-tag.notice {
    background: #28a745;
}

.news-category-tag.awards {
    background: #ffc107;
    color: white;
}

.news-category-tag.papers {
    background: #dc3545;
}

.news-category-tag.conference {
    background: #17a2b8;
}

.news-category-tag.grants {
    background: #6f42c1;
}

/* News More Link */
.news-more {
    text-align: center;
    margin-top: 2rem;
}

.more-link {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 40px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.more-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Links Section */
.links {
    background: var(--white);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.link-item {
    aspect-ratio: 4090/1151;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.link-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.link-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.link-item:hover {
    animation: gentle-bounce 1s ease-in-out infinite;
    box-shadow: var(--shadow-hover);
}

.link-item:hover img {
    transform: scale(1.02);
}

/* Access Section */
.access {
    background: var(--background-light);
}

/* Default access container width (English) */
#access .container {
    max-width: 900px;
}

/* Japanese language specific width */
html[lang="ja"] #access .container {
    max-width: 900px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 0.5rem;
}

.contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-item i {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-item h4 {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.contact-item p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 1rem;
    white-space: pre-line;
}

.contact-list p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.contact-list p:last-child {
    margin-bottom: 0;
}

.map-placeholder iframe {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Mobile line breaks - hidden by default */
.mobile-br {
    display: none;
}


/* Footer */
.footer {
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
}

.footer-links {
    margin-bottom: 2rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Medium screen responsive for news tabs */
@media (max-width: 900px) {
    .news-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        row-gap: 0.8rem;
        column-gap: 0.2rem;
        max-width: 500px;
        margin: 0 auto 3rem;
        justify-items: center;
    }

    .tab-btn {
        width: 110px;
        font-size: 0.85rem;
        padding: 8px 12px;
    }
}

@media (max-width: 600px) {
    .news-tabs {
        row-gap: 0.6rem;
        column-gap: 0.1rem;
        max-width: 280px;
    }

    .tab-btn {
        width: 90px;
        padding: 6px 8px;
        font-size: 0.8rem;
    }
}

.mobile-language-toggle {
    display: none;
}

/* Mobile line breaks */
.mobile-br {
    display: none;
}

@media (max-width: 768px) {
    .mobile-br {
        display: block;
    }
}

/* Tablet Design - 744px area */
@media (max-width: 850px) and (min-width: 769px) {
    .research-photos {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* モバイルでは元のサイズに戻す */
    }

    /* ヘッダーを常に表示 */
    .header {
        transform: translateY(0) !important;
    }

    .header.header-hidden {
        transform: translateY(0) !important;
    }

    .nav-container {
        height: 80px;
        padding: 0 20px;
        position: relative;
    }

    .logo {
        position: absolute;
        left: 50%;
        top: 45%; /* FIXED POSITION - DO NOT CHANGE WITHOUT EXPLICIT INSTRUCTION */
        transform: translate(-50%, -50%);
        z-index: 1000;
    }

    .mobile-menu-toggle {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1002;
        transition: all 0.3s ease;
    }

    .mobile-menu-toggle.active {
        transform: translateY(-50%) rotate(90deg);
    }

    .mobile-menu-toggle.active .fa-bars {
        display: none;
    }

    .mobile-menu-toggle.active .fa-times {
        display: inline-block;
    }

    .mobile-menu-toggle .fa-times {
        display: none;
    }

    .research-intro h3 {
        font-size: 1.5rem; /* モバイルでは元のサイズ */
    }

    .research-text {
        font-size: 1.1rem; /* モバイルでは少し小さく */
    }
    .language-toggle {
        display: none;
    }
    .nav-menu {
        position: fixed;
        top: 80px;
        right: -100%;
        height: calc(100vh - 80px);
        width: 300px;
        background: var(--background-light);
        flex-direction: column;
        padding: 2rem 2rem 2rem 2rem;
        box-shadow: var(--shadow);
        opacity: 0;
        visibility: hidden;
        transition: right 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999;
        justify-content: flex-start;
        align-items: center;
    }


    .mobile-language-toggle {
        display: flex;
        gap: 5px;
        background: var(--background-light);
        border-radius: 20px;
        padding: 5px;
        margin-top: 2rem;
        justify-content: center;
    }

    .mobile-language-toggle .lang-btn {
        padding: 8px 16px;
        border: none;
        background: transparent;
        border-radius: 15px;
        font-weight: 500;
        cursor: pointer;
        transition: var(--transition);
        color: var(--text-light);
        font-size: 0.9rem;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1.2;
        height: 40px;
        box-sizing: border-box;
        -webkit-font-feature-settings: "kern";
        font-feature-settings: "kern";
        letter-spacing: 0;
        word-spacing: 0;
        font-variant-emoji: text;
    }

    .mobile-language-toggle .lang-btn.active {
        background: var(--primary-color);
        color: var(--white);
    }

    .nav-menu.active {
        right: 0;
        opacity: 1;
        visibility: visible;
    }

    .nav-menu a {
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-light);
        display: block;
        font-size: 1.1rem;
        font-weight: 700;
    }

    .nav-menu a:last-child {
        border-bottom: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 998;
    }

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

    .research-photos {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .news-tabs {
        max-width: 350px;
        margin: 0 auto 3rem;
    }

    .photo-caption {
        padding: 6px 8px;
        width: 70px;
    }

    .photo-caption h4 {
        font-size: 0.7rem;
    }

    .research-intro h3 br {
        display: none;
    }

    .hero {
        min-height: 200px;
        padding: 0;
        padding-top: 90px;
        margin-bottom: 10px;
    }

    .hero-media {
        margin: 0 15px;
    }

    .hero-animation-container {
        border-radius: 6px;
    }

    .hero-dots {
        gap: 10px;
        margin-top: 15px;
        margin-bottom: 5px;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .hero-dot {
        width: 14px;
        height: 14px;
        border-width: 2px;
    }


    .news-tabs {
        flex-direction: column;
        align-items: center;
    }

    .news-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .staff-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        max-width: 400px;
    }

    .staff-photo {
        width: 120px;
        height: 120px;
    }

    .news-item {
        flex-direction: column;
        gap: 1rem;
    }

    .news-date {
        align-self: flex-start;
        width: fit-content;
    }

    .links-grid {
        grid-template-columns: 1fr;
        max-width: 250px;
    }

    .contact-info {
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .mobile-br {
        display: inline;
    }

    section {
        padding: 60px 0;
    }

    section h2 {
        font-size: 1.8rem; /* モバイルでは元のサイズ */
    }
}

/* Very small screens - 440px and below */
@media (max-width: 440px) {
    body {
        padding-top: 80px;
    }

    .hero {
        padding-top: 20px;
        margin-top: 0px;
    }

    .hero-dots {
        margin-bottom: 0px;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .research-photos {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .news-tabs {
        column-gap: 0;
        row-gap: 0.3rem;
        max-width: 300px;
    }

    .tab-btn {
        width: 100px;
        padding: 4px 8px;
        font-size: 0.8rem;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    /* News page mobile adjustments */
    .news-date-category {
        gap: 8px;
        margin-left: 0;
        margin-bottom: 0.5rem;
    }

    .news-category-tag {
        margin-left: 0;
    }

    .news-content {
        padding-left: 0;
        padding: 1rem;
    }

    .news-content h4 {
        margin-bottom: 0.5rem;
    }

    .news-tabs {
        margin-bottom: 1.5rem;
        max-width: 280px;
    }

    /* Disable hero animation on mobile */
    .hero-media {
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
    }

    .hero-animation-container {
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

@media (max-width: 480px) and (min-width: 441px) {
    .nav-container {
        padding: 0 15px;
    }

    .container {
        padding: 0 15px;
    }


    .hero {
        padding: 40px 0;
    }

    .hero-eyecatch {
        max-width: 100%;
    }

    .language-toggle {
        order: -1;
    }

    .logo h1 {
        font-size: 1.4rem; /* モバイルでは元のサイズ */
    }

    .news-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .news-tabs {
        row-gap: 0.5rem;
        column-gap: 0.15rem;
        max-width: 320px;
    }

    .tab-btn {
        width: 80px;
        padding: 6px 8px;
        font-size: 0.75rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Scroll Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Loading animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.research-card,
.member-card,
.publication-item,
.news-item {
    animation: fadeInUp 0.6s ease forwards;
}

/* Gentle bounce animation for hover effects */
@keyframes gentle-bounce {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Hero animations */
@keyframes zoomInFadeOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    30% {
        transform: scale(1.1);
        opacity: 1;
    }
    35% {
        transform: scale(1.1);
        opacity: 0;
    }
    100% {
        transform: scale(1.1);
        opacity: 0;
    }
}

@keyframes videoFadeIn {
    0% {
        opacity: 0;
    }
    35% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}